Dear ROOTers, I'm trying to chain root files with the following comands (with root 3.10): TChain MCchain("Calib Tree","Calib Tree"); const int size = 2; TBranch* jetInfoBranch[size]; MCchain.Add(filename1); MCchain.Add(filename2); MCchain.Add(filename3); MCchain.Add(filename4); MCchain.Add(filename5); MCchain.Add(filename6); MCchain.Add(filename7); MCchain.Add(filename8); MCchain.Add(filename9); MCchain.Add(filename10); MCchain.SetBranchStatus("*",0); MCchain.SetBranchStatus("bJetsBranch",1); MCchain.SetBranchStatus("OtherJetsBranch",1); MCchain.SetBranchAddress("bJetsBranch",&jetInfo); MCchain.SetBranchAddress("OtherJetsBranch",&jetInfo2); cout << "MC chain entries : " << (MCchain.GetBranch("bJetsBranch"))->GetEntries() << endl; jetInfoBranch[0] = MCchain.GetBranch("bJetsBranch"); cout << "Jet entries : " << jetInfoBranch[0]->GetEntries() << endl; jetInfoBranch[1] = MCchain.GetBranch("OtherJetsBranch"); cout << "Jet 2 entries : " << jetInfoBranch[1]->GetEntries() << endl; cout << "MC chain entries : " << MCchain.GetEntries() << endl; [/i] Unfortunatelly the (MCchain.GetBranch("bJetsBranch"))->GetEntries() or MCchain.GetEntries() returns 0 and the jetInfoBranch[*]->GetEntries() return the number of entries of the last file... so where is my error ? Best regards, Alain -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Alain Romeyer Service de Physique des Particules Elémentaires 19 Avenue Maistriau Tél : +32 (0) 65.37.33.93 B-7000 MONS Belgium Email : alain.romeyer@umh.ac.be ----------------------------------------- http://membres.lycos.fr/aromeyer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:08 MET