#define T_cxx #include "T.h" #include #include #include void T::Loop(Int_t CutValue) { // In a ROOT session, you can do: // Root > .L T.C // Root > T 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 if (fChain == 0) return; TH1F *NaIOutput=new TH1F("NaIOutput","NaIOutput",2000,0,2000); Long64_t nentries = fChain->GetEntriesFast(); Long64_t nbytes = 0, nb = 0; Int_t GoodEvent=0; //for (Long64_t jentry=4; jentryGetEntry(jentry); nbytes += nb; // if (Cut(ientry) < 0) continue; // T->Draw("CH14:Iteration$","","L",1,jentry); GoodEvent=Cut(jentry); if( GoodEvent > 10 && GoodEvent < 20) cout << "Event:" << jentry << " Cut " << GoodEvent << endl; if(GoodEvent > CutValue) { // cout << "Event:" << jentry << " Integral" << IntegrateEvent(jentry) << endl; NaIOutput->Fill(IntegrateEvent(jentry)); } } NaIOutput->Draw(); }