#define llllTree2_cxx #include "llllTree2.h" #include #include #include void llllTree2::Loop() { // In a ROOT session, you can do: // root> .L llllTree2.C // root> llllTree2 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; //Distribution m4l //Declare histograms TObjArray *MyHistArray = new TObjArray(0); TH1D *hist_m4l_4e_channel = new TH1D("hist_m4l_4e_channel", "hist_m4l_4e_channel" , 140,40,180); MyHistArray->AddLast(hist_m4l_4e_channel); TH1D *hist_m4l_2e2m_channel = new TH1D("hist_m4l_2e2m_channel", "hist_m4l_2e2m_channel" , 140,40,180); MyHistArray->AddLast(hist_m4l_2e2m_channel); TH1D *hist_m4l_4m_channel = new TH1D("hist_m4l_4m_channel", "hist_m4l_4m_channel" , 140,40,180); MyHistArray->AddLast(hist_m4l_4m_channel); Long64_t nentries = fChain->GetEntriesFast(); Long64_t nbytes = 0, nb = 0; for (Long64_t jentry=0; jentryGetEntry(jentry); nbytes += nb; // if (Cut(ientry) < 0) continue; for(int i=0; iat(i)==44){//4e hist_m4l_4e_channel->Fill(llll_tlv_m->at(i)*0.001,1);} } } hist_m4l_4e_channel->Draw(); }