TSelector errors


I am trying to create an analysis program on the root tree that I have created. I have used MakeSelector to make a source and header files.

So far I have added a simple std::cout statement to the Process() function.

std::cout << "muon charge is " <<Muon_charge[0] << std::endl;

I am using a simple script to run the analysis:

void run_bprime_analyzer()
TChain* fChain=new TChain(“ntuplizer/bprime_tree”);
// farm data
fChain->Add("/cms/data11/bprime/bkgrnd/ntuple.root"); fChain->Process("/$HOME/CMSSW_1_6_9/src/bprime_tree.C++");

However, I am getting the following errors:

root [0] .x run_bprime_analyzer.C
Info in TUnixSystem::ACLiC: creating shared library //home/hits/CMSSW_1_6_9/src/bprime_tree_C.so
Error: Unexpected EOF G__fgetspace():2 //home/hits/CMSSW_1_6_9/src/filefP91AGlinkdef.h:2:
Error: class,struct,union or type not defined //home/hits/CMSSW_1_6_9/src/filefP91AGlinkdef.h:4:
Warning: link requested for unknown srcfile //home/hits/CMSSW_1_6_9/src/filefP91AGlinkdef.h:4:
Error: Unexpected EOF G__fignorestream():3 //home/hits/CMSSW_1_6_9/src/filefP91AGlinkdef.h:4:
Syntax error: #pragma link //home/hits/CMSSW_1_6_9/src/filefP91AGlinkdef.h:4:
Warning: Error occurred during reading source files
Warning: Error occurred during dictionary source generation
!!!Removing //home/hits/CMSSW_1_6_9/src/filepMpIH3.cxx //home/hits/CMSSW_1_6_9/src/filepMpIH3.h !!!
Error: rootcint: error loading headers…
Error in : Dictionary generation failed!
Info in : Invoking compiler to check macro’s validity
Info in : The compiler has not found any problem with your macro.
Probably your macro uses something rootcint can’t parse.
Check root.cern.ch/root/Cint.phtml?limitations for Cint’s limitations.
Error in TSelector::GetSelector: file /$HOME/CMSSW_1_6_9/src/bprime_tree.C++ does not have a valid class deriving from TSelector

None of it make any sense to me. Can somebody please explain what am I doing wrong?

thank you very much,


I am getting some clues: If I open the root file directly and then use TBrowser() to get inside the folder that contains my tree then the following command works:


However, I still do not know how to do it with the TChain.



In your failed case you used:fChain->Process("/$HOME/CMSSW_1_6_9/src/bprime_tree.C++"); . In your successful case you used: bprime_tree->Process("bprime_tree.C+"); .The difference is the way you pointed to the selector file. In the ‘broken’ case, the name is expressed in such a way that the system is inconsistently referring to your file and getting confused. So hopefully you can use:fChain->Process("bprime_tree.C+");


yes, I can use this. And it does work. Thank you for your help!