diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefCommon.xml b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefCommon.xml index b9b1a5117a37dff60e333a2823855ad3fc7873aa..79abfa53da330a99f80bc5d7b41da40c58c90770 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefCommon.xml +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefCommon.xml @@ -1078,7 +1078,7 @@ <h id="pullHelper_eta_ptqopt" type="TH2F" title="pull vs #eta for p_{T} #times q/p_{T}"> <x title="#eta" n="&NETA;" lo="-&ETA;" hi="&ETA;"/> - <y title="(reco_{q/p_{T}} - truth_{q/p_{T}) / #sigma(q/p_{T})" n="100" lo="-10.0" hi="10.0"/> + <y title="(reco_{q/p_{T}} - truth_{q/p_{T}}) / #sigma(q/p_{T})" n="100" lo="-10.0" hi="10.0"/> </h> <h id="pullHelper_eta_theta" type="TH2F" title="pull vs #eta for #theta"> diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Resolution.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Resolution.cxx index d7eaa5113295b5f9bbc06bf19e56e1b0698b8015..ab319b3d7957eb849ef90c7c513b80977ad22ca2 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Resolution.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Resolution.cxx @@ -367,7 +367,7 @@ InDetPerfPlot_Resolution::getTrackParameters(const xAOD::TruthParticle& truthprt } } //rescale Pt - if (m_truetrkP[PT] != undefinedValue) m_truetrkP[PT] = truthprt.pt() / Gaudi::Units::GeV; + m_truetrkP[PT] = truthprt.pt() / Gaudi::Units::GeV; //special cases //need both theta and qOverP for qOverPT //we didnt check qOverP yet, since the closest named variable (strangely; see header) is ptqopt @@ -422,4 +422,4 @@ InDetPerfPlot_Resolution::finalizePlots() { } -} \ No newline at end of file +} diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringTool.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringTool.cxx index 80be6f74dcd152b3ee590798875253f5a00219f1..f88dfc4668250d1026433cfd290e9319653b8072 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringTool.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringTool.cxx @@ -343,18 +343,20 @@ InDetPhysValMonitoringTool::fillHistograms() { // //Loop over reco tracks to find the match // + const xAOD::TrackParticle* matchedTrack = nullptr; for (const auto& thisTrack: selectedTracks) { // Inner loop over selected track particles const xAOD::TruthParticle* associatedTruth = getAsTruth.getTruth(thisTrack); if (associatedTruth && associatedTruth == thisTruth) { float prob = getMatchingProbability(*thisTrack); if (not std::isnan(prob) && prob > m_lowProb) { isEfficient = true; + matchedTrack = thisTrack; break; } } } ATH_MSG_DEBUG("Filling efficiency plots info monitoring plots"); - m_monPlots->fillEfficiency(*thisTruth, isEfficient, puEvents); + m_monPlots->fillEfficiency(*thisTruth, *matchedTrack, isEfficient, puEvents); } } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.cxx index 547002cf1a89e1264ae5d7d63f7b6f7d3cf4a969..f74928bc807cbcaab76769325548c55338640935 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.cxx @@ -40,6 +40,32 @@ InDetRttPlots::InDetRttPlots(InDetPlotBase* pParent, const std::string& sDir, co m_resolutionPlotSecd = std::unique_ptr<InDetPerfPlot_Resolution>(new InDetPerfPlot_Resolution(this, "Tracks/Matched/Resolutions/Secondary")); m_hitsMatchedTracksPlots = std::unique_ptr<InDetPerfPlot_Hits>(new InDetPerfPlot_Hits(this, "Tracks/Matched/HitsOnTracks")); m_vertexTruthMatchingPlots = std::unique_ptr<InDetPerfPlot_VertexTruthMatching>(new InDetPerfPlot_VertexTruthMatching(this, "Vertices/AllPrimaryVertices", m_iDetailLevel)); + + //Split by track author + m_effSiSPSeededFinderPlots = std::unique_ptr<InDetPerfPlot_Efficiency>(new InDetPerfPlot_Efficiency(this, "TracksByAuthor/SiSPSeededFinder/Tracks/Efficiency")); + m_effInDetExtensionProcessorPlots = std::unique_ptr<InDetPerfPlot_Efficiency>(new InDetPerfPlot_Efficiency(this, "TracksByAuthor/InDetExtensionProcessor/Tracks/Efficiency")); + m_effTRTSeededTrackFinderPlots = std::unique_ptr<InDetPerfPlot_Efficiency>(new InDetPerfPlot_Efficiency(this, "TracksByAuthor/TRTSeededTrackFinder/Tracks/Efficiency")); + m_effTRTStandalonePlots = std::unique_ptr<InDetPerfPlot_Efficiency>(new InDetPerfPlot_Efficiency(this, "TracksByAuthor/TRTStandalone/Tracks/Efficiency")); + m_effSiSpacePointsSeedMaker_LargeD0Plots = std::unique_ptr<InDetPerfPlot_Efficiency>(new InDetPerfPlot_Efficiency(this, "TracksByAuthor/SiSpacePointsSeedMaker_LargeD0/Tracks/Efficiency")); + + m_fakeSiSPSeededFinderPlots = std::unique_ptr<InDetPerfPlot_FakeRate>(new InDetPerfPlot_FakeRate(this, "TracksByAuthor/SiSPSeededFinder/Tracks/FakeRate")); + m_fakeInDetExtensionProcessorPlots = std::unique_ptr<InDetPerfPlot_FakeRate>(new InDetPerfPlot_FakeRate(this, "TracksByAuthor/InDetExtensionProcessor/Tracks/FakeRate")); + m_fakeTRTSeededTrackFinderPlots = std::unique_ptr<InDetPerfPlot_FakeRate>(new InDetPerfPlot_FakeRate(this, "TracksByAuthor/TRTSeededTrackFinder/Tracks/FakeRate")); + m_fakeTRTStandalonePlots = std::unique_ptr<InDetPerfPlot_FakeRate>(new InDetPerfPlot_FakeRate(this, "TracksByAuthor/TRTStandalone/Tracks/FakeRate")); + m_fakeSiSpacePointsSeedMaker_LargeD0Plots = std::unique_ptr<InDetPerfPlot_FakeRate>(new InDetPerfPlot_FakeRate(this, "TracksByAuthor/SiSpacePointsSeedMaker_LargeD0/Tracks/FakeRate")); + + m_trkParaSiSPSeededFinderPlots = std::unique_ptr<InDetPerfPlot_TrackParameters>(new InDetPerfPlot_TrackParameters(this, "TracksByAuthor/SiSPSeededFinder/Tracks/Parameters")); + m_trkParaInDetExtensionProcessorPlots = std::unique_ptr<InDetPerfPlot_TrackParameters>(new InDetPerfPlot_TrackParameters(this, "TracksByAuthor/InDetExtensionProcessor/Tracks/Parameters")); + m_trkParaTRTSeededTrackFinderPlots = std::unique_ptr<InDetPerfPlot_TrackParameters>(new InDetPerfPlot_TrackParameters(this, "TracksByAuthor/TRTSeededTrackFinder/Tracks/Parameters")); + m_trkParaTRTStandalonePlots = std::unique_ptr<InDetPerfPlot_TrackParameters>(new InDetPerfPlot_TrackParameters(this, "TracksByAuthor/TRTStandalone/Tracks/Parameters")); + m_trkParaSiSpacePointsSeedMaker_LargeD0Plots = std::unique_ptr<InDetPerfPlot_TrackParameters>(new InDetPerfPlot_TrackParameters(this, "TracksByAuthor/SiSpacePointsSeedMaker_LargeD0/Tracks/Parameters")); + + m_resSiSPSeededFinderPlots = std::unique_ptr<InDetPerfPlot_Resolution>(new InDetPerfPlot_Resolution(this, "TracksByAuthor/SiSPSeededFinder/Tracks/Resolution")); + m_resInDetExtensionProcessorPlots = std::unique_ptr<InDetPerfPlot_Resolution>(new InDetPerfPlot_Resolution(this, "TracksByAuthor/InDetExtensionProcessor/Tracks/Resolution")); + m_resTRTSeededTrackFinderPlots = std::unique_ptr<InDetPerfPlot_Resolution>(new InDetPerfPlot_Resolution(this, "TracksByAuthor/TRTSeededTrackFinder/Tracks/Resolution")); + m_resTRTStandalonePlots = std::unique_ptr<InDetPerfPlot_Resolution>(new InDetPerfPlot_Resolution(this, "TracksByAuthor/TRTStandalone/Tracks/Resolution")); + m_resSiSpacePointsSeedMaker_LargeD0Plots = std::unique_ptr<InDetPerfPlot_Resolution>(new InDetPerfPlot_Resolution(this, "TracksByAuthor/SiSpacePointsSeedMaker_LargeD0/Tracks/Resolution")); + } //A lot of Jets... do we need these at all??? @@ -65,6 +91,26 @@ InDetRttPlots::fill(const xAOD::TrackParticle& particle, const xAOD::TruthPartic } else if (barcode >= 200000 && prob > 0.7 && m_iDetailLevel >= 200) { m_resolutionPlotSecd->fill(particle, truthParticle); } + + if(m_iDetailLevel >= 200 and (barcode < 200000 and barcode != 0 and prob > 0.5)){ + std::bitset<xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo> patternInfo = particle.patternRecoInfo(); + + bool isSiSpSeededFinder = patternInfo.test(0); + bool isInDetExtensionProcessor = patternInfo.test(3); + bool isTRTSeededTrackFinder = patternInfo.test(4); + bool isTRTStandalone = patternInfo.test(20); + bool isSiSpacePointsSeedMaker_LargeD0 = patternInfo.test(49); + + if(isSiSpSeededFinder and not isInDetExtensionProcessor) m_resSiSPSeededFinderPlots->fill(particle, truthParticle); + if(isInDetExtensionProcessor and not (isTRTSeededTrackFinder or isSiSpacePointsSeedMaker_LargeD0)) m_resInDetExtensionProcessorPlots->fill(particle, truthParticle); + if(isTRTSeededTrackFinder and not isTRTStandalone) m_resTRTSeededTrackFinderPlots->fill(particle, truthParticle); + if(isTRTStandalone) m_resTRTStandalonePlots->fill(particle, truthParticle); + if(isSiSpacePointsSeedMaker_LargeD0) m_resSiSpacePointsSeedMaker_LargeD0Plots->fill(particle, truthParticle); + + } + + + } if(m_iDetailLevel >= 200){ @@ -85,6 +131,24 @@ InDetRttPlots::fill(const xAOD::TrackParticle& particle) { m_hitEffPlot.fill(particle); // fill pt plots m_trackParameters.fill(particle); + if(m_iDetailLevel >= 200){ + std::bitset<xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo> patternInfo = particle.patternRecoInfo(); + + bool isSiSpSeededFinder = patternInfo.test(0); + bool isInDetExtensionProcessor = patternInfo.test(3); + bool isTRTSeededTrackFinder = patternInfo.test(4); + 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); + + } + + m_hitsRecoTracksPlots.fill(particle); } @@ -104,8 +168,35 @@ InDetRttPlots::fill(const xAOD::TruthParticle& truthParticle) { void -InDetRttPlots::fillEfficiency(const xAOD::TruthParticle& truth, const bool isGood, const unsigned int /*nMuEvents*/) { +InDetRttPlots::fillEfficiency(const xAOD::TruthParticle& truth, const xAOD::TrackParticle& track, const bool isGood, const unsigned int /*nMuEvents*/) { m_effPlots.fill(truth, isGood); + + if(m_iDetailLevel >= 200){ + if(isGood){ + std::bitset<xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo> patternInfo = track.patternRecoInfo(); + + bool isSiSpSeededFinder = patternInfo.test(0); + bool isInDetExtensionProcessor = patternInfo.test(3); + bool isTRTSeededTrackFinder = patternInfo.test(4); + 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); + } 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); + + } + + } + } // @@ -116,7 +207,25 @@ void InDetRttPlots::fillFakeRate(const xAOD::TrackParticle& track, const bool isFake, const bool isAssociatedTruth){ m_missingTruthFakePlots.fill(track, !isAssociatedTruth); - if(isAssociatedTruth) m_fakePlots.fill(track, isFake); + if(isAssociatedTruth) { + m_fakePlots.fill(track, isFake); + + if(m_iDetailLevel >= 200){ + std::bitset<xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo> patternInfo = track.patternRecoInfo(); + + bool isSiSpSeededFinder = patternInfo.test(0); + bool isInDetExtensionProcessor = patternInfo.test(3); + bool isTRTSeededTrackFinder = patternInfo.test(4); + 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 + } + } } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.h index c4302232d859cc4ba1e7067e17b916e5a7769b11..d666f14c5612e63200da194f5afacd550a61acbf 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.h @@ -56,7 +56,7 @@ public: ///fill for things needing truth only void fill(const xAOD::TruthParticle& particle); ///Fill for efficiency plots - void fillEfficiency(const xAOD::TruthParticle& truth, const bool isGood, unsigned int /*mu=0*/); + void fillEfficiency(const xAOD::TruthParticle& truth, const xAOD::TrackParticle& track, const bool isGood, unsigned int /*mu=0*/); ///fill for things needing all truth - not just the ones from the reco tracks @@ -97,6 +97,34 @@ private: bool m_doTrackInJetPlots; std::unique_ptr<InDetPerfPlot_TrkInJet> m_trkInJetPlots; + //By track authors + std::unique_ptr<InDetPerfPlot_Efficiency> m_effSiSPSeededFinderPlots; + std::unique_ptr<InDetPerfPlot_Efficiency> m_effInDetExtensionProcessorPlots; + std::unique_ptr<InDetPerfPlot_Efficiency> m_effTRTSeededTrackFinderPlots; + std::unique_ptr<InDetPerfPlot_Efficiency> m_effTRTStandalonePlots; + std::unique_ptr<InDetPerfPlot_Efficiency> m_effSiSpacePointsSeedMaker_LargeD0Plots; + + std::unique_ptr<InDetPerfPlot_FakeRate> m_fakeSiSPSeededFinderPlots; + std::unique_ptr<InDetPerfPlot_FakeRate> m_fakeInDetExtensionProcessorPlots; + std::unique_ptr<InDetPerfPlot_FakeRate> m_fakeTRTSeededTrackFinderPlots; + std::unique_ptr<InDetPerfPlot_FakeRate> m_fakeTRTStandalonePlots; + std::unique_ptr<InDetPerfPlot_FakeRate> m_fakeSiSpacePointsSeedMaker_LargeD0Plots; + + std::unique_ptr<InDetPerfPlot_TrackParameters> m_trkParaSiSPSeededFinderPlots; + std::unique_ptr<InDetPerfPlot_TrackParameters> m_trkParaInDetExtensionProcessorPlots; + std::unique_ptr<InDetPerfPlot_TrackParameters> m_trkParaTRTSeededTrackFinderPlots; + std::unique_ptr<InDetPerfPlot_TrackParameters> m_trkParaTRTStandalonePlots; + std::unique_ptr<InDetPerfPlot_TrackParameters> m_trkParaSiSpacePointsSeedMaker_LargeD0Plots; + + std::unique_ptr<InDetPerfPlot_Resolution> m_resSiSPSeededFinderPlots; + std::unique_ptr<InDetPerfPlot_Resolution> m_resInDetExtensionProcessorPlots; + std::unique_ptr<InDetPerfPlot_Resolution> m_resTRTSeededTrackFinderPlots; + std::unique_ptr<InDetPerfPlot_Resolution> m_resTRTStandalonePlots; + std::unique_ptr<InDetPerfPlot_Resolution> m_resSiSpacePointsSeedMaker_LargeD0Plots; + + + + std::string m_trackParticleTruthProbKey; float m_truthProbLowThreshold; };