I am trying to make some plots with a cut that removes a middle range of the values of an observable, e.g., <globalCut variable="obs1" condition="<100||>300" value="ON"/>. I’ve tried several different options in the plot.rml config I’m using but I cannot find a way to do this, I always get the same error:
Plot string not properly constructed. Does the analysis observable exist inside the file?
The observable does exist. I’ve tried with a simple cut (e.g. <300) and it works.
Is this kind of cut possible to do? And if it is, what would be the right syntax in the .rml?
it is actually not possible to do what you mention.
The reason behind is that <globalCut was only thought to work with && operator. And TRestAnalysisPlot will build the cut string given as argument to TTree->Draw method using the values from <globalCutobservables + condition fields.
… it will produce the following cut string passed to the ROOT TTree->Draw method.
obs1<X1 && obs2==X2 && obs3>X3
I have added a new piece of code to TRestAnalysisPlot so that we can build an additional arbitrary cutString being passed to the Draw method.
See changes in commit:
It will add a new <globalCutString line option to TRestAnalysisPlot where we can define a conditional string that will be added to the Draw method cut string.
Thanks Javier.
I moved to the latest commit 4b8a5176 but it doesn’t work. I can run restManager and I get no error now, but the ouput plot does not have the cut with the OR condition. I’ve saved the plot as a root.C macro and I’ve checked that the string is not there. It is as it was being ignored…
Please, set the section TRestAnalysisPlot to verboseLevel="debug" and attach the output as a txt. Attach also the RML file you are using to generate the output.