Hi,
I am facing two errors. One related to reading TClonesArray and other related to stacking of histograms:
For, the TClonesArray, I am tring to access the following branch of a TTree:
The Brach I want to study is:
*............................................................................*
*Br 163 :GenJet : Int_t GenJet_ *
*Entries : 10000 : Total Size= 116365 bytes File Size = 27349 *
*Baskets : 26 : Basket Size= 64000 bytes Compression= 3.01 *
*............................................................................*
The part of macro where I guess the problem is:
TTreeReaderArray<int>tnjet(readerxx1,"GenJet");
And the displayed error is:
Error in <TTreeReaderArrayBase::CreateContentProxy()>: The branch GenJet contains data of type Jet. It cannot be accessed by a TTreeReaderArray<int>
If I try to change it to TTreeReaderValue:
Error in <TTreeReaderValueBase::CreateProxy()>: The branch GenJet contains data of type TClonesArray. It cannot be accessed by a TTreeReaderValue<int>
Thank you for the reply. It still does solve the issue: /home/krunal/Downloads/MG5_aMC_v2_5_4/ExRootAnalysis/data.c:146:18: error: use of undeclared identifier 'Jet' TTreeReaderArray<Jet> tnjet(readerxx1,"GenJet"); ^ /home/krunal/Downloads/MG5_aMC_v2_5_4/ExRootAnalysis/data.c:265:20: error: use of undeclared identifier 'tnjet' for (size_t j=0; j<tnjet.GetSize();j++) ^
this is C++ you still need to include the header where the Jet class is defined. In order to read fromt he TTree, as usual, you’ll also need to load the dictionary for it.
I actually used MG5+Pythia8 and then converted that .hepmc file of output to .root file using Delphes(as a stand alone program) (i.e I used Deplhes converter).