using namespace std; #include #include "TNtupleD.h" #include "TProfile.h" #include #include #include #include #include #include #include "TMath.h" #include "TLorentzVector.h" #include "TTree.h" #include "TTreeReader.h" #include "TLeaf.h" #include #include #include #include #include #include #include void MakeTemplates(TString Region, TString SampleType, TString LeptonType="elec", TString SliceType="1", TString RegionABCD= "A"){ cout<<"Run with region: "<Get("CollectionTree"); TH1F*hCF=(TH1F*)f0->Get(nameHistoCF); hCF->Sumw2(); cout<<"1st bin content "<GetBinContent(1)<GetEntries(); cout<<"nev0 "< v_photonptcone20; std::vector v_tight; std::vector v_iso; std::vector v_photonpt; std::vector v_jetpt; TTreeReader reader("CollectionTree", f0); TTreeReaderValue weight(reader, "HGamEventInfoAuxDyn.weight"); TTreeReaderValue centrality(reader, "HGamEventInfoAuxDyn.Zy_centrality"); TTreeReaderValue N_j_btag(reader, "HGamEventInfoAuxDyn.N_j_btag30"); TTreeReaderValue N_j(reader, "HGamEventInfoAuxDyn.N_j"); TTreeReaderValue> photonptcone20(reader, "HGamPhotonsAuxDyn.ptcone20"); TTreeReaderValue> photonpt(reader, "HGamPhotonsAuxDyn.pt"); TTreeReaderValue> tight(reader, "HGamPhotonsAuxDyn.isTight"); TTreeReaderValue> iso(reader, "HGamPhotonsAuxDyn.isIsoFixedCutLoose"); TTreeReaderValue N_e(reader, "HGamEventInfoAuxDyn.N_e"); TTreeReaderValue N_mu(reader, "HGamEventInfoAuxDyn.N_mu"); TTreeReaderValue m_ll(reader, "HGamEventInfoAuxDyn.m_ll"); TTreeReaderValue m_lly(reader, "HGamEventInfoAuxDyn.m_lly"); TTreeReaderValue pass(reader, "HGamEventInfoAuxDyn.isPassedZyVBSPreSel"); TTreeReaderValue< vector > jetpt(reader, "HGamAntiKt4EMTopoJetsAuxDyn.pt"); TString XSreader=""; XSreader="HGamEventInfoAuxDyn.crossSectionBRfilterEff"; TTreeReaderValue weightCrossSection(reader, XSreader); TH1F *h_ngj=new TH1F("h_ngj", "", 10, 0, 10); TH1F *h_mj=new TH1F("h_mj", "", 300, 0, 3000); TH1F *h_ptj1=new TH1F("h_ptj1", "",500, 0, 1000); TH1F *h_ptj2=new TH1F("h_ptj2", "",500, 0, 1000); TH1F *h_ptg=new TH1F("h_ptg", "",500, 0, 1000); TH1F *h_etag=new TH1F("h_etag", "",60, -3, -3); TH1F *h_phig=new TH1F("h_phig", "",64, -3.2, 3.2); TH1F *h_etaj1=new TH1F("h_etaj1", "",100, -5, 5); TH1F *h_etaj2=new TH1F("h_etaj2", "",100, -5, 5); TH1F *h_Zgcentr=new TH1F("h_Zgcentr", "",200, 0, 100); h_ngj->Sumw2(); h_mj->Sumw2(); h_ptj1->Sumw2(); h_ptj2->Sumw2(); h_ptg->Sumw2(); h_etag->Sumw2(); h_phig->Sumw2(); h_etaj1->Sumw2(); h_etaj2->Sumw2(); h_Zgcentr->Sumw2(); while (reader.Next()) { v_tight=*tight; v_iso=*iso; v_photonptcone20= *photonptcone20; v_photonpt = *photonpt; //passing the value isTight=v_tight[0]; isIso=v_iso[0]; ptcone20g = v_photonptcone20[0]*1e-3; ptg = v_photonpt[0]*1e-3; v_jetpt = *jetpt; //passing the value ptj1 = v_jetpt[0]*1e-3; isPass=*pass; Ne=*N_e; Nmu=*N_mu; mll=*m_ll*1e-3; mlly=*m_lly*1e-3; ngj=*N_j; nBJets=*N_j_btag; Zgcentr=*centrality; weight2=*weight; weightXS=*weightCrossSection; //cout<<"isPass "<182 && (ptcone20g<(0.05*ptg)) && isTight && isIso){ //cout<<"Pass first step"<=2 && nBJets==0 && fabs(Zgcentr)<=5){ //cout<<"Pass second step"<GetBinContent(1)); cout<<"m_countw "<Close(); }