ATLAS Offline Software
InDetRttPlots.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
10 #include "InDetRttPlots.h"
14 #include "xAODTruth/TruthVertex.h"
17 #include <cmath> // std::isnan()
18 #include <limits>
19 
20 InDetRttPlots::InDetRttPlots(InDetPlotBase* pParent, const std::string& sDir, const InDetRttPlotConfig & cfg) : InDetPlotBase(pParent, sDir),
21  m_config(cfg){
22 
25  if (m_config.doTrackParameters) m_trackParameters = std::make_unique<InDetPerfPlot_TrackParameters>(this, "Tracks/Selected/Parameters");
26  if (m_config.doNTracks) m_nTracks = std::make_unique<InDetPerfPlot_nTracks>(this, "Tracks/Tracks");
27  if (m_config.doHitResidualPlot) m_hitResidualPlot= std::make_unique<InDetPerfPlot_HitResidual>(this, "Tracks/Hits/Residuals");
28  if (m_config.doHitEffPlot) m_hitEffPlot= std::make_unique<InDetPerfPlot_HitEfficiency>(this, "Tracks/Hits/Efficiency");
29  if (m_config.doFakePlots) m_fakePlots= std::make_unique<InDetPerfPlot_FakeRate>(this, "Tracks/FakeRate");
30  if (m_config.doMissingTruthFakePlots) m_missingTruthFakePlots= std::make_unique<InDetPerfPlot_FakeRate>(this, "Tracks/Unlinked/FakeRate");
31  if (m_config.doResolutionPlotPrim) m_resolutionPlotPrim= std::make_unique<InDetPerfPlot_Resolution>(this, "Tracks/Matched/Resolutions/Primary");
32  if (m_config.doResolutionPlotPrim_truthFromB) m_resolutionPlotPrim_truthFromB= std::make_unique<InDetPerfPlot_Resolution>(this, "Tracks/Matched/Resolutions/TruthFromB");
33  if (m_config.doHitsRecoTracksPlots) m_hitsRecoTracksPlots= std::make_unique<InDetPerfPlot_Hits>(this, "Tracks/Selected/HitsOnTracks");
34  if (m_config.doEffPlots) m_effPlots= std::make_unique<InDetPerfPlot_Efficiency>(this, "Tracks/Efficiency");
35  if (m_config.doDuplicatePlots) m_duplicatePlots = std::make_unique<InDetPerfPlot_Duplicate>(this, "Tracks/Duplicate");
36  if (m_config.doVerticesVsMuPlots) m_verticesVsMuPlots= std::make_unique<InDetPerfPlot_VerticesVsMu>(this, "Vertices/AllPrimaryVertices");
37  if (m_config.doVertexPlots) m_vertexPlots= std::make_unique<InDetPerfPlot_Vertex>(this, "Vertices/AllPrimaryVertices");
38  if (m_config.doHardScatterVertexPlots) m_hardScatterVertexPlots= std::make_unique<InDetPerfPlot_Vertex>(this, "Vertices/HardScatteringVertex");
39  if (m_config.doHardScatterVertexTruthMatchingPlots) m_hardScatterVertexTruthMatchingPlots= std::make_unique<InDetPerfPlot_VertexTruthMatching>(this, "Vertices/HardScatteringVertex");
40  if (m_config.doTrtExtensionPlots) m_trtExtensionPlots= std::make_unique<InDetPerfPlot_TRTExtension>(this, "Tracks/TRTExtension");
41  if (m_config.doNtupleTruthToReco) m_ntupleTruthToReco= std::make_unique<InDetPerfNtuple_TruthToReco>(this, "Ntuples", "TruthToReco");
42  if (m_config.doResolutionPlotSecd) m_resolutionPlotSecd = std::make_unique<InDetPerfPlot_Resolution>(this, "Tracks/Matched/Resolutions/Secondary");
43  if (m_config.doHitsMatchedTracksPlots) m_hitsMatchedTracksPlots = std::make_unique<InDetPerfPlot_Hits>(this, "Tracks/Matched/HitsOnTracks");
44  if (m_config.doHitsFakeTracksPlots) m_hitsFakeTracksPlots = std::make_unique<InDetPerfPlot_Hits>(this, "Tracks/Fakes/HitsOnTracks");
45  if (m_config.doHitsUnlinkedTracksPlots) m_hitsUnlinkedTracksPlots = std::make_unique<InDetPerfPlot_Hits>(this, "Tracks/Unlinked/HitsOnTracks");
46  if (m_config.doVertexTruthMatchingPlots) m_vertexTruthMatchingPlots = std::make_unique<InDetPerfPlot_VertexTruthMatching>(this, "Vertices/AllPrimaryVertices", m_iDetailLevel);
47 
49  m_effSiSPSeededFinderPlots = std::make_unique<InDetPerfPlot_Efficiency>(this, "TracksByAuthor/SiSPSeededFinder/Tracks/Efficiency");
50  m_effInDetExtensionProcessorPlots = std::make_unique<InDetPerfPlot_Efficiency>(this, "TracksByAuthor/InDetExtensionProcessor/Tracks/Efficiency");
51  m_effTRTSeededTrackFinderPlots = std::make_unique<InDetPerfPlot_Efficiency>(this, "TracksByAuthor/TRTSeededTrackFinder/Tracks/Efficiency");
52  m_effTRTStandalonePlots = std::make_unique<InDetPerfPlot_Efficiency>(this, "TracksByAuthor/TRTStandalone/Tracks/Efficiency");
53  m_effSiSpacePointsSeedMaker_LargeD0Plots = std::make_unique<InDetPerfPlot_Efficiency>(this, "TracksByAuthor/SiSpacePointsSeedMaker_LargeD0/Tracks/Efficiency");
54  }
55 
57  m_fakeSiSPSeededFinderPlots = std::make_unique<InDetPerfPlot_FakeRate>(this, "TracksByAuthor/SiSPSeededFinder/Tracks/FakeRate");
58  m_fakeInDetExtensionProcessorPlots = std::make_unique<InDetPerfPlot_FakeRate>(this, "TracksByAuthor/InDetExtensionProcessor/Tracks/FakeRate");
59  m_fakeTRTSeededTrackFinderPlots = std::make_unique<InDetPerfPlot_FakeRate>(this, "TracksByAuthor/TRTSeededTrackFinder/Tracks/FakeRate");
60  m_fakeTRTStandalonePlots = std::make_unique<InDetPerfPlot_FakeRate>(this, "TracksByAuthor/TRTStandalone/Tracks/FakeRate");
61  m_fakeSiSpacePointsSeedMaker_LargeD0Plots = std::make_unique<InDetPerfPlot_FakeRate>(this, "TracksByAuthor/SiSpacePointsSeedMaker_LargeD0/Tracks/FakeRate");
62  }
63 
65  m_trkParaSiSPSeededFinderPlots = std::make_unique<InDetPerfPlot_TrackParameters>(this, "TracksByAuthor/SiSPSeededFinder/Tracks/Parameters");
66  m_trkParaInDetExtensionProcessorPlots = std::make_unique<InDetPerfPlot_TrackParameters>(this, "TracksByAuthor/InDetExtensionProcessor/Tracks/Parameters");
67  m_trkParaTRTSeededTrackFinderPlots = std::make_unique<InDetPerfPlot_TrackParameters>(this, "TracksByAuthor/TRTSeededTrackFinder/Tracks/Parameters");
68  m_trkParaTRTStandalonePlots = std::make_unique<InDetPerfPlot_TrackParameters>(this, "TracksByAuthor/TRTStandalone/Tracks/Parameters");
69  m_trkParaSiSpacePointsSeedMaker_LargeD0Plots= std::make_unique<InDetPerfPlot_TrackParameters>(this, "TracksByAuthor/SiSpacePointsSeedMaker_LargeD0/Tracks/Parameters");
70  }
71 
73  m_resSiSPSeededFinderPlots = std::make_unique<InDetPerfPlot_Resolution>(this, "TracksByAuthor/SiSPSeededFinder/Tracks/Resolution");
74  m_resInDetExtensionProcessorPlots = std::make_unique<InDetPerfPlot_Resolution>(this, "TracksByAuthor/InDetExtensionProcessor/Tracks/Resolution");
75  m_resTRTSeededTrackFinderPlots = std::make_unique<InDetPerfPlot_Resolution>(this, "TracksByAuthor/TRTSeededTrackFinder/Tracks/Resolution");
76  m_resTRTStandalonePlots = std::make_unique<InDetPerfPlot_Resolution>(this, "TracksByAuthor/TRTStandalone/Tracks/Resolution");
77  m_resSiSpacePointsSeedMaker_LargeD0Plots = std::make_unique<InDetPerfPlot_Resolution>(this, "TracksByAuthor/SiSpacePointsSeedMaker_LargeD0/Tracks/Resolution");
78  }
79 
80  if (m_config.doTrkInJetPlots) m_trkInJetPlots = std::make_unique<InDetPerfPlot_TrkInJet>(this, "TracksInJets/Tracks");
81  if (m_config.doTrkInJetPlots_matched) m_trkInJetPlots_matched = std::make_unique<InDetPerfPlot_TrkInJet>(this, "TracksInJets/Matched",false);
82  if (m_config.doTrkInJetPlots_fake) m_trkInJetPlots_fake = std::make_unique<InDetPerfPlot_TrkInJet>(this, "TracksInJets/Fakes",false);
83  if (m_config.doTrkInJetPlots_unlinked) m_trkInJetPlots_unlinked = std::make_unique<InDetPerfPlot_TrkInJet>(this, "TracksInJets/Unlinked",false);
84  if (m_config.doTrkInJetPlots_bjets) m_trkInJetPlots_bjets = std::make_unique<InDetPerfPlot_TrkInJet>(this, "TracksInBJets/Tracks");
85  if (m_config.doTrkInJetPlots_matched_bjets) m_trkInJetPlots_matched_bjets = std::make_unique<InDetPerfPlot_TrkInJet>(this, "TracksInBJets/Matched",false);
86  if (m_config.doTrkInJetPlots_fake_bjets) m_trkInJetPlots_fake_bjets = std::make_unique<InDetPerfPlot_TrkInJet>(this, "TracksInBJets/Fakes",false);
87  if (m_config.doTrkInJetPlots_unlinked_bjets) m_trkInJetPlots_unlinked_bjets = std::make_unique<InDetPerfPlot_TrkInJet>(this, "TracksInBJets/Unlinked",false);
88  if (m_config.doTrkInJetPlots_truthFromB) m_trkInJetPlots_truthFromB = std::make_unique<InDetPerfPlot_TrkInJet>(this, "TracksInBJets/TruthFromB");
89 
92 }
93 //
94 //Fill plots for matched particles
95 //
96 
97 void
98 InDetRttPlots::fill(const xAOD::TrackParticle& particle, const xAOD::TruthParticle& truthParticle, bool isFromB, float mu, float weight) {
99  // fill measurement bias, resolution, and pull plots
100 
101  // fill ITK resolutions (bias / resolutions)
103  if (tpTruthProbKeyAcc.isAvailable(particle)) {
104  const float prob = tpTruthProbKeyAcc(particle);
105  int uniqueID = HepMC::uniqueID(truthParticle);
106  if (!HepMC::is_simulation_particle(&truthParticle) && uniqueID != HepMC::UNDEFINED_ID && prob > 0.5) {
107  if (m_resolutionPlotPrim) m_resolutionPlotPrim->fill(particle, truthParticle, weight);
108  } else if (HepMC::is_simulation_particle(&truthParticle) && prob > 0.7 && m_iDetailLevel >= 200) {
109  if (m_resolutionPlotSecd) m_resolutionPlotSecd->fill(particle, truthParticle, weight);
110  }
111  if ( isFromB ) {
113  }
114 
116  std::bitset<xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo> patternInfo = particle.patternRecoInfo();
117 
118  bool isSiSpSeededFinder = patternInfo.test(xAOD::TrackPatternRecoInfo::SiSPSeededFinder);
119  bool isInDetExtensionProcessor = patternInfo.test(xAOD::TrackPatternRecoInfo::InDetExtensionProcessor);
120  bool isTRTSeededTrackFinder = patternInfo.test(xAOD::TrackPatternRecoInfo::TRTSeededTrackFinder);
121  bool isTRTStandalone = patternInfo.test(xAOD::TrackPatternRecoInfo::TRTStandalone);
122  bool isSiSpacePointsSeedMaker_LargeD0 = patternInfo.test(xAOD::TrackPatternRecoInfo::SiSpacePointsSeedMaker_LargeD0);
123 
124  if(isSiSpSeededFinder and not isInDetExtensionProcessor) m_resSiSPSeededFinderPlots->fill(particle, truthParticle, weight);
125  if(isInDetExtensionProcessor and not (isTRTSeededTrackFinder or isSiSpacePointsSeedMaker_LargeD0)) m_resInDetExtensionProcessorPlots->fill(particle, truthParticle, weight);
126  if(isTRTSeededTrackFinder and not isTRTStandalone) m_resTRTSeededTrackFinderPlots->fill(particle, truthParticle, weight);
127  if(isTRTStandalone) m_resTRTStandalonePlots->fill(particle, truthParticle, weight);
128  if(isSiSpacePointsSeedMaker_LargeD0) m_resSiSpacePointsSeedMaker_LargeD0Plots->fill(particle, truthParticle, weight);
129 
130  }
131 
132  if (m_trtExtensionPlots && !HepMC::is_simulation_particle(&truthParticle) && uniqueID != HepMC::UNDEFINED_ID && prob > 0.5 ) m_trtExtensionPlots->fill(particle, truthParticle, weight);
133  }
134 
136  int uniqueID = HepMC::uniqueID(truthParticle);
137  if (!HepMC::is_simulation_particle(&truthParticle) && uniqueID != HepMC::UNDEFINED_ID) {
139  }
140  }
141 }
142 
143 //
144 //Fill basic track properties for reconstructed tracks
145 //
146 
147 void
151  // fill pt plots
153 
155  std::bitset<xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo> patternInfo = particle.patternRecoInfo();
156 
157  bool isSiSpSeededFinder = patternInfo.test(0);
158  bool isInDetExtensionProcessor = patternInfo.test(3);
159  bool isTRTSeededTrackFinder = patternInfo.test(4);
160  bool isTRTStandalone = patternInfo.test(20);
161  bool isSiSpacePointsSeedMaker_LargeD0 = patternInfo.test(49);
162 
163  if(isSiSpSeededFinder and not isInDetExtensionProcessor) m_trkParaSiSPSeededFinderPlots->fill(particle, weight);
164  else if(isInDetExtensionProcessor and not (isTRTSeededTrackFinder or isSiSpacePointsSeedMaker_LargeD0)) m_trkParaInDetExtensionProcessorPlots->fill(particle, weight);
165  else if(isTRTSeededTrackFinder and not isTRTStandalone) m_trkParaTRTSeededTrackFinderPlots->fill(particle, weight);
166  else if(isTRTStandalone) m_trkParaTRTStandalonePlots->fill(particle, weight);
167  else if(isSiSpacePointsSeedMaker_LargeD0) m_trkParaSiSpacePointsSeedMaker_LargeD0Plots->fill(particle, weight);
168 
169  }
170 
172 }
173 
174 void
175 InDetRttPlots::fill(const xAOD::TrackParticle& particle, const float mu, const unsigned int nVtx, float weight) {
176 
179 
180 }
181 
182 void
183 InDetRttPlots::fill(const unsigned int ntracks, const unsigned int truthMu,
184  const float actualMu, const unsigned int nvertices,
185  const float weight) {
186 
187  if (m_nTracks) m_nTracks->fill(ntracks, truthMu, actualMu, nvertices, weight);
188 
189 }
190 //
191 //Fill plots for selected truth particle
192 //
193 
194 void
195 InDetRttPlots::fill(const xAOD::TruthParticle& truthParticle, float weight) {
196  // fill truth plots
197  if (m_trackParameters) m_trackParameters->fill(truthParticle, weight);
198 }
199 
200 //
201 //Fill Efficiencies
202 //
203 
204 void
206 (const xAOD::TruthParticle& truth, const xAOD::TrackParticle* track,
207  const bool isGood, const unsigned int truthMu, const float actualMu, float weight) {
208  if (m_effPlots) m_effPlots->fill(truth, isGood, truthMu, actualMu, weight);
209 
211 
212  bool isGoodSiSPSeededFinder = false;
213  bool isGoodInDetExtensionProcessor = false;
214  bool isGoodTRTSeededTrackFinder = false;
215  bool isGoodTRTStandalone = false;
216  bool isGoodSiSpacePointsSeedMaker_LargeD0 = false;
217 
218  if(isGood && track){
219  std::bitset<xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo> patternInfo = track->patternRecoInfo();
220 
221  bool isSiSpSeededFinder = patternInfo.test(0);
222  bool isInDetExtensionProcessor = patternInfo.test(3);
223  bool isTRTSeededTrackFinder = patternInfo.test(4);
224  bool isTRTStandalone = patternInfo.test(20);
225  bool isSiSpacePointsSeedMaker_LargeD0 = patternInfo.test(49);
226 
227  isGoodSiSPSeededFinder = isSiSpSeededFinder and not isInDetExtensionProcessor;
228  isGoodInDetExtensionProcessor = isInDetExtensionProcessor and
229  not (isTRTSeededTrackFinder or isSiSpacePointsSeedMaker_LargeD0);
230  isGoodTRTSeededTrackFinder = isTRTSeededTrackFinder and not isTRTStandalone;
231  isGoodTRTStandalone = isTRTStandalone;
232  isGoodSiSpacePointsSeedMaker_LargeD0 = isSiSpacePointsSeedMaker_LargeD0;
233 
234  }
235 
236  m_effSiSPSeededFinderPlots->fill(truth, isGoodSiSPSeededFinder,
237  truthMu, actualMu, weight);
238  m_effInDetExtensionProcessorPlots->fill(truth, isGoodInDetExtensionProcessor,
239  truthMu, actualMu, weight);
240  m_effTRTSeededTrackFinderPlots->fill(truth, isGoodTRTSeededTrackFinder,
241  truthMu, actualMu, weight);
242  m_effTRTStandalonePlots->fill(truth, isGoodTRTStandalone, truthMu, actualMu, weight);
243  m_effSiSpacePointsSeedMaker_LargeD0Plots->fill(truth, isGoodSiSpacePointsSeedMaker_LargeD0,
244  truthMu, actualMu, weight);
245  }
246 
247 }
248 
250 (const xAOD::TruthParticle& truth, const bool isGood,
251  const unsigned int truthMu, const float actualMu, float weight) {
252  if(m_effPlots) m_effPlots->fillTechnicalEfficiency(truth, isGood, truthMu, actualMu, weight);
253 }
254 
255 //
256 //Fill Fake Rates
257 //
259 (const xAOD::TruthParticle& truth,
260  const std::vector<const xAOD::TrackParticle*>& tracks, float weight) {
261  m_duplicatePlots->fill(truth, tracks.size(), weight);
262 }
263 
264 
265 //
266 //Fill Fake Rates
267 //
268 
269 void
270 InDetRttPlots::fillFakeRate(const xAOD::TrackParticle& track, const bool isFake, const bool isAssociatedTruth, const float mu, float weight){
271 
272  if (m_missingTruthFakePlots) m_missingTruthFakePlots->fill(track, !isAssociatedTruth, weight, mu);
273  if(isAssociatedTruth) {
274  if (m_fakePlots) m_fakePlots->fill(track, isFake, weight, mu);
277  std::bitset<xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo> patternInfo = track.patternRecoInfo();
278 
279  bool isSiSpSeededFinder = patternInfo.test(0);
280  bool isInDetExtensionProcessor = patternInfo.test(3);
281  bool isTRTSeededTrackFinder = patternInfo.test(4);
282  bool isTRTStandalone = patternInfo.test(20);
283  bool isSiSpacePointsSeedMaker_LargeD0 = patternInfo.test(49);
284 
285  if(isSiSpSeededFinder and not isInDetExtensionProcessor) m_fakeSiSPSeededFinderPlots->fill(track, isFake, weight, mu); //No extensions
286  if(isInDetExtensionProcessor and not (isTRTSeededTrackFinder or isSiSpacePointsSeedMaker_LargeD0)) m_fakeInDetExtensionProcessorPlots->fill(track, isFake, weight, mu); //Extensions but not Back-tracking
287  if(isTRTSeededTrackFinder and not isTRTStandalone) m_fakeTRTSeededTrackFinderPlots->fill(track, isFake, weight, mu); //BackTracking
288  if(isTRTStandalone) m_fakeTRTStandalonePlots->fill(track, isFake, weight, mu); //TRT standalone
289  if(isSiSpacePointsSeedMaker_LargeD0) m_fakeSiSpacePointsSeedMaker_LargeD0Plots->fill(track, isFake, weight, mu);
290  }
291  }
292  else {
294  }
295 
296 }
297 
298 
299 
300 //
301 //Fill Vertexing Plots
302 //
303 void
304 InDetRttPlots::fill(const xAOD::VertexContainer& vertexContainer, const xAOD::Vertex* recoHardScatter, const std::vector<const xAOD::TruthVertex*>& truthHSVertices, const std::vector<const xAOD::TruthVertex*>& truthPUVertices, float weight) {
305  // fill vertex-specific properties, for all vertices and for hard-scattering vertex
306 
307  for (const auto& vtx : vertexContainer.stdcont()) {
308  if (vtx->vertexType() == xAOD::VxType::NoVtx) {
309  ATH_MSG_DEBUG("IN InDetRttPlots::fill, found xAOD::VxType::NoVtx");
310  continue; // skip dummy vertex
311  }
312  if (m_vertexPlots) m_vertexPlots->fill(*vtx, weight);
313  ATH_MSG_DEBUG("IN InDetRttPlots::fill, filling for all vertices");
314  }
315 
316  if (recoHardScatter) {
317  if (m_hardScatterVertexPlots) m_hardScatterVertexPlots->fill(*recoHardScatter, weight);
319  if(!truthHSVertices.empty() ) m_hardScatterVertexTruthMatchingPlots->fill(*recoHardScatter,truthHSVertices[0],weight);
320  else m_hardScatterVertexTruthMatchingPlots->fill(*recoHardScatter,nullptr,weight);
321  }
322  ATH_MSG_DEBUG("IN InDetRttPlots::fill, filling for all HS vertex");
323  }
324 
325  if(m_vertexTruthMatchingPlots) m_vertexTruthMatchingPlots->fill(recoHardScatter, vertexContainer, truthHSVertices, truthPUVertices, weight);
326 }
327 
328 
329 void
330 InDetRttPlots::fill(const xAOD::VertexContainer& vertexContainer, const unsigned int truthMu, const float actualMu, float weight) {
331  if (m_verticesVsMuPlots) m_verticesVsMuPlots->fill(vertexContainer, truthMu, actualMu, weight);
332 }
333 
334 //
335 //Fill Counters
336 //
337 void
339  if (m_nTracks) m_nTracks->fill(freq, counter, weight);
340 }
341 
342 //Track in Jet Plots
343 void
344 InDetRttPlots::fill(const xAOD::TrackParticle& track, const xAOD::Jet& jet, bool isBjet, bool isFake, bool isUnlinked, bool truthIsFromB, float weight){
346  if (isFake){
349  }
350  else if (isUnlinked){
353  }
354  else {
357  }
358  if(isBjet){
361  }
362 }
363 
364 void
365 InDetRttPlots::fillEfficiency(const xAOD::TruthParticle& truth, const xAOD::Jet& jet, bool isEfficient, bool isBjet, bool truthIsFromB, float weight) {
366  if (m_trkInJetPlots) m_trkInJetPlots->fillEfficiency(truth, jet, isEfficient, weight);
367  if(isBjet && m_trkInJetPlots_bjets) m_trkInJetPlots_bjets->fillEfficiency(truth, jet, isEfficient, weight);
368 
369  if ( isBjet and m_trkInJetPlots_truthFromB and truthIsFromB ) { // truth is from B
370  m_trkInJetPlots_truthFromB->fillEfficiency(truth, jet, isEfficient, weight);
371  }
372 }
373 
374 void
375 InDetRttPlots::fillFakeRate(const xAOD::TrackParticle& track, const xAOD::Jet& jet, bool isFake, bool isBjet, bool truthIsFromB, float weight) {
376  if (m_trkInJetPlots) m_trkInJetPlots->fillFakeRate(track, jet, isFake, weight);
377  if(isBjet && m_trkInJetPlots_bjets) m_trkInJetPlots_bjets->fillFakeRate(track, jet, isFake, weight);
378 
379  if ( isBjet and m_trkInJetPlots_truthFromB and truthIsFromB ) { // truth is from B
381  }
382 }
383 
384 //IDPVM Ntuple
385 void
387  // Fill track only entries with dummy truth values
388  if (m_ntupleTruthToReco){
389  m_ntupleTruthToReco->fillTrack(track, vtx);
390  m_ntupleTruthToReco->fillTree();
391  }
392 }
393 
394 void
396  // Fill truth only entries with dummy track values
397  if (m_ntupleTruthToReco){
398  m_ntupleTruthToReco->fillTruth(truth);
399  m_ntupleTruthToReco->fillTree();
400  }
401 }
402 
403 void
404 InDetRttPlots::fillNtuple(const xAOD::TrackParticle& track, const xAOD::TruthParticle& truth, const xAOD::Vertex* vtx, const int truthMatchRanking) {
405  // Fill track and truth entries
406  if (m_ntupleTruthToReco){
407  m_ntupleTruthToReco->fillTrack(track, vtx, truthMatchRanking);
408  m_ntupleTruthToReco->fillTruth(truth);
409  m_ntupleTruthToReco->fillTree();
410  }
411 }
InDetRttPlots::m_trkInJetPlots_fake_bjets
std::unique_ptr< InDetPerfPlot_TrkInJet > m_trkInJetPlots_fake_bjets
Definition: InDetRttPlots.h:196
PlotBase::m_iDetailLevel
int m_iDetailLevel
Definition: PlotBase.h:100
InDetRttPlots::m_trackParameters
std::unique_ptr< InDetPerfPlot_TrackParameters > m_trackParameters
plot members.
Definition: InDetRttPlots.h:169
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
InDetRttPlots::m_resTRTStandalonePlots
std::unique_ptr< InDetPerfPlot_Resolution > m_resTRTStandalonePlots
Definition: InDetRttPlots.h:223
InDetRttPlots::m_fakeSiSpacePointsSeedMaker_LargeD0Plots
std::unique_ptr< InDetPerfPlot_FakeRate > m_fakeSiSpacePointsSeedMaker_LargeD0Plots
Definition: InDetRttPlots.h:212
InDetRttPlots::m_nTracks
std::unique_ptr< InDetPerfPlot_nTracks > m_nTracks
Definition: InDetRttPlots.h:170
InDetRttPlotConfig::doResolutionsPerAuthor
bool doResolutionsPerAuthor
Definition: InDetRttPlots.h:102
InDetRttPlots::m_resTRTSeededTrackFinderPlots
std::unique_ptr< InDetPerfPlot_Resolution > m_resTRTSeededTrackFinderPlots
Definition: InDetRttPlots.h:222
InDetSecVtxTruthMatchUtils::isFake
bool isFake(int matchInfo)
Definition: InDetSecVtxTruthMatchTool.h:60
InDetRttPlotConfig::doTrkInJetPlots_matched_bjets
bool doTrkInJetPlots_matched_bjets
Definition: InDetRttPlots.h:91
InDetRttPlots::InDetRttPlots
InDetRttPlots(InDetPlotBase *pParent, const std::string &dirName, const InDetRttPlotConfig &config)
Definition: InDetRttPlots.cxx:20
InDetRttPlotConfig::doResolutionPlotSecd
bool doResolutionPlotSecd
Definition: InDetRttPlots.h:75
InDetRttPlots::m_missingTruthFakePlots
std::unique_ptr< InDetPerfPlot_FakeRate > m_missingTruthFakePlots
Definition: InDetRttPlots.h:174
InDetRttPlotConfig::doHitsUnlinkedTracksPlots
bool doHitsUnlinkedTracksPlots
Definition: InDetRttPlots.h:64
python.copyTCTOutput.sDir
sDir
Definition: copyTCTOutput.py:60
InDetRttPlots::fillNtuple
void fillNtuple(const xAOD::TrackParticle &track, const xAOD::Vertex *vtx)
Definition: InDetRttPlots.cxx:386
InDetRttPlotConfig::doHardScatterVertexTruthMatchingPlots
bool doHardScatterVertexTruthMatchingPlots
Definition: InDetRttPlots.h:85
InDetRttPlotConfig::doHardScatterVertexPlots
bool doHardScatterVertexPlots
Definition: InDetRttPlots.h:81
TruthParticleContainer.h
InDetRttPlots::m_effInDetExtensionProcessorPlots
std::unique_ptr< InDetPerfPlot_Efficiency > m_effInDetExtensionProcessorPlots
Definition: InDetRttPlots.h:203
InDetRttPlotConfig::doNTracks
bool doNTracks
Definition: InDetRttPlots.h:54
InDetRttPlots::m_fakeTRTStandalonePlots
std::unique_ptr< InDetPerfPlot_FakeRate > m_fakeTRTStandalonePlots
Definition: InDetRttPlots.h:211
InDetRttPlots::m_resolutionPlotPrim
std::unique_ptr< InDetPerfPlot_Resolution > m_resolutionPlotPrim
Definition: InDetRttPlots.h:175
InDetRttPlotConfig::doTrtExtensionPlots
bool doTrtExtensionPlots
Definition: InDetRttPlots.h:58
InDetRttPlotConfig::doTrkInJetPlots_unlinked_bjets
bool doTrkInJetPlots_unlinked_bjets
Definition: InDetRttPlots.h:95
SG::ConstAccessor< float >
InDetRttPlotConfig::doHitEffPlot
bool doHitEffPlot
Definition: InDetRttPlots.h:56
InDetRttPlotConfig::doTrkInJetPlots_truthFromB
bool doTrkInJetPlots_truthFromB
Definition: InDetRttPlots.h:96
InDetRttPlotConfig::doHitResidualPlot
bool doHitResidualPlot
Definition: InDetRttPlots.h:55
InDetRttPlotConfig::doTrkInJetPlots
bool doTrkInJetPlots
Plots for tracks in jets.
Definition: InDetRttPlots.h:88
covarianceTool.prob
prob
Definition: covarianceTool.py:678
InDetRttPlotConfig::doTrkInJetPlots_matched
bool doTrkInJetPlots_matched
Definition: InDetRttPlots.h:90
xAOD::VxType::NoVtx
@ NoVtx
Dummy vertex. TrackParticle was not used in vertex fit.
Definition: TrackingPrimitives.h:570
InDetRttPlots::m_trkParaInDetExtensionProcessorPlots
std::unique_ptr< InDetPerfPlot_TrackParameters > m_trkParaInDetExtensionProcessorPlots
Definition: InDetRttPlots.h:215
InDetRttPlotConfig::doFakesPerAuthor
bool doFakesPerAuthor
Definition: InDetRttPlots.h:100
InDetRttPlots::m_verticesVsMuPlots
std::unique_ptr< InDetPerfPlot_VerticesVsMu > m_verticesVsMuPlots
Definition: InDetRttPlots.h:180
InDetRttPlots::m_trkInJetPlots_unlinked_bjets
std::unique_ptr< InDetPerfPlot_TrkInJet > m_trkInJetPlots_unlinked_bjets
Definition: InDetRttPlots.h:198
InDetRttPlots::m_resInDetExtensionProcessorPlots
std::unique_ptr< InDetPerfPlot_Resolution > m_resInDetExtensionProcessorPlots
Definition: InDetRttPlots.h:221
InDetRttPlots::m_hitsRecoTracksPlots
std::unique_ptr< InDetPerfPlot_Hits > m_hitsRecoTracksPlots
Definition: InDetRttPlots.h:177
InDetRttPlots::m_effTRTStandalonePlots
std::unique_ptr< InDetPerfPlot_Efficiency > m_effTRTStandalonePlots
Definition: InDetRttPlots.h:205
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:200
InDetRttPlots::m_config
InDetRttPlotConfig m_config
configuration object
Definition: InDetRttPlots.h:156
InDetRttPlots::m_duplicatePlots
std::unique_ptr< InDetPerfPlot_Duplicate > m_duplicatePlots
Definition: InDetRttPlots.h:179
InDetRttPlots::m_resolutionPlotPrim_truthFromB
std::unique_ptr< InDetPerfPlot_Resolution > m_resolutionPlotPrim_truthFromB
Definition: InDetRttPlots.h:176
InDetRttPlots::m_trkParaTRTStandalonePlots
std::unique_ptr< InDetPerfPlot_TrackParameters > m_trkParaTRTStandalonePlots
Definition: InDetRttPlots.h:217
InDetRttPlots::m_hardScatterVertexTruthMatchingPlots
std::unique_ptr< InDetPerfPlot_VertexTruthMatching > m_hardScatterVertexTruthMatchingPlots
Definition: InDetRttPlots.h:183
InDetRttPlots::m_hitResidualPlot
std::unique_ptr< InDetPerfPlot_HitResidual > m_hitResidualPlot
Definition: InDetRttPlots.h:171
InDetRttPlots::m_trkInJetPlots_matched_bjets
std::unique_ptr< InDetPerfPlot_TrkInJet > m_trkInJetPlots_matched_bjets
Definition: InDetRttPlots.h:194
InDetPlotBase
Mixin class to give extra capabilities to plots such as ATH_MSG and an easier booking interface,...
Definition: InDetPlotBase.h:31
InDetRttPlots::m_resolutionPlotSecd
std::unique_ptr< InDetPerfPlot_Resolution > m_resolutionPlotSecd
Definition: InDetRttPlots.h:186
InDetRttPlots::m_resSiSPSeededFinderPlots
std::unique_ptr< InDetPerfPlot_Resolution > m_resSiSPSeededFinderPlots
Definition: InDetRttPlots.h:220
InDetRttPlots::m_ntupleTruthToReco
std::unique_ptr< InDetPerfNtuple_TruthToReco > m_ntupleTruthToReco
Definition: InDetRttPlots.h:185
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
InDetRttPlots::m_hardScatterVertexPlots
std::unique_ptr< InDetPerfPlot_Vertex > m_hardScatterVertexPlots
Definition: InDetRttPlots.h:182
InDetRttPlots::m_trkParaTRTSeededTrackFinderPlots
std::unique_ptr< InDetPerfPlot_TrackParameters > m_trkParaTRTSeededTrackFinderPlots
Definition: InDetRttPlots.h:216
InDetRttPlotConfig::doTrkInJetPlots_bjets
bool doTrkInJetPlots_bjets
Definition: InDetRttPlots.h:89
InDetRttPlots::m_effSiSPSeededFinderPlots
std::unique_ptr< InDetPerfPlot_Efficiency > m_effSiSPSeededFinderPlots
Definition: InDetRttPlots.h:202
InDetRttPlots::m_effTRTSeededTrackFinderPlots
std::unique_ptr< InDetPerfPlot_Efficiency > m_effTRTSeededTrackFinderPlots
Definition: InDetRttPlots.h:204
HepMC::is_simulation_particle
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
Definition: MagicNumbers.h:299
InDetRttPlots::m_trkParaSiSpacePointsSeedMaker_LargeD0Plots
std::unique_ptr< InDetPerfPlot_TrackParameters > m_trkParaSiSpacePointsSeedMaker_LargeD0Plots
Definition: InDetRttPlots.h:218
InDetRttPlots::fill
void fill(const xAOD::TrackParticle &particle, const xAOD::TruthParticle &truthParticle, bool truthIsFromB=false, float mu=0.0, float weight=1.0)
fill for things needing truth and track only
Definition: InDetRttPlots.cxx:98
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
InDetRttPlotConfig
helper struct - steer the configuration from the parent tool's side
Definition: InDetRttPlots.h:51
InDetRttPlotConfig::doResolutionPlotPrim_truthFromB
bool doResolutionPlotPrim_truthFromB
Definition: InDetRttPlots.h:74
InDetRttPlots.h
InDetRttPlotConfig::doFakePlots
bool doFakePlots
Fake plots (and unlinked)
Definition: InDetRttPlots.h:61
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
InDetRttPlots::fillCounter
void fillCounter(const unsigned int freq, const InDetPerfPlot_nTracks::CounterCategory counter, float weight)
fill for Counters
Definition: InDetRttPlots.cxx:338
HepMC::uniqueID
int uniqueID(const T &p)
Definition: MagicNumbers.h:113
InDetRttPlots::m_fakeTRTSeededTrackFinderPlots
std::unique_ptr< InDetPerfPlot_FakeRate > m_fakeTRTSeededTrackFinderPlots
Definition: InDetRttPlots.h:210
InDet::TrkOrigin::isFromB
bool isFromB(int origin)
from B decay chain including B-->D
Definition: InDetTrackTruthOriginDefs.h:111
InDetRttPlots::m_trkInJetPlots_truthFromB
std::unique_ptr< InDetPerfPlot_TrkInJet > m_trkInJetPlots_truthFromB
Definition: InDetRttPlots.h:200
InDetRttPlotConfig::doTrkInJetPlots_fake_bjets
bool doTrkInJetPlots_fake_bjets
Definition: InDetRttPlots.h:93
InDetRttPlots::m_trkInJetPlots_fake
std::unique_ptr< InDetPerfPlot_TrkInJet > m_trkInJetPlots_fake
Definition: InDetRttPlots.h:195
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
xAOD::SiSpacePointsSeedMaker_LargeD0
@ SiSpacePointsSeedMaker_LargeD0
Definition: TrackingPrimitives.h:183
InDetRttPlots::m_hitEffPlot
std::unique_ptr< InDetPerfPlot_HitEfficiency > m_hitEffPlot
Definition: InDetRttPlots.h:172
InDetRttPlotConfig::doEfficienciesPerAuthor
bool doEfficienciesPerAuthor
per author plots
Definition: InDetRttPlots.h:99
InDetRttPlotConfig::doNtupleTruthToReco
bool doNtupleTruthToReco
Ntuple functionality.
Definition: InDetRttPlots.h:105
xAOD::TRTSeededTrackFinder
@ TRTSeededTrackFinder
Tracks from TRT Seeded Track finder.
Definition: TrackingPrimitives.h:93
HepMC::UNDEFINED_ID
constexpr int UNDEFINED_ID
Definition: MagicNumbers.h:55
TruthVertex.h
InDetRttPlotConfig::doDuplicatePlots
bool doDuplicatePlots
Definition: InDetRttPlots.h:69
InDetRttPlots::m_resSiSpacePointsSeedMaker_LargeD0Plots
std::unique_ptr< InDetPerfPlot_Resolution > m_resSiSpacePointsSeedMaker_LargeD0Plots
Definition: InDetRttPlots.h:224
InDetRttPlots::m_vertexPlots
std::unique_ptr< InDetPerfPlot_Vertex > m_vertexPlots
Definition: InDetRttPlots.h:181
InDetRttPlots::m_trkInJetPlots_bjets
std::unique_ptr< InDetPerfPlot_TrkInJet > m_trkInJetPlots_bjets
Definition: InDetRttPlots.h:192
InDetRttPlots::m_trkInJetPlots_matched
std::unique_ptr< InDetPerfPlot_TrkInJet > m_trkInJetPlots_matched
Definition: InDetRttPlots.h:193
InDetRttPlotConfig::doHitsMatchedTracksPlots
bool doHitsMatchedTracksPlots
Definition: InDetRttPlots.h:76
InDetRttPlotConfig::doResolutionPlotPrim
bool doResolutionPlotPrim
Resolution and "matched track" plots - filled if both reco and truth exist.
Definition: InDetRttPlots.h:73
MagicNumbers.h
InDetRttPlots::m_effSiSpacePointsSeedMaker_LargeD0Plots
std::unique_ptr< InDetPerfPlot_Efficiency > m_effSiSpacePointsSeedMaker_LargeD0Plots
Definition: InDetRttPlots.h:206
InDetRttPlots::fillTechnicalEfficiency
void fillTechnicalEfficiency(const xAOD::TruthParticle &truth, const bool isGood, const unsigned int truthMu, const float actualMu, float weight)
Definition: InDetRttPlots.cxx:250
InDetRttPlotConfig::doVertexTruthMatchingPlots
bool doVertexTruthMatchingPlots
Vertexing plots - truth requirement.
Definition: InDetRttPlots.h:84
WriteCaloSwCorrections.cfg
cfg
Definition: WriteCaloSwCorrections.py:23
InDetRttPlotConfig::doMissingTruthFakePlots
bool doMissingTruthFakePlots
Definition: InDetRttPlots.h:62
InDetRttPlotConfig::doVerticesVsMuPlots
bool doVerticesVsMuPlots
Definition: InDetRttPlots.h:80
DataVector::stdcont
const PtrVector & stdcont() const
Return the underlying std::vector of the container.
InDetRttPlotConfig::doHitsRecoTracksPlots
bool doHitsRecoTracksPlots
Definition: InDetRttPlots.h:57
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
InDetRttPlots::m_hitsFakeTracksPlots
std::unique_ptr< InDetPerfPlot_Hits > m_hitsFakeTracksPlots
Definition: InDetRttPlots.h:188
InDetRttPlots::fillDuplicate
void fillDuplicate(const xAOD::TruthParticle &truth, const std::vector< const xAOD::TrackParticle * > &tracks, float weight)
fill for duplicate plots
Definition: InDetRttPlots.cxx:259
InDetRttPlots::m_trackParticleTruthProbKey
const std::string m_trackParticleTruthProbKey
key for the truth match prob
Definition: InDetRttPlots.h:164
xAOD::TRTStandalone
@ TRTStandalone
TRT Standalone.
Definition: TrackingPrimitives.h:125
InDetRttPlots::m_effPlots
std::unique_ptr< InDetPerfPlot_Efficiency > m_effPlots
Definition: InDetRttPlots.h:178
InDetRttPlots::m_fakeInDetExtensionProcessorPlots
std::unique_ptr< InDetPerfPlot_FakeRate > m_fakeInDetExtensionProcessorPlots
Definition: InDetRttPlots.h:209
InDetRttPlotConfig::doEffPlots
bool doEffPlots
Efficiency and duplicate plots - require truth, optionally matching reco
Definition: InDetRttPlots.h:68
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
InDetRttPlots::m_fakeSiSPSeededFinderPlots
std::unique_ptr< InDetPerfPlot_FakeRate > m_fakeSiSPSeededFinderPlots
Definition: InDetRttPlots.h:208
InDetRttPlots::m_trkInJetPlots_unlinked
std::unique_ptr< InDetPerfPlot_TrkInJet > m_trkInJetPlots_unlinked
Definition: InDetRttPlots.h:197
InDetRttPlotConfig::doTrkInJetPlots_fake
bool doTrkInJetPlots_fake
Definition: InDetRttPlots.h:92
InDetRttPlotConfig::detailLevel
int detailLevel
detail level (kept for compatibility)
Definition: InDetRttPlots.h:108
InDetRttPlots::m_vertexTruthMatchingPlots
std::unique_ptr< InDetPerfPlot_VertexTruthMatching > m_vertexTruthMatchingPlots
Definition: InDetRttPlots.h:190
InDetRttPlotConfig::doTrackParameters
bool doTrackParameters
Plots for (selected) tracks, not necessarily truth matched.
Definition: InDetRttPlots.h:53
InDetRttPlots::m_hitsMatchedTracksPlots
std::unique_ptr< InDetPerfPlot_Hits > m_hitsMatchedTracksPlots
Definition: InDetRttPlots.h:187
xAOD::SiSPSeededFinder
@ SiSPSeededFinder
Tracks from SiSPSeedFinder.
Definition: TrackingPrimitives.h:85
InDetRttPlots::m_fakePlots
std::unique_ptr< InDetPerfPlot_FakeRate > m_fakePlots
Definition: InDetRttPlots.h:173
xAOD::InDetExtensionProcessor
@ InDetExtensionProcessor
Tracks with InDetExtensionProcessor used.
Definition: TrackingPrimitives.h:91
SG::ConstAccessor::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
InDetRttPlots::m_hitsUnlinkedTracksPlots
std::unique_ptr< InDetPerfPlot_Hits > m_hitsUnlinkedTracksPlots
Definition: InDetRttPlots.h:189
InDetPerfPlot_nTracks::CounterCategory
CounterCategory
Definition: InDetPerfPlot_nTracks.h:24
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
TruthParticle.h
InDetRttPlots::m_trkParaSiSPSeededFinderPlots
std::unique_ptr< InDetPerfPlot_TrackParameters > m_trkParaSiSPSeededFinderPlots
Definition: InDetRttPlots.h:214
test_pyathena.counter
counter
Definition: test_pyathena.py:15
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
InDetRttPlotConfig::doVertexPlots
bool doVertexPlots
Vertexing plots - no truth requirement.
Definition: InDetRttPlots.h:79
InDetRttPlots::m_trtExtensionPlots
std::unique_ptr< InDetPerfPlot_TRTExtension > m_trtExtensionPlots
Definition: InDetRttPlots.h:184
PlotBase::setDetailLevel
void setDetailLevel(int iDetailLevel)
Definition: PlotBase.cxx:49
TrackParticleContainer.h
InDetRttPlotConfig::doHitsFakeTracksPlots
bool doHitsFakeTracksPlots
Definition: InDetRttPlots.h:63
InDetRttPlotConfig::doTrackParametersPerAuthor
bool doTrackParametersPerAuthor
Definition: InDetRttPlots.h:101
InDetRttPlots::m_trkInJetPlots
std::unique_ptr< InDetPerfPlot_TrkInJet > m_trkInJetPlots
Definition: InDetRttPlots.h:191
InDetRttPlots::fillFakeRate
void fillFakeRate(const xAOD::TrackParticle &track, const xAOD::Jet &jet, const bool isFake, bool isBjet=false, bool truthIsFromB=false, float weight=1.0)
Definition: InDetRttPlots.cxx:375
InDetRttPlots::fillEfficiency
void fillEfficiency(const xAOD::TruthParticle &truth, const xAOD::TrackParticle *track, const bool isGood, const unsigned int truthMu, const float actualMu, float weight)
Fill for efficiency plots.
Definition: InDetRttPlots.cxx:206
InDetRttPlotConfig::doTrkInJetPlots_unlinked
bool doTrkInJetPlots_unlinked
Definition: InDetRttPlots.h:94