#define normist_cxx #include "normist.h" #include #include #include #include #include #include void normist::Loop() { // In a ROOT session, you can do: // Root > .L normist.C // Root > normist 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; TFile *_file1 = TFile::Open("/data/Data2011/MC/Zmumu/DumperOut/DumperOut_MC_Zmumu_ALL.root"); TFile *_file0 = TFile::Open("/data/Data2011/RealData/data2010_part1_40pb.root"); {//invmass _file0->cd(); JpsiTree->Draw("invmass>>h1","invmass<100500&&invmass>75000"); Double_t scale=1/h1->Integral(); h1->Scale(scale); _file1->cd(); JpsiTree->Draw("invmass>>h2","invmass<100500&&invmass>75000"); Double_t scale=1/h2->Integral(); h2->Scale(scale); h2->Draw(); h2->SetLineColor(2); h2->SetLineWidth(2); _file0->cd(); h1->Draw("same"); h1->SetLineWidth(2); 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; } }}