diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_ANTracking.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_ANTracking.cxx index 5f30a133adc6d2f497cd9a86d86b79849f538402..072f9a8d45ab2f66665de1b623ed7e51c50e6d28 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_ANTracking.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_ANTracking.cxx @@ -174,7 +174,7 @@ InDetPerfPlot_ANTracking::initializePlots() { } void -InDetPerfPlot_ANTracking::fillEfficiency(const xAOD::TruthParticle& truth, const xAOD::TrackParticle& track, const bool isGood, const float mu, const unsigned int nVtx) { +InDetPerfPlot_ANTracking::fillEfficiency(const xAOD::TruthParticle& truth, const xAOD::TrackParticle& track, const bool isGood, const float mu, const unsigned int nVtx, float weight) { const float undefinedValue = -9999; @@ -194,65 +194,65 @@ InDetPerfPlot_ANTracking::fillEfficiency(const xAOD::TruthParticle& truth, const isSTD = not isBAT and not isANT; if(isANT){ - fillHisto(m_effANT_eta, eta, isGood); - fillHisto(m_effANT_pt, pt, isGood); - fillHisto(m_effANT_phi, phi, isGood); - fillHisto(m_effANT_d0, d0, isGood); - fillHisto(m_effANT_z0, z0, isGood); - fillHisto(m_effANT_radius, radius, isGood); - fillHisto(m_effANT_mu, mu, isGood); - fillHisto(m_effANT_nvertices, nVtx, isGood); + fillHisto(m_effANT_eta, eta, isGood, weight); + fillHisto(m_effANT_pt, pt, isGood, weight); + fillHisto(m_effANT_phi, phi, isGood, weight); + fillHisto(m_effANT_d0, d0, isGood, weight); + fillHisto(m_effANT_z0, z0, isGood, weight); + fillHisto(m_effANT_radius, radius, isGood, weight); + fillHisto(m_effANT_mu, mu, isGood, weight); + fillHisto(m_effANT_nvertices, nVtx, isGood, weight); } else if(isSTD){ - fillHisto(m_effSTD_eta, eta, isGood); - fillHisto(m_effSTD_pt, pt, isGood); - fillHisto(m_effSTD_phi, phi, isGood); - fillHisto(m_effSTD_d0, d0, isGood); - fillHisto(m_effSTD_z0, z0, isGood); - fillHisto(m_effSTD_radius, radius, isGood); - fillHisto(m_effSTD_mu, mu, isGood); - fillHisto(m_effSTD_nvertices, nVtx, isGood); + fillHisto(m_effSTD_eta, eta, isGood, weight); + fillHisto(m_effSTD_pt, pt, isGood, weight); + fillHisto(m_effSTD_phi, phi, isGood, weight); + fillHisto(m_effSTD_d0, d0, isGood, weight); + fillHisto(m_effSTD_z0, z0, isGood, weight); + fillHisto(m_effSTD_radius, radius, isGood, weight); + fillHisto(m_effSTD_mu, mu, isGood, weight); + fillHisto(m_effSTD_nvertices, nVtx, isGood, weight); } else if(isBAT){ - fillHisto(m_effBAT_eta, eta, isGood); - fillHisto(m_effBAT_pt, pt, isGood); - fillHisto(m_effBAT_phi, phi, isGood); - fillHisto(m_effBAT_d0, d0, isGood); - fillHisto(m_effBAT_z0, z0, isGood); - fillHisto(m_effBAT_radius, radius, isGood); - fillHisto(m_effBAT_mu, mu, isGood); - fillHisto(m_effBAT_nvertices, nVtx, isGood); + fillHisto(m_effBAT_eta, eta, isGood, weight); + fillHisto(m_effBAT_pt, pt, isGood, weight); + fillHisto(m_effBAT_phi, phi, isGood, weight); + fillHisto(m_effBAT_d0, d0, isGood, weight); + fillHisto(m_effBAT_z0, z0, isGood, weight); + fillHisto(m_effBAT_radius, radius, isGood, weight); + fillHisto(m_effBAT_mu, mu, isGood, weight); + fillHisto(m_effBAT_nvertices, nVtx, isGood, weight); } } else { - fillHisto(m_effANT_eta, eta, isGood); - fillHisto(m_effANT_pt, pt, isGood); - fillHisto(m_effANT_phi, phi, isGood); - fillHisto(m_effANT_d0, d0, isGood); - fillHisto(m_effANT_z0, z0, isGood); - fillHisto(m_effANT_radius, radius, isGood); - fillHisto(m_effANT_mu, mu, isGood); - fillHisto(m_effANT_nvertices, nVtx, isGood); - fillHisto(m_effSTD_eta, eta, isGood); - fillHisto(m_effSTD_pt, pt, isGood); - fillHisto(m_effSTD_phi, phi, isGood); - fillHisto(m_effSTD_d0, d0, isGood); - fillHisto(m_effSTD_z0, z0, isGood); - fillHisto(m_effSTD_radius, radius, isGood); - fillHisto(m_effSTD_mu, mu, isGood); - fillHisto(m_effSTD_nvertices, nVtx, isGood); - fillHisto(m_effBAT_eta, eta, isGood); - fillHisto(m_effBAT_pt, pt, isGood); - fillHisto(m_effBAT_phi, phi, isGood); - fillHisto(m_effBAT_d0, d0, isGood); - fillHisto(m_effBAT_z0, z0, isGood); - fillHisto(m_effBAT_radius, radius, isGood); - fillHisto(m_effBAT_mu, mu, isGood); - fillHisto(m_effBAT_nvertices, nVtx, isGood); + fillHisto(m_effANT_eta, eta, isGood, weight); + fillHisto(m_effANT_pt, pt, isGood, weight); + fillHisto(m_effANT_phi, phi, isGood, weight); + fillHisto(m_effANT_d0, d0, isGood, weight); + fillHisto(m_effANT_z0, z0, isGood, weight); + fillHisto(m_effANT_radius, radius, isGood, weight); + fillHisto(m_effANT_mu, mu, isGood, weight); + fillHisto(m_effANT_nvertices, nVtx, isGood, weight); + fillHisto(m_effSTD_eta, eta, isGood, weight); + fillHisto(m_effSTD_pt, pt, isGood, weight); + fillHisto(m_effSTD_phi, phi, isGood, weight); + fillHisto(m_effSTD_d0, d0, isGood, weight); + fillHisto(m_effSTD_z0, z0, isGood, weight); + fillHisto(m_effSTD_radius, radius, isGood, weight); + fillHisto(m_effSTD_mu, mu, isGood, weight); + fillHisto(m_effSTD_nvertices, nVtx, isGood, weight); + fillHisto(m_effBAT_eta, eta, isGood, weight); + fillHisto(m_effBAT_pt, pt, isGood, weight); + fillHisto(m_effBAT_phi, phi, isGood, weight); + fillHisto(m_effBAT_d0, d0, isGood, weight); + fillHisto(m_effBAT_z0, z0, isGood, weight); + fillHisto(m_effBAT_radius, radius, isGood, weight); + fillHisto(m_effBAT_mu, mu, isGood, weight); + fillHisto(m_effBAT_nvertices, nVtx, isGood, weight); } } void -InDetPerfPlot_ANTracking::fillFakeRate(const xAOD::TrackParticle& track, const bool isFake, const float mu, const unsigned int nVtx){ +InDetPerfPlot_ANTracking::fillFakeRate(const xAOD::TrackParticle& track, const bool isFake, const float mu, const unsigned int nVtx, float weight){ double eta = track.eta(); double phi = track.phi(); @@ -266,36 +266,36 @@ InDetPerfPlot_ANTracking::fillFakeRate(const xAOD::TrackParticle& track, const b bool isSTD = not isBAT and not isANT; if(isANT){ - fillHisto(m_fakeANT_eta, eta, isFake); - fillHisto(m_fakeANT_pt, pt, isFake); - fillHisto(m_fakeANT_phi, phi, isFake); - fillHisto(m_fakeANT_d0, d0, isFake); - fillHisto(m_fakeANT_z0, z0, isFake); - fillHisto(m_fakeANT_mu, mu, isFake); - fillHisto(m_fakeANT_nvertices, nVtx, isFake); + fillHisto(m_fakeANT_eta, eta, isFake, weight); + fillHisto(m_fakeANT_pt, pt, isFake, weight); + fillHisto(m_fakeANT_phi, phi, isFake, weight); + fillHisto(m_fakeANT_d0, d0, isFake, weight); + fillHisto(m_fakeANT_z0, z0, isFake, weight); + fillHisto(m_fakeANT_mu, mu, isFake, weight); + fillHisto(m_fakeANT_nvertices, nVtx, isFake, weight); } else if(isSTD){ - fillHisto(m_fakeSTD_eta, eta, isFake); - fillHisto(m_fakeSTD_pt, pt, isFake); - fillHisto(m_fakeSTD_phi, phi, isFake); - fillHisto(m_fakeSTD_d0, d0, isFake); - fillHisto(m_fakeSTD_z0, z0, isFake); - fillHisto(m_fakeSTD_mu, mu, isFake); - fillHisto(m_fakeSTD_nvertices, nVtx, isFake); + fillHisto(m_fakeSTD_eta, eta, isFake, weight); + fillHisto(m_fakeSTD_pt, pt, isFake, weight); + fillHisto(m_fakeSTD_phi, phi, isFake, weight); + fillHisto(m_fakeSTD_d0, d0, isFake, weight); + fillHisto(m_fakeSTD_z0, z0, isFake, weight); + fillHisto(m_fakeSTD_mu, mu, isFake, weight); + fillHisto(m_fakeSTD_nvertices, nVtx, isFake, weight); } else if(isBAT){ - fillHisto(m_fakeBAT_eta, eta, isFake); - fillHisto(m_fakeBAT_pt, pt, isFake); - fillHisto(m_fakeBAT_phi, phi, isFake); - fillHisto(m_fakeBAT_d0, d0, isFake); - fillHisto(m_fakeBAT_z0, z0, isFake); - fillHisto(m_fakeBAT_mu, mu, isFake); - fillHisto(m_fakeBAT_nvertices, nVtx, isFake); + fillHisto(m_fakeBAT_eta, eta, isFake, weight); + fillHisto(m_fakeBAT_pt, pt, isFake, weight); + fillHisto(m_fakeBAT_phi, phi, isFake, weight); + fillHisto(m_fakeBAT_d0, d0, isFake, weight); + fillHisto(m_fakeBAT_z0, z0, isFake, weight); + fillHisto(m_fakeBAT_mu, mu, isFake, weight); + fillHisto(m_fakeBAT_nvertices, nVtx, isFake, weight); } } void -InDetPerfPlot_ANTracking::fillUnlinked(const xAOD::TrackParticle& track, const bool isAssociatedTruth, const float mu, const unsigned int nVtx) { +InDetPerfPlot_ANTracking::fillUnlinked(const xAOD::TrackParticle& track, const bool isAssociatedTruth, const float mu, const unsigned int nVtx, float weight) { double eta = track.eta(); double phi = track.phi(); @@ -309,36 +309,36 @@ InDetPerfPlot_ANTracking::fillUnlinked(const xAOD::TrackParticle& track, const b bool isSTD = not isBAT and not isANT; if(isANT){ - fillHisto(m_unlinkedANT_eta, eta, isAssociatedTruth); - fillHisto(m_unlinkedANT_pt, pt, isAssociatedTruth); - fillHisto(m_unlinkedANT_phi, phi, isAssociatedTruth); - fillHisto(m_unlinkedANT_d0, d0, isAssociatedTruth); - fillHisto(m_unlinkedANT_z0, z0, isAssociatedTruth); - fillHisto(m_unlinkedANT_mu, mu, isAssociatedTruth); - fillHisto(m_unlinkedANT_nvertices, nVtx, isAssociatedTruth); + fillHisto(m_unlinkedANT_eta, eta, isAssociatedTruth, weight); + fillHisto(m_unlinkedANT_pt, pt, isAssociatedTruth, weight); + fillHisto(m_unlinkedANT_phi, phi, isAssociatedTruth, weight); + fillHisto(m_unlinkedANT_d0, d0, isAssociatedTruth, weight); + fillHisto(m_unlinkedANT_z0, z0, isAssociatedTruth, weight); + fillHisto(m_unlinkedANT_mu, mu, isAssociatedTruth, weight); + fillHisto(m_unlinkedANT_nvertices, nVtx, isAssociatedTruth, weight); } else if(isSTD){ - fillHisto(m_unlinkedSTD_eta, eta, isAssociatedTruth); - fillHisto(m_unlinkedSTD_pt, pt, isAssociatedTruth); - fillHisto(m_unlinkedSTD_phi, phi, isAssociatedTruth); - fillHisto(m_unlinkedSTD_d0, d0, isAssociatedTruth); - fillHisto(m_unlinkedSTD_z0, z0, isAssociatedTruth); - fillHisto(m_unlinkedSTD_mu, mu, isAssociatedTruth); - fillHisto(m_unlinkedSTD_nvertices, nVtx, isAssociatedTruth); + fillHisto(m_unlinkedSTD_eta, eta, isAssociatedTruth, weight); + fillHisto(m_unlinkedSTD_pt, pt, isAssociatedTruth, weight); + fillHisto(m_unlinkedSTD_phi, phi, isAssociatedTruth, weight); + fillHisto(m_unlinkedSTD_d0, d0, isAssociatedTruth, weight); + fillHisto(m_unlinkedSTD_z0, z0, isAssociatedTruth, weight); + fillHisto(m_unlinkedSTD_mu, mu, isAssociatedTruth, weight); + fillHisto(m_unlinkedSTD_nvertices, nVtx, isAssociatedTruth, weight); } else if(isBAT){ - fillHisto(m_unlinkedBAT_eta, eta, isAssociatedTruth); - fillHisto(m_unlinkedBAT_pt, pt, isAssociatedTruth); - fillHisto(m_unlinkedBAT_phi, phi, isAssociatedTruth); - fillHisto(m_unlinkedBAT_d0, d0, isAssociatedTruth); - fillHisto(m_unlinkedBAT_z0, z0, isAssociatedTruth); - fillHisto(m_unlinkedBAT_mu, mu, isAssociatedTruth); - fillHisto(m_unlinkedBAT_nvertices, nVtx, isAssociatedTruth); + fillHisto(m_unlinkedBAT_eta, eta, isAssociatedTruth, weight); + fillHisto(m_unlinkedBAT_pt, pt, isAssociatedTruth, weight); + fillHisto(m_unlinkedBAT_phi, phi, isAssociatedTruth, weight); + fillHisto(m_unlinkedBAT_d0, d0, isAssociatedTruth, weight); + fillHisto(m_unlinkedBAT_z0, z0, isAssociatedTruth, weight); + fillHisto(m_unlinkedBAT_mu, mu, isAssociatedTruth, weight); + fillHisto(m_unlinkedBAT_nvertices, nVtx, isAssociatedTruth, weight); } } void -InDetPerfPlot_ANTracking::fill(const xAOD::TrackParticle& track) { +InDetPerfPlot_ANTracking::fill(const xAOD::TrackParticle& track, const float weight) { double eta = track.eta(); double phi = track.phi(); @@ -356,80 +356,80 @@ InDetPerfPlot_ANTracking::fill(const xAOD::TrackParticle& track) { uint8_t iPixelShared(0), iSCTShared(0); if (track.summaryValue(iPixHits, xAOD::numberOfPixelHits)) { - if(isANT) fillHisto(m_nPixelHitsANT_vs_eta, eta, iPixHits); - if(isSTD) fillHisto(m_nPixelHitsSTD_vs_eta, eta, iPixHits); - if(isBAT) fillHisto(m_nPixelHitsBAT_vs_eta, eta, iPixHits); + if(isANT) fillHisto(m_nPixelHitsANT_vs_eta, eta, iPixHits, weight); + if(isSTD) fillHisto(m_nPixelHitsSTD_vs_eta, eta, iPixHits, weight); + if(isBAT) fillHisto(m_nPixelHitsBAT_vs_eta, eta, iPixHits, weight); } if (track.summaryValue(iSctHits, xAOD::numberOfSCTHits)) { - if(isANT) fillHisto(m_nSCTHitsANT_vs_eta, eta, iSctHits); - if(isSTD) fillHisto(m_nSCTHitsSTD_vs_eta, eta, iSctHits); - if(isBAT) fillHisto(m_nSCTHitsBAT_vs_eta, eta, iSctHits); + if(isANT) fillHisto(m_nSCTHitsANT_vs_eta, eta, iSctHits, weight); + if(isSTD) fillHisto(m_nSCTHitsSTD_vs_eta, eta, iSctHits, weight); + if(isBAT) fillHisto(m_nSCTHitsBAT_vs_eta, eta, iSctHits, weight); } if (track.summaryValue(iTrtHits, xAOD::numberOfTRTHits)) { - if(isANT) fillHisto(m_nTRTHitsANT_vs_eta, eta, iTrtHits); - if(isSTD) fillHisto(m_nTRTHitsSTD_vs_eta, eta, iTrtHits); - if(isBAT) fillHisto(m_nTRTHitsBAT_vs_eta, eta, iTrtHits); + if(isANT) fillHisto(m_nTRTHitsANT_vs_eta, eta, iTrtHits, weight); + if(isSTD) fillHisto(m_nTRTHitsSTD_vs_eta, eta, iTrtHits, weight); + if(isBAT) fillHisto(m_nTRTHitsBAT_vs_eta, eta, iTrtHits, weight); } if (track.summaryValue(iPixHoles, xAOD::numberOfPixelHoles)) { - if(isANT) fillHisto(m_nPixelHolesANT_vs_eta, eta, iPixHoles); - if(isSTD) fillHisto(m_nPixelHolesSTD_vs_eta, eta, iPixHoles); - if(isBAT) fillHisto(m_nPixelHolesBAT_vs_eta, eta, iPixHoles); + if(isANT) fillHisto(m_nPixelHolesANT_vs_eta, eta, iPixHoles, weight); + if(isSTD) fillHisto(m_nPixelHolesSTD_vs_eta, eta, iPixHoles, weight); + if(isBAT) fillHisto(m_nPixelHolesBAT_vs_eta, eta, iPixHoles, weight); } if (track.summaryValue(iSCTHoles, xAOD::numberOfSCTHoles)) { - if(isANT) fillHisto(m_nSCTHolesANT_vs_eta, eta, iSCTHoles); - if(isSTD) fillHisto(m_nSCTHolesSTD_vs_eta, eta, iSCTHoles); - if(isBAT) fillHisto(m_nSCTHolesBAT_vs_eta, eta, iSCTHoles); + if(isANT) fillHisto(m_nSCTHolesANT_vs_eta, eta, iSCTHoles, weight); + if(isSTD) fillHisto(m_nSCTHolesSTD_vs_eta, eta, iSCTHoles, weight); + if(isBAT) fillHisto(m_nSCTHolesBAT_vs_eta, eta, iSCTHoles, weight); } if (track.summaryValue(iTrtHTHits, xAOD::numberOfTRTHighThresholdHits)) { - if(isANT) fillHisto(m_nTRTHTHitsANT_vs_eta, eta, iTrtHTHits); - if(isSTD) fillHisto(m_nTRTHTHitsSTD_vs_eta, eta, iTrtHTHits); - if(isBAT) fillHisto(m_nTRTHTHitsBAT_vs_eta, eta, iTrtHTHits); + if(isANT) fillHisto(m_nTRTHTHitsANT_vs_eta, eta, iTrtHTHits, weight); + if(isSTD) fillHisto(m_nTRTHTHitsSTD_vs_eta, eta, iTrtHTHits, weight); + if(isBAT) fillHisto(m_nTRTHTHitsBAT_vs_eta, eta, iTrtHTHits, weight); } if (track.summaryValue(iPixelShared, xAOD::numberOfPixelSharedHits)) { - if(isANT) fillHisto(m_nPixelSharedHitsANT_vs_eta, eta, iPixelShared); - if(isSTD) fillHisto(m_nPixelSharedHitsSTD_vs_eta, eta, iPixelShared); - if(isBAT) fillHisto(m_nPixelSharedHitsBAT_vs_eta, eta, iPixelShared); + if(isANT) fillHisto(m_nPixelSharedHitsANT_vs_eta, eta, iPixelShared, weight); + if(isSTD) fillHisto(m_nPixelSharedHitsSTD_vs_eta, eta, iPixelShared, weight); + if(isBAT) fillHisto(m_nPixelSharedHitsBAT_vs_eta, eta, iPixelShared, weight); } if (track.summaryValue(iSCTShared, xAOD::numberOfSCTSharedHits)) { - if(isANT) fillHisto(m_nSCTSharedHitsANT_vs_eta, eta, iSCTShared); - if(isSTD) fillHisto(m_nSCTSharedHitsSTD_vs_eta, eta, iSCTShared); - if(isBAT) fillHisto(m_nSCTSharedHitsBAT_vs_eta, eta, iSCTShared); + if(isANT) fillHisto(m_nSCTSharedHitsANT_vs_eta, eta, iSCTShared, weight); + if(isSTD) fillHisto(m_nSCTSharedHitsSTD_vs_eta, eta, iSCTShared, weight); + if(isBAT) fillHisto(m_nSCTSharedHitsBAT_vs_eta, eta, iSCTShared, weight); } if(isANT){ - fillHisto(m_trkpropANT_eta, eta); - fillHisto(m_trkpropANT_phi, phi); - fillHisto(m_trkpropANT_pt, pt); - fillHisto(m_trkpropANT_d0, d0); - fillHisto(m_trkpropANT_z0, z0); + fillHisto(m_trkpropANT_eta, eta, weight); + fillHisto(m_trkpropANT_phi, phi, weight); + fillHisto(m_trkpropANT_pt, pt, weight); + fillHisto(m_trkpropANT_d0, d0, weight); + fillHisto(m_trkpropANT_z0, z0, weight); } if(isBAT){ - fillHisto(m_trkpropBAT_eta, eta); - fillHisto(m_trkpropBAT_phi, phi); - fillHisto(m_trkpropBAT_pt, pt); - fillHisto(m_trkpropBAT_d0, d0); - fillHisto(m_trkpropBAT_z0, z0); + fillHisto(m_trkpropBAT_eta, eta, weight); + fillHisto(m_trkpropBAT_phi, phi, weight); + fillHisto(m_trkpropBAT_pt, pt, weight); + fillHisto(m_trkpropBAT_d0, d0, weight); + fillHisto(m_trkpropBAT_z0, z0, weight); } if(isSTD){ - fillHisto(m_trkpropSTD_eta, eta); - fillHisto(m_trkpropSTD_phi, phi); - fillHisto(m_trkpropSTD_pt, pt); - fillHisto(m_trkpropSTD_d0, d0); - fillHisto(m_trkpropSTD_z0, z0); + fillHisto(m_trkpropSTD_eta, eta, weight); + fillHisto(m_trkpropSTD_phi, phi, weight); + fillHisto(m_trkpropSTD_pt, pt, weight); + fillHisto(m_trkpropSTD_d0, d0, weight); + fillHisto(m_trkpropSTD_z0, z0, weight); } } void -InDetPerfPlot_ANTracking::fill(const unsigned int nTrkANT, const unsigned int nTrkSTD, const unsigned int nTrkBAT, const float mu, const unsigned int nVtx) { +InDetPerfPlot_ANTracking::fill(const unsigned int nTrkANT, const unsigned int nTrkSTD, const unsigned int nTrkBAT, const float mu, const unsigned int nVtx, const float weight) { - fillHisto(m_ntrkANT_mu, mu, nTrkANT); - fillHisto(m_ntrkSTD_mu, mu, nTrkSTD); - fillHisto(m_ntrkBAT_mu, mu, nTrkBAT); + fillHisto(m_ntrkANT_mu, mu, nTrkANT, weight); + fillHisto(m_ntrkSTD_mu, mu, nTrkSTD, weight); + fillHisto(m_ntrkBAT_mu, mu, nTrkBAT, weight); - fillHisto(m_ntrkANT_nvertices, nVtx, nTrkANT); - fillHisto(m_ntrkSTD_nvertices, nVtx, nTrkSTD); - fillHisto(m_ntrkBAT_nvertices, nVtx, nTrkBAT); + fillHisto(m_ntrkANT_nvertices, nVtx, nTrkANT, weight); + fillHisto(m_ntrkSTD_nvertices, nVtx, nTrkSTD, weight); + fillHisto(m_ntrkBAT_nvertices, nVtx, nTrkBAT, weight); } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_ANTracking.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_ANTracking.h index fc1cd2f86d8b92a50b7d02e3839a1b4f1d3d9960..01fd0529594fb72794cb42afec51ebc1b8e6aa88 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_ANTracking.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_ANTracking.h @@ -29,12 +29,12 @@ class InDetPerfPlot_ANTracking: public InDetPlotBase { public: InDetPerfPlot_ANTracking(InDetPlotBase* pParent, const std::string& dirName); - void fillEfficiency(const xAOD::TruthParticle& truth, const xAOD::TrackParticle& track, const bool isGood, const float mu, const unsigned int nVtx); - void fillFakeRate(const xAOD::TrackParticle& track, const bool isAssociatedTruth, const float mu, const unsigned int nVtx); - void fillUnlinked(const xAOD::TrackParticle& track, const bool isAssociatedTruth, const float mu, const unsigned int nVtx); + void fillEfficiency(const xAOD::TruthParticle& truth, const xAOD::TrackParticle& track, const bool isGood, const float mu, const unsigned int nVtx, float weight); + void fillFakeRate(const xAOD::TrackParticle& track, const bool isAssociatedTruth, const float mu, const unsigned int nVtx, float weight); + void fillUnlinked(const xAOD::TrackParticle& track, const bool isAssociatedTruth, const float mu, const unsigned int nVtx, float weight); - void fill(const xAOD::TrackParticle& track); - void fill(const unsigned int nTrkANT, const unsigned int nTrkSTD, const unsigned int nTrkBAT, const float mu, const unsigned int nVtx); + void fill(const xAOD::TrackParticle& track, const float weight=1.0); + void fill(const unsigned int nTrkANT, const unsigned int nTrkSTD, const unsigned int nTrkBAT, const float mu, const unsigned int nVtx, const float weight=1.0); private: diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Efficiency.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Efficiency.cxx index 66bed68a4bcf626683ca3abb4794ec7a2be7565a..41bd9c6cf3e2ce088e60a7a9cb5ac280e42382d3 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Efficiency.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Efficiency.cxx @@ -53,36 +53,36 @@ InDetPerfPlot_Efficiency::initializePlots() { } void -InDetPerfPlot_Efficiency::fill(const xAOD::TruthParticle& truth, const bool isGood) { +InDetPerfPlot_Efficiency::fill(const xAOD::TruthParticle& truth, const bool isGood, float weight) { double eta = truth.eta(); double pt = truth.pt() / Gaudi::Units::GeV; // convert MeV to GeV double phi = truth.phi(); - fillHisto(m_efficiency_vs_eta, eta, isGood); - fillHisto(m_efficiency_vs_pt, pt, isGood); - fillHisto(m_efficiency_vs_pt_low, pt, isGood); - fillHisto(m_efficiency_vs_pt_high, pt, isGood); - fillHisto(m_efficiency_vs_phi, phi, isGood); + fillHisto(m_efficiency_vs_eta, eta, isGood, weight); + fillHisto(m_efficiency_vs_pt, pt, isGood, weight); + fillHisto(m_efficiency_vs_pt_low, pt, isGood, weight); + fillHisto(m_efficiency_vs_pt_high, pt, isGood, weight); + fillHisto(m_efficiency_vs_phi, phi, isGood, weight); double d0 = truth.auxdata<float>("d0"); double z0 = truth.auxdata<float>("z0"); double R = truth.auxdata<float>("prodR"); double Z = truth.auxdata<float>("prodZ"); - fillHisto(m_efficiency_vs_d0, d0, isGood); - fillHisto(m_efficiency_vs_z0, z0, isGood); - fillHisto(m_efficiency_vs_R, R, isGood); - fillHisto(m_efficiency_vs_Z, Z, isGood); + fillHisto(m_efficiency_vs_d0, d0, isGood, weight); + fillHisto(m_efficiency_vs_z0, z0, isGood, weight); + fillHisto(m_efficiency_vs_R, R, isGood, weight); + fillHisto(m_efficiency_vs_Z, Z, isGood, weight); - fillHisto(m_extended_efficiency_vs_d0, d0, isGood); - fillHisto(m_extended_efficiency_vs_z0, z0, isGood); + fillHisto(m_extended_efficiency_vs_d0, d0, isGood, weight); + fillHisto(m_extended_efficiency_vs_z0, z0, isGood, weight); if (truth.hasProdVtx()) { const xAOD::TruthVertex* vtx = truth.prodVtx(); double prod_rad = vtx->perp(); double prod_z = vtx->z(); - fillHisto(m_efficiency_vs_prodR, prod_rad, isGood); - fillHisto(m_efficiency_vs_prodR_extended, prod_rad, isGood); - fillHisto(m_efficiency_vs_prodZ, prod_z, isGood); - fillHisto(m_efficiency_vs_prodZ_extended, prod_z, isGood); + fillHisto(m_efficiency_vs_prodR, prod_rad, isGood, weight); + fillHisto(m_efficiency_vs_prodR_extended, prod_rad, isGood, weight); + fillHisto(m_efficiency_vs_prodZ, prod_z, isGood, weight); + fillHisto(m_efficiency_vs_prodZ_extended, prod_z, isGood, weight); } } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Efficiency.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Efficiency.h index b03ded92b8d424693767c3c8f96354145dd8a932..b4af93a7f8d3c2da0237ec6fff282c3e2c860ef0 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Efficiency.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Efficiency.h @@ -29,7 +29,7 @@ class InDetPerfPlot_Efficiency: public InDetPlotBase { public: InDetPerfPlot_Efficiency(InDetPlotBase* pParent, const std::string& dirName); - void fill(const xAOD::TruthParticle& truth, const bool isGood); + void fill(const xAOD::TruthParticle& truth, const bool isGood, float weight); private: TEfficiency* m_efficiency_vs_eta; TEfficiency* m_efficiency_vs_pt; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_FakeRate.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_FakeRate.cxx index ec7613d112ce9b61cac42401cf9e464232ae4adf..52a93b13c0dd0bfb26b277af73d44f78bab4962b 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_FakeRate.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_FakeRate.cxx @@ -32,7 +32,7 @@ InDetPerfPlot_FakeRate::initializePlots() { } void -InDetPerfPlot_FakeRate::fill(const xAOD::TrackParticle& track, const bool isFake) { +InDetPerfPlot_FakeRate::fill(const xAOD::TrackParticle& track, const bool isFake, float weight) { double eta = track.eta(); double pt = track.pt() / Gaudi::Units::GeV; // convert MeV to GeV @@ -40,11 +40,11 @@ InDetPerfPlot_FakeRate::fill(const xAOD::TrackParticle& track, const bool isFake double d0 = track.d0(); double z0 = track.z0(); - fillHisto(m_fakerate_vs_eta, eta, isFake); - fillHisto(m_fakerate_vs_pt, pt, isFake); - fillHisto(m_fakerate_vs_phi, phi, isFake); - fillHisto(m_fakerate_vs_d0, d0, isFake); - fillHisto(m_fakerate_vs_z0, z0, isFake); + fillHisto(m_fakerate_vs_eta, eta, isFake, weight); + fillHisto(m_fakerate_vs_pt, pt, isFake, weight); + fillHisto(m_fakerate_vs_phi, phi, isFake, weight); + fillHisto(m_fakerate_vs_d0, d0, isFake, weight); + fillHisto(m_fakerate_vs_z0, z0, isFake, weight); } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_FakeRate.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_FakeRate.h index f9e855ffcf6dd1ed3d3765b88cdb586adddffc28..fb16e2327921aa86b9f1b7ea722627dd24919621 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_FakeRate.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_FakeRate.h @@ -29,7 +29,7 @@ class InDetPerfPlot_FakeRate: public InDetPlotBase { public: InDetPerfPlot_FakeRate(InDetPlotBase* pParent, const std::string& dirName); - void fill(const xAOD::TrackParticle& track, const bool isFake); + void fill(const xAOD::TrackParticle& track, const bool isFake, float weight); private: TEfficiency* m_fakerate_vs_eta; TEfficiency* m_fakerate_vs_pt; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_HitEfficiency.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_HitEfficiency.cxx index f6c8abdba72a5326f7b737e8b2716097ea0459a8..5ec6c76dd0503c7682020aa45c7ebae56d9bdd74 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_HitEfficiency.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_HitEfficiency.cxx @@ -49,7 +49,7 @@ InDetPerfPlot_HitEfficiency::initializePlots() { } void -InDetPerfPlot_HitEfficiency::fill(const xAOD::TrackParticle& trkprt) { +InDetPerfPlot_HitEfficiency::fill(const xAOD::TrackParticle& trkprt, float weight) { if (m_debug) { ATH_MSG_INFO("Filling HitEfficiency"); } @@ -74,7 +74,7 @@ InDetPerfPlot_HitEfficiency::fill(const xAOD::TrackParticle& trkprt) { const int region = result_region[idx]; // BARREL OR ENDCAP float eta = std::fabs(trkprt.eta()); - fillHisto(m_HitEfficiencyVsEta[det][region], eta, isHit); + fillHisto(m_HitEfficiencyVsEta[det][region], eta, isHit, weight); } } } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_HitEfficiency.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_HitEfficiency.h index 16e78e76b67dc4f9c3046bf315aff122fb5aed19..f2afbdd32596c92b663f5c569b8d53ea81a0b1c3 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_HitEfficiency.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_HitEfficiency.h @@ -33,7 +33,7 @@ class InDetPerfPlot_HitEfficiency: public InDetPlotBase { public: InDetPerfPlot_HitEfficiency(InDetPlotBase* pParent, const std::string& dirName); - void fill(const xAOD::TrackParticle& trkprt); + void fill(const xAOD::TrackParticle& trkprt, float weight); ~InDetPerfPlot_HitEfficiency() {/** nop **/ } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_HitResidual.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_HitResidual.cxx index 01e9163a65d99b88ec5bb64c8313d284bc23664b..694d0edb83603a6513944ff1ef980eb687c11645 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_HitResidual.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_HitResidual.cxx @@ -101,7 +101,7 @@ InDetPerfPlot_HitResidual::initializePlots() { } void -InDetPerfPlot_HitResidual::fill(const xAOD::TrackParticle& trkprt) { +InDetPerfPlot_HitResidual::fill(const xAOD::TrackParticle& trkprt, float weight) { const static bool hitDetailsAvailable = trkprt.isAvailable<std::vector<int> >("measurement_region"); if (!hitDetailsAvailable) { @@ -146,29 +146,29 @@ InDetPerfPlot_HitResidual::fill(const xAOD::TrackParticle& trkprt) { } if ((width > 0) or (det ==TRT)){//TRT does not have defined cluster width // introduce cluster width histograms - fillHisto(m_phiWidth[det][region], width); - fillHisto(m_etaWidth[det][region], etaWidth); - fillHisto(m_residualx[det][region], residualLocX); + fillHisto(m_phiWidth[det][region], width, weight); + fillHisto(m_etaWidth[det][region], etaWidth, weight); + fillHisto(m_residualx[det][region], residualLocX, weight); const bool hasYCoordinate = (det != SCT)and(det != TRT); // SCT & TRT do not have LocY if (hasYCoordinate) { - fillHisto(m_residualy[det][region], residualLocY); + fillHisto(m_residualy[det][region], residualLocY, weight); } - fillHisto(m_pullx[det][region], pullLocX); + fillHisto(m_pullx[det][region], pullLocX, weight); if (hasYCoordinate) { // SCT & TRT do not have LocY - fillHisto(m_pully[det][region], pullLocY); + fillHisto(m_pully[det][region], pullLocY, weight); } if ((det == TRT) or (width < 0)) { continue; } if (width == 1) { - fillHisto(m_residualx_1hit[det][region], residualLocX); + fillHisto(m_residualx_1hit[det][region], residualLocX, weight); if (hasYCoordinate) { - fillHisto(m_residualy_1hit[det][region], residualLocY); + fillHisto(m_residualy_1hit[det][region], residualLocY, weight); } } else { - fillHisto(m_residualx_2ormorehits[det][region], residualLocX); + fillHisto(m_residualx_2ormorehits[det][region], residualLocX, weight); if (hasYCoordinate) { - fillHisto(m_residualy_2ormorehits[det][region], residualLocY); + fillHisto(m_residualy_2ormorehits[det][region], residualLocY, weight); } } } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_HitResidual.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_HitResidual.h index 9ecc146ec6de10fdf545be11ae46afb53cb1f066..883fe9c8c8aaca7e4bf36d7562048845ac0bf90a 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_HitResidual.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_HitResidual.h @@ -34,7 +34,7 @@ class InDetPerfPlot_HitResidual: public InDetPlotBase { public: InDetPerfPlot_HitResidual(InDetPlotBase* pParent, const std::string& dirName); - void fill(const xAOD::TrackParticle& trkprt); + void fill(const xAOD::TrackParticle& trkprt, float weight); ~InDetPerfPlot_HitResidual() {/** nop **/ } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Hits.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Hits.cxx index 92ab8bbb56eb0c5be2dce9d7a68743259ef46dcd..045fba03113b72aaeabdcaf275d8049d0e78a7f6 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Hits.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Hits.cxx @@ -188,7 +188,7 @@ InDetPerfPlot_Hits::initializePlots() { } void -InDetPerfPlot_Hits::fill(const xAOD::TrackParticle& track) { +InDetPerfPlot_Hits::fill(const xAOD::TrackParticle& track, float weight) { float eta = track.eta(); float phi = track.phi(); @@ -198,59 +198,59 @@ InDetPerfPlot_Hits::fill(const xAOD::TrackParticle& track) { uint8_t iInnerMostPixelShared(0), iPixelShared(0), iSCTShared(0); if (track.summaryValue(iInnerMostPixelHits, xAOD::numberOfInnermostPixelLayerHits)) { - fillHisto(m_nInnerMostPixelHits, iInnerMostPixelHits); - fillHisto(m_nInnerMostPixelHits_vs_eta, eta, iInnerMostPixelHits); - fillHisto(m_nInnerMostPixelHits_vs_phi, phi, iInnerMostPixelHits); + fillHisto(m_nInnerMostPixelHits, iInnerMostPixelHits, weight); + fillHisto(m_nInnerMostPixelHits_vs_eta, eta, iInnerMostPixelHits, weight); + fillHisto(m_nInnerMostPixelHits_vs_phi, phi, iInnerMostPixelHits, weight); } if (track.summaryValue(iNextToInnerMostPixelHits, xAOD::numberOfNextToInnermostPixelLayerHits)) { - fillHisto(m_nNextToInnerMostPixelHits, iNextToInnerMostPixelHits); - fillHisto(m_nNextToInnerMostPixelHits_vs_eta, eta, iNextToInnerMostPixelHits); - fillHisto(m_nNextToInnerMostPixelHits_vs_phi, phi, iNextToInnerMostPixelHits); + fillHisto(m_nNextToInnerMostPixelHits, iNextToInnerMostPixelHits, weight); + fillHisto(m_nNextToInnerMostPixelHits_vs_eta, eta, iNextToInnerMostPixelHits, weight); + fillHisto(m_nNextToInnerMostPixelHits_vs_phi, phi, iNextToInnerMostPixelHits, weight); } if (track.summaryValue(iPixHits, xAOD::numberOfPixelHits)) { - fillHisto(m_nPixelHits, iPixHits); - fillHisto(m_nPixelHits_vs_eta, eta, iPixHits); - fillHisto(m_nPixelHits_vs_phi, phi, iPixHits); + fillHisto(m_nPixelHits, iPixHits, weight); + fillHisto(m_nPixelHits_vs_eta, eta, iPixHits, weight); + fillHisto(m_nPixelHits_vs_phi, phi, iPixHits, weight); } if (track.summaryValue(iSctHits, xAOD::numberOfSCTHits)) { - fillHisto(m_nSCTHits, iSctHits); - fillHisto(m_nSCTHits_vs_eta, eta, iSctHits); - fillHisto(m_nSCTHits_vs_phi, phi, iSctHits); + fillHisto(m_nSCTHits, iSctHits, weight); + fillHisto(m_nSCTHits_vs_eta, eta, iSctHits, weight); + fillHisto(m_nSCTHits_vs_phi, phi, iSctHits, weight); } if (track.summaryValue(iTrtHits, xAOD::numberOfTRTHits)) { - fillHisto(m_nTRTHits, iTrtHits); - fillHisto(m_nTRTHits_vs_eta, eta, iTrtHits); - fillHisto(m_nTRTHits_vs_phi, phi, iTrtHits); + fillHisto(m_nTRTHits, iTrtHits, weight); + fillHisto(m_nTRTHits_vs_eta, eta, iTrtHits, weight); + fillHisto(m_nTRTHits_vs_phi, phi, iTrtHits, weight); } if (track.summaryValue(iPixHoles, xAOD::numberOfPixelHoles)) { - fillHisto(m_nPixelHoles, iPixHoles); - fillHisto(m_nPixelHoles_vs_eta, eta, iPixHoles); - fillHisto(m_nPixelHoles_vs_phi, phi, iPixHoles); + fillHisto(m_nPixelHoles, iPixHoles, weight); + fillHisto(m_nPixelHoles_vs_eta, eta, iPixHoles, weight); + fillHisto(m_nPixelHoles_vs_phi, phi, iPixHoles, weight); } if (track.summaryValue(iSCTHoles, xAOD::numberOfSCTHoles)) { - fillHisto(m_nSCTHoles, iSCTHoles); - fillHisto(m_nSCTHoles_vs_eta, eta, iSCTHoles); - fillHisto(m_nSCTHoles_vs_phi, phi, iSCTHoles); + fillHisto(m_nSCTHoles, iSCTHoles, weight); + fillHisto(m_nSCTHoles_vs_eta, eta, iSCTHoles, weight); + fillHisto(m_nSCTHoles_vs_phi, phi, iSCTHoles, weight); } if (track.summaryValue(iTrtHTHits, xAOD::numberOfTRTHighThresholdHits)) { - fillHisto(m_nTRTHighThresholdHits, iTrtHTHits); - fillHisto(m_nTRTHighThresholdHits_vs_eta, eta, iTrtHTHits); - fillHisto(m_nTRTHighThresholdHits_vs_phi, phi, iTrtHTHits); + fillHisto(m_nTRTHighThresholdHits, iTrtHTHits, weight); + fillHisto(m_nTRTHighThresholdHits_vs_eta, eta, iTrtHTHits, weight); + fillHisto(m_nTRTHighThresholdHits_vs_phi, phi, iTrtHTHits, weight); } if (track.summaryValue(iInnerMostPixelShared, xAOD::numberOfInnermostPixelLayerSharedHits)) { - fillHisto(m_nInnerMostPixelSharedHits, iInnerMostPixelShared); - fillHisto(m_nInnerMostPixelSharedHits_vs_eta, eta, iInnerMostPixelShared); - fillHisto(m_nInnerMostPixelSharedHits_vs_phi, phi, iInnerMostPixelShared); + fillHisto(m_nInnerMostPixelSharedHits, iInnerMostPixelShared, weight); + fillHisto(m_nInnerMostPixelSharedHits_vs_eta, eta, iInnerMostPixelShared, weight); + fillHisto(m_nInnerMostPixelSharedHits_vs_phi, phi, iInnerMostPixelShared, weight); } if (track.summaryValue(iPixelShared, xAOD::numberOfPixelSharedHits)) { - fillHisto(m_nPixelSharedHits, iPixelShared); - fillHisto(m_nPixelSharedHits_vs_eta, eta, iPixelShared); - fillHisto(m_nPixelSharedHits_vs_phi, phi, iPixelShared); + fillHisto(m_nPixelSharedHits, iPixelShared, weight); + fillHisto(m_nPixelSharedHits_vs_eta, eta, iPixelShared, weight); + fillHisto(m_nPixelSharedHits_vs_phi, phi, iPixelShared, weight); } if (track.summaryValue(iSCTShared, xAOD::numberOfSCTSharedHits)) { - fillHisto(m_nSCTSharedHits, iSCTShared); - fillHisto(m_nSCTSharedHits_vs_eta, eta, iSCTShared); - fillHisto(m_nSCTSharedHits_vs_phi, phi, iSCTShared); + fillHisto(m_nSCTSharedHits, iSCTShared, weight); + fillHisto(m_nSCTSharedHits_vs_eta, eta, iSCTShared, weight); + fillHisto(m_nSCTSharedHits_vs_phi, phi, iSCTShared, weight); } // expert plots @@ -263,79 +263,79 @@ InDetPerfPlot_Hits::fill(const xAOD::TrackParticle& track) { uint8_t iPixelDeadSensors(0), iSCTDeadSensors(0); if (track.summaryValue(iInnerMostPixelOutliers, xAOD::numberOfInnermostPixelLayerOutliers)) { - fillHisto(m_nInnerMostPixelOutliers, iInnerMostPixelOutliers); - fillHisto(m_nInnerMostPixelOutliers_vs_eta, eta, iInnerMostPixelOutliers); - fillHisto(m_nInnerMostPixelOutliers_vs_phi, phi, iInnerMostPixelOutliers); + fillHisto(m_nInnerMostPixelOutliers, iInnerMostPixelOutliers, weight); + fillHisto(m_nInnerMostPixelOutliers_vs_eta, eta, iInnerMostPixelOutliers, weight); + fillHisto(m_nInnerMostPixelOutliers_vs_phi, phi, iInnerMostPixelOutliers, weight); } if (track.summaryValue(iInnerMostPixelSplit, xAOD::numberOfInnermostPixelLayerSplitHits)) { - fillHisto(m_nInnerMostPixelSplitHits, iInnerMostPixelSplit); - fillHisto(m_nInnerMostPixelSplitHits_vs_eta, eta, iInnerMostPixelSplit); - fillHisto(m_nInnerMostPixelSplitHits_vs_phi, phi, iInnerMostPixelSplit); + fillHisto(m_nInnerMostPixelSplitHits, iInnerMostPixelSplit, weight); + fillHisto(m_nInnerMostPixelSplitHits_vs_eta, eta, iInnerMostPixelSplit, weight); + fillHisto(m_nInnerMostPixelSplitHits_vs_phi, phi, iInnerMostPixelSplit, weight); } if (track.summaryValue(iExpectedInnerMostPixelHits, xAOD::expectInnermostPixelLayerHit)) { - fillHisto(m_nExpectedInnerMostPixelHits, iExpectedInnerMostPixelHits); - fillHisto(m_nExpectedInnerMostPixelHits_vs_eta, eta, iExpectedInnerMostPixelHits); - fillHisto(m_nExpectedInnerMostPixelHits_vs_phi, phi, iExpectedInnerMostPixelHits); + fillHisto(m_nExpectedInnerMostPixelHits, iExpectedInnerMostPixelHits, weight); + fillHisto(m_nExpectedInnerMostPixelHits_vs_eta, eta, iExpectedInnerMostPixelHits, weight); + fillHisto(m_nExpectedInnerMostPixelHits_vs_phi, phi, iExpectedInnerMostPixelHits, weight); } if (track.summaryValue(iExpectedNextToInnerMostPixelHits, xAOD::expectNextToInnermostPixelLayerHit)) { - fillHisto(m_nExpectedNextToInnerMostPixelHits, iExpectedNextToInnerMostPixelHits); - fillHisto(m_nExpectedNextToInnerMostPixelHits_vs_eta, eta, iExpectedNextToInnerMostPixelHits); - fillHisto(m_nExpectedNextToInnerMostPixelHits_vs_phi, phi, iExpectedNextToInnerMostPixelHits); + fillHisto(m_nExpectedNextToInnerMostPixelHits, iExpectedNextToInnerMostPixelHits, weight); + fillHisto(m_nExpectedNextToInnerMostPixelHits_vs_eta, eta, iExpectedNextToInnerMostPixelHits, weight); + fillHisto(m_nExpectedNextToInnerMostPixelHits_vs_phi, phi, iExpectedNextToInnerMostPixelHits, weight); } if (track.summaryValue(iPixelOutliers, xAOD::numberOfPixelOutliers)) { - fillHisto(m_nPixelOutliers, iPixelOutliers); - fillHisto(m_nPixelOutliers_vs_eta, eta, iPixelOutliers); - fillHisto(m_nPixelOutliers_vs_phi, phi, iPixelOutliers); + fillHisto(m_nPixelOutliers, iPixelOutliers, weight); + fillHisto(m_nPixelOutliers_vs_eta, eta, iPixelOutliers, weight); + fillHisto(m_nPixelOutliers_vs_phi, phi, iPixelOutliers, weight); } if (track.summaryValue(iPixelContribLayers, xAOD::numberOfContribPixelLayers)) { - fillHisto(m_nPixelContribLayers, iPixelContribLayers); - fillHisto(m_nPixelContribLayers_vs_eta, eta, iPixelContribLayers); - fillHisto(m_nPixelContribLayers_vs_phi, phi, iPixelContribLayers); + fillHisto(m_nPixelContribLayers, iPixelContribLayers, weight); + fillHisto(m_nPixelContribLayers_vs_eta, eta, iPixelContribLayers, weight); + fillHisto(m_nPixelContribLayers_vs_phi, phi, iPixelContribLayers, weight); } if (track.summaryValue(iPixelSplit, xAOD::numberOfPixelSplitHits)) { - fillHisto(m_nPixelSplitHits, iPixelSplit); - fillHisto(m_nPixelSplitHits_vs_eta, eta, iPixelSplit); - fillHisto(m_nPixelSplitHits_vs_phi, phi, iPixelSplit); + fillHisto(m_nPixelSplitHits, iPixelSplit, weight); + fillHisto(m_nPixelSplitHits_vs_eta, eta, iPixelSplit, weight); + fillHisto(m_nPixelSplitHits_vs_phi, phi, iPixelSplit, weight); } if (track.summaryValue(iPixelGanged, xAOD::numberOfGangedPixels)) { - fillHisto(m_nPixelGangedHits, iPixelGanged); - fillHisto(m_nPixelGangedHits_vs_eta, eta, iPixelGanged); - fillHisto(m_nPixelGangedHits_vs_phi, phi, iPixelGanged); + fillHisto(m_nPixelGangedHits, iPixelGanged, weight); + fillHisto(m_nPixelGangedHits_vs_eta, eta, iPixelGanged, weight); + fillHisto(m_nPixelGangedHits_vs_phi, phi, iPixelGanged, weight); } if (track.summaryValue(iPixelGangedFakes, xAOD::numberOfGangedFlaggedFakes)) { - fillHisto(m_nPixelGangedHitsFlaggedFakes, iPixelGangedFakes); - fillHisto(m_nPixelGangedHitsFlaggedFakes_vs_eta, eta, iPixelGangedFakes); - fillHisto(m_nPixelGangedHitsFlaggedFakes_vs_phi, phi, iPixelGangedFakes); + fillHisto(m_nPixelGangedHitsFlaggedFakes, iPixelGangedFakes, weight); + fillHisto(m_nPixelGangedHitsFlaggedFakes_vs_eta, eta, iPixelGangedFakes, weight); + fillHisto(m_nPixelGangedHitsFlaggedFakes_vs_phi, phi, iPixelGangedFakes, weight); } if (track.summaryValue(iSCTOutliers, xAOD::numberOfSCTOutliers)) { - fillHisto(m_nSCTOutliers, iSCTOutliers); - fillHisto(m_nSCTOutliers_vs_eta, eta, iSCTOutliers); - fillHisto(m_nSCTOutliers_vs_phi, phi, iSCTOutliers); + fillHisto(m_nSCTOutliers, iSCTOutliers, weight); + fillHisto(m_nSCTOutliers_vs_eta, eta, iSCTOutliers, weight); + fillHisto(m_nSCTOutliers_vs_phi, phi, iSCTOutliers, weight); } if (track.summaryValue(iSCTDoubleHoles, xAOD::numberOfSCTDoubleHoles)) { - fillHisto(m_nSCTDoubleHoles, iSCTDoubleHoles); - fillHisto(m_nSCTDoubleHoles_vs_eta, eta, iSCTDoubleHoles); - fillHisto(m_nSCTDoubleHoles_vs_phi, phi, iSCTDoubleHoles); + fillHisto(m_nSCTDoubleHoles, iSCTDoubleHoles, weight); + fillHisto(m_nSCTDoubleHoles_vs_eta, eta, iSCTDoubleHoles, weight); + fillHisto(m_nSCTDoubleHoles_vs_phi, phi, iSCTDoubleHoles, weight); } if (track.summaryValue(iTRTOutliers, xAOD::numberOfTRTOutliers)) { - fillHisto(m_nTRTOutliers, iTRTOutliers); - fillHisto(m_nTRTOutliers_vs_eta, eta, iTRTOutliers); - fillHisto(m_nTRTOutliers_vs_phi, phi, iTRTOutliers); + fillHisto(m_nTRTOutliers, iTRTOutliers, weight); + fillHisto(m_nTRTOutliers_vs_eta, eta, iTRTOutliers, weight); + fillHisto(m_nTRTOutliers_vs_phi, phi, iTRTOutliers, weight); } if (track.summaryValue(iTRTHTOutliers, xAOD::numberOfTRTHighThresholdOutliers)) { - fillHisto(m_nTRTHighThresholdOutliers, iTRTHTOutliers); - fillHisto(m_nTRTHighThresholdOutliers_vs_eta, eta, iTRTHTOutliers); - fillHisto(m_nTRTHighThresholdOutliers_vs_phi, phi, iTRTHTOutliers); + fillHisto(m_nTRTHighThresholdOutliers, iTRTHTOutliers, weight); + fillHisto(m_nTRTHighThresholdOutliers_vs_eta, eta, iTRTHTOutliers, weight); + fillHisto(m_nTRTHighThresholdOutliers_vs_phi, phi, iTRTHTOutliers, weight); } if (track.summaryValue(iPixelDeadSensors, xAOD::numberOfPixelDeadSensors)) { - fillHisto(m_nPixelDeadSensors, iPixelDeadSensors); - fillHisto(m_nPixelDeadSensors_vs_eta, eta, iPixelDeadSensors); - fillHisto(m_nPixelDeadSensors_vs_phi, phi, iPixelDeadSensors); + fillHisto(m_nPixelDeadSensors, iPixelDeadSensors, weight); + fillHisto(m_nPixelDeadSensors_vs_eta, eta, iPixelDeadSensors, weight); + fillHisto(m_nPixelDeadSensors_vs_phi, phi, iPixelDeadSensors, weight); } if (track.summaryValue(iSCTDeadSensors, xAOD::numberOfSCTDeadSensors)) { - fillHisto(m_nSCTDeadSensors, iSCTDeadSensors); - fillHisto(m_nSCTDeadSensors_vs_eta, eta, iSCTDeadSensors); - fillHisto(m_nSCTDeadSensors_vs_phi, phi, iSCTDeadSensors); + fillHisto(m_nSCTDeadSensors, iSCTDeadSensors, weight); + fillHisto(m_nSCTDeadSensors_vs_eta, eta, iSCTDeadSensors, weight); + fillHisto(m_nSCTDeadSensors_vs_phi, phi, iSCTDeadSensors, weight); } } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Hits.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Hits.h index 374c0a394eefa2017c60d53f1e3f8b4dfe4f0c2d..8a48ae15605094f2f58f8c236a4e9d80c80fcb0a 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Hits.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Hits.h @@ -24,7 +24,7 @@ class InDetPerfPlot_Hits: public InDetPlotBase { public: InDetPerfPlot_Hits(InDetPlotBase* pParent, const std::string& dirName); - void fill(const xAOD::TrackParticle& track); + void fill(const xAOD::TrackParticle& track, float weight); private: // //1D diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TRTExtension.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TRTExtension.cxx index e937b48548853f0837919bc5d7a906a4788ca6d7..6e2ad9be75ae23be58b59fc9fff53e29f8eda775 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TRTExtension.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TRTExtension.cxx @@ -104,7 +104,7 @@ InDetPerfPlot_TRTExtension::initializePlots() { } void -InDetPerfPlot_TRTExtension::fill(const xAOD::TrackParticle& particle) { +InDetPerfPlot_TRTExtension::fill(const xAOD::TrackParticle& particle, float weight) { double eta = particle.eta(); double pt = particle.pt() / Gaudi::Units::GeV; @@ -118,16 +118,16 @@ InDetPerfPlot_TRTExtension::fill(const xAOD::TrackParticle& particle) { std::bitset<xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo> patternInfo = particle.patternRecoInfo(); bool isTRTExtension = patternInfo.test(xAOD::TrackPatternRecoInfo::InDetExtensionProcessor) or iTrtHits > 0; - fillHisto(m_fracTRTExtensions_vs_eta, eta, isTRTExtension); - fillHisto(m_fracTRTExtensions_vs_pt, pt, isTRTExtension); + fillHisto(m_fracTRTExtensions_vs_eta, eta, isTRTExtension, weight); + fillHisto(m_fracTRTExtensions_vs_pt, pt, isTRTExtension, weight); - if(isTRTExtension) fillHisto(m_chi2ndofTRTExtensions, chi2Overndof); - else { fillHisto(m_chi2ndofNoTRTExtensions, chi2Overndof); } + if(isTRTExtension) fillHisto(m_chi2ndofTRTExtensions, chi2Overndof, weight); + else { fillHisto(m_chi2ndofNoTRTExtensions, chi2Overndof, weight); } } void -InDetPerfPlot_TRTExtension::fill(const xAOD::TrackParticle& particle, const float mu, const unsigned int nvertices) { +InDetPerfPlot_TRTExtension::fill(const xAOD::TrackParticle& particle, const float mu, const unsigned int nvertices, float weight) { uint8_t iTrtHits = 0; particle.summaryValue(iTrtHits, xAOD::numberOfTRTHits); @@ -135,13 +135,13 @@ InDetPerfPlot_TRTExtension::fill(const xAOD::TrackParticle& particle, const floa std::bitset<xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo> patternInfo = particle.patternRecoInfo(); bool isTRTExtension = patternInfo.test(xAOD::TrackPatternRecoInfo::InDetExtensionProcessor) or iTrtHits > 0; - fillHisto(m_fracTRTExtensions_vs_mu, mu, isTRTExtension); - fillHisto(m_fracTRTExtensions_vs_nvertices, nvertices, isTRTExtension); + fillHisto(m_fracTRTExtensions_vs_mu, mu, isTRTExtension, weight); + fillHisto(m_fracTRTExtensions_vs_nvertices, nvertices, isTRTExtension, weight); } void -InDetPerfPlot_TRTExtension::fill(const xAOD::TrackParticle& particle, const xAOD::TruthParticle& truthParticle) { +InDetPerfPlot_TRTExtension::fill(const xAOD::TrackParticle& particle, const xAOD::TruthParticle& truthParticle, float weight) { //Fraction of extended for truth matched tracks @@ -174,21 +174,21 @@ InDetPerfPlot_TRTExtension::fill(const xAOD::TrackParticle& particle, const xAOD if(isTRTExtension){ - fillHisto(m_ptresTRTExtensions_vs_eta, eta, ptres); - fillHisto(m_ptresTRTExtensions_vs_pt, pt, ptres); + fillHisto(m_ptresTRTExtensions_vs_eta, eta, ptres, weight); + fillHisto(m_ptresTRTExtensions_vs_pt, pt, ptres, weight); - fillHisto(m_ptpullTRTExtensions_vs_eta, eta, ptpull); - fillHisto(m_ptpullTRTExtensions_vs_pt, pt, ptpull); + fillHisto(m_ptpullTRTExtensions_vs_eta, eta, ptpull, weight); + fillHisto(m_ptpullTRTExtensions_vs_pt, pt, ptpull, weight); } else { - fillHisto(m_ptresNoTRTExtensions_vs_eta, eta, ptres); - fillHisto(m_ptresNoTRTExtensions_vs_pt, pt, ptres); + fillHisto(m_ptresNoTRTExtensions_vs_eta, eta, ptres, weight); + fillHisto(m_ptresNoTRTExtensions_vs_pt, pt, ptres, weight); - fillHisto(m_ptpullNoTRTExtensions_vs_eta, eta, ptpull); - fillHisto(m_ptpullNoTRTExtensions_vs_pt, pt, ptpull); + fillHisto(m_ptpullNoTRTExtensions_vs_eta, eta, ptpull, weight); + fillHisto(m_ptpullNoTRTExtensions_vs_pt, pt, ptpull, weight); } - fillHisto(m_fracTRTExtensions_matched_vs_eta, eta, isTRTExtension); - fillHisto(m_fracTRTExtensions_matched_vs_pt, pt, isTRTExtension); + fillHisto(m_fracTRTExtensions_matched_vs_eta, eta, isTRTExtension, weight); + fillHisto(m_fracTRTExtensions_matched_vs_pt, pt, isTRTExtension, weight); } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TRTExtension.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TRTExtension.h index 2851f4a81a44a6aec813490d9577e9c26abc0486..cc828f750fe6cea3bdfb41ef6be944a3104199fb 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TRTExtension.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TRTExtension.h @@ -24,10 +24,10 @@ class InDetPerfPlot_TRTExtension: public InDetPlotBase { public: InDetPerfPlot_TRTExtension(InDetPlotBase* pParent, const std::string& dirName); - void fill(const xAOD::TrackParticle& particle); - void fill(const xAOD::TrackParticle& particle, const float mu, const unsigned int nVtx); + void fill(const xAOD::TrackParticle& particle, float weight); + void fill(const xAOD::TrackParticle& particle, const float mu, const unsigned int nVtx, float weight); - void fill(const xAOD::TrackParticle& particle, const xAOD::TruthParticle& truthie); + void fill(const xAOD::TrackParticle& particle, const xAOD::TruthParticle& truthie, float weight); private: diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrackParameters.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrackParameters.cxx index f1faa7363aef429aac86f90ad3d4548d5df04d0a..6a1e3cd4c1292f414fbe57a27281ab2a1be6c08d 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrackParameters.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrackParameters.cxx @@ -94,7 +94,7 @@ InDetPerfPlot_TrackParameters::initializePlots() { } void -InDetPerfPlot_TrackParameters::fill(const xAOD::TruthParticle& particle) { +InDetPerfPlot_TrackParameters::fill(const xAOD::TruthParticle& particle, float weight) { // quantities with xAOD::TruthParticle accessors: float eta = particle.eta(); @@ -109,26 +109,26 @@ InDetPerfPlot_TrackParameters::fill(const xAOD::TruthParticle& particle) { float prodR = (particle.isAvailable<float>("prodR")) ? particle.auxdata<float>("prodR") : -9999.; float prodZ = (particle.isAvailable<float>("prodZ")) ? particle.auxdata<float>("prodZ") : -9999.; - if(d0 > -9000.) fillHisto(m_truth_d0, d0); - if(z0 > -9000.) fillHisto(m_truth_z0, z0); - if(theta > -9000.) fillHisto(m_truth_theta, theta); - if(phi > -9000.) fillHisto(m_truth_phi, phi); - if(z0sin > -9000.) fillHisto(m_truth_z0sin, z0sin); - if(qOverP > -9000.) fillHisto(m_truth_qoverp, qOverP); - if(prodR > -9000.) fillHisto(m_truth_prodR, prodR); - if(prodZ > -9000.) fillHisto(m_truth_prodZ, prodZ); + if(d0 > -9000.) fillHisto(m_truth_d0, d0, weight); + if(z0 > -9000.) fillHisto(m_truth_z0, z0, weight); + if(theta > -9000.) fillHisto(m_truth_theta, theta, weight); + if(phi > -9000.) fillHisto(m_truth_phi, phi, weight); + if(z0sin > -9000.) fillHisto(m_truth_z0sin, z0sin, weight); + if(qOverP > -9000.) fillHisto(m_truth_qoverp, qOverP, weight); + if(prodR > -9000.) fillHisto(m_truth_prodR, prodR, weight); + if(prodZ > -9000.) fillHisto(m_truth_prodZ, prodZ, weight); - fillHisto(m_truth_eta, eta); - fillHisto(m_truth_pt, pt); - fillHisto(m_truth_lowpt, pt); + fillHisto(m_truth_eta, eta, weight); + fillHisto(m_truth_pt, pt, weight); + fillHisto(m_truth_lowpt, pt, weight); - fillHisto(m_truth_pt_vs_eta, pt, eta); - fillHisto(m_truth_phi_vs_eta, phi, eta); + fillHisto(m_truth_pt_vs_eta, pt, eta, weight); + fillHisto(m_truth_phi_vs_eta, phi, eta, weight); } void -InDetPerfPlot_TrackParameters::fill(const xAOD::TrackParticle& particle) { +InDetPerfPlot_TrackParameters::fill(const xAOD::TrackParticle& particle, float weight) { float pt = particle.pt() / Gaudi::Units::GeV; float eta = particle.eta(); @@ -139,30 +139,30 @@ InDetPerfPlot_TrackParameters::fill(const xAOD::TrackParticle& particle) { float chi2Overndof = ndof > 0 ? chi2 / ndof : 0; - fillHisto(m_reco_d0, particle.d0()); - fillHisto(m_reco_z0, particle.z0()); - fillHisto(m_reco_z0sin, particle.z0()* std::sin(particle.theta())); + fillHisto(m_reco_d0, particle.d0(), weight); + fillHisto(m_reco_z0, particle.z0(), weight); + fillHisto(m_reco_z0sin, particle.z0()* std::sin(particle.theta()), weight); - fillHisto(m_reco_phi, phi); - fillHisto(m_reco_theta, particle.theta()); - fillHisto(m_reco_eta, eta); - fillHisto(m_reco_qoverp, particle.qOverP()); - fillHisto(m_reco_pt, pt); - fillHisto(m_reco_lowpt, pt); + fillHisto(m_reco_phi, phi, weight); + fillHisto(m_reco_theta, particle.theta(), weight); + fillHisto(m_reco_eta, eta, weight); + fillHisto(m_reco_qoverp, particle.qOverP(), weight); + fillHisto(m_reco_pt, pt, weight); + fillHisto(m_reco_lowpt, pt, weight); - fillHisto(m_reco_pt_vs_eta, pt, eta); - fillHisto(m_reco_phi_vs_eta, phi, eta); + fillHisto(m_reco_pt_vs_eta, pt, eta, weight); + fillHisto(m_reco_phi_vs_eta, phi, eta, weight); - fillHisto(m_reco_d0_z0, particle.d0(), particle.z0()); - fillHisto(m_reco_d0_z0sin, particle.d0(), particle.z0()*std::sin(particle.theta())); + fillHisto(m_reco_d0_z0, particle.d0(), particle.z0(), weight); + fillHisto(m_reco_d0_z0sin, particle.d0(), particle.z0()*std::sin(particle.theta()), weight); - fillHisto(m_reco_chi2, chi2); - fillHisto(m_reco_ndof, ndof); - fillHisto(m_reco_chi2Overndof, chi2Overndof); + fillHisto(m_reco_chi2, chi2, weight); + fillHisto(m_reco_ndof, ndof, weight); + fillHisto(m_reco_chi2Overndof, chi2Overndof, weight); std::bitset<xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo> patternInfo = particle.patternRecoInfo(); for(unsigned int i = 0; i < xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo; i++){ - if(patternInfo.test(i)) fillHisto(m_reco_author, i); + if(patternInfo.test(i)) fillHisto(m_reco_author, i, weight); } } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrackParameters.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrackParameters.h index 126192b1ebc7d3d5ae85e6cc92ceb1f081c4886f..1781b4dec14323155c8974462e1f0b28b5278a86 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrackParameters.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrackParameters.h @@ -23,8 +23,8 @@ class InDetPerfPlot_TrackParameters: public InDetPlotBase { public: InDetPerfPlot_TrackParameters(InDetPlotBase* pParent, const std::string& dirName); - void fill(const xAOD::TrackParticle& particle); - void fill(const xAOD::TruthParticle& particle); + void fill(const xAOD::TrackParticle& particle, float weight); + void fill(const xAOD::TruthParticle& particle, float weight); private: TH1* m_reco_d0; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrkInJet.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrkInJet.cxx index 22fc13f0e0462fa19f3143b194c9351508d5621d..3d834506d604e171c7c4e036f620aa2f839fda05 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrkInJet.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrkInJet.cxx @@ -134,35 +134,35 @@ InDetPerfPlot_TrkInJet::initializePlots() { void -InDetPerfPlot_TrkInJet::fill(const xAOD::TrackParticle& trk, const xAOD::Jet& jet) { +InDetPerfPlot_TrkInJet::fill(const xAOD::TrackParticle& trk, const xAOD::Jet& jet, float weight) { float dR = jet.p4().DeltaR(trk.p4()); uint8_t iInnerMostPixelHits(0), iNextToInnerMostPixelHits(0), iPixHits(0), iSctHits(0), iTrtHits(0); uint8_t iPixHoles(0), iSCTHoles(0), iTrtHTHits(0); if (trk.summaryValue(iInnerMostPixelHits, xAOD::numberOfInnermostPixelLayerHits)) { - fillHisto(m_nInnerMostPixelHits_vs_dR, dR, iInnerMostPixelHits); + fillHisto(m_nInnerMostPixelHits_vs_dR, dR, iInnerMostPixelHits,weight); } if (trk.summaryValue(iNextToInnerMostPixelHits, xAOD::numberOfNextToInnermostPixelLayerHits)) { - fillHisto(m_nNextToInnerMostPixelHits_vs_dR, dR, iNextToInnerMostPixelHits); + fillHisto(m_nNextToInnerMostPixelHits_vs_dR, dR, iNextToInnerMostPixelHits,weight); } if (trk.summaryValue(iPixHits, xAOD::numberOfPixelHits)) { - fillHisto(m_nPixelHits_vs_dR, dR, iPixHits); + fillHisto(m_nPixelHits_vs_dR, dR, iPixHits,weight); } if (trk.summaryValue(iSctHits, xAOD::numberOfSCTHits)) { - fillHisto(m_nSCTHits_vs_dR, dR, iSctHits); + fillHisto(m_nSCTHits_vs_dR, dR, iSctHits,weight); } if (trk.summaryValue(iTrtHits, xAOD::numberOfTRTHits)) { - fillHisto(m_nTRTHits_vs_dR, dR, iTrtHits); + fillHisto(m_nTRTHits_vs_dR, dR, iTrtHits,weight); } if (trk.summaryValue(iPixHoles, xAOD::numberOfPixelHoles)) { - fillHisto(m_nPixelHoles_vs_dR, dR, iPixHoles); + fillHisto(m_nPixelHoles_vs_dR, dR, iPixHoles,weight); } if (trk.summaryValue(iSCTHoles, xAOD::numberOfSCTHoles)) { - fillHisto(m_nSCTHoles_vs_dR, dR, iSCTHoles); + fillHisto(m_nSCTHoles_vs_dR, dR, iSCTHoles,weight); } if (trk.summaryValue(iTrtHTHits, xAOD::numberOfTRTHighThresholdHits)) { - fillHisto(m_nTRTHighThresholdHits_vs_dR, dR, iTrtHTHits); + fillHisto(m_nTRTHighThresholdHits_vs_dR, dR, iTrtHTHits,weight); } // expert plots if (m_iDetailLevel >= 100) { @@ -174,58 +174,58 @@ InDetPerfPlot_TrkInJet::fill(const xAOD::TrackParticle& trk, const xAOD::Jet& je uint8_t iPixelDeadSensors(0), iSCTDeadSensors(0); if (trk.summaryValue(iInnerMostPixelOutliers, xAOD::numberOfInnermostPixelLayerOutliers)) { - fillHisto(m_nInnerMostPixelOutliers_vs_dR, dR, iInnerMostPixelOutliers); + fillHisto(m_nInnerMostPixelOutliers_vs_dR, dR, iInnerMostPixelOutliers,weight); } if (trk.summaryValue(iInnerMostPixelShared, xAOD::numberOfInnermostPixelLayerSharedHits)) { - fillHisto(m_nInnerMostPixelSharedHits_vs_dR, dR, iInnerMostPixelShared); + fillHisto(m_nInnerMostPixelSharedHits_vs_dR, dR, iInnerMostPixelShared,weight); } if (trk.summaryValue(iInnerMostPixelSplit, xAOD::numberOfInnermostPixelLayerSplitHits)) { - fillHisto(m_nInnerMostPixelSplitHits_vs_dR, dR, iInnerMostPixelSplit); + fillHisto(m_nInnerMostPixelSplitHits_vs_dR, dR, iInnerMostPixelSplit,weight); } if (trk.summaryValue(iExpectedInnerMostPixelHits, xAOD::expectInnermostPixelLayerHit)) { - fillHisto(m_nExpectedInnerMostPixelHits_vs_dR, dR, iExpectedInnerMostPixelHits); + fillHisto(m_nExpectedInnerMostPixelHits_vs_dR, dR, iExpectedInnerMostPixelHits,weight); } if (trk.summaryValue(iExpectedNextToInnerMostPixelHits, xAOD::expectNextToInnermostPixelLayerHit)) { - fillHisto(m_nExpectedNextToInnerMostPixelHits_vs_dR, dR, iExpectedNextToInnerMostPixelHits); + fillHisto(m_nExpectedNextToInnerMostPixelHits_vs_dR, dR, iExpectedNextToInnerMostPixelHits,weight); } if (trk.summaryValue(iPixelOutliers, xAOD::numberOfPixelOutliers)) { - fillHisto(m_nPixelOutliers_vs_dR, dR, iPixelOutliers); + fillHisto(m_nPixelOutliers_vs_dR, dR, iPixelOutliers, weight); } if (trk.summaryValue(iPixelContribLayers, xAOD::numberOfContribPixelLayers)) { - fillHisto(m_nPixelContribLayers_vs_dR, dR, iPixelContribLayers); + fillHisto(m_nPixelContribLayers_vs_dR, dR, iPixelContribLayers,weight); } if (trk.summaryValue(iPixelShared, xAOD::numberOfPixelSharedHits)) { - fillHisto(m_nPixelSharedHits_vs_dR, dR, iPixelShared); + fillHisto(m_nPixelSharedHits_vs_dR, dR, iPixelShared,weight); } if (trk.summaryValue(iPixelSplit, xAOD::numberOfPixelSplitHits)) { - fillHisto(m_nPixelSplitHits_vs_dR, dR, iPixelSplit); + fillHisto(m_nPixelSplitHits_vs_dR, dR, iPixelSplit,weight); } if (trk.summaryValue(iPixelGanged, xAOD::numberOfGangedPixels)) { - fillHisto(m_nPixelGangedHits_vs_dR, dR, iPixelGanged); + fillHisto(m_nPixelGangedHits_vs_dR, dR, iPixelGanged, weight); } if (trk.summaryValue(iPixelGangedFakes, xAOD::numberOfGangedFlaggedFakes)) { - fillHisto(m_nPixelGangedHitsFlaggedFakes_vs_dR, dR, iPixelGangedFakes); + fillHisto(m_nPixelGangedHitsFlaggedFakes_vs_dR, dR, iPixelGangedFakes, weight); } if (trk.summaryValue(iSCTOutliers, xAOD::numberOfSCTOutliers)) { - fillHisto(m_nSCTOutliers_vs_dR, dR, iSCTOutliers); + fillHisto(m_nSCTOutliers_vs_dR, dR, iSCTOutliers,weight); } if (trk.summaryValue(iSCTDoubleHoles, xAOD::numberOfSCTDoubleHoles)) { - fillHisto(m_nSCTDoubleHoles_vs_dR, dR, iSCTDoubleHoles); + fillHisto(m_nSCTDoubleHoles_vs_dR, dR, iSCTDoubleHoles,weight); } if (trk.summaryValue(iSCTShared, xAOD::numberOfSCTSharedHits)) { - fillHisto(m_nSCTSharedHits_vs_dR, dR, iSCTShared); + fillHisto(m_nSCTSharedHits_vs_dR, dR, iSCTShared,weight); } if (trk.summaryValue(iTRTOutliers, xAOD::numberOfTRTOutliers)) { - fillHisto(m_nTRTOutliers_vs_dR, dR, iTRTOutliers); + fillHisto(m_nTRTOutliers_vs_dR, dR, iTRTOutliers,weight); } if (trk.summaryValue(iTRTHTOutliers, xAOD::numberOfTRTHighThresholdOutliers)) { - fillHisto(m_nTRTHighThresholdOutliers_vs_dR, dR, iTRTHTOutliers); + fillHisto(m_nTRTHighThresholdOutliers_vs_dR, dR, iTRTHTOutliers,weight); } if (trk.summaryValue(iPixelDeadSensors, xAOD::numberOfPixelDeadSensors)) { - fillHisto(m_nPixelDeadSensors_vs_dR, dR, iPixelDeadSensors); + fillHisto(m_nPixelDeadSensors_vs_dR, dR, iPixelDeadSensors,weight); } if (trk.summaryValue(iSCTDeadSensors, xAOD::numberOfSCTDeadSensors)) { - fillHisto(m_nSCTDeadSensors_vs_dR, dR, iSCTDeadSensors); + fillHisto(m_nSCTDeadSensors_vs_dR, dR, iSCTDeadSensors,weight); } } @@ -240,36 +240,36 @@ InDetPerfPlot_TrkInJet::fill(const xAOD::TrackParticle& trk, const xAOD::Jet& je float chi2Overndof = ndof > 0 ? chi2 / ndof : 0; - fillHisto(m_reco_d0_vs_dR, dR, trk.d0()); - fillHisto(m_reco_z0_vs_dR, dR, trk.z0()); - fillHisto(m_reco_z0sin_vs_dR, dR, trk.z0()* trk.theta()); - fillHisto(m_reco_phi_vs_dR, dR, phi); - fillHisto(m_reco_theta_vs_dR, dR, trk.theta()); - fillHisto(m_reco_eta_vs_dR, dR, eta); - fillHisto(m_reco_pt_vs_dR, dR, pt); - fillHisto(m_reco_lowpt_vs_dR, dR, pt); - fillHisto(m_reco_chi2Overndof_vs_dR, dR, chi2Overndof); + fillHisto(m_reco_d0_vs_dR, dR, trk.d0(),weight); + fillHisto(m_reco_z0_vs_dR, dR, trk.z0(),weight); + fillHisto(m_reco_z0sin_vs_dR, dR, trk.z0()* trk.theta(),weight); + fillHisto(m_reco_phi_vs_dR, dR, phi,weight); + fillHisto(m_reco_theta_vs_dR, dR, trk.theta(),weight); + fillHisto(m_reco_eta_vs_dR, dR, eta,weight); + fillHisto(m_reco_pt_vs_dR, dR, pt,weight); + fillHisto(m_reco_lowpt_vs_dR, dR, pt,weight); + fillHisto(m_reco_chi2Overndof_vs_dR, dR, chi2Overndof,weight); } void -InDetPerfPlot_TrkInJet::fillEfficiency(const xAOD::TruthParticle& truth, const xAOD::Jet& jet, const bool isGood) { +InDetPerfPlot_TrkInJet::fillEfficiency(const xAOD::TruthParticle& truth, const xAOD::Jet& jet, const bool isGood, float weight) { if (!m_doFakeAndEff) return; float dR = jet.p4().DeltaR(truth.p4()); float jetpT = jet.pt() / Gaudi::Units::GeV; - fillHisto(m_efficiency_vs_dR, dR, isGood); - fillHisto(m_efficiency_vs_smalldR, dR, isGood); - fillHisto(m_efficiency_vs_jetpT, jetpT, isGood); + fillHisto(m_efficiency_vs_dR, dR, isGood, weight); + fillHisto(m_efficiency_vs_smalldR, dR, isGood, weight); + fillHisto(m_efficiency_vs_jetpT, jetpT, isGood, weight); } void -InDetPerfPlot_TrkInJet::fillFakeRate(const xAOD::TrackParticle& trk, const xAOD::Jet& jet, const bool isFake) { +InDetPerfPlot_TrkInJet::fillFakeRate(const xAOD::TrackParticle& trk, const xAOD::Jet& jet, const bool isFake, float weight) { if (!m_doFakeAndEff) return; float dR = jet.p4().DeltaR(trk.p4()); float jetpT = jet.pt() / Gaudi::Units::GeV; - fillHisto(m_fakerate_vs_dR, dR, isFake); - fillHisto(m_fakerate_vs_smalldR, dR, isFake); - fillHisto(m_fakerate_vs_jetpT, jetpT, isFake); + fillHisto(m_fakerate_vs_dR, dR, isFake, weight); + fillHisto(m_fakerate_vs_smalldR, dR, isFake, weight); + fillHisto(m_fakerate_vs_jetpT, jetpT, isFake, weight); } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrkInJet.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrkInJet.h index c509b8a391709f063dc21f7dee24a62ee4f00124..9f86ed1d4439c9be823c954efeccf7c528cc6916 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrkInJet.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrkInJet.h @@ -15,10 +15,10 @@ class InDetPerfPlot_TrkInJet: public InDetPlotBase { public: InDetPerfPlot_TrkInJet(InDetPlotBase* pParent, std::string sDir, bool bookFakeAndEff=true); - void fill(const xAOD::TrackParticle& trk, const xAOD::Jet& jet); + void fill(const xAOD::TrackParticle& trk, const xAOD::Jet& jet,float weight=1.0); - void fillEfficiency(const xAOD::TruthParticle& trk, const xAOD::Jet& jet, const bool isEfficient); - void fillFakeRate(const xAOD::TrackParticle& trk, const xAOD::Jet& jet, const bool isFake); + void fillEfficiency(const xAOD::TruthParticle& trk, const xAOD::Jet& jet, const bool isEfficient, float weight); + void fillFakeRate(const xAOD::TrackParticle& trk, const xAOD::Jet& jet, const bool isFake, float weight); private: diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Vertex.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Vertex.cxx index 2fe81931ffbf252b376c776bb21cadf771c3cf4b..d7296e46f50905a9f0d1234435e3e2603c12ce47 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Vertex.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Vertex.cxx @@ -65,33 +65,33 @@ InDetPerfPlot_Vertex::initializePlots() { } void -InDetPerfPlot_Vertex::fill(const xAOD::Vertex& vertex) { +InDetPerfPlot_Vertex::fill(const xAOD::Vertex& vertex, float weight) { // fill position plots - fillHisto(m_vx_x, vertex.x()); - fillHisto(m_vx_y, vertex.y()); - fillHisto(m_vx_z, vertex.z()); + fillHisto(m_vx_x, vertex.x(), weight); + fillHisto(m_vx_y, vertex.y(), weight); + fillHisto(m_vx_z, vertex.z(), weight); // fill error plots const AmgSymMatrix(3)& covariance = vertex.covariancePosition(); - fillHisto(m_vx_err_x, Amg::error(covariance, 0)); - fillHisto(m_vx_err_y, Amg::error(covariance, 1)); - fillHisto(m_vx_err_z, Amg::error(covariance, 2)); + fillHisto(m_vx_err_x, Amg::error(covariance, 0), weight); + fillHisto(m_vx_err_y, Amg::error(covariance, 1), weight); + fillHisto(m_vx_err_z, Amg::error(covariance, 2), weight); // fill vertex quality and type - fillHisto(m_vx_type, vertex.vertexType()); + fillHisto(m_vx_type, vertex.vertexType(), weight); float ndf = vertex.numberDoF(); if (ndf != 0) { - fillHisto(m_vx_chi2_over_ndf, vertex.chiSquared() / ndf); + fillHisto(m_vx_chi2_over_ndf, vertex.chiSquared() / ndf, weight); } else { - fillHisto(m_vx_chi2_over_ndf, -1); + fillHisto(m_vx_chi2_over_ndf, -1, weight); } // fill vertex tracks properties int nTracks = vertex.nTrackParticles(); - fillHisto(m_vx_nTracks, nTracks); - for (const float& weight : vertex.trackWeights()) { - fillHisto(m_vx_track_weights, weight); + fillHisto(m_vx_nTracks, nTracks, weight); + for (const float& trackWeight : vertex.trackWeights()) { + fillHisto(m_vx_track_weights, trackWeight, weight); } // fill expert plots: tracks properties at vertex @@ -99,24 +99,24 @@ InDetPerfPlot_Vertex::fill(const xAOD::Vertex& vertex) { // loop over tracks at vertex for (const auto& elTrk : vertex.trackParticleLinks()) { const xAOD::TrackParticle* trk = *elTrk; - fillHisto(m_vx_track_pt, trk->pt() / Gaudi::Units::GeV); // MeV -> GeV - fillHisto(m_vx_track_eta, trk->eta()); + fillHisto(m_vx_track_pt, trk->pt() / Gaudi::Units::GeV, weight); // MeV -> GeV + fillHisto(m_vx_track_eta, trk->eta(), weight); const xAOD::ParametersCovMatrix_t covTrk = trk->definingParametersCovMatrix(); - fillHisto(m_vx_track_d0, trk->d0()); - fillHisto(m_vx_track_err_d0, Amg::error(covTrk, 0)); - fillHisto(m_vx_track_z0, trk->z0() - vertex.z()); - fillHisto(m_vx_track_err_z0, Amg::error(covTrk, 1)); + fillHisto(m_vx_track_d0, trk->d0(), weight); + fillHisto(m_vx_track_err_d0, Amg::error(covTrk, 0), weight); + fillHisto(m_vx_track_z0, trk->z0() - vertex.z(), weight); + fillHisto(m_vx_track_err_z0, Amg::error(covTrk, 1), weight); bool successfulRetrieval(false); uint8_t iPixHits, iSctHits, iPixHoles, iSctHoles; successfulRetrieval = trk->summaryValue(iPixHits, xAOD::numberOfPixelHits); successfulRetrieval &= trk->summaryValue(iSctHits, xAOD::numberOfSCTHits); if (successfulRetrieval) { - fillHisto(m_vx_track_nSiHits, iPixHits + iSctHits); + fillHisto(m_vx_track_nSiHits, iPixHits + iSctHits, weight); } successfulRetrieval = trk->summaryValue(iPixHoles, xAOD::numberOfPixelHoles); successfulRetrieval &= trk->summaryValue(iSctHoles, xAOD::numberOfSCTHoles); if (successfulRetrieval) { - fillHisto(m_vx_track_nSiHoles, iPixHoles + iSctHoles); + fillHisto(m_vx_track_nSiHoles, iPixHoles + iSctHoles, weight); } } } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Vertex.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Vertex.h index 92270befe6fc308cfbb9a0d3d1467de53513145f..a8cea14668600fc5bc2bfe6e8f767b419c9fcc85 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Vertex.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Vertex.h @@ -24,7 +24,7 @@ class TH1; class InDetPerfPlot_Vertex: public InDetPlotBase { public: InDetPerfPlot_Vertex(InDetPlotBase* pParent, const std::string& dirName); - void fill(const xAOD::Vertex& vertex); + void fill(const xAOD::Vertex& vertex, float weight); private: ///@name Position of vertex ///@{ diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_VertexTruthMatching.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_VertexTruthMatching.cxx index b0a4d3b19efd62260d48882561c980ed8b4bf7ff..b1f23133f5af4b179b0264f6202b9bddc2b98825 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_VertexTruthMatching.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_VertexTruthMatching.cxx @@ -316,14 +316,14 @@ const xAOD::TruthVertex* InDetPerfPlot_VertexTruthMatching::getTruthVertex(const return truthVtx; } -void InDetPerfPlot_VertexTruthMatching::fill(const xAOD::Vertex& vertex, const xAOD::TruthVertex * tvrt) { - +void InDetPerfPlot_VertexTruthMatching::fill(const xAOD::Vertex& vertex, const xAOD::TruthVertex * tvrt, float weight) { + // not sure how to deal with this type of histogram if(tvrt){ float diff_z=vertex.z()-tvrt->z(); const AmgSymMatrix(3)& covariance = vertex.covariancePosition(); float err_z = fabs(Amg::error(covariance, 2)) > 1e-7 ? Amg::error(covariance, 2) : 1000.; - fillHisto(m_vx_z_diff,diff_z); - fillHisto(m_vx_z_diff_pull,diff_z/err_z); + fillHisto(m_vx_z_diff,diff_z, weight); + fillHisto(m_vx_z_diff_pull,diff_z/err_z, weight); } // Get the match type info for each vertex: @@ -333,7 +333,7 @@ void InDetPerfPlot_VertexTruthMatching::fill(const xAOD::Vertex& vertex, const x try { matchType = recoVtxMatchTypeInfo(vertex); ATH_MSG_DEBUG("VERTEX DECORATOR ======= " << matchType << ", with nTRACKS === " << vertex.nTrackParticles() << ", vertex index = " << vertex.index() << " AT (x, y, z) = (" << vertex.x() << ", " << vertex.y() << ", " << vertex.z() << ")"); - fillHisto(m_vx_type_truth, matchType); + fillHisto(m_vx_type_truth, matchType, weight); } catch (SG::ExcBadAuxVar &) { ATH_MSG_WARNING("VertexMatchType DECORATOR seems to be available, but may be broken ==========="); @@ -345,7 +345,7 @@ void InDetPerfPlot_VertexTruthMatching::fill(const xAOD::Vertex& vertex, const x } // void InDetPerfPlot_VertexTruthMatching::fill(const xAOD::Vertex& vertex) { -void InDetPerfPlot_VertexTruthMatching::fill(const xAOD::VertexContainer& vertexContainer, const std::vector<const xAOD::TruthVertex*>& truthHSVertices, const std::vector<const xAOD::TruthVertex*>& truthPUVertices) { +void InDetPerfPlot_VertexTruthMatching::fill(const xAOD::VertexContainer& vertexContainer, const std::vector<const xAOD::TruthVertex*>& truthHSVertices, const std::vector<const xAOD::TruthVertex*>& truthPUVertices, float weight) { if (m_iDetailLevel >= 200) { @@ -353,7 +353,7 @@ void InDetPerfPlot_VertexTruthMatching::fill(const xAOD::VertexContainer& vertex // Inclusive: int nTruthVertices = (int)(truthHSVertices.size() + truthPUVertices.size()); int nRecoVertices = (int)vertexContainer.size(); - fillHisto(m_vx_nReco_vs_nTruth_inclusive, nTruthVertices, nRecoVertices); + fillHisto(m_vx_nReco_vs_nTruth_inclusive, nTruthVertices, nRecoVertices, weight); // Let's also plot the vertices by vertex match type: const static xAOD::Vertex::Decorator<InDetVertexTruthMatchUtils::VertexMatchType> recoVtxMatchTypeInfo("VertexMatchType"); @@ -383,7 +383,7 @@ void InDetPerfPlot_VertexTruthMatching::fill(const xAOD::VertexContainer& vertex return; } localPUDensity = getLocalPUDensity(truthVtx, truthHSVertices, truthPUVertices); - fillHisto(m_vx_hs_sel_eff, localPUDensity, (bestRecoHSVtx_sumpt2 == bestRecoHSVtx_truth)); + fillHisto(m_vx_hs_sel_eff, localPUDensity, (bestRecoHSVtx_sumpt2 == bestRecoHSVtx_truth), weight); // Did we successfully reconstruct our truth HS vertex? bool truthHSVtxRecoed = false; @@ -443,29 +443,29 @@ void InDetPerfPlot_VertexTruthMatching::fill(const xAOD::VertexContainer& vertex float vtxerr_z = fabs(Amg::error(covariance, 2)) > 1e-7 ? Amg::error(covariance, 2) : 1000.; localPUDensity = getLocalPUDensity(matchVertex, truthHSVertices, truthPUVertices); - fillHisto(m_vx_all_z_pull, residual_z/vtxerr_z); - fillHisto(m_vx_all_y_pull, residual_y/vtxerr_y); - fillHisto(m_vx_all_x_pull, residual_x/vtxerr_x); + fillHisto(m_vx_all_z_pull, residual_z/vtxerr_z, weight); + fillHisto(m_vx_all_y_pull, residual_y/vtxerr_y, weight); + fillHisto(m_vx_all_x_pull, residual_x/vtxerr_x, weight); - fillHisto(m_vx_all_truth_z_res_vs_PU, localPUDensity, residual_z); - fillHisto(m_vx_all_truth_x_res_vs_PU, localPUDensity, residual_x); - fillHisto(m_vx_all_truth_y_res_vs_PU, localPUDensity, residual_y); + fillHisto(m_vx_all_truth_z_res_vs_PU, localPUDensity, residual_z, weight); + fillHisto(m_vx_all_truth_x_res_vs_PU, localPUDensity, residual_x, weight); + fillHisto(m_vx_all_truth_y_res_vs_PU, localPUDensity, residual_y, weight); - fillHisto(m_vx_all_z_res, residual_z); - fillHisto(m_vx_all_y_res, residual_y); - fillHisto(m_vx_all_x_res, residual_x); + fillHisto(m_vx_all_z_res, residual_z, weight); + fillHisto(m_vx_all_y_res, residual_y, weight); + fillHisto(m_vx_all_x_res, residual_x, weight); - fillHisto(m_vx_all_truth_z_pull_vs_PU, localPUDensity, residual_z/vtxerr_z); - fillHisto(m_vx_all_truth_x_pull_vs_PU, localPUDensity, residual_x/vtxerr_y); - fillHisto(m_vx_all_truth_y_pull_vs_PU, localPUDensity, residual_y/vtxerr_x); + fillHisto(m_vx_all_truth_z_pull_vs_PU, localPUDensity, residual_z/vtxerr_z, weight); + fillHisto(m_vx_all_truth_x_pull_vs_PU, localPUDensity, residual_x/vtxerr_y, weight); + fillHisto(m_vx_all_truth_y_pull_vs_PU, localPUDensity, residual_y/vtxerr_x, weight); - fillHisto(m_vx_all_truth_z_res_vs_nTrk, vertex->nTrackParticles(), residual_z); - fillHisto(m_vx_all_truth_x_res_vs_nTrk, vertex->nTrackParticles(), residual_x); - fillHisto(m_vx_all_truth_y_res_vs_nTrk, vertex->nTrackParticles(), residual_y); + fillHisto(m_vx_all_truth_z_res_vs_nTrk, vertex->nTrackParticles(), residual_z, weight); + fillHisto(m_vx_all_truth_x_res_vs_nTrk, vertex->nTrackParticles(), residual_x, weight); + fillHisto(m_vx_all_truth_y_res_vs_nTrk, vertex->nTrackParticles(), residual_y, weight); - fillHisto(m_vx_all_truth_z_pull_vs_nTrk, vertex->nTrackParticles(), residual_z/vtxerr_z); - fillHisto(m_vx_all_truth_x_pull_vs_nTrk, vertex->nTrackParticles(), residual_x/vtxerr_y); - fillHisto(m_vx_all_truth_y_pull_vs_nTrk, vertex->nTrackParticles(), residual_y/vtxerr_x); + fillHisto(m_vx_all_truth_z_pull_vs_nTrk, vertex->nTrackParticles(), residual_z/vtxerr_z, weight); + fillHisto(m_vx_all_truth_x_pull_vs_nTrk, vertex->nTrackParticles(), residual_x/vtxerr_y, weight); + fillHisto(m_vx_all_truth_y_pull_vs_nTrk, vertex->nTrackParticles(), residual_y/vtxerr_x, weight); } // end loop over vertices @@ -478,75 +478,75 @@ void InDetPerfPlot_VertexTruthMatching::fill(const xAOD::VertexContainer& vertex float residual_r = std::sqrt(std::pow(truthHSVtx->x() - bestRecoHSVtx_truth->x(), 2) + std::pow(truthHSVtx->y() - bestRecoHSVtx_truth->y(), 2)); float residual_x = truthHSVtx->x() - bestRecoHSVtx_truth->x(); float residual_y = truthHSVtx->y() - bestRecoHSVtx_truth->y(); - fillHisto(m_vx_hs_reco_eff, localPUDensity, 1); - fillHisto(m_vx_hs_reco_long_reso, localPUDensity, getRecoLongitudinalReso(bestRecoHSVtx_truth)); - fillHisto(m_vx_hs_reco_trans_reso, localPUDensity, getRecoTransverseReso(bestRecoHSVtx_truth)); - fillHisto(m_vx_hs_truth_long_reso_vs_PU, localPUDensity, residual_z); - fillHisto(m_vx_hs_truth_trans_reso_vs_PU, localPUDensity, residual_r); + fillHisto(m_vx_hs_reco_eff, localPUDensity, 1, weight); + fillHisto(m_vx_hs_reco_long_reso, localPUDensity, getRecoLongitudinalReso(bestRecoHSVtx_truth), weight); + fillHisto(m_vx_hs_reco_trans_reso, localPUDensity, getRecoTransverseReso(bestRecoHSVtx_truth), weight); + fillHisto(m_vx_hs_truth_long_reso_vs_PU, localPUDensity, residual_z, weight); + fillHisto(m_vx_hs_truth_trans_reso_vs_PU, localPUDensity, residual_r, weight); const AmgSymMatrix(3)& covariance = bestRecoHSVtx_truth->covariancePosition(); float vtxerr_x = Amg::error(covariance, 0); float vtxerr_y = Amg::error(covariance, 1); float vtxerr_z = Amg::error(covariance, 2); - if(fabs(vtxerr_z) > 1e-7) fillHisto(m_vx_hs_z_pull, residual_z/vtxerr_z); - if(fabs(vtxerr_y) > 1e-7) fillHisto(m_vx_hs_y_pull, residual_y/vtxerr_y); - if(fabs(vtxerr_x) > 1e-7) fillHisto(m_vx_hs_x_pull, residual_x/vtxerr_x); + if(fabs(vtxerr_z) > 1e-7) fillHisto(m_vx_hs_z_pull, residual_z/vtxerr_z, weight); + if(fabs(vtxerr_y) > 1e-7) fillHisto(m_vx_hs_y_pull, residual_y/vtxerr_y, weight); + if(fabs(vtxerr_x) > 1e-7) fillHisto(m_vx_hs_x_pull, residual_x/vtxerr_x, weight); - fillHisto(m_vx_hs_truth_z_res_vs_PU, localPUDensity, residual_z); - fillHisto(m_vx_hs_truth_x_res_vs_PU, localPUDensity, residual_x); - fillHisto(m_vx_hs_truth_y_res_vs_PU, localPUDensity, residual_y); + fillHisto(m_vx_hs_truth_z_res_vs_PU, localPUDensity, residual_z, weight); + fillHisto(m_vx_hs_truth_x_res_vs_PU, localPUDensity, residual_x, weight); + fillHisto(m_vx_hs_truth_y_res_vs_PU, localPUDensity, residual_y, weight); - fillHisto(m_vx_hs_z_res, residual_z); - fillHisto(m_vx_hs_y_res, residual_y); - fillHisto(m_vx_hs_x_res, residual_x); + fillHisto(m_vx_hs_z_res, residual_z, weight); + fillHisto(m_vx_hs_y_res, residual_y, weight); + fillHisto(m_vx_hs_x_res, residual_x, weight); - fillHisto(m_vx_hs_truth_z_pull_vs_PU, localPUDensity, residual_z/vtxerr_z); - fillHisto(m_vx_hs_truth_x_pull_vs_PU, localPUDensity, residual_x/vtxerr_y); - fillHisto(m_vx_hs_truth_y_pull_vs_PU, localPUDensity, residual_y/vtxerr_x); + fillHisto(m_vx_hs_truth_z_pull_vs_PU, localPUDensity, residual_z/vtxerr_z, weight); + fillHisto(m_vx_hs_truth_x_pull_vs_PU, localPUDensity, residual_x/vtxerr_y, weight); + fillHisto(m_vx_hs_truth_y_pull_vs_PU, localPUDensity, residual_y/vtxerr_x, weight); - fillHisto(m_vx_hs_truth_z_res_vs_nTrk, bestRecoHSVtx_truth->nTrackParticles(), residual_z); - fillHisto(m_vx_hs_truth_x_res_vs_nTrk, bestRecoHSVtx_truth->nTrackParticles(), residual_x); - fillHisto(m_vx_hs_truth_y_res_vs_nTrk, bestRecoHSVtx_truth->nTrackParticles(), residual_y); + fillHisto(m_vx_hs_truth_z_res_vs_nTrk, bestRecoHSVtx_truth->nTrackParticles(), residual_z, weight); + fillHisto(m_vx_hs_truth_x_res_vs_nTrk, bestRecoHSVtx_truth->nTrackParticles(), residual_x, weight); + fillHisto(m_vx_hs_truth_y_res_vs_nTrk, bestRecoHSVtx_truth->nTrackParticles(), residual_y, weight); - fillHisto(m_vx_hs_truth_z_pull_vs_nTrk, bestRecoHSVtx_truth->nTrackParticles(), residual_z/vtxerr_z); - fillHisto(m_vx_hs_truth_x_pull_vs_nTrk, bestRecoHSVtx_truth->nTrackParticles(), residual_x/vtxerr_y); - fillHisto(m_vx_hs_truth_y_pull_vs_nTrk, bestRecoHSVtx_truth->nTrackParticles(), residual_y/vtxerr_x); + fillHisto(m_vx_hs_truth_z_pull_vs_nTrk, bestRecoHSVtx_truth->nTrackParticles(), residual_z/vtxerr_z, weight); + fillHisto(m_vx_hs_truth_x_pull_vs_nTrk, bestRecoHSVtx_truth->nTrackParticles(), residual_x/vtxerr_y, weight); + fillHisto(m_vx_hs_truth_y_pull_vs_nTrk, bestRecoHSVtx_truth->nTrackParticles(), residual_y/vtxerr_x, weight); } else { - fillHisto(m_vx_hs_reco_eff, localPUDensity, 0); + fillHisto(m_vx_hs_reco_eff, localPUDensity, 0, weight); } } - fillHisto(m_vx_nReco_vs_nTruth_matched, nTruthVertices, breakdown[InDetVertexTruthMatchUtils::VertexMatchType::MATCHED]); - fillHisto(m_vx_nReco_vs_nTruth_merged, nTruthVertices, breakdown[InDetVertexTruthMatchUtils::VertexMatchType::MERGED]); - fillHisto(m_vx_nReco_vs_nTruth_split, nTruthVertices, breakdown[InDetVertexTruthMatchUtils::VertexMatchType::SPLIT]); - fillHisto(m_vx_nReco_vs_nTruth_fake, nTruthVertices, breakdown[InDetVertexTruthMatchUtils::VertexMatchType::FAKE]); - fillHisto(m_vx_nReco_vs_nTruth_dummy, nTruthVertices, breakdown[InDetVertexTruthMatchUtils::VertexMatchType::DUMMY]); + fillHisto(m_vx_nReco_vs_nTruth_matched, nTruthVertices, breakdown[InDetVertexTruthMatchUtils::VertexMatchType::MATCHED], weight); + fillHisto(m_vx_nReco_vs_nTruth_merged, nTruthVertices, breakdown[InDetVertexTruthMatchUtils::VertexMatchType::MERGED], weight); + fillHisto(m_vx_nReco_vs_nTruth_split, nTruthVertices, breakdown[InDetVertexTruthMatchUtils::VertexMatchType::SPLIT], weight); + fillHisto(m_vx_nReco_vs_nTruth_fake, nTruthVertices, breakdown[InDetVertexTruthMatchUtils::VertexMatchType::FAKE], weight); + fillHisto(m_vx_nReco_vs_nTruth_dummy, nTruthVertices, breakdown[InDetVertexTruthMatchUtils::VertexMatchType::DUMMY], weight); // And by hardscatter type: InDetVertexTruthMatchUtils::HardScatterType hsType = InDetVertexTruthMatchUtils::classifyHardScatter(vertexContainer); - fillHisto(m_vx_hs_classification, hsType); + fillHisto(m_vx_hs_classification, hsType, weight); switch (hsType) { case InDetVertexTruthMatchUtils::HardScatterType::CLEAN: { - fillHisto(m_vx_nReco_vs_nTruth_clean, nTruthVertices, nRecoVertices); + fillHisto(m_vx_nReco_vs_nTruth_clean, nTruthVertices, nRecoVertices, weight); break; } case InDetVertexTruthMatchUtils::HardScatterType::LOWPU: { - fillHisto(m_vx_nReco_vs_nTruth_lowpu, nTruthVertices, nRecoVertices); + fillHisto(m_vx_nReco_vs_nTruth_lowpu, nTruthVertices, nRecoVertices, weight); break; } case InDetVertexTruthMatchUtils::HardScatterType::HIGHPU: { - fillHisto(m_vx_nReco_vs_nTruth_highpu, nTruthVertices, nRecoVertices); + fillHisto(m_vx_nReco_vs_nTruth_highpu, nTruthVertices, nRecoVertices, weight); break; } case InDetVertexTruthMatchUtils::HardScatterType::HSSPLIT: { - fillHisto(m_vx_nReco_vs_nTruth_hssplit, nTruthVertices, nRecoVertices); + fillHisto(m_vx_nReco_vs_nTruth_hssplit, nTruthVertices, nRecoVertices, weight); break; } case InDetVertexTruthMatchUtils::HardScatterType::NONE: { - fillHisto(m_vx_nReco_vs_nTruth_none, nTruthVertices, nRecoVertices); + fillHisto(m_vx_nReco_vs_nTruth_none, nTruthVertices, nRecoVertices, weight); break; } default: { diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_VertexTruthMatching.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_VertexTruthMatching.h index 6ac0364c84b3dfd35319f33126883f4741132be3..87b9864c97f3b0e0dc37137d9d314c27737531f6 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_VertexTruthMatching.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_VertexTruthMatching.h @@ -41,8 +41,8 @@ class InDetPerfPlot_VertexTruthMatching: public InDetPlotBase { public: InDetPerfPlot_VertexTruthMatching(InDetPlotBase* pParent, const std::string& dirName, const int iDetailLevel = 10); - void fill(const xAOD::Vertex& vertex, const xAOD::TruthVertex * tvrt =0); - void fill(const xAOD::VertexContainer& vertexContainer, const std::vector<const xAOD::TruthVertex*>& truthHSVertices, const std::vector<const xAOD::TruthVertex*>& truthPUVertices); + void fill(const xAOD::Vertex& vertex, const xAOD::TruthVertex * tvrt =0, float weight=1.0); + void fill(const xAOD::VertexContainer& vertexContainer, const std::vector<const xAOD::TruthVertex*>& truthHSVertices, const std::vector<const xAOD::TruthVertex*>& truthPUVertices, float weight=1.0); private: int m_iDetailLevel; float m_cutMinTruthRecoRadialDiff = 0.1; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_VerticesVsMu.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_VerticesVsMu.cxx index 7a5e4c13afd8db650664e132968f4739d54b04f2..3b9fd2da3c34994cbce106c2807005ed9f9d7151 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_VerticesVsMu.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_VerticesVsMu.cxx @@ -30,7 +30,7 @@ InDetPerfPlot_VerticesVsMu::initializePlots() { } void -InDetPerfPlot_VerticesVsMu::fill(const xAOD::VertexContainer& vertices, unsigned int nPU) { +InDetPerfPlot_VerticesVsMu::fill(const xAOD::VertexContainer& vertices, unsigned int nPU, float weight) { // fill number of vertices int nGoodVertices(0); @@ -40,5 +40,5 @@ InDetPerfPlot_VerticesVsMu::fill(const xAOD::VertexContainer& vertices, unsigned } nGoodVertices++; } - fillHisto(m_vx_n_vs_mu, nGoodVertices, nPU); + fillHisto(m_vx_n_vs_mu, nGoodVertices, nPU,weight); } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_VerticesVsMu.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_VerticesVsMu.h index a0c866122ff4fa57cc01d1e63a4963d46c935799..944e43aa5a8fc1c4364255ff62b63daa80fd49ff 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_VerticesVsMu.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_VerticesVsMu.h @@ -27,7 +27,7 @@ public: InDetPerfPlot_VerticesVsMu(InDetPlotBase* pParent, const std::string& dirName); // Fills vertex container information; also uses EventInfo - void fill(const xAOD::VertexContainer& vertices, unsigned int nPU); + void fill(const xAOD::VertexContainer& vertices, unsigned int nPU, float weight=1.0); private: ///@name Number of vertices vs mu ///@{ diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_nTracks.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_nTracks.cxx index a261480fd99862f5bc7b39c0e41fbf1136ab93c7..8f4844c7ee93e2321ac58f2011c1ac3028929d98 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_nTracks.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_nTracks.cxx @@ -35,15 +35,15 @@ InDetPerfPlot_nTracks::initializePlots() { } void -InDetPerfPlot_nTracks::fill(const unsigned int freq, const CounterCategory counter) { +InDetPerfPlot_nTracks::fill(const unsigned int freq, const CounterCategory counter, float weight) { if (counter < N_COUNTERS) { - fillHisto((m_counters[counter]), freq); + fillHisto((m_counters[counter]), freq, weight); } } -void InDetPerfPlot_nTracks::fill(const unsigned int ntracks, const unsigned int muu, const unsigned int nvertices) { +void InDetPerfPlot_nTracks::fill(const unsigned int ntracks, const unsigned int muu, const unsigned int nvertices, const float weight) { - fillHisto(m_ntracks_vs_mu, muu, ntracks); - fillHisto(m_ntracks_vs_nvertices, nvertices, ntracks); + fillHisto(m_ntracks_vs_mu, muu, ntracks, weight); + fillHisto(m_ntracks_vs_nvertices, nvertices, ntracks, weight); } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_nTracks.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_nTracks.h index 2028fdb69937495c3c2ac575a55cf1cebefefe99..93895196dff75710ad3fe515ccfdad8db70a56e1 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_nTracks.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_nTracks.h @@ -22,8 +22,8 @@ public: enum CounterCategory { ALLRECO, SELECTEDRECO, ALLTRUTH, SELECTEDTRUTH, ALLASSOCIATEDTRUTH, MATCHEDRECO, N_COUNTERS }; - void fill(const unsigned int freq, const CounterCategory counter); - void fill(const unsigned int ntracks, const unsigned int mu, const unsigned int nvertices); + void fill(const unsigned int freq, const CounterCategory counter, float weight=1.0); + void fill(const unsigned int ntracks, const unsigned int mu, const unsigned int nvertices, float weight=1.0); private: TH1* m_counters[N_COUNTERS]; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringTool.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringTool.cxx index 8589be9084da68ebebe5b361ed6b2d44dfba6558..0ea090b0b7037cbff083535e93a7197f167ac656 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringTool.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringTool.cxx @@ -233,6 +233,8 @@ InDetPhysValMonitoringTool::fillHistograms() { const xAOD::Vertex* primaryvertex = nullptr; const float puEvents = !m_truthPileUpEventName.key().empty() and truthPileupEventContainer.isValid() ? static_cast<int>( truthPileupEventContainer->size() ) : pie.isValid() ? pie->actualInteractionsPerCrossing() : 0; const float nVertices = not vertices->empty() ? vertices->size() : 0; + const float beamSpotWeight = pie->beamSpotWeight(); + ATH_MSG_DEBUG("beamSpotWeight is equal to " << beamSpotWeight); if (vertices.isValid() and not vertices->empty()) { ATH_MSG_DEBUG("Number of vertices retrieved for this event " << vertices->size()); @@ -253,11 +255,11 @@ InDetPhysValMonitoringTool::fillHistograms() { ATH_CHECK(m_vtxValidTool->matchVertices(*vertices)); ATH_MSG_DEBUG("Hard scatter classification type: " << InDetVertexTruthMatchUtils::classifyHardScatter(*vertices) << ", vertex container size = " << vertices->size()); } - m_monPlots->fill(*vertices, truthHSVertices, truthPUVertices); + m_monPlots->fill(*vertices, truthHSVertices, truthPUVertices, beamSpotWeight); ATH_MSG_DEBUG("Filling vertex/event info monitoring plots"); //Filling vertexing plots for the reconstructed hard-scatter as a function of mu - m_monPlots->fill(*vertices, puEvents); + m_monPlots->fill(*vertices, puEvents, beamSpotWeight); } else { //FIXME: Does this happen for single particles? ATH_MSG_WARNING("Skipping vertexing plots."); @@ -318,8 +320,8 @@ InDetPhysValMonitoringTool::fillHistograms() { if(isSTD) nTrackSTD++; if(isANT) nTrackANT++; nTrackTOT++; - m_monPlots->fill(*thisTrack); - m_monPlots->fill(*thisTrack, puEvents, nVertices); //fill mu dependent plots + m_monPlots->fill(*thisTrack, beamSpotWeight); + m_monPlots->fill(*thisTrack, puEvents, nVertices, beamSpotWeight); //fill mu dependent plots const xAOD::TruthParticle* associatedTruth = getAsTruth.getTruth(thisTrack); float prob = getMatchingProbability(*thisTrack); @@ -340,7 +342,7 @@ InDetPhysValMonitoringTool::fillHistograms() { if ( m_doTruthOriginPlots and m_trackTruthOriginTool->isFrom(associatedTruth, 5) ) { truthIsFromB = true; } - m_monPlots->fill(*thisTrack, *associatedTruth, truthIsFromB); // Make plots requiring matched truth + m_monPlots->fill(*thisTrack, *associatedTruth, truthIsFromB, beamSpotWeight); // Make plots requiring matched truth } } @@ -349,7 +351,7 @@ InDetPhysValMonitoringTool::fillHistograms() { if(isFake) nFakeTracks++; if(!isAssociatedTruth) nMissingAssociatedTruth++; - m_monPlots->fillFakeRate(*thisTrack, isFake, isAssociatedTruth, puEvents, nVertices); + m_monPlots->fillFakeRate(*thisTrack, isFake, isAssociatedTruth, puEvents, nVertices, beamSpotWeight); if (m_fillTruthToRecoNtuple) { // Decorate track particle with extra flags @@ -401,8 +403,8 @@ InDetPhysValMonitoringTool::fillHistograms() { } } } - m_monPlots->fill(nTrackANT, nTrackSTD, nTrackBAT, puEvents, nVertices); - m_monPlots->fill(nTrackTOT, puEvents, nVertices); + m_monPlots->fill(nTrackANT, nTrackSTD, nTrackBAT, puEvents, nVertices,beamSpotWeight); + m_monPlots->fill(nTrackTOT, puEvents, nVertices,beamSpotWeight); //FIXME: I don't get why... this is here if (m_truthSelectionTool.get()) { @@ -424,7 +426,7 @@ InDetPhysValMonitoringTool::fillHistograms() { ++nSelectedTruthTracks; // total number of truth which pass cuts per event bool isEfficient(false); // weight for the trackeff histos - m_monPlots->fill(*thisTruth); // This is filling truth-only plots + m_monPlots->fill(*thisTruth, beamSpotWeight); // This is filling truth-only plots // //Loop over reco tracks to find the match // @@ -441,7 +443,7 @@ InDetPhysValMonitoringTool::fillHistograms() { } } ATH_MSG_DEBUG("Filling efficiency plots info monitoring plots"); - m_monPlots->fillEfficiency(*thisTruth, *matchedTrack, isEfficient, puEvents, nVertices); + m_monPlots->fillEfficiency(*thisTruth, *matchedTrack, isEfficient, puEvents, nVertices, beamSpotWeight); } if (m_fillTruthToRecoNtuple) { @@ -464,12 +466,12 @@ InDetPhysValMonitoringTool::fillHistograms() { ATH_MSG_DEBUG(nAssociatedTruth << " tracks out of " << tracks->size() << " had associated truth."); } - m_monPlots->fillCounter(nSelectedRecoTracks, InDetPerfPlot_nTracks::SELECTEDRECO); - m_monPlots->fillCounter(tracks->size(), InDetPerfPlot_nTracks::ALLRECO); - m_monPlots->fillCounter(nSelectedTruthTracks, InDetPerfPlot_nTracks::SELECTEDTRUTH); - m_monPlots->fillCounter(nTruths, InDetPerfPlot_nTracks::ALLTRUTH); - m_monPlots->fillCounter(nAssociatedTruth, InDetPerfPlot_nTracks::ALLASSOCIATEDTRUTH); - m_monPlots->fillCounter(nSelectedMatchedTracks, InDetPerfPlot_nTracks::MATCHEDRECO); + m_monPlots->fillCounter(nSelectedRecoTracks, InDetPerfPlot_nTracks::SELECTEDRECO, beamSpotWeight); + m_monPlots->fillCounter(tracks->size(), InDetPerfPlot_nTracks::ALLRECO, beamSpotWeight); + m_monPlots->fillCounter(nSelectedTruthTracks, InDetPerfPlot_nTracks::SELECTEDTRUTH, beamSpotWeight); + m_monPlots->fillCounter(nTruths, InDetPerfPlot_nTracks::ALLTRUTH, beamSpotWeight); + m_monPlots->fillCounter(nAssociatedTruth, InDetPerfPlot_nTracks::ALLASSOCIATEDTRUTH, beamSpotWeight); + m_monPlots->fillCounter(nSelectedMatchedTracks, InDetPerfPlot_nTracks::MATCHEDRECO, beamSpotWeight); // Tracking In Dense Environment if (!m_doTrackInJetPlots) return StatusCode::SUCCESS; @@ -533,7 +535,7 @@ InDetPhysValMonitoringTool::fillHistograms() { if ( m_doTruthOriginPlots and m_trackTruthOriginTool->isFrom(truth, 5) ) { truthIsFromB = true; } - m_monPlots->fillEfficiency(*truth, *thisJet, isEfficient, isBjet, truthIsFromB); + m_monPlots->fillEfficiency(*truth, *thisJet, isEfficient, isBjet, truthIsFromB, beamSpotWeight); } } } @@ -555,9 +557,9 @@ InDetPhysValMonitoringTool::fillHistograms() { if ( m_doTruthOriginPlots and m_trackTruthOriginTool->isFrom(associatedTruth, 5) ) { truthIsFromB = true; } - m_monPlots->fill(*thisTrack, *thisJet, isBjet, isFake, unlinked, truthIsFromB); + m_monPlots->fill(*thisTrack, *thisJet, isBjet, isFake, unlinked, truthIsFromB, beamSpotWeight); if (associatedTruth){ - m_monPlots->fillFakeRate(*thisTrack, *thisJet, isFake, isBjet, truthIsFromB); + m_monPlots->fillFakeRate(*thisTrack, *thisJet, isFake, isBjet, truthIsFromB, beamSpotWeight); } } } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPlotBase.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPlotBase.cxx index 87d169b485f7ee8b748d650e79c7f7be9a731a4e..f890c5f8ec8a7971f381cb8ee866d0c2aecbf689 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPlotBase.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPlotBase.cxx @@ -122,9 +122,9 @@ InDetPlotBase::book(TEfficiency*& pHisto, const std::string& histoIdentifier, co } void -InDetPlotBase::fillHisto(TProfile* pTprofile, const float bin, const float weight) { +InDetPlotBase::fillHisto(TProfile* pTprofile, const float bin, const float weight, const float weight2) { if (pTprofile and validArguments(bin, weight)) { - pTprofile->Fill(bin, weight); + pTprofile->Fill(bin, weight,weight2); } } @@ -151,6 +151,14 @@ InDetPlotBase::fillHisto(TH2* pTh2, const float xval, const float yval) { } } +// +void +InDetPlotBase::fillHisto(TH2* pTh2, const float xval, const float yval, const float weight) { + if (pTh2 and validArguments(xval, yval)) { + pTh2->Fill(xval, yval, weight); + } +} + void InDetPlotBase::fillHisto(TH3* pTh3, const float xval, const float yval, const float zval) { if (pTh3 and validArguments(xval, yval, zval)) { @@ -159,9 +167,9 @@ InDetPlotBase::fillHisto(TH3* pTh3, const float xval, const float yval, const fl } void -InDetPlotBase::fillHisto(TEfficiency* pTeff, const float value, const bool accepted) { +InDetPlotBase::fillHisto(TEfficiency* pTeff, const float value, const bool accepted, float weight) { if (pTeff and validArguments(value)) { - pTeff->Fill(accepted, value); + pTeff->FillWeighted(accepted, weight, value); } } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPlotBase.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPlotBase.h index 4e0dbba4850223286b161a7bddde2db4054dda54..830275685713202a0c6001f8a6aff8afe3f6558c 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPlotBase.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPlotBase.h @@ -66,17 +66,18 @@ public: /// 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); + // weight2 allows us to weight averaging in the profile + void fillHisto(TProfile* pTprofile, const float bin, const float weight, const float weight2=1.0); // void fillHisto(TH1* pTh1, const float value); void fillHisto(TH1* pTh1, const float value, const float weight); // void fillHisto(TH2* pTh2, const float xval, const float yval); + void fillHisto(TH2* pTh2, const float xval, const float yval, const float weight); // void fillHisto(TH3* pTh3, const float xval, const float yval, const float zval); // - void fillHisto(TEfficiency* pTeff, const float value, const bool accepted); + void fillHisto(TEfficiency* pTeff, const float value, const bool accepted, float weight); // protected: /// book, for use by macro diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.cxx index 99983a58236fb42129252227938fd590018dd9fb..aea9e26e8f2196bf152d82d24a46a937d6f7267f 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.cxx @@ -114,7 +114,7 @@ void InDetRttPlots::SetFillJetPlots(bool fillJets, bool fillBJets){ // void -InDetRttPlots::fill(const xAOD::TrackParticle& particle, const xAOD::TruthParticle& truthParticle, bool isFromB) { +InDetRttPlots::fill(const xAOD::TrackParticle& particle, const xAOD::TruthParticle& truthParticle, bool isFromB, float weight) { // fill measurement bias, resolution, and pull plots // fill ITK resolutions (bias / resolutions) @@ -147,7 +147,7 @@ InDetRttPlots::fill(const xAOD::TrackParticle& particle, const xAOD::TruthPartic } - if (barcode < 200000 && barcode != 0 && prob > 0.5) m_trtExtensionPlots.fill(particle, truthParticle); + if (barcode < 200000 && barcode != 0 && prob > 0.5) m_trtExtensionPlots.fill(particle, truthParticle, weight); } @@ -155,7 +155,7 @@ InDetRttPlots::fill(const xAOD::TrackParticle& particle, const xAOD::TruthPartic if(m_iDetailLevel >= 200){ float barcode = truthParticle.barcode(); if (barcode < 200000 && barcode != 0) { - m_hitsMatchedTracksPlots->fill(particle); + m_hitsMatchedTracksPlots->fill(particle, weight); } } } @@ -165,12 +165,12 @@ InDetRttPlots::fill(const xAOD::TrackParticle& particle, const xAOD::TruthPartic // void -InDetRttPlots::fill(const xAOD::TrackParticle& particle) { - m_hitResidualPlot.fill(particle); - m_hitEffPlot.fill(particle); +InDetRttPlots::fill(const xAOD::TrackParticle& particle, float weight) { + m_hitResidualPlot.fill(particle, weight); + m_hitEffPlot.fill(particle, weight); // fill pt plots - m_trackParameters.fill(particle); - m_anTrackingPlots.fill(particle); + m_trackParameters.fill(particle, weight); + m_anTrackingPlots.fill(particle, weight); if(m_iDetailLevel >= 200){ std::bitset<xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo> patternInfo = particle.patternRecoInfo(); @@ -181,36 +181,36 @@ InDetRttPlots::fill(const xAOD::TrackParticle& particle) { bool isTRTStandalone = patternInfo.test(20); bool isSiSpacePointsSeedMaker_LargeD0 = patternInfo.test(49); - if(isSiSpSeededFinder and not isInDetExtensionProcessor) m_trkParaSiSPSeededFinderPlots->fill(particle); - else if(isInDetExtensionProcessor and not (isTRTSeededTrackFinder or isSiSpacePointsSeedMaker_LargeD0)) m_trkParaInDetExtensionProcessorPlots->fill(particle); - else if(isTRTSeededTrackFinder and not isTRTStandalone) m_trkParaTRTSeededTrackFinderPlots->fill(particle); - else if(isTRTStandalone) m_trkParaTRTStandalonePlots->fill(particle); - else if(isSiSpacePointsSeedMaker_LargeD0) m_trkParaSiSpacePointsSeedMaker_LargeD0Plots->fill(particle); + if(isSiSpSeededFinder and not isInDetExtensionProcessor) m_trkParaSiSPSeededFinderPlots->fill(particle, weight); + else if(isInDetExtensionProcessor and not (isTRTSeededTrackFinder or isSiSpacePointsSeedMaker_LargeD0)) m_trkParaInDetExtensionProcessorPlots->fill(particle, weight); + else if(isTRTSeededTrackFinder and not isTRTStandalone) m_trkParaTRTSeededTrackFinderPlots->fill(particle, weight); + else if(isTRTStandalone) m_trkParaTRTStandalonePlots->fill(particle, weight); + else if(isSiSpacePointsSeedMaker_LargeD0) m_trkParaSiSpacePointsSeedMaker_LargeD0Plots->fill(particle, weight); } - m_hitsRecoTracksPlots.fill(particle); - m_trtExtensionPlots.fill(particle); + m_hitsRecoTracksPlots.fill(particle, weight); + m_trtExtensionPlots.fill(particle, weight); } void -InDetRttPlots::fill(const xAOD::TrackParticle& particle, const float mu, const unsigned int nVtx) { +InDetRttPlots::fill(const xAOD::TrackParticle& particle, const float mu, const unsigned int nVtx, float weight) { - m_trtExtensionPlots.fill(particle, mu, nVtx); + m_trtExtensionPlots.fill(particle, mu, nVtx, weight); } void -InDetRttPlots::fill(const unsigned int nTrkANT, const unsigned int nTrkSTD, const unsigned int nTrkBAT, const float mu, const unsigned int nVtx) { +InDetRttPlots::fill(const unsigned int nTrkANT, const unsigned int nTrkSTD, const unsigned int nTrkBAT, const float mu, const unsigned int nVtx, const float weight) { - m_anTrackingPlots.fill(nTrkANT, nTrkSTD, nTrkBAT, mu, nVtx); + m_anTrackingPlots.fill(nTrkANT, nTrkSTD, nTrkBAT, mu, nVtx, weight); } void -InDetRttPlots::fill(const unsigned int ntracks, const unsigned int mu, const unsigned int nvertices) { +InDetRttPlots::fill(const unsigned int ntracks, const unsigned int mu, const unsigned int nvertices, const float weight) { - m_nTracks.fill(ntracks, mu, nvertices); + m_nTracks.fill(ntracks, mu, nvertices, weight); } @@ -219,9 +219,9 @@ InDetRttPlots::fill(const unsigned int ntracks, const unsigned int mu, const uns // void -InDetRttPlots::fill(const xAOD::TruthParticle& truthParticle) { +InDetRttPlots::fill(const xAOD::TruthParticle& truthParticle, float weight) { // fill truth plots - m_trackParameters.fill(truthParticle); + m_trackParameters.fill(truthParticle, weight); } // @@ -229,10 +229,10 @@ InDetRttPlots::fill(const xAOD::TruthParticle& truthParticle) { // void -InDetRttPlots::fillEfficiency(const xAOD::TruthParticle& truth, const xAOD::TrackParticle& track, const bool isGood, const float mu, const unsigned int nVtx) { - m_effPlots.fill(truth, isGood); +InDetRttPlots::fillEfficiency(const xAOD::TruthParticle& truth, const xAOD::TrackParticle& track, const bool isGood, const float mu, const unsigned int nVtx, float weight) { + m_effPlots.fill(truth, isGood, weight); - m_anTrackingPlots.fillEfficiency(truth, track, isGood, mu, nVtx); + m_anTrackingPlots.fillEfficiency(truth, track, isGood, mu, nVtx, weight); if(m_iDetailLevel >= 200){ if(isGood){ std::bitset<xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo> patternInfo = track.patternRecoInfo(); @@ -243,17 +243,17 @@ InDetRttPlots::fillEfficiency(const xAOD::TruthParticle& truth, const xAOD::Trac bool isTRTStandalone = patternInfo.test(20); bool isSiSpacePointsSeedMaker_LargeD0 = patternInfo.test(49); - if(isSiSpSeededFinder and not isInDetExtensionProcessor) m_effSiSPSeededFinderPlots->fill(truth, isGood); - if(isInDetExtensionProcessor and not (isTRTSeededTrackFinder or isSiSpacePointsSeedMaker_LargeD0)) m_effInDetExtensionProcessorPlots->fill(truth, isGood); - if(isTRTSeededTrackFinder and not isTRTStandalone) m_effTRTSeededTrackFinderPlots->fill(truth, isGood); - if(isTRTStandalone) m_effTRTStandalonePlots->fill(truth, isGood); - if(isSiSpacePointsSeedMaker_LargeD0) m_effSiSpacePointsSeedMaker_LargeD0Plots->fill(truth, isGood); + if(isSiSpSeededFinder and not isInDetExtensionProcessor) m_effSiSPSeededFinderPlots->fill(truth, isGood, weight); + if(isInDetExtensionProcessor and not (isTRTSeededTrackFinder or isSiSpacePointsSeedMaker_LargeD0)) m_effInDetExtensionProcessorPlots->fill(truth, isGood, weight); + if(isTRTSeededTrackFinder and not isTRTStandalone) m_effTRTSeededTrackFinderPlots->fill(truth, isGood, weight); + if(isTRTStandalone) m_effTRTStandalonePlots->fill(truth, isGood, weight); + if(isSiSpacePointsSeedMaker_LargeD0) m_effSiSpacePointsSeedMaker_LargeD0Plots->fill(truth, isGood, weight); } else { - m_effSiSPSeededFinderPlots->fill(truth, isGood); - m_effInDetExtensionProcessorPlots->fill(truth, isGood); - m_effTRTSeededTrackFinderPlots->fill(truth, isGood); - m_effTRTStandalonePlots->fill(truth, isGood); - m_effSiSpacePointsSeedMaker_LargeD0Plots->fill(truth, isGood); + m_effSiSPSeededFinderPlots->fill(truth, isGood, weight); + m_effInDetExtensionProcessorPlots->fill(truth, isGood, weight); + m_effTRTSeededTrackFinderPlots->fill(truth, isGood, weight); + m_effTRTStandalonePlots->fill(truth, isGood, weight); + m_effSiSpacePointsSeedMaker_LargeD0Plots->fill(truth, isGood, weight); } @@ -266,17 +266,17 @@ InDetRttPlots::fillEfficiency(const xAOD::TruthParticle& truth, const xAOD::Trac // void -InDetRttPlots::fillFakeRate(const xAOD::TrackParticle& track, const bool isFake, const bool isAssociatedTruth, const float mu, const unsigned int nVtx){ +InDetRttPlots::fillFakeRate(const xAOD::TrackParticle& track, const bool isFake, const bool isAssociatedTruth, const float mu, const unsigned int nVtx, float weight){ - m_missingTruthFakePlots.fill(track, !isAssociatedTruth); - m_anTrackingPlots.fillUnlinked(track, !isAssociatedTruth, mu, nVtx); + m_missingTruthFakePlots.fill(track, !isAssociatedTruth, weight); + m_anTrackingPlots.fillUnlinked(track, !isAssociatedTruth, mu, nVtx, weight); if(m_iDetailLevel >= 200){ - if (!isAssociatedTruth) m_hitsUnlinkedTracksPlots->fill(track); - else m_hitsFakeTracksPlots->fill(track); + if (!isAssociatedTruth) m_hitsUnlinkedTracksPlots->fill(track, weight); + else m_hitsFakeTracksPlots->fill(track, weight); } if(isAssociatedTruth) { - m_fakePlots.fill(track, isFake); - m_anTrackingPlots.fillFakeRate(track, isFake, mu, nVtx); + m_fakePlots.fill(track, isFake, weight); + m_anTrackingPlots.fillFakeRate(track, isFake, mu, nVtx, weight); if(m_iDetailLevel >= 200){ std::bitset<xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo> patternInfo = track.patternRecoInfo(); @@ -287,11 +287,11 @@ InDetRttPlots::fillFakeRate(const xAOD::TrackParticle& track, const bool isFake, bool isTRTStandalone = patternInfo.test(20); bool isSiSpacePointsSeedMaker_LargeD0 = patternInfo.test(49); - if(isSiSpSeededFinder and not isInDetExtensionProcessor) m_fakeSiSPSeededFinderPlots->fill(track, isFake); //No extensions - if(isInDetExtensionProcessor and not (isTRTSeededTrackFinder or isSiSpacePointsSeedMaker_LargeD0)) m_fakeInDetExtensionProcessorPlots->fill(track, isFake); //Extensions but not Back-tracking - if(isTRTSeededTrackFinder and not isTRTStandalone) m_fakeTRTSeededTrackFinderPlots->fill(track, isFake); //BackTracking - if(isTRTStandalone) m_fakeTRTStandalonePlots->fill(track, isFake); //TRT standalone - if(isSiSpacePointsSeedMaker_LargeD0) m_fakeSiSpacePointsSeedMaker_LargeD0Plots->fill(track, isFake); //ANT + if(isSiSpSeededFinder and not isInDetExtensionProcessor) m_fakeSiSPSeededFinderPlots->fill(track, isFake, weight); //No extensions + if(isInDetExtensionProcessor and not (isTRTSeededTrackFinder or isSiSpacePointsSeedMaker_LargeD0)) m_fakeInDetExtensionProcessorPlots->fill(track, isFake, weight); //Extensions but not Back-tracking + if(isTRTSeededTrackFinder and not isTRTStandalone) m_fakeTRTSeededTrackFinderPlots->fill(track, isFake, weight); //BackTracking + if(isTRTStandalone) m_fakeTRTStandalonePlots->fill(track, isFake, weight); //TRT standalone + if(isSiSpacePointsSeedMaker_LargeD0) m_fakeSiSpacePointsSeedMaker_LargeD0Plots->fill(track, isFake, weight); //ANT } } @@ -303,95 +303,96 @@ InDetRttPlots::fillFakeRate(const xAOD::TrackParticle& track, const bool isFake, //Fill Vertexing Plots // void -InDetRttPlots::fill(const xAOD::VertexContainer& vertexContainer, const std::vector<const xAOD::TruthVertex*>& truthHSVertices, const std::vector<const xAOD::TruthVertex*>& truthPUVertices) { +InDetRttPlots::fill(const xAOD::VertexContainer& vertexContainer, const std::vector<const xAOD::TruthVertex*>& truthHSVertices, const std::vector<const xAOD::TruthVertex*>& truthPUVertices, float weight) { // fill vertex container general properties // m_verticesVsMuPlots.fill(vertexContainer); //if ever needed // fill vertex-specific properties, for all vertices and for hard-scattering vertex + for (const auto& vtx : vertexContainer.stdcont()) { if (vtx->vertexType() == xAOD::VxType::NoVtx) { ATH_MSG_DEBUG("IN InDetRttPlots::fill, found xAOD::VxType::NoVtx"); continue; // skip dummy vertex } - m_vertexPlots.fill(*vtx); + m_vertexPlots.fill(*vtx, weight); ATH_MSG_DEBUG("IN InDetRttPlots::fill, filling for all vertices"); if (vtx->vertexType() == xAOD::VxType::PriVtx) { - m_hardScatterVertexPlots.fill(*vtx); + m_hardScatterVertexPlots.fill(*vtx, weight); if(truthHSVertices.size()>0)m_hardScatterVertexTruthMatchingPlots.fill(*vtx,truthHSVertices[0]); - else m_hardScatterVertexTruthMatchingPlots.fill(*vtx); + else m_hardScatterVertexTruthMatchingPlots.fill(*vtx); ATH_MSG_DEBUG("IN InDetRttPlots::fill, filling for all HS vertex"); } } if(m_iDetailLevel >= 200){ - m_vertexTruthMatchingPlots->fill(vertexContainer, truthHSVertices, truthPUVertices); + m_vertexTruthMatchingPlots->fill(vertexContainer, truthHSVertices, truthPUVertices, weight); } } void -InDetRttPlots::fill(const xAOD::VertexContainer& vertexContainer, unsigned int nPU) { - m_verticesVsMuPlots.fill(vertexContainer, nPU); +InDetRttPlots::fill(const xAOD::VertexContainer& vertexContainer, unsigned int nPU, float weight) { + m_verticesVsMuPlots.fill(vertexContainer, nPU, weight); } // //Fill Counters // void -InDetRttPlots::fillCounter(const unsigned int freq, const InDetPerfPlot_nTracks::CounterCategory counter) { - m_nTracks.fill(freq, counter); +InDetRttPlots::fillCounter(const unsigned int freq, const InDetPerfPlot_nTracks::CounterCategory counter, float weight) { + m_nTracks.fill(freq, counter, weight); } //Track in Jet Plots void -InDetRttPlots::fill(const xAOD::TrackParticle& track, const xAOD::Jet& jet, bool isBjet, bool isFake, bool isUnlinked, bool truthIsFromB){ - m_trkInJetPlots->fill(track, jet); +InDetRttPlots::fill(const xAOD::TrackParticle& track, const xAOD::Jet& jet, bool isBjet, bool isFake, bool isUnlinked, bool truthIsFromB, float weight){ + m_trkInJetPlots->fill(track, jet,weight); if (m_iDetailLevel >= 200){ if (isFake){ - m_trkInJetPlots_fake->fill(track,jet); + m_trkInJetPlots_fake->fill(track,jet,weight); } else if (isUnlinked){ - m_trkInJetPlots_unlinked->fill(track,jet); + m_trkInJetPlots_unlinked->fill(track,jet,weight); } else { - m_trkInJetPlots_matched->fill(track,jet); + m_trkInJetPlots_matched->fill(track,jet,weight); } } if(isBjet && m_doTrackInBJetPlots){ - m_trkInJetPlots_bjets->fill(track, jet); + m_trkInJetPlots_bjets->fill(track, jet,weight); if ( truthIsFromB ) { // truth from B decay - m_trkInJetPlots_truthFromB->fill(track, jet); + m_trkInJetPlots_truthFromB->fill(track, jet,weight); } if (m_iDetailLevel >= 200){ if (isFake){ - m_trkInJetPlots_fake_bjets->fill(track,jet); + m_trkInJetPlots_fake_bjets->fill(track,jet,weight); } else if (isUnlinked){ - m_trkInJetPlots_unlinked_bjets->fill(track,jet); + m_trkInJetPlots_unlinked_bjets->fill(track,jet,weight); } else { - m_trkInJetPlots_matched_bjets->fill(track,jet); + m_trkInJetPlots_matched_bjets->fill(track,jet,weight); } } } } void -InDetRttPlots::fillEfficiency(const xAOD::TruthParticle& truth, const xAOD::Jet& jet, bool isEfficient, bool isBjet, bool truthIsFromB) { - m_trkInJetPlots->fillEfficiency(truth, jet, isEfficient); - if(isBjet && m_doTrackInBJetPlots) m_trkInJetPlots_bjets->fillEfficiency(truth, jet, isEfficient); +InDetRttPlots::fillEfficiency(const xAOD::TruthParticle& truth, const xAOD::Jet& jet, bool isEfficient, bool isBjet, bool truthIsFromB, float weight) { + m_trkInJetPlots->fillEfficiency(truth, jet, isEfficient, weight); + if(isBjet && m_doTrackInBJetPlots) m_trkInJetPlots_bjets->fillEfficiency(truth, jet, isEfficient, weight); if ( isBjet and m_doTrackInBJetPlots and truthIsFromB ) { // truth is from B - m_trkInJetPlots_truthFromB->fillEfficiency(truth, jet, isEfficient); + m_trkInJetPlots_truthFromB->fillEfficiency(truth, jet, isEfficient, weight); } } void -InDetRttPlots::fillFakeRate(const xAOD::TrackParticle& track, const xAOD::Jet& jet, bool isFake, bool isBjet, bool truthIsFromB) { - m_trkInJetPlots->fillFakeRate(track, jet, isFake); - if(isBjet && m_doTrackInBJetPlots) m_trkInJetPlots_bjets->fillFakeRate(track, jet, isFake); +InDetRttPlots::fillFakeRate(const xAOD::TrackParticle& track, const xAOD::Jet& jet, bool isFake, bool isBjet, bool truthIsFromB, float weight) { + m_trkInJetPlots->fillFakeRate(track, jet, isFake, weight); + if(isBjet && m_doTrackInBJetPlots) m_trkInJetPlots_bjets->fillFakeRate(track, jet, isFake, weight); if ( isBjet and m_doTrackInBJetPlots and truthIsFromB ) { // truth is from B - m_trkInJetPlots_truthFromB->fillFakeRate(track, jet, isFake); + m_trkInJetPlots_truthFromB->fillFakeRate(track, jet, isFake, weight); } } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.h index 6f684a13f8238484e17a54b6f05309d7147c9e39..9bc8456d4fcad08d793badb5c34f5374659c3fcf 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.h @@ -54,35 +54,35 @@ public: void SetFillJetPlots(bool fillJets, bool fillBJets); ///fill for things needing truth and track only - void fill(const xAOD::TrackParticle& particle, const xAOD::TruthParticle& truthParticle, bool truthIsFromB=false); + void fill(const xAOD::TrackParticle& particle, const xAOD::TruthParticle& truthParticle, bool truthIsFromB=false, float weight=1.0); ///fill for things needing track only - void fill(const xAOD::TrackParticle& particle); - void fill(const xAOD::TrackParticle& particle, const float mu, const unsigned int nVtx); //mu dependent plots - void fill(const unsigned int nTrkANT, const unsigned int nTrkSTD, const unsigned int nTrkBAT, const float mu, const unsigned int nVtx); - void fill(const unsigned int nTracks, const unsigned int mu, const unsigned nVtx); + void fill(const xAOD::TrackParticle& particle, float weight=1.0); + void fill(const xAOD::TrackParticle& particle, const float mu, const unsigned int nVtx, float weight=1.0); //mu dependent plots + void fill(const unsigned int nTrkANT, const unsigned int nTrkSTD, const unsigned int nTrkBAT, const float mu, const unsigned int nVtx,const float weight=1.0); + void fill(const unsigned int nTracks, const unsigned int mu, const unsigned nVtx, const float weight=1.0); ///fill for things needing truth only - void fill(const xAOD::TruthParticle& particle); + void fill(const xAOD::TruthParticle& particle, float weight); ///Fill for efficiency plots - void fillEfficiency(const xAOD::TruthParticle& truth, const xAOD::TrackParticle& track, const bool isGood, const float mu, const unsigned int nVtx); + void fillEfficiency(const xAOD::TruthParticle& truth, const xAOD::TrackParticle& track, const bool isGood, const float mu, const unsigned int nVtx, float weight); ///fill for things needing all truth - not just the ones from the reco tracks ///fill reco-vertex related plots - void fill(const xAOD::VertexContainer& vertexContainer, const std::vector<const xAOD::TruthVertex*>& truthHSVertices, const std::vector<const xAOD::TruthVertex*>& truthPUVertices); + void fill(const xAOD::VertexContainer& vertexContainer, const std::vector<const xAOD::TruthVertex*>& truthHSVertices, const std::vector<const xAOD::TruthVertex*>& truthPUVertices, float weight=1.0); ///fill reco-vertex related plots that need EventInfo - void fill(const xAOD::VertexContainer& vertexContainer, const unsigned int nPU); + void fill(const xAOD::VertexContainer& vertexContainer, const unsigned int nPU, const float weight=1.0); - void fill(const xAOD::TrackParticle& track, const xAOD::Jet& jet, bool isBjet=false, bool isFake=false, bool isUnlinked=false, bool truthIsFromB=false); - void fillEfficiency(const xAOD::TruthParticle& truth, const xAOD::Jet& jet, const bool isGood, bool isBjet=false, bool truthIsFromB=false); - void fillFakeRate(const xAOD::TrackParticle& track, const xAOD::Jet& jet, const bool isFake, bool isBjet=false, bool truthIsFromB=false); + void fill(const xAOD::TrackParticle& track, const xAOD::Jet& jet, bool isBjet=false, bool isFake=false, bool isUnlinked=false, bool truthIsFromB=false, const float weight=1.0); + void fillEfficiency(const xAOD::TruthParticle& truth, const xAOD::Jet& jet, const bool isGood, bool isBjet=false, bool truthIsFromB=false, float weight=1.0); + void fillFakeRate(const xAOD::TrackParticle& track, const xAOD::Jet& jet, const bool isFake, bool isBjet=false, bool truthIsFromB=false, float weight=1.0); virtual ~InDetRttPlots() {/**nop**/ }; ///fill for Counters - void fillCounter(const unsigned int freq, const InDetPerfPlot_nTracks::CounterCategory counter); + void fillCounter(const unsigned int freq, const InDetPerfPlot_nTracks::CounterCategory counter, float weight); ///fill for fakes - void fillFakeRate(const xAOD::TrackParticle& particle, const bool isFake, const bool isAssociatedTruth, const float mu, const unsigned int nVtx); + void fillFakeRate(const xAOD::TrackParticle& particle, const bool isFake, const bool isAssociatedTruth, const float mu, const unsigned int nVtx, float weight); // fill IDPVM Ntuple void fillNtuple(const xAOD::TrackParticle& track); diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/InDetPlotBase_test.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/InDetPlotBase_test.cxx index d58004e09a3bff64af89b1c58a91f9f5e2ac4442..2d8d1feff52f20eace770dbc702d9b2538662a05 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/InDetPlotBase_test.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/InDetPlotBase_test.cxx @@ -130,8 +130,8 @@ InDetTestPlot::fill(const xAOD::TrackParticle& /*particle*/) { const float ybin = (rand() % 20); fillHisto(m_test2D, eta, ybin); const bool passed(p > 25); - fillHisto(m_testEff, p, passed); - fillHisto(m_nonsense, pt); + fillHisto(m_testEff, p, passed, 1); //no beamspot weight here + fillHisto(m_nonsense, pt, 1); //no beamspot weight here }