MakeSelector and TTreeReader usage problems

Dear expert,

I am now switching to TSelector class to do my analysis( chain.MakeSelector(“objectTSelector”)) , and use the generated TTreeReader class to retrieve the branches in the tree.

Here is the problem, I have data and MC tree that are almost the same except MC have a few more branches than MC( for example EVENT_genWeight). But it seems I have to manually comment out the ‘’‘TTreeReaderValue<Double_t> EVENT_genWeight = {fReader, “EVENT_genWeight”};’’’ in objectTSelector.h for it to be run on data.

I really what to keep the objectTSelector.C objectTSelector.h the same for data and MC files, use a bool to control the reading of those different branches. I made quite a few trials my self but it seems the TTreeReaderValue class has to initialize in declaration.

I am using root 6.12/07.

Hope I make myself clear and thanks for reading my questions.

Best regards,

Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided

I think @pcanal can help you.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.