//void triggerturnon(TString infname="/mnt/hadoop/cms/store/user/jwang/Dmeson/5p02TeV/ntD_20151016_DinderMC_20151015_EvtMatching_Pyquen_D0tokaonpion_D0pt15p0_Pthat15_TuneZ2_Unquenched_5020GeV_GENSIM_75x_v2_20151010.root") void variables(TString infname=Form("/mnt/hadoop/cms/store/user/jwang/Dmeson/5p02TeV/ntD_20151018_DfinderMC_20151017_EvtMatching_Pyquen_D0tokaonpion_D0pt%.0fp0_Pthat%.0f_TuneZ2_Unquenched_5020GeV_GENSIM_75x_v2_20151016.root",pthat,pthat)) { void plotTurnOn(TTree* inttree, TString triggerpass, TString variable, TString varname, TString varlatex); TFile* infile = new TFile(infname); TTree* root = (TTree*)infile->Get("ntDkpi"); plotTurnOn(root,"HLT_DmesonTrackingGlobalPt8_Dpt20_v1","TMath::Cos(Dalpha)","cosalpha","cos#alpha"); plotTurnOn(root,"HLT_DmesonTrackingGlobalPt8_Dpt20_v1","DsvpvDistance/DsvpvDisErr","ffls3d","decay length significance"); plotTurnOn(root,"HLT_DmesonTrackingGlobalPt8_Dpt20_v1","Dchi2cl","vtxprob","vertex prob"); plotTurnOn(root,"HLT_DmesonTrackingGlobalPt8_Dpt40_v1","TMath::Cos(Dalpha)","cosalpha","cos#alpha"); plotTurnOn(root,"HLT_DmesonTrackingGlobalPt8_Dpt40_v1","DsvpvDistance/DsvpvDisErr","ffls3d","decay length significance"); plotTurnOn(root,"HLT_DmesonTrackingGlobalPt8_Dpt40_v1","Dchi2cl","vtxprob","vertex prob"); plotTurnOn(root,"HLT_DmesonTrackingGlobalPt8_Dpt60_v1","TMath::Cos(Dalpha)","cosalpha","cos#alpha"); plotTurnOn(root,"HLT_DmesonTrackingGlobalPt8_Dpt60_v1","DsvpvDistance/DsvpvDisErr","ffls3d","decay length significance"); plotTurnOn(root,"HLT_DmesonTrackingGlobalPt8_Dpt60_v1","Dchi2cl","vtxprob","vertex prob"); }
int main(int argc, char **argv) { if(argc == 3) { plotTurnOn(argv[1], argv[2]); return 0; } else { std::cout << "Usage:\nplotTurnOn.exe <input_filename> <output_tag>" << std::cout; std::cout << "An output pdf will be named <output_tag>_turnon.pdf" << std::cout; return 1; } }
void triggerturnonFast(TString trigger="HLT_DmesonPPTrackingGlobal_Dpt20_v1") { TH1D* getYield(TTree* nt, TString triggerpass, TString triggername, TString prescale, TString variable, TString varname, TString varlatex, Int_t BIN_NUM, Double_t BIN_MIN, Double_t BIN_MAX, TString addcut=""); void plotTurnOn(TH1D* hnominator, TH1D* hdenominator, TString triggerlegend, TString triggername, TString varname, TString varlatex, Int_t BIN_NUM, Double_t BIN_MIN, Double_t BIN_MAX); TString infname; infname = "/data/dmeson2015/Dntuple/ntD_BigMergeExpressHiForest_run262163-run262252_match.root"; //infname = "/data/dmeson2015/Dntuple/Dntuple_run262163_262165_262167_262172.root"; TFile* infile = new TFile(infname); TTree* root = (TTree*)infile->Get("ntDkpi"); root->AddFriend("HltTree",infname); TH1D* hpp_pt = getYield(root,"","","","Dpt","pt","p_{T} (GeV/c)",16,0,80); TH1D* hpp_pt_Hlt = getYield(root,Form("&&%s",trigger.Data()),Form("_%s",trigger.Data()),Form("*%s_Prescl",trigger.Data()),"Dpt","pt","p_{T} (GeV/c)",16,0,80); plotTurnOn(hpp_pt_Hlt,hpp_pt,trigger,Form("_%s",trigger.Data()),"pt","p_{T} (GeV/c)",16,0,80); }
void extract(TString trigger="HLT_HIDmesonHITrackingGlobal_Dpt40_v1",double nbins=2,double minpt=2,double maxpt=2) { TH1D* getYield(TTree* nt, TTree* ntMC, TString triggerpass, TString triggername, TString prescale, TString variable, TString varname, TString varlatex, Int_t BIN_NUM, Double_t BIN_MIN, Double_t BIN_MAX, TString addcut=""); void plotTurnOn(TH1D* hnominator, TH1D* hdenominator, TString triggerlegend, TString triggername, TString varname, TString varlatex, Int_t BIN_NUM, Double_t BIN_MIN, Double_t BIN_MAX); TFile* infile = new TFile(infname); TTree* root = (TTree*)infile->Get("ntDkpi"); root->AddFriend("ntHlt"); TFile* infileMC = new TFile(infnameMC); TTree* rootMC = (TTree*)infileMC->Get("ntDkpi"); rootMC->AddFriend("ntHlt"); rootMC->AddFriend("ntGen"); if(!isPbPb) { TH1D* hpp_pt = getYield(root,rootMC,"","","","Dpt","pt","p_{T} (GeV/c)",nbins,minpt,maxpt); TH1D* hpp_pt_Hlt = getYield(root,rootMC,Form("&&%s",trigger.Data()),Form("_%s",trigger.Data()),"","Dpt","pt","p_{T} (GeV/c)",nbins,minpt,maxpt); plotTurnOn(hpp_pt_Hlt,hpp_pt,trigger,Form("_%s",trigger.Data()),"pt","p_{T} (GeV/c)",nbins,minpt,maxpt); } }
int main() { plotTurnOn(); return 0; }
void triggerturnon() { void plotTurnOn(TTree* inttree, TString triggerpass, TString variable, TString varname, TString varlatex, Int_t BIN_NUM, Double_t BIN_MIN, Double_t BIN_MAX, TString addcut=""); void plotTurnOnNL1seed(TTree* inttree, TString triggerpass, Int_t BIN_NUM, Double_t BIN_MIN, Double_t BIN_MAX); TString infname; if(!isPbPb) infname = Form("/export/d00/scratch/jwang/Dmeson/ntD_20151115_DfinderMC_20151115_EvtMatching_Pythia_D0pt%.0fp0_Pthat%.0f_TuneZ2_5020GeV_GENSIM_75x_1015_20151110_ppGlobaTrackingPPmenuHFlowpuv11_MBseed_twang-Pythia_755patch2_v20_MBseed_1116.root",pthat,pthat); else infname = Form("/export/d00/scratch/jwang/Dmeson/ntD_20151110_DfinderMC_20151110_EvtMatching_Pyquen_D0tokaonpion_D0pt%.0fp0_Pthat%.0f_TuneZ2_Unquenched_5020GeV_GENSIM_75x_v2_20151110_50k_L1v4_v15_loosecuts_MBseed_1108.root",pthat,pthat); //infname = "/export/d00/scratch/jwang/Dmeson/nt_merged_dntuple.root"; TFile* infile = new TFile(infname); TTree* root = (TTree*)infile->Get("ntDkpi"); root->AddFriend("HltTree"); if(!isPbPb) { plotTurnOn(root,"HLT_DmesonPPTrackingGlobal_Dpt8_v1&&L1_SingleJet16_BptxAND","Dpt","pt","p_{T} (GeV/c)",16,0,80); plotTurnOn(root,"HLT_DmesonPPTrackingGlobal_Dpt15_v1&&L1_SingleJet24_BptxAND","Dpt","pt","p_{T} (GeV/c)",16,0,80); plotTurnOn(root,"HLT_DmesonPPTrackingGlobal_Dpt20_v1&&L1_SingleJet28_BptxAND","Dpt","pt","p_{T} (GeV/c)",16,0,80); plotTurnOn(root,"HLT_DmesonPPTrackingGlobal_Dpt30_v1&&L1_SingleJet40_BptxAND","Dpt","pt","p_{T} (GeV/c)",16,0,80); plotTurnOn(root,"HLT_DmesonPPTrackingGlobal_Dpt40_v1&&L1_SingleJet40_BptxAND","Dpt","pt","p_{T} (GeV/c)",16,0,80); plotTurnOn(root,"HLT_DmesonPPTrackingGlobal_Dpt50_v1&&L1_SingleJet48_BptxAND","Dpt","pt","p_{T} (GeV/c)",16,0,80); plotTurnOn(root,"HLT_DmesonPPTrackingGlobal_Dpt60_v1&&L1_SingleJet48_BptxAND","Dpt","pt","p_{T} (GeV/c)",16,0,80); /* plotTurnOn(root,"HLT_DmesonPPTrackingGlobal_Dpt10_v1","Dpt","pt","p_{T} (GeV/c)",16,0,80); plotTurnOn(root,"HLT_DmesonPPTrackingGlobal_Dpt20_v1","Dpt","pt","p_{T} (GeV/c)",16,0,80); plotTurnOn(root,"HLT_DmesonPPTrackingGlobal_Dpt30_v1","Dpt","pt","p_{T} (GeV/c)",16,0,80); plotTurnOn(root,"HLT_DmesonPPTrackingGlobal_Dpt40_v1","Dpt","pt","p_{T} (GeV/c)",16,0,80); plotTurnOn(root,"HLT_DmesonPPTrackingGlobal_Dpt50_v1","Dpt","pt","p_{T} (GeV/c)",16,0,80); plotTurnOn(root,"HLT_DmesonPPTrackingGlobal_Dpt60_v1","Dpt","pt","p_{T} (GeV/c)",16,0,80); plotTurnOnNL1seed(root,"HLT_DmesonPPTrackingGlobal_Dpt10_v1",16,0,80); plotTurnOnNL1seed(root,"HLT_DmesonPPTrackingGlobal_Dpt20_v1",16,0,80); plotTurnOnNL1seed(root,"HLT_DmesonPPTrackingGlobal_Dpt30_v1",16,0,80); plotTurnOnNL1seed(root,"HLT_DmesonPPTrackingGlobal_Dpt40_v1",16,0,80); plotTurnOnNL1seed(root,"HLT_DmesonPPTrackingGlobal_Dpt50_v1",16,0,80); plotTurnOnNL1seed(root,"HLT_DmesonPPTrackingGlobal_Dpt60_v1",16,0,80); */ } else { plotTurnOn(root,"HLT_DmesonTrackingGlobalPt8_Dpt20_v1","Dpt","pt","p_{T} (GeV/c)",16,0,80); plotTurnOn(root,"HLT_DmesonTrackingGlobalPt8_Dpt30_v1","Dpt","pt","p_{T} (GeV/c)",16,0,80); plotTurnOn(root,"HLT_DmesonTrackingGlobalPt8_Dpt40_v1","Dpt","pt","p_{T} (GeV/c)",16,0,80); plotTurnOn(root,"HLT_DmesonTrackingGlobalPt8_Dpt50_v1","Dpt","pt","p_{T} (GeV/c)",16,0,80); plotTurnOn(root,"HLT_DmesonTrackingGlobalPt8_Dpt60_v1","Dpt","pt","p_{T} (GeV/c)",16,0,80); plotTurnOnNL1seed(root,"HLT_DmesonTrackingGlobalPt8_Dpt20_v1",16,0,80); plotTurnOnNL1seed(root,"HLT_DmesonTrackingGlobalPt8_Dpt30_v1",16,0,80); plotTurnOnNL1seed(root,"HLT_DmesonTrackingGlobalPt8_Dpt40_v1",16,0,80); plotTurnOnNL1seed(root,"HLT_DmesonTrackingGlobalPt8_Dpt50_v1",16,0,80); plotTurnOnNL1seed(root,"HLT_DmesonTrackingGlobalPt8_Dpt60_v1",16,0,80); } }