//STL 'n' stuff #include //Root includes #include #include using namespace std; int chaintest(){ //const int kMaxm_genParticles = 4214; const int kMaxm_genParticles = 10000; //<=================== Int_t m_genParticles_; Float_t m_genParticles_m_px[kMaxm_genParticles]; //[m_genParticles_] Float_t m_genParticles_m_py[kMaxm_genParticles]; //[m_genParticles_] Float_t m_genParticles_m_pz[kMaxm_genParticles]; //[m_genParticles_] TBranch *b_McEventCollection_p4_GEN_EVENT_m_genParticles_; //! TBranch *b_m_genParticles_m_px; //! TBranch *b_m_genParticles_m_py; //! TBranch *b_m_genParticles_m_pz; //! TChain* chain = new TChain("CollectionTree"); chain->SetMakeClass(1); chain->Add("/afs/cern.ch/user/m/mackepr/public/EVNT.024150._00001.pool.root.1"); chain->Add("/afs/cern.ch/user/m/mackepr/public/EVNT.024150._00002.pool.root.1"); chain->SetBranchAddress("m_genParticles", &m_genParticles_, &b_McEventCollection_p4_GEN_EVENT_m_genParticles_); chain->SetBranchAddress("m_genParticles.m_px", m_genParticles_m_px, &b_m_genParticles_m_px); chain->SetBranchAddress("m_genParticles.m_py", m_genParticles_m_py, &b_m_genParticles_m_py); chain->SetBranchAddress("m_genParticles.m_pz", m_genParticles_m_pz, &b_m_genParticles_m_pz); Long64_t nentries = chain->GetEntriesFast(); for (Long64_t chain_entry=0; chain_entryLoadTree(chain_entry); if (tree_entry < 0) break; b_McEventCollection_p4_GEN_EVENT_m_genParticles_->GetEntry(tree_entry); cout<GetEntry(tree_entry); b_m_genParticles_m_py->GetEntry(tree_entry); b_m_genParticles_m_pz->GetEntry(tree_entry); } return 0; }