void analyseFitToystudiesB0(string filename, bool justTau = false) { fileprefix = "fitToyStudiesB0"; TTree *t = new TTree; t->ReadFile(filename.c_str(),"tau:tau_err:mass_peak:mass_peak_err:m_sigma1:m_sigma1_err:m_sigma2:m_sigma2_err:frac_m_gauss:frac_m_gauss_err:core_frac:core_frac_err:tau_bk:tau_bk_err:n_nonprompt:n_nonprompt_err:n_prompt:n_prompt_err:n_signal:n_signal_err:prompt_p1:prompt_p1_err:prompt_sigma_core:prompt_sigma_core_err:prompt_sigma_tail:prompt_sigma_tail_err"); if (!justTau) { plotPulls(t, "tau_pulls", "#tau(B^{0})", "tau", 1.529, 100, 5.0); plotPulls(t, "mass_pulls", "m(B^{0})", "mass_peak", 5.27950, 100, 5.0); plotPulls(t, "tau_bk_pulls", "#tau_{bgr}(B^{0})", "tau_bk", 0.750, 100, 5.0); plotPulls(t, "nsig_pulls", "n_{sig}", "n_signal", 6750, 100, 5.0); plotPulls(t, "npr_pulls", "n_{prompt}", "n_prompt", 3375, 100, 10); plotPulls(t, "nnpr_pulls", "n_{nonprompt}", "n_nonprompt", 1125, 100, 10); } plotHisto(t, "tau_histo", "#tau(B^{0})", "ps", "tau", 100, 1.30, 1.70); if (!justTau) { plotHisto(t, "mass_histo", "m(B^{0})", "GeV", "mass_peak", 100, 5.2785, 5.281); plotHisto(t, "tau_bk_histo", "#tau_{bgr}(B^{0})", "ps", "tau_bk", 100, 0.5, 0.9); plotHisto(t, "nsig_histo", "n_{sig}", "", "n_signal", 100, 6500, 7000); plotHisto(t, "npr_histo", "n_{prompt}", "", "n_prompt", 100, 2900, 3900); plotHisto(t, "nnpr_histo", "n_{nonprompt}", "", "n_nonprompt", 100, 950, 1450); } }
void analyseFitToystudiesLb(string filename, bool justTau = false) { fileprefix = "fitToyStudiesLb"; TTree *t = new TTree; //t->ReadFile(filename.c_str(),"tau:tau_err:mass_peak:mass_peak_err:m_sigma1:m_sigma1_err:m_sigma2:m_sigma2_err:frac_m_gauss:frac_m_gauss_err:core_frac:core_frac_err:tau_bk:tau_bk_err:n_nonprompt:n_nonprompt_err:n_prompt:n_prompt_err:n_signal:n_signal_err:prompt_p1:prompt_p1_err:prompt_sigma_core:prompt_sigma_core_err:prompt_sigma_tail:prompt_sigma_tail_err"); // alter Fit //t->ReadFile(filename.c_str(),"tau:tau_err:mass_peak:mass_peak_err:m_sigma1:m_sigma1_err:m_sigma2:m_sigma2_err:frac_m_gauss:frac_m_gauss_err:core_frac:core_frac_err:tau_bk:tau_bk_err:n_nonprompt:n_nonprompt_err:n_prompt:n_prompt_err:n_signal:n_signal_err:prompt_p1:prompt_p1_err:prompt_sigma_core:prompt_sigma_core_err:prompt_sigma_tail:prompt_sigma_tail_err:npr_reso_sigma:npr_reso_sigma_err:sig_reso_sigma:sig_reso_sigma_err"); // Fit ohne PEE //t->ReadFile(filename.c_str(),"tau:tau_err:mass_peak:mass_peak_err:m_sigma1:m_sigma1_err:m_sigma2:m_sigma2_err:frac_m_gauss:frac_m_gauss_err:tau_bk:tau_bk_err:n_nonprompt:n_nonprompt_err:n_prompt:n_prompt_err:n_signal:n_signal_err:prompt_p1:prompt_p1_err:reso_bias:reso_bias_err:reso_sigma:reso_sigma_err"); // Fit mit PEE 1 Gauss t->ReadFile(filename.c_str(),"tau:tau_err:mass_peak:mass_peak_err:m_sigma1:m_sigma1_err:m_sigma2:m_sigma2_err:frac_m_gauss:frac_m_gauss_err:tau_bk:tau_bk_err:n_nonprompt:n_nonprompt_err:n_prompt:n_prompt_err:n_signal:n_signal_err:prompt_p1:prompt_p1_err:reso_bias:reso_bias_err:reso_sigma:reso_sigma_err:npr_reso_bias:npr_reso_bias_err:npr_reso_sigma:npr_reso_sigma_err:sig_reso_bias:sig_reso_bias_err:sig_reso_sigma:sig_reso_sigma_err"); // Fit mit PEE 3 Gauss //t.Draw("tau>>htau"); //t->Draw("(tau-1.507)/tau_err>>htau_pulls(100,-5,5)"); if (!justTau) { const int Nevents = 5000; const double bgrfrac = 0.8; const double nonprfrac = 0.25; const int Nsig = Nevents * (1-bgrfrac); const int Npr = Nevents * bgrfrac * ( 1-nonprfrac); const int Nnpr = Nevents * bgrfrac * nonprfrac; plotPulls(t, "tau_pulls", "#tau(#Lambda_{b})", "tau", 1.507, 100, 5.0); plotPulls(t, "mass_pulls", "m(#Lambda_{b})", "mass_peak", 5.6202, 100, 5.0); plotPulls(t, "tau_bk_pulls", "#tau_{bgr}(#Lambda_{b})", "tau_bk", 0.750, 100, 5.0); plotPulls(t, "nsig_pulls", "n_{sig}", "n_signal", Nsig, 100, 5.0); plotPulls(t, "npr_pulls", "n_{prompt}", "n_prompt", Npr, 100, 10.0); plotPulls(t, "nnpr_pulls", "n_{nonprompt}", "n_nonprompt", Nnpr, 100, 10.0); } plotHisto(t, "tau_histo", "#tau(#Lambda_{b})", "ps", "tau", 100, 1.30, 1.70); if (!justTau) { plotHisto(t, "mass_histo", "m(#Lambda_{b})", "GeV", "mass_peak", 100, 5.615, 5.625); plotHisto(t, "tau_bk_histo", "#tau_{bgr}(#Lambda_{b})", "ps", "tau_bk", 100, 0.5, 0.9); plotHisto(t, "nsig_histo", "n_{sig}", "", "n_signal", 100, .8*Nsig, 1.2*Nsig); plotHisto(t, "npr_histo", "n_{prompt}", "", "n_prompt", 100, .8*Npr, 1.2*Npr); plotHisto(t, "nnpr_histo", "n_{nonprompt}", "", "n_nonprompt", 100, 0.8*Nnpr, 1.2*Nnpr); } }
void plotPulls(TTree *t, string hname, string valtitle, string toPlot, double trueVal, int nBins = 100, double range = 5.0) { plotPulls(t, hname, valtitle, toPlot, trueVal, nBins, -range, range); }
void IterTrackValHistoPublisher(char* newFile="NEW_FILE",char* refFile="REF_FILE") { //gROOT->ProcessLine(".x HistoCompare_Tracks.C"); gROOT ->Reset(); gROOT ->SetBatch(); //========= settings ==================== gROOT->SetStyle("Plain"); gStyle->SetPadGridX(kTRUE); gStyle->SetPadGridY(kTRUE); gStyle->SetPadRightMargin(0.07); gStyle->SetPadLeftMargin(0.13); //gStyle->SetTitleXSize(0.07); //gStyle->SetTitleXOffset(0.6); //tyle->SetTitleYSize(0.3); //gStyle->SetLabelSize(0.6) //gStyle->SetTextSize(0.5); char* refLabel("REF_LABEL, REF_RELEASE REFSELECTION"); char* newLabel("NEW_LABEL, NEW_RELEASE NEWSELECTION"); //============================================= delete gROOT->GetListOfFiles()->FindObject(refFile); delete gROOT->GetListOfFiles()->FindObject(newFile); TText* te = new TText(); TFile * sfile = new TFile(newFile); TDirectory * sdir=gDirectory; TFile * rfile = new TFile(refFile); TDirectory * rdir=gDirectory; if(sfile->GetDirectory("DQMData/Run 1/RecoTrackV")) sfile->cd("DQMData/Run 1/RecoTrackV/Run summary/Track"); else if(sfile->GetDirectory("DQMData/RecoTrackV/Track"))sfile->cd("DQMData/RecoTrackV/Track"); else if(sfile->GetDirectory("DQMData/Run 1/Tracking")) sfile->cd("DQMData/Run 1/Tracking/Run summary/Track"); else if(sfile->GetDirectory("DQMData/Tracking/Track"))sfile->cd("DQMData/Tracking/Track"); sdir=gDirectory; TList *sl= sdir->GetListOfKeys(); TString collname2 =sl->At(0)->GetName(); // select generalTracks to make the usual validation plots for int num_col = sl->GetSize(); for(int i=0; i<num_col;i++){ collname2 =sl->At(i)->GetName(); if(collname2.Contains("general")) break; } //cout << "collname2 = " << collname2 << endl; if(rfile->GetDirectory("DQMData/Run 1/RecoTrackV")) rfile->cd("DQMData/Run 1/RecoTrackV/Run summary/Track"); else if(rfile->GetDirectory("DQMData/RecoTrackV/Track"))rfile->cd("DQMData/RecoTrackV/Track"); else if(rfile->GetDirectory("DQMData/Run 1/Tracking")) rfile->cd("DQMData/Run 1/Tracking/Run summary/Track"); else if(rfile->GetDirectory("DQMData/Tracking/Track"))rfile->cd("DQMData/Tracking/Track"); rdir=gDirectory; TList *rl= rdir->GetListOfKeys(); TString collname1=rl->At(0)->GetName(); num_col = rl->GetSize(); for(int i=0; i<num_col;i++){ collname1 =rl->At(i)->GetName(); if(collname1.Contains("general")) break; } //cout << "collname1 = " << collname1 << endl; //int num_col = rl->GetSize(); //for(int i=0; i<num_col;i++){ // cout << " >>>>>>>>>dir " << i << " name = " << rl->At(i)->GetName() << endl; //} //HistoCompare_Tracks * myPV = new HistoCompare_Tracks(); TCanvas *canvas; TH1F *sh1,*rh1; TH1F *sh2,*rh2; TH1F *sh3,*rh3; TH1F *sh4,*rh4; TH1F *sh5,*rh5; TH1F *sh6,*rh6; TH1F *sc1,*rc1; TH1F *sc2,*rc2; TH1F *sc3,*rc3; bool hit=1; bool chi2=1; bool ctf=1; bool rs=0; ////////////////////////////////////// /////////// CTF ////////////////////// ////////////////////////////////////// if (ctf){ //===== building rdir->GetObject(collname1+"/effic",rh1); sdir->GetObject(collname2+"/effic",sh1); rh1->GetYaxis()->SetRangeUser(MINEFF,MAXEFF); sh1->GetYaxis()->SetRangeUser(MINEFF,MAXEFF); rh1->GetXaxis()->SetTitle("#eta"); rh1->GetYaxis()->SetTitle("efficiency vs #eta"); rh1->GetYaxis()->SetTitleSize(0.05); rh1->GetYaxis()->SetTitleOffset(1.2); // rh1->GetYaxis()->SetRangeUser(0.5,1.025); // sh1->GetYaxis()->SetRangeUser(0.5,1.025); rdir->GetObject(collname1+"/fakerate",rh2); sdir->GetObject(collname2+"/fakerate",sh2); rh2->GetYaxis()->SetRangeUser(0.,MAXFAKE); sh2->GetYaxis()->SetRangeUser(0.,MAXFAKE); rh2->GetXaxis()->SetTitle("#eta"); rh2->GetYaxis()->SetTitle("fakerate vs #eta"); rh2->GetYaxis()->SetTitleSize(0.05); rh2->GetYaxis()->SetTitleOffset(1.2); // rh2->GetYaxis()->SetRangeUser(0.,.70); // sh2->GetYaxis()->SetRangeUser(0.,.70); rdir->GetObject(collname1+"/efficPt",rh3); sdir->GetObject(collname2+"/efficPt",sh3); rh3->GetXaxis()->SetRangeUser(0,300); sh3->GetXaxis()->SetRangeUser(0,300); rh3->GetXaxis()->SetTitle("p_{t}"); rh3->GetYaxis()->SetTitle("efficiency vs p_{t}"); rh3->GetYaxis()->SetTitleSize(0.05); rh3->GetYaxis()->SetTitleOffset(1.2); rh3->SetTitle(""); rdir->GetObject(collname1+"/fakeratePt",rh4); sdir->GetObject(collname2+"/fakeratePt",sh4); rh4->SetTitle(""); rh4->GetXaxis()->SetTitle("p_{t}"); rh4->GetYaxis()->SetTitle("fakrate vs p_{t}"); rh4->GetYaxis()->SetTitleSize(0.05); rh4->GetYaxis()->SetTitleOffset(1.2); rh4->GetYaxis()->SetRangeUser(0.,.80); sh4->GetYaxis()->SetRangeUser(0.,.80); rh4->GetXaxis()->SetRangeUser(0.2,300); sh4->GetXaxis()->SetRangeUser(0.2,300); rdir->GetObject(collname1+"/effic_vs_hit",rh5); sdir->GetObject(collname2+"/effic_vs_hit",sh5); rh5->GetXaxis()->SetTitle("hits"); rh5->GetYaxis()->SetTitle("efficiency vs hits"); rh5->GetYaxis()->SetTitleSize(0.05); rh5->GetYaxis()->SetTitleOffset(1.2); //rh3->GetXaxis()->SetRangeUser(0,30); //sh3->GetXaxis()->SetRangeUser(0,30); rdir->GetObject(collname1+"/fakerate_vs_hit",rh6); sdir->GetObject(collname2+"/fakerate_vs_hit",sh6); rh6->GetYaxis()->SetRangeUser(0.,1.0); rh6->GetYaxis()->SetRangeUser(0.,1.0); rh6->GetXaxis()->SetTitle("hits"); rh6->GetYaxis()->SetTitle("fakerate vs hits"); rh6->GetYaxis()->SetTitleSize(0.05); rh6->GetYaxis()->SetTitleOffset(1.2); //rdir->GetObject(collname1+"/num_reco_pT",rh6); //sdir->GetObject(collname2+"/num_reco_pT",sh6); canvas = new TCanvas("Tracks","Tracks: efficiency & fakerate",1000,1400); //NormalizeHistograms(rh2,sh2); //NormalizeHistograms(rh6,sh6); //rh1->GetYaxis()->SetRangeUser(8,24); //sh1->GetYaxis()->SetRangeUser(8,24); //rh6->GetXaxis()->SetRangeUser(0,10); //sh6->GetXaxis()->SetRangeUser(0,10); TH1F * r[6]={rh1,rh2,rh3,rh4,rh5,rh6}; TH1F * s[6]={sh1,sh2,sh3,sh4,sh5,sh6}; plotBuilding(canvas,s, r,6, te,"UU",-1, 1, false, 0xC); canvas->cd(); //TPaveText* text = new TPaveText(0.25,0.72,0.75,0.77,"prova"); //text->SetFillColor(0); //text->SetTextColor(1); //text->Draw(); l = new TLegend(0.10,0.64,0.90,0.69); l->SetTextSize(0.016); l->SetLineColor(1); l->SetLineWidth(1); l->SetLineStyle(1); l->SetFillColor(0); l->SetBorderSize(3); l->AddEntry(rh1,refLabel,"LPF"); l->AddEntry(sh1,newLabel,"LPF"); l->Draw(); canvas->Print("building.pdf"); delete l; // ====== hits and pt rdir->GetObject(collname1+"/nhits_vs_eta_pfx",(TProfile*)rh1); sdir->GetObject(collname2+"/nhits_vs_eta_pfx",(TProfile*)sh1); rdir->GetObject(collname1+"/hits",rh2); sdir->GetObject(collname2+"/hits",sh2); rdir->GetObject(collname1+"/num_simul_pT",rh3); sdir->GetObject(collname2+"/num_simul_pT",sh3); rdir->GetObject(collname1+"/num_reco_pT",rh4); sdir->GetObject(collname2+"/num_reco_pT",sh4); canvas = new TCanvas("Tracks1","Tracks: hits and Pt",1000,1050); rh1->GetYaxis()->SetRangeUser(8,24); sh1->GetYaxis()->SetRangeUser(8,24); rh1->GetXaxis()->SetTitle("#eta"); rh1->GetYaxis()->SetTitle("<hits> vs #eta"); rh2->GetXaxis()->SetRangeUser(0,30); sh2->GetXaxis()->SetRangeUser(0,30); rh2->GetXaxis()->SetTitle("hits"); rh3->GetXaxis()->SetRangeUser(0,10); sh3->GetXaxis()->SetRangeUser(0,10); rh3->GetXaxis()->SetTitle("p_{t}"); rh4->GetXaxis()->SetRangeUser(0,10); sh4->GetXaxis()->SetRangeUser(0,10); rh4->GetXaxis()->SetTitle("p_{t}"); NormalizeHistograms(rh3,sh3); NormalizeHistograms(rh4,sh4); plot4histos(canvas, sh1,rh1,sh2,rh2, sh3,rh3,sh4,rh4, te,"UU",-1); canvas->cd(); l = new TLegend(0.20,0.49,0.90,0.54); l->SetTextSize(0.016); l->SetLineColor(1); l->SetLineWidth(1); l->SetLineStyle(1); l->SetFillColor(0); l->SetBorderSize(3); l->AddEntry(rh1,refLabel,"LPF"); l->AddEntry(sh1,newLabel,"LPF"); l->Draw(); canvas->Print("hitsAndPt.pdf"); delete l; //===== tuning rdir->GetObject(collname1+"/chi2",rh1); sdir->GetObject(collname2+"/chi2",sh1); rdir->GetObject(collname1+"/chi2_prob",rh2); sdir->GetObject(collname2+"/chi2_prob",sh2); rdir->GetObject(collname1+"/chi2_vs_eta_pfx",(TProfile*)rh3); sdir->GetObject(collname2+"/chi2_vs_eta_pfx",(TProfile*)sh3); rdir->GetObject(collname1+"/ptres_vs_eta_Mean",rh4); sdir->GetObject(collname2+"/ptres_vs_eta_Mean",sh4); canvas = new TCanvas("Tracks2","Tracks: chi2 & chi2 probability",1000,1050); NormalizeHistograms(rh1,sh1); NormalizeHistograms(rh2,sh2); fixRangeY(rh1,sh1); fixRangeY(rh2,sh2); rh1->GetXaxis()->SetTitle("#chi^{2}"); rh2->GetXaxis()->SetTitle("Prob(#chi^{2})"); rh3->GetYaxis()->SetRangeUser(0,2.5); sh3->GetYaxis()->SetRangeUser(0,2.5); rh3->SetTitle(""); rh3->GetYaxis()->SetTitleSize(0.05); rh3->GetYaxis()->SetTitleOffset(1.2); rh3->GetYaxis()->SetTitle("< #chi^{2} / ndf >"); rh3->GetXaxis()->SetTitleSize(0.07); rh3->GetXaxis()->SetTitleOffset(0.6); rh3->GetXaxis()->SetTitle("#eta"); rh4->Scale(100.); sh4->Scale(100.); rh4->GetYaxis()->SetRangeUser(-1.5,1.5); sh4->GetYaxis()->SetRangeUser(-1.5,1.5); rh4->SetTitle(""); rh4->GetYaxis()->SetTitleSize(0.05); rh4->GetYaxis()->SetTitleOffset(1.2); rh4->GetYaxis()->SetTitle("< #delta p_{t} / p_{t} > [%]"); rh4->GetXaxis()->SetTitleSize(0.07); rh4->GetXaxis()->SetTitleOffset(0.6); rh4->GetXaxis()->SetTitle("#eta"); plot4histos(canvas, sh1,rh1,sh2,rh2, sh3,rh3,sh4,rh4, te,"UU",-1); canvas->cd(); l = new TLegend(0.20,0.48,0.90,0.53); l->SetTextSize(0.016); l->SetLineColor(1); l->SetLineWidth(1); l->SetLineStyle(1); l->SetFillColor(0); l->SetBorderSize(3); l->AddEntry(rh1,refLabel,"LPF"); l->AddEntry(sh1,newLabel,"LPF"); l->Draw(); canvas->Print("tuning.pdf"); delete l; //===== pulls rdir->GetObject(collname1+"/pullPt",rh1); sdir->GetObject(collname2+"/pullPt",sh1); rdir->GetObject(collname1+"/pullQoverp",rh2); sdir->GetObject(collname2+"/pullQoverp",sh2); rdir->GetObject(collname1+"/pullPhi",rh3); sdir->GetObject(collname2+"/pullPhi",sh3); rdir->GetObject(collname1+"/pullTheta",rh4); sdir->GetObject(collname2+"/pullTheta",sh4); rdir->GetObject(collname1+"/pullDxy",rh5); sdir->GetObject(collname2+"/pullDxy",sh5); rdir->GetObject(collname1+"/pullDz",rh6); sdir->GetObject(collname2+"/pullDz",sh6); canvas = new TCanvas("Tracks4","Tracks: pull of Pt, Qoverp and Phi",1000,1400); NormalizeHistograms(rh1,sh1); NormalizeHistograms(rh2,sh2); NormalizeHistograms(rh3,sh3); NormalizeHistograms(rh4,sh4); NormalizeHistograms(rh5,sh5); NormalizeHistograms(rh6,sh6); rh1->GetXaxis()->SetRangeUser(-10,10); sh1->GetXaxis()->SetRangeUser(-10,10); rh2->GetXaxis()->SetRangeUser(-10,10); sh2->GetXaxis()->SetRangeUser(-10,10); rh3->GetXaxis()->SetRangeUser(-10,10); sh3->GetXaxis()->SetRangeUser(-10,10); rh4->GetXaxis()->SetRangeUser(-10,10); sh4->GetXaxis()->SetRangeUser(-10,10); rh5->GetXaxis()->SetRangeUser(-10,10); sh5->GetXaxis()->SetRangeUser(-10,10); rh6->GetXaxis()->SetRangeUser(-10,10); sh6->GetXaxis()->SetRangeUser(-10,10); plotPulls(canvas, sh1,rh1,sh2,rh2, sh3,rh3,sh4,rh4, sh5,rh5,sh6,rh6, te,"UU",-1); canvas->cd(); l = new TLegend(0.20,0.655,0.80,0.69); l->SetTextSize(0.016); l->SetLineColor(1); l->SetLineWidth(1); l->SetLineStyle(1); l->SetFillColor(0); l->SetBorderSize(3); l->AddEntry(rh1,refLabel,"LPF"); l->AddEntry(sh1,newLabel,"LPF"); l->Draw(); canvas->Print("pulls.pdf"); delete l; //===== resolutions vs eta rdir->GetObject(collname1+"/phires_vs_eta_Sigma",rh1); sdir->GetObject(collname2+"/phires_vs_eta_Sigma",sh1); rdir->GetObject(collname1+"/cotThetares_vs_eta_Sigma",rh2); sdir->GetObject(collname2+"/cotThetares_vs_eta_Sigma",sh2); rdir->GetObject(collname1+"/dxyres_vs_eta_Sigma",rh3); sdir->GetObject(collname2+"/dxyres_vs_eta_Sigma",sh3); rdir->GetObject(collname1+"/dzres_vs_eta_Sigma",rh4); sdir->GetObject(collname2+"/dzres_vs_eta_Sigma",sh4); rdir->GetObject(collname1+"/ptres_vs_eta_Sigma",rh5); sdir->GetObject(collname2+"/ptres_vs_eta_Sigma",sh5); canvas = new TCanvas("Tracks7","Tracks: Dxy, Dz, Theta resolution",1000,1400); plotResolutions(canvas, sh1,rh1,sh2,rh2, sh3,rh3,sh4,rh4, sh5,rh5,sh6,rh6, te,"UU",-1); // new general range rh1->GetYaxis()->SetRangeUser(0.000009,0.01); sh1->GetYaxis()->SetRangeUser(0.000009,0.01); rh1->SetTitle(""); rh1->GetYaxis()->SetTitleSize(0.05); rh1->GetYaxis()->SetTitleOffset(1.2); // rh1->GetYaxis()->SetTitleColor(2); rh1->GetYaxis()->SetTitle("#sigma(#delta #phi) [rad]"); rh1->GetXaxis()->SetTitleSize(0.07); rh1->GetXaxis()->SetTitleOffset(0.6); rh1->GetXaxis()->SetTitle("#eta"); // new general range rh2->GetYaxis()->SetRangeUser(0.00009,0.03); sh2->GetYaxis()->SetRangeUser(0.00009,0.03); // for multi-track samples //rh2->GetYaxis()->SetRangeUser(0.0009,0.01); //sh2->GetYaxis()->SetRangeUser(0.0009,0.01); // for single particle pt 10 //rh2->GetYaxis()->SetRangeUser(0.00009,0.01); //sh2->GetYaxis()->SetRangeUser(0.00009,0.01); // for single particle pt 1 //rh2->GetYaxis()->SetRangeUser(0.0009,0.01); //sh2->GetYaxis()->SetRangeUser(0.0009,0.01); rh2->SetTitle(""); rh2->GetYaxis()->SetTitleSize(0.05); rh2->GetYaxis()->SetTitleOffset(1.2); rh2->GetYaxis()->SetTitle("#sigma(#delta cot(#theta)) "); rh2->GetXaxis()->SetTitleSize(0.07); rh2->GetXaxis()->SetTitleOffset(0.6); rh2->GetXaxis()->SetTitle("#eta"); // new general range rh3->GetYaxis()->SetRangeUser(0.00009,0.05); sh3->GetYaxis()->SetRangeUser(0.00009,0.05); // for multi-track samples //rh3->GetYaxis()->SetRangeUser(0.0009,0.02); //sh3->GetYaxis()->SetRangeUser(0.0009,0.02); //rh3->GetYaxis()->SetRangeUser(0.0009,0.02); //sh3->GetYaxis()->SetRangeUser(0.0009,0.02); // for single particle pt 100 //rh3->GetYaxis()->SetRangeUser(0.00009,0.002); //sh3->GetYaxis()->SetRangeUser(0.00009,0.002); rh3->SetTitle(""); rh3->GetYaxis()->SetTitleSize(0.05); rh3->GetYaxis()->SetTitleOffset(1.2); rh3->GetYaxis()->SetTitle("#sigma(#delta d_{0}) [cm]"); rh3->GetXaxis()->SetTitleSize(0.07); rh3->GetXaxis()->SetTitleOffset(0.6); rh3->GetXaxis()->SetTitle("#eta"); // new general range rh4->GetYaxis()->SetRangeUser(0.0009,0.1); sh4->GetYaxis()->SetRangeUser(0.0009,0.1); // for multi-track samples //rh4->GetYaxis()->SetRangeUser(0.0009,0.08); //sh4->GetYaxis()->SetRangeUser(0.0009,0.08); rh4->SetTitle(""); rh4->GetYaxis()->SetTitleSize(0.05); rh4->GetYaxis()->SetTitleOffset(1.2); rh4->GetYaxis()->SetTitle("#sigma(#delta z_{0}) [cm]"); rh4->GetXaxis()->SetTitleSize(0.07); rh4->GetXaxis()->SetTitleOffset(0.6); rh4->GetXaxis()->SetTitle("#eta"); rh5->SetTitle(""); rh5->GetYaxis()->SetTitleSize(0.05); rh5->GetYaxis()->SetTitleOffset(1.2); rh5->GetYaxis()->SetTitle("#sigma(#delta p_{t}/p_{t}) "); rh5->GetXaxis()->SetTitleSize(0.07); rh5->GetXaxis()->SetTitleOffset(0.6); rh5->GetXaxis()->SetTitle("#eta"); /* plotResolutions(canvas, sh1,rh1,sh2,rh2, sh3,rh3,sh4,rh4, sh5,rh5,sh6,rh6, te,"UU",-1); */ canvas->cd(); l = new TLegend(0.10,0.63,0.90,0.67); l->SetTextSize(0.016); l->SetLineColor(1); l->SetLineWidth(1); l->SetLineStyle(1); l->SetFillColor(0); l->SetBorderSize(3); l->AddEntry(rh1,refLabel,"LPF"); l->AddEntry(sh1,newLabel,"LPF"); l->Draw(); canvas->Print("resolutionsEta.pdf"); delete l; //===== resolutions vs pt rdir->GetObject(collname1+"/phires_vs_pt_Sigma",rh1); sdir->GetObject(collname2+"/phires_vs_pt_Sigma",sh1); rdir->GetObject(collname1+"/cotThetares_vs_pt_Sigma",rh2); sdir->GetObject(collname2+"/cotThetares_vs_pt_Sigma",sh2); rdir->GetObject(collname1+"/dxyres_vs_pt_Sigma",rh3); sdir->GetObject(collname2+"/dxyres_vs_pt_Sigma",sh3); rdir->GetObject(collname1+"/dzres_vs_pt_Sigma",rh4); sdir->GetObject(collname2+"/dzres_vs_pt_Sigma",sh4); rdir->GetObject(collname1+"/ptres_vs_pt_Sigma",rh5); sdir->GetObject(collname2+"/ptres_vs_pt_Sigma",sh5); rh1->SetTitle(""); rh1->GetYaxis()->SetTitleSize(0.05); rh1->GetYaxis()->SetTitleOffset(1.2); rh1->GetYaxis()->SetTitle("#sigma(#delta #phi) [rad]"); rh1->GetXaxis()->SetTitleSize(0.055); rh1->GetXaxis()->SetTitleOffset(0.8); rh1->GetXaxis()->SetTitle("p_{t}"); rh1->GetXaxis()->SetRangeUser(0,1000.); sh1->GetXaxis()->SetRangeUser(0,1000.); rh2->SetTitle(""); rh2->GetYaxis()->SetTitleSize(0.05); rh2->GetYaxis()->SetTitleOffset(1.2); rh2->GetYaxis()->SetTitle("#sigma(#delta cot(#theta)) "); rh2->GetXaxis()->SetTitleSize(0.055); rh2->GetXaxis()->SetTitleOffset(0.8); rh2->GetXaxis()->SetTitle("p_{t}"); rh2->GetXaxis()->SetRangeUser(0,1000.); sh2->GetXaxis()->SetRangeUser(0,1000.); rh3->SetTitle(""); rh3->GetYaxis()->SetTitleSize(0.05); rh3->GetYaxis()->SetTitleOffset(1.2); rh3->GetYaxis()->SetTitle("#sigma(#delta d_{0}) [cm]"); rh3->GetXaxis()->SetTitleSize(0.055); rh3->GetXaxis()->SetTitleOffset(0.8); rh3->GetXaxis()->SetTitle("p_{t}"); rh3->GetXaxis()->SetRangeUser(0,1000.); sh3->GetXaxis()->SetRangeUser(0,1000.); rh4->SetTitle(""); rh4->GetYaxis()->SetTitleSize(0.05); rh4->GetYaxis()->SetTitleOffset(1.2); rh4->GetYaxis()->SetTitle("#sigma(#delta z_{0}) [cm]"); rh4->GetXaxis()->SetTitleSize(0.055); rh4->GetXaxis()->SetTitleOffset(0.8); rh4->GetXaxis()->SetTitle("p_{t}"); rh4->GetXaxis()->SetRangeUser(0,1000.); sh4->GetXaxis()->SetRangeUser(0,1000.); rh5->SetTitle(""); rh5->GetYaxis()->SetTitleSize(0.05); rh5->GetYaxis()->SetTitleOffset(1.2); rh5->GetYaxis()->SetTitle("#sigma(#delta p_{t}/p_{t}) "); rh5->GetXaxis()->SetTitleSize(0.055); rh5->GetXaxis()->SetTitleOffset(0.8); rh5->GetXaxis()->SetTitle("p_{t}"); rh5->GetXaxis()->SetRangeUser(0,1000.); sh5->GetXaxis()->SetRangeUser(0,1000.); rh6->GetXaxis()->SetRangeUser(0,1000.); sh6->GetXaxis()->SetRangeUser(0,1000.); canvas = new TCanvas("Tracks7b","Tracks: Dxy, Dz, Theta resolution",1000,1400); plotResolutions(canvas, sh1,rh1,sh2,rh2, sh3,rh3,sh4,rh4, sh5,rh5,sh6,rh6, te,"UU",-1, true); canvas->cd(); l = new TLegend(0.10,0.63,0.90,0.67); l->SetTextSize(0.016); l->SetLineColor(1); l->SetLineWidth(1); l->SetLineStyle(1); l->SetFillColor(0); l->SetBorderSize(3); l->AddEntry(rh1,refLabel,"LPF"); l->AddEntry(sh1,newLabel,"LPF"); l->Draw(); canvas->Print("resolutionsPt.pdf"); delete l; //===== building 2 rdir->GetObject(collname1+"/effic_vs_phi",rh1); sdir->GetObject(collname2+"/effic_vs_phi",sh1); rh1->GetYaxis()->SetRangeUser(MINEFF,MAXEFF); sh1->GetYaxis()->SetRangeUser(MINEFF,MAXEFF); rh1->GetXaxis()->SetTitle("#phi"); rh1->GetYaxis()->SetTitle("efficiency vs #phi"); rh1->GetYaxis()->SetTitleSize(0.05); rh1->GetYaxis()->SetTitleOffset(1.2); rdir->GetObject(collname1+"/fakerate_vs_phi",rh2); sdir->GetObject(collname2+"/fakerate_vs_phi",sh2); rh2->GetXaxis()->SetTitle("#phi"); rh2->GetYaxis()->SetTitle("fakerate vs #phi"); rh2->GetYaxis()->SetRangeUser(0.,MAXFAKE); sh2->GetYaxis()->SetRangeUser(0.,MAXFAKE); rh2->GetYaxis()->SetTitleSize(0.05); rh2->GetYaxis()->SetTitleOffset(1.2); rdir->GetObject(collname1+"/effic_vs_dxy",rh3); sdir->GetObject(collname2+"/effic_vs_dxy",sh3); rh3->GetXaxis()->SetTitle("dxy"); rh3->GetYaxis()->SetTitle("efficiency vs dxy"); rh3->GetYaxis()->SetRangeUser(MINEFF,MAXEFF); sh3->GetYaxis()->SetRangeUser(MINEFF,MAXEFF); rh3->GetYaxis()->SetTitleSize(0.05); rh3->GetYaxis()->SetTitleOffset(1.2); rh3->SetTitle(""); rdir->GetObject(collname1+"/fakerate_vs_dxy",rh4); sdir->GetObject(collname2+"/fakerate_vs_dxy",sh4); rh4->SetTitle(""); rh4->GetXaxis()->SetTitle("dxy"); rh4->GetYaxis()->SetTitle("fakerate vs dxy"); rh4->GetYaxis()->SetTitleSize(0.05); rh4->GetYaxis()->SetTitleOffset(1.2); rh4->GetYaxis()->SetRangeUser(0.,MAXFAKE); sh4->GetYaxis()->SetRangeUser(0.,MAXFAKE); rdir->GetObject(collname1+"/effic_vs_dz",rh5); sdir->GetObject(collname2+"/effic_vs_dz",sh5); rh5->GetXaxis()->SetTitle("dz"); rh5->GetYaxis()->SetTitle("efficiency vs dz"); rh5->GetYaxis()->SetTitleSize(0.05); rh5->GetYaxis()->SetTitleOffset(1.2); rh5->GetYaxis()->SetRangeUser(MINEFF,MAXEFF); sh5->GetYaxis()->SetRangeUser(MINEFF,MAXEFF); rdir->GetObject(collname1+"/fakerate_vs_dz",rh6); sdir->GetObject(collname2+"/fakerate_vs_dz",sh6); rh6->GetYaxis()->SetRangeUser(0.,1.0); rh6->GetYaxis()->SetRangeUser(0.,1.0); rh6->GetXaxis()->SetTitle("dz"); rh6->GetYaxis()->SetTitle("fakerate vs dz"); rh6->GetYaxis()->SetTitleSize(0.05); rh6->GetYaxis()->SetTitleOffset(1.2); canvas = new TCanvas("Tracks8","Tracks: efficiency & fakerate",1000,1400); TH1F * r[6]={rh1,rh2,rh3,rh4,rh5,rh6}; TH1F * s[6]={sh1,sh2,sh3,sh4,sh5,sh6}; plotBuilding(canvas,s, r,6, te,"UU",-1); canvas->cd(); l = new TLegend(0.10,0.64,0.90,0.69); l->SetTextSize(0.016); l->SetLineColor(1); l->SetLineWidth(1); l->SetLineStyle(1); l->SetFillColor(0); l->SetBorderSize(3); l->AddEntry(rh1,refLabel,"LPF"); l->AddEntry(sh1,newLabel,"LPF"); l->Draw(); canvas->Print("building2.pdf"); delete l; //===== building 3 rdir->GetObject(collname1+"/effic_vs_vertpos",rh1); sdir->GetObject(collname2+"/effic_vs_vertpos",sh1); rh1->GetYaxis()->SetRangeUser(MINEFF,MAXEFF); sh1->GetYaxis()->SetRangeUser(MINEFF,MAXEFF); rh1->GetXaxis()->SetTitle("TP vert xy pos"); rh1->GetYaxis()->SetTitle("efficiency vs vert xy pos"); rh1->GetYaxis()->SetTitleSize(0.05); rh1->GetYaxis()->SetTitleOffset(1.2); rdir->GetObject(collname1+"/effic_vs_zpos",rh2); sdir->GetObject(collname2+"/effic_vs_zpos",sh2); rh2->GetXaxis()->SetTitle("TP vert z pos"); rh2->GetYaxis()->SetTitle("efficiency vs vert z pos"); rh2->GetYaxis()->SetRangeUser(MINEFF,MAXEFF); sh2->GetYaxis()->SetRangeUser(MINEFF,MAXEFF); rh2->GetYaxis()->SetTitleSize(0.05); rh2->GetYaxis()->SetTitleOffset(1.2); rh2->SetTitle(""); canvas = new TCanvas("Tracks9","Tracks: efficiency & fakerate",1000,1400); TH1F * r[2]={rh1,rh2}; TH1F * s[2]={sh1,sh2}; plotBuilding(canvas,s, r,2, te,"UU",-1); canvas->cd(); l = new TLegend(0.10,0.14,0.90,0.19); l->SetTextSize(0.016); l->SetLineColor(1); l->SetLineWidth(1); l->SetLineStyle(1); l->SetFillColor(0); l->SetBorderSize(3); l->AddEntry(rh1,refLabel,"LPF"); l->AddEntry(sh1,newLabel,"LPF"); l->Draw(); canvas->Print("building3.pdf"); delete l; //======== plots of eff, fake rates for various iterative tracking steps //== we assume that the ref and new have the same histogram list! (and there are 6!) // HERE // TString refcollname=rl->At(0)->GetName(); // TString newcollname=sl->At(0)->GetName(); // num_col = rl->GetSize(); TH1F * r[6]; TH1F * s[6]; // // eff vs eta // for(int i=0; i<num_col;i++){ // refcollname =rl->At(i)->GetName(); // newcollname =sl->At(i)->GetName(); // rdir->GetObject(refcollname+"/effic",r[i]); // sdir->GetObject(newcollname+"/effic",s[i]); // //r[i]->GetYaxis()->SetRangeUser(MINEFF,MAXEFF); // //s[i]->GetYaxis()->SetRangeUser(MINEFF,MAXEFF); // r[i]->GetYaxis()->SetRangeUser(0.,MAXEFF); // s[i]->GetYaxis()->SetRangeUser(0.,MAXEFF); // r[i]->GetXaxis()->SetTitle("#eta"); // r[i]->GetYaxis()->SetTitle("efficiency vs #eta"); // r[i]->GetYaxis()->SetTitleSize(0.05); // r[i]->GetYaxis()->SetTitleOffset(1.2); // r[i]->SetTitle(refcollname); // if(i==2 || i==3) { // //r[i]->SetTitleY(0.); // //r[i]->SetTitle(""); // r[i]->SetTitleOffset(-1.,"HIST"); // } // } // fill with the histos we want for eff fillStepHisto(rdir, sdir, rl, sl, r, s, "/effic", "#eta", "efficiency vs #eta", 0., MAXEFF); // rearrange to a more natural order for plotting TH1F * rr[6]={r[5],r[2],r[0],r[3],r[4],r[1]}; TH1F * ss[6]={s[5],s[2],s[0],s[3],s[4],s[1]}; canvas = new TCanvas("Tracks10","Tracks: efficiency for each step",1000,1400); plotBuilding(canvas,ss, rr,6, te,"UU",-69); canvas->cd(); l = new TLegend(0.10,0.64,0.90,0.69); l->SetTextSize(0.016); l->SetLineColor(1); l->SetLineWidth(1); l->SetLineStyle(1); l->SetFillColor(0); l->SetBorderSize(3); l->AddEntry(r[0],refLabel,"LPF"); l->AddEntry(s[0],newLabel,"LPF"); l->Draw(); canvas->Print("steps_eff.pdf"); delete l; // fill with the histos we want for fake rate fillStepHisto(rdir, sdir, rl, sl, r, s, "/fakerate", "#eta", "fakerate vs #eta", 0., MAXFAKE); // rearrange to a more natural order for plotting TH1F * rr[6]={r[5],r[2],r[0],r[3],r[4],r[1]}; TH1F * ss[6]={s[5],s[2],s[0],s[3],s[4],s[1]}; canvas = new TCanvas("Tracks11","Tracks: fakerate for each step",1000,1400); plotBuilding(canvas,ss, rr,6, te,"UU",-69); canvas->cd(); l = new TLegend(0.10,0.64,0.90,0.69); l->SetTextSize(0.016); l->SetLineColor(1); l->SetLineWidth(1); l->SetLineStyle(1); l->SetFillColor(0); l->SetBorderSize(3); l->AddEntry(r[0],refLabel,"LPF"); l->AddEntry(s[0],newLabel,"LPF"); l->Draw(); canvas->Print("steps_fakerate.pdf"); delete l; // fill with the histos we want for eff vs pT fillStepHisto(rdir, sdir, rl, sl, r, s, "/efficPt", "p_{t}", "efficiency vs p_{t}", 0., MAXEFF); // rearrange to a more natural order for plotting TH1F * rr[6]={r[5],r[2],r[0],r[3],r[4],r[1]}; TH1F * ss[6]={s[5],s[2],s[0],s[3],s[4],s[1]}; canvas = new TCanvas("Tracks12","Tracks: efficiency for each step",1000,1400); plotBuilding(canvas,ss, rr,6, te,"UU",-69, 1, false, 127); canvas->cd(); l = new TLegend(0.10,0.64,0.90,0.69); l->SetTextSize(0.016); l->SetLineColor(1); l->SetLineWidth(1); l->SetLineStyle(1); l->SetFillColor(0); l->SetBorderSize(3); l->AddEntry(r[0],refLabel,"LPF"); l->AddEntry(s[0],newLabel,"LPF"); l->Draw(); canvas->Print("steps_effpt.pdf"); delete l; fillStepHisto(rdir, sdir, rl, sl, r, s, "/fakeratePt", "p_{t}", "fakerate vs p_{t}", 0., MAXFAKE); // rearrange to a more natural order for plotting TH1F * rr[6]={r[5],r[2],r[0],r[3],r[4],r[1]}; TH1F * ss[6]={s[5],s[2],s[0],s[3],s[4],s[1]}; canvas = new TCanvas("Tracks13","Tracks: fakerate for each step",1000,1400); plotBuilding(canvas,ss, rr,6, te,"UU",-69, 1, false, 127); canvas->cd(); l = new TLegend(0.10,0.64,0.90,0.69); l->SetTextSize(0.016); l->SetLineColor(1); l->SetLineWidth(1); l->SetLineStyle(1); l->SetFillColor(0); l->SetBorderSize(3); l->AddEntry(r[0],refLabel,"LPF"); l->AddEntry(s[0],newLabel,"LPF"); l->Draw(); canvas->Print("steps_fakeratePt.pdf"); delete l; // fill with the histos we want for eff fillStepHisto(rdir, sdir, rl, sl, r, s, "/effic_vs_hit", "hits", "efficiency vs hits", 0., MAXEFF); // rearrange to a more natural order for plotting TH1F * rr[6]={r[5],r[2],r[0],r[3],r[4],r[1]}; TH1F * ss[6]={s[5],s[2],s[0],s[3],s[4],s[1]}; canvas = new TCanvas("Tracks14","Tracks: efficiency for each step",1000,1400); plotBuilding(canvas,ss, rr,6, te,"UU",-69); canvas->cd(); l = new TLegend(0.10,0.64,0.90,0.69); l->SetTextSize(0.016); l->SetLineColor(1); l->SetLineWidth(1); l->SetLineStyle(1); l->SetFillColor(0); l->SetBorderSize(3); l->AddEntry(r[0],refLabel,"LPF"); l->AddEntry(s[0],newLabel,"LPF"); l->Draw(); canvas->Print("steps_effhits.pdf"); delete l; // fill with the histos we want for fake rate fillStepHisto(rdir, sdir, rl, sl, r, s, "/fakerate_vs_hit", "hits", "fakerate vs hits", 0., MAXFAKE); // rearrange to a more natural order for plotting TH1F * rr[6]={r[5],r[2],r[0],r[3],r[4],r[1]}; TH1F * ss[6]={s[5],s[2],s[0],s[3],s[4],s[1]}; canvas = new TCanvas("Tracks15","Tracks: fakerate for each step",1000,1400); plotBuilding(canvas,ss, rr,6, te,"UU",-69); canvas->cd(); l = new TLegend(0.10,0.64,0.90,0.69); l->SetTextSize(0.016); l->SetLineColor(1); l->SetLineWidth(1); l->SetLineStyle(1); l->SetFillColor(0); l->SetBorderSize(3); l->AddEntry(r[0],refLabel,"LPF"); l->AddEntry(s[0],newLabel,"LPF"); l->Draw(); canvas->Print("steps_fakeratehits.pdf"); delete l; } }