Check single entry of a tree is in TCutG

Hello, I would like to check if a single entry of a tree is on TCutG.

for (Long64_t i=0; i<nentries;i++) {
tree->GetEntry(i);
if(!tree->Scan(“Mass”,TcutG,"",1,i)) continue;
…Use that single tree entry, not only one branch…
}

The problem is when I use Scan(), every time I get for all the entries:


  • Row * Mass *


Is there an option in Scan not to show these ********, or is there an easier way to check if the entry satisfy the cut.

Thanks.

Instead of Scan() may be you can try Draw() with option “goff”…

I used:

if (!tree->Draw(“Mass”,“Entry$ && TCutG”,“goff”)) continue;

but the code is very slow. I thought there was an easier way to do this.

Thanks for such a quick answer.

like in Scan add …1,i) in the Draw command.

Using: tree->Draw(“Mass”,cutg,“goff”,1,i) is a little faster and it is doing the job.
Thanks you very much