diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefCommon.xml b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefCommon.xml index 6c428a7233b565e3a6e5ed22f0655a87f435393f..cf1822536e12ae1c5e49058da8d78138b69d6415 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefCommon.xml +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefCommon.xml @@ -935,204 +935,204 @@ <y title="Number of Entries"/> </h> -<h id="resHelpereta_d0" type="TH2F" title="residual vs #eta for d_{0}"> +<h id="resHelper_eta_d0" type="TH2F" title="residual vs #eta for d_{0}"> <x title="#eta" n="&NETA;" lo="-&ETA;" hi="&ETA;"/> <y title="reco_{d_{0}} - truth_{d_{0}} [mm]" n="3000" lo="-&D0RES;" hi="&D0RES;"/> </h> -<h id="resHelpereta_z0" type="TH2F" title="residual vs #eta for z_{0}"> +<h id="resHelper_eta_z0" type="TH2F" title="residual vs #eta for z_{0}"> <x title="#eta" n="&NETA;" lo="-&ETA;" hi="&ETA;"/> <y title="reco_{z_{0}} - truth_{z_{0}} [mm]" n="2000" lo="-&Z0RES;" hi="&Z0RES;"/> </h> -<h id="resHelpereta_qoverp" type="TH2F" title="residual vs #eta for qoverp"> +<h id="resHelper_eta_qoverp" type="TH2F" title="residual vs #eta for qoverp"> <x title="#eta" n="&NETA;" lo="-&ETA;" hi="&ETA;"/> <y title="reco_{qoverp} - truth_{qoverp} [MeV^{-1}]" n="2000" lo="-2.5e-5" hi="2.5e-5"/> </h> -<h id="resHelpereta_ptqopt" type="TH2F" title="residual vs #eta for p_{T} #times q/p_{T}"> +<h id="resHelper_eta_ptqopt" type="TH2F" title="residual vs #eta for p_{T} #times q/p_{T}"> <x title="#eta" n="&NETA;" lo="-&ETA;" hi="&ETA;"/> <y title="reco_{p_{T} #times q/p_{T}} - truth_{p_{T} #times q/p_{T}}" n="2000" lo="-&PTQOPTRES;" hi="&PTQOPTRES;"/> </h> -<h id="resHelpereta_theta" type="TH2F" title="residual vs #eta for #theta"> +<h id="resHelper_eta_theta" type="TH2F" title="residual vs #eta for #theta"> <x title="#eta" n="&NETA;" lo="-&ETA;" hi="&ETA;"/> <y title="reco_{#theta} - truth_{#theta} [rads]" n="1000" lo="-&THETARES;" hi="&THETARES;"/> </h> -<h id="resHelpereta_phi" type="TH2F" title="residual vs #eta for #phi"> +<h id="resHelper_eta_phi" type="TH2F" title="residual vs #eta for #phi"> <x title="#eta" n="&NETA;" lo="-&ETA;" hi="&ETA;"/> <y title="reco_{#phi} - truth_{#phi} [rads]" n="1000" lo="-&PHIRES;" hi="&PHIRES;"/> </h> -<h id="resHelpereta_pt" type="TH2F" title="residual vs #eta for pt"> +<h id="resHelper_eta_pt" type="TH2F" title="residual vs #eta for pt"> <x title="#eta" n="&NETA;" lo="-&ETA;" hi="&ETA;"/> <y title="reco_{pt} - truth_{pt} [GeV]" n="1000" lo="-100.0" hi="100.0"/> </h> -<h id="resHelpereta_z0sin" type="TH2F" title="residual vs #eta for z0 #times sin"> +<h id="resHelper_eta_z0sin" type="TH2F" title="residual vs #eta for z0 #times sin"> <x title="#eta" n="&NETA;" lo="-&ETA;" hi="&ETA;"/> <y title="reco_{z0 #times sin} - truth_{z0 #times sin} [mm]" n="1000" lo="-&Z0SINRES;" hi="&Z0SINRES;"/> </h> -<h id="resHelperpt_d0" type="TH2F" title="residual vs p_{T} for d_{0}"> +<h id="resHelper_pt_d0" type="TH2F" title="residual vs p_{T} for d_{0}"> <x title="p_{T} [GeV]" n="100" lo="0." hi="100"/> <y title="reco_{d_{0}} - truth_{d_{0}} [mm]" n="1000" lo="-&D0RES;" hi="&D0RES;"/> </h> -<h id="resHelperpt_z0" type="TH2F" title="residual vs p_{T} for z_{0}"> +<h id="resHelper_pt_z0" type="TH2F" title="residual vs p_{T} for z_{0}"> <x title="p_{T} [GeV]" n="100" lo="0." hi="100"/> <y title="reco_{z_{0}} - truth_{z_{0}} [mm]" n="2000" lo="-&Z0RES;" hi="&Z0RES;"/> </h> -<h id="resHelperpt_qoverp" type="TH2F" title="residual vs pT for qoverp"> +<h id="resHelper_pt_qoverp" type="TH2F" title="residual vs pT for qoverp"> <x title="p_{T} [GeV]" n="100" lo="0." hi="100"/> <y title="reco_{qoverp} - truth_{qoverp} [MeV^{-1}]" n="2000" lo="-2.5e-5" hi="2.5e-5"/> </h> -<h id="resHelperpt_ptqopt" type="TH2F" title="residual vs p_{T} for p_{T} #times q/p_{T}"> +<h id="resHelper_pt_ptqopt" type="TH2F" title="residual vs p_{T} for p_{T} #times q/p_{T}"> <x title="p_{T} [GeV]" n="100" lo="0." hi="100"/> <y title="reco_{pT #times q/pT} - truth_{pT #times q/pT}" n="2000" lo="-&PTQOPTRES;" hi="&PTQOPTRES;"/> </h> -<h id="resHelperpt_theta" type="TH2F" title="residual vs p_{T} for #theta"> +<h id="resHelper_pt_theta" type="TH2F" title="residual vs p_{T} for #theta"> <x title="p_{T} [GeV]" n="100" lo="0." hi="100"/> <y title="reco_{#theta} - truth_{#theta} [rads]" n="1000" lo="-&THETARES;" hi="&THETARES;"/> </h> -<h id="resHelperpt_phi" type="TH2F" title="residual vs p_{T} for #phi"> +<h id="resHelper_pt_phi" type="TH2F" title="residual vs p_{T} for #phi"> <x title="p_{T} [GeV]" n="100" lo="0." hi="100"/> <y title="reco_{#phi} - truth_{#phi} [rads]" n="1000" lo="-&PHIRES;" hi="&PHIRES;"/> </h> -<h id="resHelperpt_pt" type="TH2F" title="residual vs pT for pt"> +<h id="resHelper_pt_pt" type="TH2F" title="residual vs pT for pt"> <x title="p_{T} [GeV]" n="100" lo="0." hi="100"/> <y title="reco_{pt} - truth_{pt} [GeV]" n="1000" lo="-100.0" hi="100.0"/> </h> -<h id="resHelperpt_z0sin" type="TH2F" title="residual vs p_{T} for z_{0} #times sin"> +<h id="resHelper_pt_z0sin" type="TH2F" title="residual vs p_{T} for z_{0} #times sin"> <x title="p_{T} [GeV]" n="100" lo="0." hi="100"/> <y title="reco_{z_{0} #times sin} - truth_{z_{0} #times sin} [mm]" n="1000" lo="-&Z0SINRES;" hi="&Z0SINRES;"/> </h> -<h id="pullHelpereta_d0" type="TH2F" title="pull vs #eta for d_{0}"> +<h id="pullHelper_eta_d0" type="TH2F" title="pull vs #eta for d_{0}"> <x title="#eta" n="&NETA;" lo="-&ETA;" hi="&ETA;"/> <y title="(reco_{d_{0}} - truth_{d_{0}}) / #sigma(d_{0})" n="100" lo="-10.0" hi="10.0"/> </h> -<h id="pullHelpereta_z0" type="TH2F" title="pull vs #eta for z_{0}"> +<h id="pullHelper_eta_z0" type="TH2F" title="pull vs #eta for z_{0}"> <x title="#eta" n="&NETA;" lo="-&ETA;" hi="&ETA;"/> <y title="(reco_{z_{0}} - truth_{z_{0}}) / #sigma(z_{0})" n="100" lo="-10.0" hi="10.0"/> </h> -<h id="pullHelpereta_qoverp" type="TH2F" title="pull vs #eta for qoverp"> +<h id="pullHelper_eta_qoverp" type="TH2F" title="pull vs #eta for qoverp"> <x title="#eta" n="&NETA;" lo="-&ETA;" hi="&ETA;"/> <y title="(reco_{qoverp} - truth_{qoverp}) / #sigma(qoverp)" n="100" lo="-10.0" hi="10.0"/> </h> -<h id="pullHelpereta_ptqopt" type="TH2F" title="pull vs #eta for p_{T} #times q/p_{T}"> +<h id="pullHelper_eta_ptqopt" type="TH2F" title="pull vs #eta for p_{T} #times q/p_{T}"> <x title="#eta" n="&NETA;" lo="-&ETA;" hi="&ETA;"/> <y title="(reco_{q/p_{T}} - truth_{q/p_{T}) / #sigma(q/p_{T})" n="100" lo="-10.0" hi="10.0"/> </h> -<h id="pullHelpereta_theta" type="TH2F" title="pull vs #eta for #theta"> +<h id="pullHelper_eta_theta" type="TH2F" title="pull vs #eta for #theta"> <x title="#eta" n="&NETA;" lo="-&ETA;" hi="&ETA;"/> <y title="(reco_{#theta} - truth_{#theta}) / #sigma(#theta)" n="100" lo="-10.0" hi="10.0"/> </h> -<h id="pullHelpereta_phi" type="TH2F" title="pull vs #eta for #phi"> +<h id="pullHelper_eta_phi" type="TH2F" title="pull vs #eta for #phi"> <x title="#eta" n="&NETA;" lo="-&ETA;" hi="&ETA;"/> <y title="(reco_{#phi} - truth_{#phi}) / #sigma(#phi)" n="100" lo="-10.0" hi="10.0"/> </h> -<h id="pullHelpereta_pt" type="TH2F" title="pull vs #eta for pt"> +<h id="pullHelper_eta_pt" type="TH2F" title="pull vs #eta for pt"> <x title="#eta" n="&NETA;" lo="-&ETA;" hi="&ETA;"/> <y title="(reco_{pt} - truth_{pt}) / #sigma(pt)" n="100" lo="-10.0" hi="10.0"/> </h> -<h id="pullHelpereta_z0sin" type="TH2F" title="pull vs #eta for z_{0} #times sin"> +<h id="pullHelper_eta_z0sin" type="TH2F" title="pull vs #eta for z_{0} #times sin"> <x title="#eta" n="&NETA;" lo="-&ETA;" hi="&ETA;"/> <y title="(reco_{z_{0} #times sin} - truth_{z_{0} #times sin}) / #sigma(z_{0} #times sin)" n="100" lo="-10.0" hi="10.0"/> </h> -<h id="pullHelperpt_d0" type="TH2F" title="pull vs p_{T} for d_{0}"> +<h id="pullHelper_pt_d0" type="TH2F" title="pull vs p_{T} for d_{0}"> <x title="p_{T} [GeV]" n="100" lo="0." hi="100"/> <y title="(reco_{d_{0}} - truth_{d_{0}}) / #sigma(d_{0})" n="100" lo="-10.0" hi="10.0"/> </h> -<h id="pullHelperpt_z0" type="TH2F" title="pull vs p_{T} for z_{0}"> +<h id="pullHelper_pt_z0" type="TH2F" title="pull vs p_{T} for z_{0}"> <x title="p_{T} [GeV]" n="100" lo="0." hi="100"/> <y title="(reco_{z_{0}} - truth_{z_{0}}) / #sigma(z_{0})" n="100" lo="-10.0" hi="10.0"/> </h> -<h id="pullHelperpt_qoverp" type="TH2F" title="pull vs pT for qoverp"> +<h id="pullHelper_pt_qoverp" type="TH2F" title="pull vs pT for qoverp"> <x title="p_{T} [GeV]" n="100" lo="0." hi="100"/> <y title="(reco_{qoverp} - truth_{qoverp}) / #sigma(qoverp)" n="100" lo="-10.0" hi="10.0"/> </h> -<h id="pullHelperpt_ptqopt" type="TH2F" title="pull vs p_{T} for p_{T} #times q/p_{T}"> +<h id="pullHelper_pt_ptqopt" type="TH2F" title="pull vs p_{T} for p_{T} #times q/p_{T}"> <x title="p_{T} [GeV]" n="100" lo="0." hi="100"/> <y title="(reco_{q/p_{T}} - truth_{q/p_{T}}) / #sigma(q/p_{T})" n="100" lo="-10.0" hi="10.0"/> </h> -<h id="pullHelperpt_theta" type="TH2F" title="pull vs p_{T} for #theta"> +<h id="pullHelper_pt_theta" type="TH2F" title="pull vs p_{T} for #theta"> <x title="p_{T} [GeV]" n="100" lo="0." hi="100"/> <y title="(reco_{#theta} - truth_{#theta}) / #sigma(#theta)" n="100" lo="-10.0" hi="10.0"/> </h> -<h id="pullHelperpt_phi" type="TH2F" title="pull vs p_{T} for #phi"> +<h id="pullHelper_pt_phi" type="TH2F" title="pull vs p_{T} for #phi"> <x title="p_{T} [GeV]" n="100" lo="0." hi="100"/> <y title="(reco_{#phi} - truth_{#phi}) / #sigma(#phi)" n="100" lo="-10.0" hi="10.0"/> </h> -<h id="pullHelperpt_pt" type="TH2F" title="pull vs pT for pt"> +<h id="pullHelper_pt_pt" type="TH2F" title="pull vs pT for pt"> <x title="p_{T} [GeV]" n="100" lo="0." hi="100"/> <y title="(reco_{pt} - truth_{pt}) / #sigma(pt)" n="100" lo="-10.0" hi="10.0"/> </h> -<h id="pullHelperpt_z0sin" type="TH2F" title="pull vs p_{T} for z_{0} #times sin"> +<h id="pullHelper_pt_z0sin" type="TH2F" title="pull vs p_{T} for z_{0} #times sin"> <x title="p_{T} [GeV]" n="100" lo="0." hi="100"/> <y title="(reco_{z_{0} #times sin} - truth_{z_{0} #times sin}) / #sigma(z_{0} #times sin)" n="100" lo="-10.0" hi="10.0"/> </h> -<h id="reswidth_vs_eta_d0" type="TH1F" title="resolution vs #eta for d_{0}"> +<h id="resolution_vs_eta_d0" type="TH1F" title="resolution vs #eta for d_{0}"> <x title="#eta" n="&NETA;" lo="-&ETA;" hi="&ETA;"/> <y title="width of resolution for d_{0}"/> </h> -<h id="reswidth_vs_eta_z0" type="TH1F" title="resolution vs #eta for z_{0}"> +<h id="resolution_vs_eta_z0" type="TH1F" title="resolution vs #eta for z_{0}"> <x title="#eta" n="&NETA;" lo="-&ETA;" hi="&ETA;"/> <y title="width of resolution for z_{0}"/> </h> -<h id="reswidth_vs_eta_qoverp" type="TH1F" title="resolution vs #eta for qoverp"> +<h id="resolution_vs_eta_qoverp" type="TH1F" title="resolution vs #eta for qoverp"> <x title="#eta" n="&NETA;" lo="-&ETA;" hi="&ETA;"/> <y title="qoverp resolution"/> </h> -<h id="reswidth_vs_eta_ptqopt" type="TH1F" title="resolution vs #eta for p_{T} #times q/p_{T}"> +<h id="resolution_vs_eta_ptqopt" type="TH1F" title="resolution vs #eta for p_{T} #times q/p_{T}"> <x title="#eta" n="&NETA;" lo="-&ETA;" hi="&ETA;"/> <y title="width of resolution for p_{T} #times q/p_{T}"/> </h> -<h id="reswidth_vs_eta_pt" type="TH1F" title="resolution vs #eta for pt"> +<h id="resolution_vs_eta_pt" type="TH1F" title="resolution vs #eta for pt"> <x title="#eta" n="&NETA;" lo="-&ETA;" hi="&ETA;"/> <y title="pt resolution"/> </h> -<h id="reswidth_vs_eta_theta" type="TH1F" title="resolution vs #eta for #theta"> +<h id="resolution_vs_eta_theta" type="TH1F" title="resolution vs #eta for #theta"> <x title="#eta" n="&NETA;" lo="-&ETA;" hi="&ETA;"/> <y title="width of resolution for #theta"/> </h> -<h id="reswidth_vs_eta_phi" type="TH1F" title="resolution vs #eta for #phi"> +<h id="resolution_vs_eta_phi" type="TH1F" title="resolution vs #eta for #phi"> <x title="#eta" n="&NETA;" lo="-&ETA;" hi="&ETA;"/> <y title="width of resolution for #phi"/> </h> -<h id="reswidth_vs_eta_z0sin" type="TH1F" title="resolution vs #eta for z_{0} #times sin"> +<h id="resolution_vs_eta_z0sin" type="TH1F" title="resolution vs #eta for z_{0} #times sin"> <x title="#eta" n="&NETA;" lo="-&ETA;" hi="&ETA;"/> <y title="width of resolution for z_{0} #times sin"/> </h> @@ -1179,42 +1179,42 @@ <y title="mean of resolution for z_{0} #times sin"/> </h> -<h id="reswidth_vs_pt_d0" type="TH1F" title="resolution vs p_{T} for d_{0}"> +<h id="resolution_vs_pt_d0" type="TH1F" title="resolution vs p_{T} for d_{0}"> <x title="p_{T} [GeV]" n="100" lo="0." hi="100"/> <y title="width of resolution for d_{0}"/> </h> -<h id="reswidth_vs_pt_z0" type="TH1F" title="resolution vs p_{T} for z_{0}"> +<h id="resolution_vs_pt_z0" type="TH1F" title="resolution vs p_{T} for z_{0}"> <x title="p_{T} [GeV]" n="100" lo="0." hi="100"/> <y title="width of resolution for z0"/> </h> -<h id="reswidth_vs_pt_qoverp" type="TH1F" title="resolution vs pT for qoverp"> +<h id="resolution_vs_pt_qoverp" type="TH1F" title="resolution vs pT for qoverp"> <x title="p_{T}" n="100" lo="0." hi="100"/> <y title="qoverp resolution"/> </h> -<h id="reswidth_vs_pt_ptqopt" type="TH1F" title="resolution vs p_{T} for p_{T} #times q/p_{T}"> +<h id="resolution_vs_pt_ptqopt" type="TH1F" title="resolution vs p_{T} for p_{T} #times q/p_{T}"> <x title="p_{T} [GeV]" n="100" lo="0." hi="100"/> <y title="width of resolution for p_{T} #times q/p_{T}"/> </h> -<h id="reswidth_vs_pt_pt" type="TH1F" title="resolution vs pT for pt"> +<h id="resolution_vs_pt_pt" type="TH1F" title="resolution vs pT for pt"> <x title="p_{T} [GeV]" n="100" lo="0." hi="100"/> <y title="pt resolution"/> </h> -<h id="reswidth_vs_pt_theta" type="TH1F" title="resolution vs p_{T} for #theta"> +<h id="resolution_vs_pt_theta" type="TH1F" title="resolution vs p_{T} for #theta"> <x title="p_{T} [GeV]" n="100" lo="0." hi="100"/> <y title="width of resolution for #theta"/> </h> -<h id="reswidth_vs_pt_phi" type="TH1F" title="resolution vs p_{T} for #phi"> +<h id="resolution_vs_pt_phi" type="TH1F" title="resolution vs p_{T} for #phi"> <x title="p_{T} [GeV]" n="100" lo="0." hi="100"/> <y title="width of resolution for #phi"/> </h> -<h id="reswidth_vs_pt_z0sin" type="TH1F" title="resolution vs p_{T} for z_{0} #times sin"> +<h id="resolution_vs_pt_z0sin" type="TH1F" title="resolution vs p_{T} for z_{0} #times sin"> <x title="p_{T} [GeV]" n="100" lo="0." hi="100"/> <y title="width of resolution for z_{0} #times sin"/> </h> diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Resolution.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Resolution.cxx index 9b46ad66093b97fc760817170fb7636e5c7e630f..b39e0b77b14a678584a1ae23b1d4e37ca9a46efa 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Resolution.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Resolution.cxx @@ -80,10 +80,6 @@ InDetPerfPlot_Resolution::InDetPerfPlot_Resolution(InDetPlotBase* pParent, const m_allTrk = true; } - // Using globally defined bin limits - for (int ieta = 0; ieta <= m_nEtaBins; ieta++) { - m_EtaBins[ieta] = m_etaMin + ((m_etaMax - m_etaMin) / m_nEtaBins) * ieta; - } std::vector<double> ptBins = IDPVM::logLinearBinning(m_nPtBins, m_ptMin, m_ptMax, false); @@ -111,18 +107,18 @@ InDetPerfPlot_Resolution::initializePlots() { // //2D Distributions to evaluate resolutions vs eta and pT // - book(m_resHelpereta[iparam], "resHelpereta_" + m_paramProp[iparam]); - book(m_resHelperpt[iparam], "resHelperpt_" + m_paramProp[iparam]); - book(m_pullHelpereta[iparam], "pullHelpereta_" + m_paramProp[iparam]); - book(m_pullHelperpt[iparam], "pullHelperpt_" + m_paramProp[iparam]); + book(m_resHelpereta[iparam], "resHelper_eta_" + m_paramProp[iparam]); + book(m_resHelperpt[iparam], "resHelper_pt_" + m_paramProp[iparam]); + book(m_pullHelpereta[iparam], "pullHelper_eta_" + m_paramProp[iparam]); + book(m_pullHelperpt[iparam], "pullHelper_pt_" + m_paramProp[iparam]); m_resHelperpt[iparam]->GetXaxis()->Set(m_nPtBins,m_PtBins); m_pullHelperpt[iparam]->GetXaxis()->Set(m_nPtBins,m_PtBins); // //1D Histograms for the final resolution and means // - book(m_reswidth_vs_eta[iparam], "reswidth_vs_eta_" + m_paramProp[iparam]); + book(m_reswidth_vs_eta[iparam], "resolution_vs_eta_" + m_paramProp[iparam]); book(m_resmean_vs_eta[iparam], "resmean_vs_eta_" + m_paramProp[iparam]); - book(m_reswidth_vs_pt[iparam], "reswidth_vs_pt_" + m_paramProp[iparam]); + book(m_reswidth_vs_pt[iparam], "resolution_vs_pt_" + m_paramProp[iparam]); book(m_resmean_vs_pt[iparam], "resmean_vs_pt_" + m_paramProp[iparam]); book(m_pullwidth_vs_eta[iparam], "pullwidth_vs_eta_" + m_paramProp[iparam]); @@ -151,25 +147,25 @@ InDetPerfPlot_Resolution::initializePlots() { //Detailed histograms // if(m_iDetailLevel >= 200){ - book(m_resHelpereta_pos[iparam], "resHelpereta_pos" + m_paramProp[iparam]); - book(m_resHelpereta_neg[iparam], "resHelpereta_neg" + m_paramProp[iparam]); - book(m_resHelperpt_pos[iparam], "resHelperpt_pos" + m_paramProp[iparam]); - book(m_resHelperpt_neg[iparam], "resHelperpt_neg" + m_paramProp[iparam]); + book(m_resHelpereta_pos[iparam], "resHelper_eta_" + m_paramProp[iparam], "resHelper_eta_" + m_paramProp[iparam]+"_posQ"); + book(m_resHelpereta_neg[iparam], "resHelper_eta_" + m_paramProp[iparam], "resHelper_eta_" + m_paramProp[iparam]+"_negQ"); + book(m_resHelperpt_pos[iparam], "resHelper_pt_" + m_paramProp[iparam], "resHelper_pt_" + m_paramProp[iparam]+"_posQ"); + book(m_resHelperpt_neg[iparam], "resHelper_pt_" + m_paramProp[iparam], "resHelper_pt_" + m_paramProp[iparam]+"_negQ"); //Add log binning m_resHelperpt_pos[iparam]->GetXaxis()->Set(m_nPtBins,m_PtBins); m_resHelperpt_neg[iparam]->GetXaxis()->Set(m_nPtBins,m_PtBins); //Resolution, Resolution Mean, Pull, Pull Mean - book(m_reswidth_vs_eta_pos[iparam], "reswidth_vs_eta_" + m_paramProp[iparam] + "_pos"); - book(m_reswidth_vs_eta_neg[iparam], "reswidth_vs_eta_" + m_paramProp[iparam] + "_neg"); - book(m_resmean_vs_eta_pos[iparam], "resmean_vs_eta_" + m_paramProp[iparam] + "_pos"); - book(m_resmean_vs_eta_neg[iparam], "resmean_vs_eta_" + m_paramProp[iparam] + "_neg"); - - book(m_reswidth_vs_pt_pos[iparam], "reswidth_vs_pt_" + m_paramProp[iparam] + "_pos"); - book(m_reswidth_vs_pt_neg[iparam], "reswidth_vs_pt_" + m_paramProp[iparam] + "_neg"); - book(m_resmean_vs_pt_pos[iparam], "resmean_vs_pt_" + m_paramProp[iparam] + "_pos"); - book(m_resmean_vs_pt_neg[iparam], "resmean_vs_pt_" + m_paramProp[iparam] + "_neg"); + book(m_reswidth_vs_eta_pos[iparam], "resolution_vs_eta_" + m_paramProp[iparam], "resolution_vs_eta_" + m_paramProp[iparam] + "_posQ"); + book(m_reswidth_vs_eta_neg[iparam], "resolution_vs_eta_" + m_paramProp[iparam], "resolution_vs_eta_" + m_paramProp[iparam] + "_negQ"); + book(m_resmean_vs_eta_pos[iparam], "resmean_vs_eta_" + m_paramProp[iparam], "resmean_vs_eta_" + m_paramProp[iparam] + "_posQ"); + book(m_resmean_vs_eta_neg[iparam], "resmean_vs_eta_" + m_paramProp[iparam], "resmean_vs_eta_" + m_paramProp[iparam] + "_negQ"); + + book(m_reswidth_vs_pt_pos[iparam], "resolution_vs_pt_" + m_paramProp[iparam], "resolution_vs_pt_" + m_paramProp[iparam] + "_posQ"); + book(m_reswidth_vs_pt_neg[iparam], "resolution_vs_pt_" + m_paramProp[iparam], "resolution_vs_pt_" + m_paramProp[iparam] + "_negQ"); + book(m_resmean_vs_pt_pos[iparam], "resmean_vs_pt_" + m_paramProp[iparam], "resmean_vs_pt_" + m_paramProp[iparam] + "_posQ"); + book(m_resmean_vs_pt_neg[iparam], "resmean_vs_pt_" + m_paramProp[iparam], "resmean_vs_pt_" + m_paramProp[iparam] + "_negQ"); m_reswidth_vs_pt_pos[iparam]->GetXaxis()->Set(m_nPtBins, m_PtBins); m_resmean_vs_pt_pos[iparam]->GetXaxis()->Set(m_nPtBins, m_PtBins); @@ -177,37 +173,37 @@ InDetPerfPlot_Resolution::initializePlots() { m_resmean_vs_pt_neg[iparam]->GetXaxis()->Set(m_nPtBins, m_PtBins); std::string tmpName, tmpTitle; - float paramResBins[NPARAMS] = { 1000, 2000, 2000, 1000, 1000, 1000, 1000 }; - float paramRes[NPARAMS] = { 1.5, 10.0, 2.5e-5, 0.01, 0.01, 100.0, 0.2 }; + + int nPtBins = m_pullHelperpt[iparam]->GetNbinsX(); + int nEtaBins = m_pullHelpereta[iparam]->GetNbinsX(); + + std::shared_ptr<TH1D> refHistEta { m_pullHelpereta[iparam]->ProjectionY("refEta")}; + std::shared_ptr<TH1D> refHistPt { m_pullHelperpt[iparam]->ProjectionY("refPt")}; //Projections - for (unsigned int ibins = 0; ibins < m_nPtBins; ibins++) { - tmpName = "PtProjections_pullProjection_" + m_paramProp[iparam] + std::to_string(ibins + 1); + for (int ibins = 0; ibins < nPtBins; ibins++) { + tmpName = "pullProjection_pt_" + m_paramProp[iparam] +"_bin_"+ std::to_string(ibins + 1); tmpTitle = tmpName + "; (" + m_paramProp[iparam] + "^{reco}-" + m_paramProp[iparam] + "^{true})/#sigma_{" + m_paramProp[iparam] + "}"; - m_pullProjections_vs_pt[iparam][ibins] = Book1D(tmpName, tmpTitle, 200, -10.0, 10.0, false); - } + m_pullProjections_vs_pt[iparam][ibins] = Book1D(tmpName, refHistPt.get(), tmpTitle , false); + + + tmpName = "resProjection_pt_" + m_paramProp[iparam] +"_bin_"+ std::to_string(ibins + 1); + tmpTitle = tmpName + "; " + m_paramProp[iparam] + "^{reco}-" + m_paramProp[iparam] + "^{true} "; + m_resProjections_vs_pt[iparam][ibins] = Book1D(tmpName, refHistPt.get(), tmpTitle , false); - for (unsigned int ibins = 0; ibins < m_nEtaBins; ibins++) { - tmpName = "EtaProjections_pullProjection_" + m_paramProp[iparam] + std::to_string(ibins + 1); + } + for (int ibins = 0; ibins < nEtaBins; ibins++) { + tmpName = "pullProjection_eta_" + m_paramProp[iparam] +"_bin_"+ std::to_string(ibins + 1); tmpTitle = tmpName + "; (" + m_paramProp[iparam] + "^{reco}-" + m_paramProp[iparam] + "^{true})/#sigma_{" + m_paramProp[iparam] + "}"; - m_pullProjections_vs_eta[iparam][ibins] = Book1D(tmpName, tmpTitle, 200, -10.0, 10.0, false); - } - for (unsigned int ibins = 0; ibins < m_nPtBins; ibins++) { - tmpName = "PtProjections_resProjection_" + m_paramProp[iparam] + std::to_string(ibins + 1); - tmpTitle = tmpName + "; " + m_paramProp[iparam] + "^{reco}-" + m_paramProp[iparam] + - "^{true} "; - m_resProjections_vs_pt[iparam][ibins] = - Book1D(tmpName, tmpTitle, paramResBins[iparam], -paramRes[iparam], paramRes[iparam], false); - } - for (unsigned int ibins = 0; ibins < m_nEtaBins; ibins++) { - tmpName = "EtaProjections_resProjection_" + m_paramProp[iparam] + std::to_string(ibins + 1); - tmpTitle = "resProjection_" + m_paramProp[iparam] + std::to_string(ibins + 1) + "; " + - m_paramProp[iparam] + "^{reco}-" + m_paramProp[iparam] + "^{true} "; - m_resProjections_vs_eta[iparam][ibins] = - Book1D(tmpName, tmpTitle, paramResBins[iparam], -paramRes[iparam], paramRes[iparam], false); - } + m_pullProjections_vs_eta[iparam][ibins] = Book1D(tmpName, refHistEta.get(), tmpTitle , false); + + + tmpName = "resProjection_eta_" + m_paramProp[iparam] +"_bin_"+ std::to_string(ibins + 1); + tmpTitle = tmpName + "; " + m_paramProp[iparam] + "^{reco}-" + m_paramProp[iparam] + "^{true} "; + m_resProjections_vs_eta[iparam][ibins] = Book1D(tmpName, refHistEta.get(), tmpTitle , false); + } } // //End of saving resolution and pull residual binnings @@ -261,9 +257,9 @@ InDetPerfPlot_Resolution::getPlots() { m_pull[iparam]->Fill(m_pullP[iparam]); m_res[iparam]->Fill(m_resP[iparam]); if(iparam == QOVERPT){ - m_sigma[iparam]->Fill(m_trkP[PT] * m_sigP[iparam]); - m_sigma_vs_eta[iparam]->Fill(eta, m_trkP[PT] * m_sigP[iparam]); - m_sigma_vs_pt[iparam]->Fill(m_truetrkP[PT], m_trkP[PT] * m_sigP[iparam]); + m_sigma[iparam]->Fill(m_sigP[iparam]); + m_sigma_vs_eta[iparam]->Fill(eta, m_sigP[iparam]); + m_sigma_vs_pt[iparam]->Fill(m_truetrkP[PT], m_sigP[iparam]); } else { m_sigma[iparam]->Fill(m_sigP[iparam]); m_sigma_vs_eta[iparam]->Fill(eta, m_sigP[iparam]); @@ -297,8 +293,8 @@ InDetPerfPlot_Resolution::getPlotParameters() { m_sigP[iparam] = m_trkErrP[iparam]; (m_sigP[iparam] != 0) ? m_pullP[iparam] = m_resP[iparam] / m_sigP[iparam] : m_pullP[iparam] = -9999.; } - m_resP[QOVERPT] = m_trkP[PT] * (m_trkP[QOVERPT] - m_truetrkP[QOVERPT]) * (1 / m_truetrkP[QOVERPT]); - m_sigP[QOVERPT] *= m_trkP[PT]; + m_resP[QOVERPT] = (m_trkP[QOVERPT] - m_truetrkP[QOVERPT]) * (1 / m_truetrkP[QOVERPT]); // relative q/pt resolution + m_sigP[QOVERPT] *= m_trkP[PT]; // relative q/pt error } void diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPlotBase.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPlotBase.cxx index 02935038eed4dd57ab8bbace0a21cf0f06cb26b5..87d169b485f7ee8b748d650e79c7f7be9a731a4e 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPlotBase.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPlotBase.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /** @@ -60,8 +60,8 @@ InDetPlotBase::book(TProfile*& pHisto, const SingleHistogramDefinition& hd) { } void -InDetPlotBase::book(TH1*& pHisto, const std::string& histoIdentifier, const std::string& folder) { - const SingleHistogramDefinition hd = retrieveDefinition(histoIdentifier, folder); +InDetPlotBase::book(TH1*& pHisto, const std::string& histoIdentifier, const std::string & nameOverride, const std::string& folder) { + const SingleHistogramDefinition hd = retrieveDefinition(histoIdentifier, folder, nameOverride); if (hd.empty()) { ATH_MSG_WARNING("Histogram definition is empty for identifier " << histoIdentifier); @@ -71,8 +71,8 @@ InDetPlotBase::book(TH1*& pHisto, const std::string& histoIdentifier, const std: } void -InDetPlotBase::book(TProfile*& pHisto, const std::string& histoIdentifier, const std::string& folder) { - const SingleHistogramDefinition hd = retrieveDefinition(histoIdentifier, folder); +InDetPlotBase::book(TProfile*& pHisto, const std::string& histoIdentifier, const std::string & nameOverride, const std::string& folder) { + const SingleHistogramDefinition hd = retrieveDefinition(histoIdentifier, folder, nameOverride); if (hd.empty()) { ATH_MSG_WARNING("Histogram definition is empty for identifier " << histoIdentifier); @@ -82,8 +82,8 @@ InDetPlotBase::book(TProfile*& pHisto, const std::string& histoIdentifier, const } void -InDetPlotBase::book(TH2*& pHisto, const std::string& histoIdentifier, const std::string& folder) { - const SingleHistogramDefinition hd = retrieveDefinition(histoIdentifier, folder); +InDetPlotBase::book(TH2*& pHisto, const std::string& histoIdentifier, const std::string & nameOverride, const std::string& folder) { + const SingleHistogramDefinition hd = retrieveDefinition(histoIdentifier, folder, nameOverride); if (hd.empty()) { ATH_MSG_WARNING("Histogram definition is empty for identifier " << histoIdentifier); @@ -111,8 +111,8 @@ InDetPlotBase::book(TEfficiency*& pHisto, const SingleHistogramDefinition& hd) { } void -InDetPlotBase::book(TEfficiency*& pHisto, const std::string& histoIdentifier, const std::string& folder) { - const SingleHistogramDefinition hd = retrieveDefinition(histoIdentifier, folder); +InDetPlotBase::book(TEfficiency*& pHisto, const std::string& histoIdentifier, const std::string & nameOverride, const std::string& folder) { + const SingleHistogramDefinition hd = retrieveDefinition(histoIdentifier, folder, nameOverride); if (hd.empty()) { ATH_MSG_WARNING("Histogram definition is empty for identifier " << histoIdentifier); @@ -167,7 +167,7 @@ InDetPlotBase::fillHisto(TEfficiency* pTeff, const float value, const bool acce /**/ SingleHistogramDefinition -InDetPlotBase::retrieveDefinition(const std::string& histoIdentifier, const std::string& folder) { +InDetPlotBase::retrieveDefinition(const std::string& histoIdentifier, const std::string& folder, const std::string & nameOverride) { SingleHistogramDefinition s; // invalid result if (not m_histoDefSvc) { @@ -189,5 +189,8 @@ InDetPlotBase::retrieveDefinition(const std::string& histoIdentifier, const std: if (s.empty()) { ATH_MSG_WARNING("Histogram definition is empty for identifier " << histoIdentifier); } + if (!nameOverride.empty()){ + s.name = nameOverride; + } return s; } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPlotBase.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPlotBase.h index 030f3b09baa7962738ed6ae4df8fecd2b4f3450a..bdc44e8ea9866ec8c9594b5bfa57d339f3fc596c 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPlotBase.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPlotBase.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef INDETPHYSVALMONITORING_INDETPLOTBASE @@ -36,26 +36,35 @@ public: /// Retrieve a single histogram definition, given the unique string identifier SingleHistogramDefinition retrieveDefinition(const std::string& histoIdentifier, - const std::string& folder = "default"); + const std::string& folder = "default", + const std::string& nameOverride=""); /// Book a TH1 histogram void book(TH1*& pHisto, const SingleHistogramDefinition& hd); - /// Book a TH1 histogram with optional folder name - void book(TH1*& pHisto, const std::string& histoIdentifier, const std::string& folder = "default"); + /// Book a TH1 histogram with optional folder name. The name_override argument allows to assign a different + /// name to the created histogram than the one looked up from the XML. This can be used to instantiate + /// multiple, identically binned plots from a single entry in the XML. + void book(TH1*& pHisto, const std::string& histoIdentifier, const std::string & nameOverride="", const std::string& folder = "default"); /// Book a TProfile histogram void book(TProfile*& pHisto, const SingleHistogramDefinition& hd); - /// Book a TH1 histogram with optional folder name - void book(TProfile*& pHisto, const std::string& histoIdentifier, const std::string& folder = "default"); + /// Book a TProfile histogram with optional folder name. The name_override argument allows to assign a different + /// name to the created histogram than the one looked up from the XML. This can be used to instantiate + /// multiple, identically binned plots from a single entry in the XML. + void book(TProfile*& pHisto, const std::string& histoIdentifier, const std::string & nameOverride="", const std::string& folder = "default"); /// Book a 2D histogram (TH2) void book(TH2*& pHisto, const SingleHistogramDefinition& hd); - /// Book a 2D histogram (TH2) with optional folder name - void book(TH2*& pHisto, const std::string& histoIdentifier, const std::string& folder = "default"); + /// Book a 2D histogram (TH2) with optional folder name. The name_override argument allows to assign a different + /// name to the created histogram than the one looked up from the XML. This can be used to instantiate + /// multiple, identically binned plots from a single entry in the XML. + void book(TH2*& pHisto, const std::string& histoIdentifier, const std::string & nameOverride="", const std::string& folder = "default"); /// Book a (1-D) TEfficiency void book(TEfficiency*& pHisto, const SingleHistogramDefinition& hd); - /// Book a TEfficiency with optional folder name - void book(TEfficiency*& pHisto, const std::string& histoIdentifier, const std::string& folder = "default"); + /// Book a TEfficiency with optional folder name. The name_override argument allows to assign a different + /// name to the created histogram than the one looked up from the XML. This can be used to instantiate + /// multiple, identically binned plots from a single entry in the XML. + void book(TEfficiency*& pHisto, const std::string& histoIdentifier, const std::string & nameOverride="", const std::string& folder = "default"); // void fillHisto(TProfile* pTprofile, const float bin, const float weight); // diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/util/postProcessIDPVMHistos.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/util/postProcessIDPVMHistos.cxx index 6106a975537c8f034d085ff24ef0dc805f51b62b..abd1132b18e6ddcf812eaf55dcefb389ddf94e69 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/util/postProcessIDPVMHistos.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/util/postProcessIDPVMHistos.cxx @@ -41,10 +41,10 @@ bool isResolutionHelper(TObject* entry){ // Relies on the conventions within IDPVM std::pair<std::string, std::string> getObservableAndReso(const TObject* resHelper){ const std::string name{resHelper->GetName()}; - const std::string keyWord {"Helper"}; + const std::string keyWord {"Helper_"}; const size_t offset = keyWord.size(); auto start = name.find(keyWord)+offset; - auto sep = name.find("_"); + auto sep = name.find("_",start); return {name.substr(start, sep-start), name.substr(sep+1)}; } @@ -69,7 +69,20 @@ TH1* cloneExisting(const std::string & name){ return ret; // will also catch ret == nullptr } -// so far, we only support the 2D --> 1D case. 3D --> 2D is not used in IDPVM to date. +// get the names of the 1D histograms following IDPVM conventions. +std::pair<std::string, std::string> getPullAndResoNames(const std::string & type){ + if (type == "res"){ + return {"resolution","resmean"}; + } + else if (type == "pull"){ + return {"pullwidth","pullmean"}; + } + else { + std::cerr << " Not able to identify the histogram names for a resolution type "<<type<<" - supported are 'res' and 'pull'. "<<std::endl; + } + return {"",""}; +} + int postProcessHistos(TObject* resHelper, IDPVM::ResolutionHelper & theHelper){ // here we have to rely on the naming conventions of IDPVM to identify what we are looking at auto vars = getObservableAndReso(resHelper); @@ -80,9 +93,10 @@ int postProcessHistos(TObject* resHelper, IDPVM::ResolutionHelper & theHelper){ std::cerr <<"Unable to reduce the histogram "<<resHelper->GetName()<<" to a TH2 - this histo can not yet be postprocessed! " <<std::endl; return 1; } + const auto & oneDimNames = getPullAndResoNames(type); // get the corresponding 1D histos by cloning the existing ones in the same folder - TH1* h_width = cloneExisting(type + "width_vs_"+vars.first+"_"+vars.second); - TH1* h_mean = cloneExisting(type + "mean_vs_"+vars.first+"_"+vars.second); + TH1* h_width = cloneExisting(oneDimNames.first+"_vs_"+vars.first+"_"+vars.second); + TH1* h_mean = cloneExisting(oneDimNames.second+"_vs_"+vars.first+"_"+vars.second); // then call the resolution helper as done in "online" IDPVM theHelper.makeResolutions(resHelper2D, h_width, h_mean); // update our 1D histos