diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefCommon.xml b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefCommon.xml index 5dbecc407140457b5a698669a3ace3d3d0ba793d..02175336aaf2fd964b410d1800a5717e85ea0d90 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefCommon.xml +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefCommon.xml @@ -664,7 +664,7 @@ <y title="Fake Rate" lo="0.0" hi="2.0"/> </h> <h id="fakerate_vs_pt" type="TEfficiency" title="Fractions of reco-tracks with matching probability < 50%"> - <x title="p_{T} [GeV]" n="25" lo="0" hi="50"/> + <x title="p_{T} [GeV]" n="100" lo="0" hi="50.0"/> <y title="Fake Rate" lo="0.0" hi="2.0"/> </h> <h id="fakerate_vs_phi" type="TEfficiency" title="Fractions of reco-tracks with matching probability < 50%"> diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_FakeRate.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_FakeRate.cxx index a8140fb8274c2b55e5cfe397a7ef3b8cd4a56d37..ec7613d112ce9b61cac42401cf9e464232ae4adf 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_FakeRate.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_FakeRate.cxx @@ -35,11 +35,11 @@ void InDetPerfPlot_FakeRate::fill(const xAOD::TrackParticle& track, const bool isFake) { double eta = track.eta(); - double pt = track.pt() * Gaudi::Units::GeV; // convert MeV to GeV + double pt = track.pt() / Gaudi::Units::GeV; // convert MeV to GeV double phi = track.phi(); 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); diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Resolution.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Resolution.cxx index 81afe6b3cb42a14242065bc8ecd5750c696dac0f..ad210e9d8846031b1198f94bf012bf57e7f58f4a 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Resolution.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Resolution.cxx @@ -102,11 +102,12 @@ InDetPerfPlot_Resolution::initializePlots() { // //1D distributions // + + if(iparam == PT) continue; book(m_pull[iparam], "pull_" + m_paramProp[iparam]); book(m_res[iparam], "res_" + m_paramProp[iparam]); book(m_sigma[iparam], "sigma_" + m_paramProp[iparam]); //New One - if(iparam == PT) continue; // //2D Distributions to evaluate resolutions vs eta and pT // diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrackParameters.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrackParameters.cxx index d57e987639cc484d7273a67dfedc288b3fc16b29..3220f56896f6f0fcb97249abd97df64445f4cc98 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrackParameters.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrackParameters.cxx @@ -91,7 +91,7 @@ InDetPerfPlot_TrackParameters::fill(const xAOD::TruthParticle& particle) { // quantities with xAOD::TruthParticle accessors: float eta = particle.eta(); - float pt = particle.pt() * Gaudi::Units::GeV; + float pt = particle.pt() / Gaudi::Units::GeV; float d0 = (particle.isAvailable<float>("d0")) ? particle.auxdata<float>("d0") : -9999.; float z0 = (particle.isAvailable<float>("z0")) ? particle.auxdata<float>("z0") : -9999.; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringTool.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringTool.cxx index ff366753d5ccd1c503df7a20229271f636027b45..414ed249634ae792b0dc104d7c4d4e3f817598bc 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringTool.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringTool.cxx @@ -366,7 +366,8 @@ InDetPhysValMonitoringTool::fillHistograms() { } SG::ReadHandle<xAOD::JetContainer> jets(m_jetContainerName); - + SG::AuxElement::ConstAccessor<std::vector<ElementLink<xAOD::IParticleContainer> > > ghosttruth("GhostTruth"); + if (not jets.isValid() or truthParticlesVec.empty()) { ATH_MSG_WARNING( "Cannot open " << m_jetContainerName << @@ -376,8 +377,40 @@ InDetPhysValMonitoringTool::fillHistograms() { if (not passJetCuts(*thisJet)) { continue; } + if(!ghosttruth.isAvailable(*thisJet)) { + ATH_MSG_WARNING("Failed to extract ghost truth particles from jet"); + } else { + for(const auto& el : ghosttruth(*thisJet)){ + if(el.isValid()) { + const xAOD::TruthParticle *truth = static_cast<const xAOD::TruthParticle*>(*el); + if (thisJet->p4().DeltaR(truth->p4()) > m_maxTrkJetDR) { + continue; + } + + const IAthSelectionTool::CutResult accept = m_truthSelectionTool->accept(truth); + + if(!accept) continue; + bool isEfficient(false); + for (auto thisTrack: *tracks) { + if (m_useTrackSelection and not (m_trackSelectionTool->accept(*thisTrack, primaryvertex))) { + continue; + } + + const xAOD::TruthParticle* associatedTruth = getAsTruth.getTruth(thisTrack); + if (associatedTruth and associatedTruth == truth) { + float prob = getMatchingProbability(*thisTrack); + if (not std::isnan(prob) && prob > m_lowProb) { + isEfficient = true; + break; + } + } + } + m_monPlots->fillEfficiency(*truth, *thisJet, isEfficient); + } + } + } for (auto thisTrack: *tracks) { // The beginning of the track loop - bool isEfficientJet = false; + bool isFakeJet = false; if (m_useTrackSelection and not (m_trackSelectionTool->accept(*thisTrack, primaryvertex))) { continue; } @@ -390,13 +423,12 @@ InDetPhysValMonitoringTool::fillHistograms() { const xAOD::TruthParticle* associatedTruth = getAsTruth.getTruth(thisTrack); - if (associatedTruth) { - if(m_truthSelectionTool->accept(associatedTruth) and prob > m_lowProb ) { - isEfficientJet = true; - } - m_monPlots->fillEfficiency(*associatedTruth, *thisJet, isEfficientJet); - m_monPlots->fillFakeRate(*thisTrack, *thisJet, !isEfficientJet); - } + if (associatedTruth){ + if(m_truthSelectionTool->accept(associatedTruth) and prob < m_lowProb ) { + isFakeJet = true; + } + m_monPlots->fillFakeRate(*thisTrack, *thisJet, isFakeJet); + } } } } // loop over jets