{ TChain * chain = new TChain("Analysis"); chain->SetMakeClass(1); for (Int_t ifil_os =0; ifil_os < 1; ifil_os++) { Char_t namefile_os[16]; strcpy (namefile_os, "test_"); Char_t numfile_os[4]; sprintf (numfile_os,"%d",ifil_os+1); Char_t endfile_os[6]; strcpy (endfile_os, ".root"); TString mystring_os = "" ; //Place the new location of test_1.root file chain-> Add(mystring_os+namefile_os+numfile_os+endfile_os); } Int_t Photon_size; Int_t Photon; chain->SetBranchAddress("Photon",&Photon); chain->SetBranchAddress("Photon_size",&Photon_size); const Int_t kMax_Photon_size = 200; Float_t Photon_CalPT[kMax_Photon_size]; //[nL1iEM] Float_t Photon_CalEta[kMax_Photon_size]; //[nL1iEM] chain->SetBranchAddress("Photon.CalPT",Photon_CalPT); // Parameters definition const Float_t Eta_End = 1.479; const Float_t PI = 3.1415927; const Float_t TWOPI = 2.0*PI; //Histograms TFile Isto("L1_Efficiency.root","recreate"); // Variables Int_t n,nBINeta = 200; Int_t k=0; Float_t etaLowLim = -6.0 , etaHiLim = 6.0 ; Int_t nBINphi = 360; Float_t phiLowLim = -PI , phiHiLim = +PI ; Float_t s; //------------------------------General_Plots----------------------------------------------------------------- TH1F * L3_PH_PT = new TH1F("L3_PH_PT","Rec_BG_120GeV_Pt_withoutEtaCut" ,nBINeta,0.,800); TH1F * L3_PH_ETA = new TH1F("L3_PH_ETA" ,"Rec_BG_120GeV_ETA_withoutEtaCut" ,nBINeta,-7.0,7.0); //------------------------------------------------------------------------------------------------------------ Int_t nevents = (Int_t)chain->GetEntries(); Int_t nbytes = 0; //+++++++++++++++++++++++++++++++++++++++++++++++++ /// loop over the events ////+++++++++++++++++++++++++++++++++++++++++++++++++ cout << "No. of events: " << nevents << endl; for(Int_t ievent=0; ieventGetEntry(ievent); //cout<<"hi"<Fill(CalPT); } } // event loop Isto->Write(); Isto->Close(); cout << "======= END ======" << endl; return 0; }