#define Event_cxx #include "Event.h" #include #include #include #include using namespace std; void Event::Loop() { // In a ROOT session, you can do: // Root > .L Event.C // Root > Event t // Root > t.GetEntry(12); // Fill t data members with entry number 12 // Root > t.Show(); // Show values of entry 12 // Root > t.Show(16); // Read and show values of entry 16 // Root > t.Loop(); // Loop on all entries // // This is the loop skeleton where: // jentry is the global entry number in the chain // ientry is the entry number in the current Tree // Note that the argument to GetEntry must be: // jentry for TChain::GetEntry // ientry for TTree::GetEntry and TBranch::GetEntry // // To read only selected branches, Insert statements like: // METHOD1: // fChain->SetBranchStatus("*",0); // disable all branches // fChain->SetBranchStatus("branchname",1); // activate branchname // METHOD2: replace line // fChain->GetEntry(jentry); //read all branches //by b_branchname->GetEntry(ientry); //read only this branch cout << "Entered Event::Loop()" << endl; if (fChain == 0) return; Long64_t nentries = fChain->GetEntriesFast(); cout << " nentries = " << nentries << endl; Long64_t nbytes = 0, nb = 0; for (Long64_t jentry=0; jentry::const_iterator it_amp = amplitude->begin(); vector::const_iterator it_phtim = photon_time->begin(); vector::const_iterator it_scrod = scrodId->begin(); vector::const_iterator it_aRow = asicRow->begin(); vector::const_iterator it_aCol = asicCol->begin(); vector::const_iterator it_aCh = asicCh->begin(); for(; it_amp != amplitude->end() && it_phtim != photon_time->end() && it_scrod != scrodId->end() && it_aRow != asicRow->end() && it_aCol != asicCol->end() && it_aCh != asicCh->end(); it_amp++, it_phtim++, it_scrod++, it_aRow++, it_aCol++, it_aCh++ ){ cout << " amplitude, photon_time = " << *it_amp << ", " << *it_phtim << endl; cout << " scrodId, asicRow, asicCol, asicCh = " << *it_scrod << ", " << *it_aRow << ", " << *it_aCol << ", " << *it_aCh << endl; } // End for iterating over hits } }