Hello,
I’m attempting to use TTree::Draw with various cuts and the results that I obtain are dependent on the ordering of the conditions. If I use:
DATA->Draw(“ThSCAT:X1pos>>hThSCATvsX1”,“ThSCAT>0 && CUTpad1pad2 && CUTpad1tof”,“col”)
I get (Long64_t)17843 entries.
If I do (changing the order of the ThSCAT from the first entry to the last entry):
DATA->Draw(“ThSCAT:X1pos>>hThSCATvsX1”,“CUTpad1pad2 && CUTpad1tof && ThSCAT>0”,“col”)
I get (Long64_t)0 entries.
CUTpad1pad2 and CUTpad1tof are both TCutGs that are loaded from external macros.
This is obviously somewhat concerning. I’ve tried to have a look at how the selection expression is compiled in TFormula.cxx and TTreeFormula.cxx but can’t find any obvious point where things go awry.
This issue exists in the 5.34 version I’m currently using but an old installation of 5.20 on one of the machines in the lab doesn’t have this issue.
I can’t find any documentation on the ROOT site which suggests that ordering of cuts is important and I can’t diagnose the problem myself so I’m posting it on here in the hopes that someone can point out what I’ve been doing wrong. It’s also possible that it has been fixed but I can’t find anything to that effect on the site.
N.B. This isn’t my code. I was asked to look into what was going wrong and, having got stuck, have come here. If there are problems with how the TTrees have been created, then I’ll need to go back to the guy who made them. Also, I’m having problems attaching files. I’ll try to give people a download link if people would like to try running examples of the code.
Many thanks.