How to process data with saved cuts of a particular 2D plot, so that only those selected events will come up in all other plots in the tree structure of the same root file!
May be, I should use TChain::MakeClass()…but I do not know how to do it. Any help!
To use the a graphical cut in TTree::Draw you only need to do:
t->Draw("x:y","cutg");
But that will not work if your cut has been defined on a histogram. You will have first to reassigned proper names to the cut variables. ie: name of variables members of the tree t. For that simply do:
If I do it that way, it is saying that “cutg was not declared in this scope”
I think, using this I can only generate that “x:y 2D” plot with that “cutg”, not that only those many events would be processed in the next compilation to other 1D and 2D plots.
I have a code (“the program”) which processes raw data and creates a .root file having several tree leafs and 2Ds. One of them is xy 2D. On this xy 2D I have put a gate and saved as cut.C.
If I put cutg in the way you suggested, it only put a cut on xy 2D, but does not do anything to other plots. That’s what I don’t want.
I want to see the effect of the applied gate on xy 2D on other 2Ds (e.g. P1 vs P2, Z1 vs Z2 etc.) as well, which are obviously dependent on x and y values.
Though it is doing the job, I have a further query…is it not possible to call cut.C inside the macro and do such gating instead of copying the content of it inside the macro!
As in this process every time one has to change inside the main program.