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", m_config.isITk);
28  if (m_config.doHitEffPlot) m_hitEffPlot= std::make_unique<InDetPerfPlot_HitEfficiency>(this, "Tracks/Hits/Efficiency", m_config.isITk);
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", true);
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", m_config.isITk);
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", m_config.isITk);
44  if (m_config.doHitsFakeTracksPlots) m_hitsFakeTracksPlots = std::make_unique<InDetPerfPlot_Hits>(this, "Tracks/Fakes/HitsOnTracks", m_config.isITk);
45  if (m_config.doHitsUnlinkedTracksPlots) m_hitsUnlinkedTracksPlots = std::make_unique<InDetPerfPlot_Hits>(this, "Tracks/Unlinked/HitsOnTracks", m_config.isITk);
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)
102  static const SG::ConstAccessor<float> tpTruthProbKeyAcc("truthMatchProbability");
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 ntracksFull, const unsigned int ntracksCentral,
184  const unsigned int ntracksPt1GeV, const unsigned int truthMu,
185  const float actualMu, const unsigned int nvertices,
186  const float weight) {
187 
188  if (m_nTracks) m_nTracks->fill(ntracksFull, ntracksCentral, ntracksPt1GeV, truthMu, actualMu, nvertices, weight);
189 
190 }
191 //
192 //Fill plots for selected truth particle
193 //
194 
195 void
196 InDetRttPlots::fill(const xAOD::TruthParticle& truthParticle, float weight) {
197  // fill truth plots
198  if (m_trackParameters) m_trackParameters->fill(truthParticle, weight);
199 }
200 
201 //
202 //Fill Efficiencies
203 //
204 
205 void
207 (const xAOD::TruthParticle& truth, const xAOD::TrackParticle* track,
208  const bool isGood, const unsigned int truthMu, const float actualMu, float weight) {
209  if (m_effPlots) m_effPlots->fill(truth, isGood, truthMu, actualMu, weight);
210 
212 
213  bool isGoodSiSPSeededFinder = false;
214  bool isGoodInDetExtensionProcessor = false;
215  bool isGoodTRTSeededTrackFinder = false;
216  bool isGoodTRTStandalone = false;
217  bool isGoodSiSpacePointsSeedMaker_LargeD0 = false;
218 
219  if(isGood && track){
220  std::bitset<xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo> patternInfo = track->patternRecoInfo();
221 
222  bool isSiSpSeededFinder = patternInfo.test(0);
223  bool isInDetExtensionProcessor = patternInfo.test(3);
224  bool isTRTSeededTrackFinder = patternInfo.test(4);
225  bool isTRTStandalone = patternInfo.test(20);
226  bool isSiSpacePointsSeedMaker_LargeD0 = patternInfo.test(49);
227 
228  isGoodSiSPSeededFinder = isSiSpSeededFinder and not isInDetExtensionProcessor;
229  isGoodInDetExtensionProcessor = isInDetExtensionProcessor and
230  not (isTRTSeededTrackFinder or isSiSpacePointsSeedMaker_LargeD0);
231  isGoodTRTSeededTrackFinder = isTRTSeededTrackFinder and not isTRTStandalone;
232  isGoodTRTStandalone = isTRTStandalone;
233  isGoodSiSpacePointsSeedMaker_LargeD0 = isSiSpacePointsSeedMaker_LargeD0;
234 
235  }
236 
237  m_effSiSPSeededFinderPlots->fill(truth, isGoodSiSPSeededFinder,
238  truthMu, actualMu, weight);
239  m_effInDetExtensionProcessorPlots->fill(truth, isGoodInDetExtensionProcessor,
240  truthMu, actualMu, weight);
241  m_effTRTSeededTrackFinderPlots->fill(truth, isGoodTRTSeededTrackFinder,
242  truthMu, actualMu, weight);
243  m_effTRTStandalonePlots->fill(truth, isGoodTRTStandalone, truthMu, actualMu, weight);
244  m_effSiSpacePointsSeedMaker_LargeD0Plots->fill(truth, isGoodSiSpacePointsSeedMaker_LargeD0,
245  truthMu, actualMu, weight);
246  }
247 
248 }
249 
251 (const xAOD::TruthParticle& truth, const bool isGood,
252  const unsigned int truthMu, const float actualMu, float weight) {
253  if(m_effPlots) m_effPlots->fillTechnicalEfficiency(truth, isGood, truthMu, actualMu, weight);
254 }
255 
256 //
257 //Fill Fake Rates
258 //
260 (const xAOD::TruthParticle& truth,
261  const std::vector<const xAOD::TrackParticle*>& tracks, float weight) {
262  m_duplicatePlots->fill(truth, tracks.size(), weight);
263 }
264 
265 
266 //
267 //Fill Fake Rates
268 //
269 
270 void
271 InDetRttPlots::fillFakeRate(const xAOD::TrackParticle& track, const bool isFake, const bool isAssociatedTruth, const float mu, float weight){
272  if (m_missingTruthFakePlots && !isAssociatedTruth) {
274  }
275  if(isAssociatedTruth) {
276  if (m_fakePlots) m_fakePlots->fill(track, isFake, weight, mu);
279  std::bitset<xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo> patternInfo = track.patternRecoInfo();
280 
281  bool isSiSpSeededFinder = patternInfo.test(0);
282  bool isInDetExtensionProcessor = patternInfo.test(3);
283  bool isTRTSeededTrackFinder = patternInfo.test(4);
284  bool isTRTStandalone = patternInfo.test(20);
285  bool isSiSpacePointsSeedMaker_LargeD0 = patternInfo.test(49);
286 
287  if(isSiSpSeededFinder and not isInDetExtensionProcessor) m_fakeSiSPSeededFinderPlots->fill(track, isFake, weight, mu); //No extensions
288  if(isInDetExtensionProcessor and not (isTRTSeededTrackFinder or isSiSpacePointsSeedMaker_LargeD0)) m_fakeInDetExtensionProcessorPlots->fill(track, isFake, weight, mu); //Extensions but not Back-tracking
289  if(isTRTSeededTrackFinder and not isTRTStandalone) m_fakeTRTSeededTrackFinderPlots->fill(track, isFake, weight, mu); //BackTracking
290  if(isTRTStandalone) m_fakeTRTStandalonePlots->fill(track, isFake, weight, mu); //TRT standalone
291  if(isSiSpacePointsSeedMaker_LargeD0) m_fakeSiSpacePointsSeedMaker_LargeD0Plots->fill(track, isFake, weight, mu);
292  }
293  }
294  else {
296  }
297 
298 }
299 
300 
301 
302 //
303 //Fill Vertexing Plots
304 //
305 void
306 InDetRttPlots::fill(const xAOD::VertexContainer& vertexContainer, const xAOD::Vertex* recoHardScatter, const std::vector<const xAOD::TruthVertex*>& truthHSVertices, const std::vector<const xAOD::TruthVertex*>& truthPUVertices, const float actualMu, float weight) {
307  // fill vertex-specific properties, for all vertices and for hard-scattering vertex
308 
309  for (const auto& vtx : vertexContainer.stdcont()) {
310  if (vtx->vertexType() == xAOD::VxType::NoVtx) {
311  ATH_MSG_DEBUG("IN InDetRttPlots::fill, found xAOD::VxType::NoVtx");
312  continue; // skip dummy vertex
313  }
314  if (m_vertexPlots) m_vertexPlots->fill(*vtx, weight);
315  ATH_MSG_DEBUG("IN InDetRttPlots::fill, filling for all vertices");
316  }
317 
318  if (recoHardScatter) {
319  if (m_hardScatterVertexPlots) m_hardScatterVertexPlots->fill(*recoHardScatter, weight);
321  if(!truthHSVertices.empty() ) m_hardScatterVertexTruthMatchingPlots->fill(*recoHardScatter,truthHSVertices[0],weight);
322  else m_hardScatterVertexTruthMatchingPlots->fill(*recoHardScatter,nullptr,weight);
323  }
324  ATH_MSG_DEBUG("IN InDetRttPlots::fill, filling for all HS vertex");
325  }
326 
327  if(m_vertexTruthMatchingPlots) m_vertexTruthMatchingPlots->fill(recoHardScatter, vertexContainer, truthHSVertices, truthPUVertices,actualMu, weight);
328 }
329 
330 
331 void
332 InDetRttPlots::fill(const xAOD::VertexContainer& vertexContainer, const unsigned int truthMu, const float actualMu, float weight) {
333  if (m_verticesVsMuPlots) m_verticesVsMuPlots->fill(vertexContainer, truthMu, actualMu, weight);
334 }
335 
336 //
337 //Fill Counters
338 //
339 void
341  if (m_nTracks) m_nTracks->fill(freq, counter, weight);
342 }
343 
344 //Track in Jet Plots
345 void
346 InDetRttPlots::fill(const xAOD::TrackParticle& track, const xAOD::Jet& jet, bool isBjet, bool isFake, bool isUnlinked, bool truthIsFromB, float weight){
348  if (isFake){
351  }
352  else if (isUnlinked){
355  }
356  else {
359  }
360  if(isBjet){
363  }
364 }
365 
366 void
367 InDetRttPlots::fillEfficiency(const xAOD::TruthParticle& truth, const xAOD::Jet& jet, bool isEfficient, bool isBjet, bool truthIsFromB, float weight) {
368  if (m_trkInJetPlots) m_trkInJetPlots->fillEfficiency(truth, jet, isEfficient, weight);
369  if(isBjet && m_trkInJetPlots_bjets) m_trkInJetPlots_bjets->fillEfficiency(truth, jet, isEfficient, weight);
370 
371  if ( isBjet and m_trkInJetPlots_truthFromB and truthIsFromB ) { // truth is from B
372  m_trkInJetPlots_truthFromB->fillEfficiency(truth, jet, isEfficient, weight);
373  }
374 }
375 
376 void
377 InDetRttPlots::fillFakeRate(const xAOD::TrackParticle& track, const xAOD::Jet& jet, bool isFake, bool isBjet, bool truthIsFromB, float weight) {
378  if (m_trkInJetPlots) m_trkInJetPlots->fillFakeRate(track, jet, isFake, weight);
379  if(isBjet && m_trkInJetPlots_bjets) m_trkInJetPlots_bjets->fillFakeRate(track, jet, isFake, weight);
380 
381  if ( isBjet and m_trkInJetPlots_truthFromB and truthIsFromB ) { // truth is from B
383  }
384 }
385 
386 //IDPVM Ntuple
387 void
389  // Fill track only entries with dummy truth values
390  if (m_ntupleTruthToReco){
391  m_ntupleTruthToReco->fillTrack(track, vtx);
392  m_ntupleTruthToReco->fillTree();
393  }
394 }
395 
396 void
398  // Fill truth only entries with dummy track values
399  if (m_ntupleTruthToReco){
400  m_ntupleTruthToReco->fillTruth(truth);
401  m_ntupleTruthToReco->fillTree();
402  }
403 }
404 
405 void
406 InDetRttPlots::fillNtuple(const xAOD::TrackParticle& track, const xAOD::TruthParticle& truth, const xAOD::Vertex* vtx, const int truthMatchRanking) {
407  // Fill track and truth entries
408  if (m_ntupleTruthToReco){
409  m_ntupleTruthToReco->fillTrack(track, vtx, truthMatchRanking);
410  m_ntupleTruthToReco->fillTruth(truth);
411  m_ntupleTruthToReco->fillTree();
412  }
413 }
InDetRttPlots::m_trkInJetPlots_fake_bjets
std::unique_ptr< InDetPerfPlot_TrkInJet > m_trkInJetPlots_fake_bjets
Definition: InDetRttPlots.h:197
PlotBase::m_iDetailLevel
int m_iDetailLevel
Definition: PlotBase.h:101
InDetRttPlots::m_trackParameters
std::unique_ptr< InDetPerfPlot_TrackParameters > m_trackParameters
plot members.
Definition: InDetRttPlots.h:170
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:224
InDetRttPlots::m_fakeSiSpacePointsSeedMaker_LargeD0Plots
std::unique_ptr< InDetPerfPlot_FakeRate > m_fakeSiSpacePointsSeedMaker_LargeD0Plots
Definition: InDetRttPlots.h:213
InDetRttPlots::m_nTracks
std::unique_ptr< InDetPerfPlot_nTracks > m_nTracks
Definition: InDetRttPlots.h:171
InDetRttPlotConfig::doResolutionsPerAuthor
bool doResolutionsPerAuthor
Definition: InDetRttPlots.h:104
InDetRttPlots::m_resTRTSeededTrackFinderPlots
std::unique_ptr< InDetPerfPlot_Resolution > m_resTRTSeededTrackFinderPlots
Definition: InDetRttPlots.h:223
InDetSecVtxTruthMatchUtils::isFake
bool isFake(int matchInfo)
Definition: InDetSecVtxTruthMatchTool.h:60
InDetRttPlotConfig::doTrkInJetPlots_matched_bjets
bool doTrkInJetPlots_matched_bjets
Definition: InDetRttPlots.h:93
InDetRttPlots::InDetRttPlots
InDetRttPlots(InDetPlotBase *pParent, const std::string &dirName, const InDetRttPlotConfig &config)
Definition: InDetRttPlots.cxx:20
InDetRttPlotConfig::doResolutionPlotSecd
bool doResolutionPlotSecd
Definition: InDetRttPlots.h:77
InDetRttPlots::m_missingTruthFakePlots
std::unique_ptr< InDetPerfPlot_FakeRate > m_missingTruthFakePlots
Definition: InDetRttPlots.h:175
InDetRttPlotConfig::doHitsUnlinkedTracksPlots
bool doHitsUnlinkedTracksPlots
Definition: InDetRttPlots.h:66
python.copyTCTOutput.sDir
sDir
Definition: copyTCTOutput.py:60
InDetRttPlots::fillNtuple
void fillNtuple(const xAOD::TrackParticle &track, const xAOD::Vertex *vtx)
Definition: InDetRttPlots.cxx:388
InDetRttPlotConfig::doHardScatterVertexTruthMatchingPlots
bool doHardScatterVertexTruthMatchingPlots
Definition: InDetRttPlots.h:87
InDetRttPlotConfig::doHardScatterVertexPlots
bool doHardScatterVertexPlots
Definition: InDetRttPlots.h:83
TruthParticleContainer.h
InDetRttPlots::m_effInDetExtensionProcessorPlots
std::unique_ptr< InDetPerfPlot_Efficiency > m_effInDetExtensionProcessorPlots
Definition: InDetRttPlots.h:204
InDetRttPlotConfig::doNTracks
bool doNTracks
Definition: InDetRttPlots.h:56
InDetRttPlots::m_fakeTRTStandalonePlots
std::unique_ptr< InDetPerfPlot_FakeRate > m_fakeTRTStandalonePlots
Definition: InDetRttPlots.h:212
InDetRttPlots::m_resolutionPlotPrim
std::unique_ptr< InDetPerfPlot_Resolution > m_resolutionPlotPrim
Definition: InDetRttPlots.h:176
InDetRttPlotConfig::doTrtExtensionPlots
bool doTrtExtensionPlots
Definition: InDetRttPlots.h:60
InDetRttPlotConfig::doTrkInJetPlots_unlinked_bjets
bool doTrkInJetPlots_unlinked_bjets
Definition: InDetRttPlots.h:97
SG::ConstAccessor< float >
InDetRttPlotConfig::doHitEffPlot
bool doHitEffPlot
Definition: InDetRttPlots.h:58
InDetRttPlotConfig::doTrkInJetPlots_truthFromB
bool doTrkInJetPlots_truthFromB
Definition: InDetRttPlots.h:98
InDetRttPlotConfig::doHitResidualPlot
bool doHitResidualPlot
Definition: InDetRttPlots.h:57
InDetRttPlotConfig::doTrkInJetPlots
bool doTrkInJetPlots
Plots for tracks in jets.
Definition: InDetRttPlots.h:90
covarianceTool.prob
prob
Definition: covarianceTool.py:678
InDetRttPlotConfig::doTrkInJetPlots_matched
bool doTrkInJetPlots_matched
Definition: InDetRttPlots.h:92
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:216
InDetRttPlotConfig::doFakesPerAuthor
bool doFakesPerAuthor
Definition: InDetRttPlots.h:102
InDetRttPlots::m_verticesVsMuPlots
std::unique_ptr< InDetPerfPlot_VerticesVsMu > m_verticesVsMuPlots
Definition: InDetRttPlots.h:181
InDetRttPlots::m_trkInJetPlots_unlinked_bjets
std::unique_ptr< InDetPerfPlot_TrkInJet > m_trkInJetPlots_unlinked_bjets
Definition: InDetRttPlots.h:199
InDetRttPlots::m_resInDetExtensionProcessorPlots
std::unique_ptr< InDetPerfPlot_Resolution > m_resInDetExtensionProcessorPlots
Definition: InDetRttPlots.h:222
InDetRttPlots::m_hitsRecoTracksPlots
std::unique_ptr< InDetPerfPlot_Hits > m_hitsRecoTracksPlots
Definition: InDetRttPlots.h:178
InDetRttPlots::m_effTRTStandalonePlots
std::unique_ptr< InDetPerfPlot_Efficiency > m_effTRTStandalonePlots
Definition: InDetRttPlots.h:206
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
InDetRttPlots::m_config
InDetRttPlotConfig m_config
configuration object
Definition: InDetRttPlots.h:160
InDetRttPlots::m_duplicatePlots
std::unique_ptr< InDetPerfPlot_Duplicate > m_duplicatePlots
Definition: InDetRttPlots.h:180
InDetRttPlots::m_resolutionPlotPrim_truthFromB
std::unique_ptr< InDetPerfPlot_Resolution > m_resolutionPlotPrim_truthFromB
Definition: InDetRttPlots.h:177
InDetRttPlots::m_trkParaTRTStandalonePlots
std::unique_ptr< InDetPerfPlot_TrackParameters > m_trkParaTRTStandalonePlots
Definition: InDetRttPlots.h:218
InDetRttPlots::m_hardScatterVertexTruthMatchingPlots
std::unique_ptr< InDetPerfPlot_VertexTruthMatching > m_hardScatterVertexTruthMatchingPlots
Definition: InDetRttPlots.h:184
InDetRttPlots::m_hitResidualPlot
std::unique_ptr< InDetPerfPlot_HitResidual > m_hitResidualPlot
Definition: InDetRttPlots.h:172
InDetRttPlots::m_trkInJetPlots_matched_bjets
std::unique_ptr< InDetPerfPlot_TrkInJet > m_trkInJetPlots_matched_bjets
Definition: InDetRttPlots.h:195
InDetPlotBase
Mixin class to give extra capabilities to plots such as ATH_MSG and an easier booking interface,...
Definition: InDetPlotBase.h:33
InDetRttPlots::m_resolutionPlotSecd
std::unique_ptr< InDetPerfPlot_Resolution > m_resolutionPlotSecd
Definition: InDetRttPlots.h:187
InDetRttPlots::m_resSiSPSeededFinderPlots
std::unique_ptr< InDetPerfPlot_Resolution > m_resSiSPSeededFinderPlots
Definition: InDetRttPlots.h:221
InDetRttPlots::m_ntupleTruthToReco
std::unique_ptr< InDetPerfNtuple_TruthToReco > m_ntupleTruthToReco
Definition: InDetRttPlots.h:186
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
InDetRttPlots::m_hardScatterVertexPlots
std::unique_ptr< InDetPerfPlot_Vertex > m_hardScatterVertexPlots
Definition: InDetRttPlots.h:183
InDetRttPlots::m_trkParaTRTSeededTrackFinderPlots
std::unique_ptr< InDetPerfPlot_TrackParameters > m_trkParaTRTSeededTrackFinderPlots
Definition: InDetRttPlots.h:217
InDetRttPlotConfig::doTrkInJetPlots_bjets
bool doTrkInJetPlots_bjets
Definition: InDetRttPlots.h:91
InDetRttPlots::m_effSiSPSeededFinderPlots
std::unique_ptr< InDetPerfPlot_Efficiency > m_effSiSPSeededFinderPlots
Definition: InDetRttPlots.h:203
InDetRttPlots::m_effTRTSeededTrackFinderPlots
std::unique_ptr< InDetPerfPlot_Efficiency > m_effTRTSeededTrackFinderPlots
Definition: InDetRttPlots.h:205
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:342
InDetRttPlots::m_trkParaSiSpacePointsSeedMaker_LargeD0Plots
std::unique_ptr< InDetPerfPlot_TrackParameters > m_trkParaSiSpacePointsSeedMaker_LargeD0Plots
Definition: InDetRttPlots.h:219
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:76
InDetRttPlots.h
InDetRttPlotConfig::doFakePlots
bool doFakePlots
Fake plots (and unlinked)
Definition: InDetRttPlots.h:63
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
InDetRttPlots::fillCounter
void fillCounter(const unsigned int freq, const InDetPerfPlot_nTracks::CounterCategory counter, float weight)
fill for Counters
Definition: InDetRttPlots.cxx:340
HepMC::uniqueID
int uniqueID(const T &p)
Definition: MagicNumbers.h:109
InDetRttPlots::m_fakeTRTSeededTrackFinderPlots
std::unique_ptr< InDetPerfPlot_FakeRate > m_fakeTRTSeededTrackFinderPlots
Definition: InDetRttPlots.h:211
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:201
InDetRttPlotConfig::doTrkInJetPlots_fake_bjets
bool doTrkInJetPlots_fake_bjets
Definition: InDetRttPlots.h:95
InDetRttPlots::m_trkInJetPlots_fake
std::unique_ptr< InDetPerfPlot_TrkInJet > m_trkInJetPlots_fake
Definition: InDetRttPlots.h:196
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:173
InDetRttPlotConfig::doEfficienciesPerAuthor
bool doEfficienciesPerAuthor
per author plots
Definition: InDetRttPlots.h:101
InDetRttPlotConfig::doNtupleTruthToReco
bool doNtupleTruthToReco
Ntuple functionality.
Definition: InDetRttPlots.h:107
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:71
InDetRttPlots::m_resSiSpacePointsSeedMaker_LargeD0Plots
std::unique_ptr< InDetPerfPlot_Resolution > m_resSiSpacePointsSeedMaker_LargeD0Plots
Definition: InDetRttPlots.h:225
InDetRttPlots::m_vertexPlots
std::unique_ptr< InDetPerfPlot_Vertex > m_vertexPlots
Definition: InDetRttPlots.h:182
InDetRttPlots::m_trkInJetPlots_bjets
std::unique_ptr< InDetPerfPlot_TrkInJet > m_trkInJetPlots_bjets
Definition: InDetRttPlots.h:193
InDetRttPlots::m_trkInJetPlots_matched
std::unique_ptr< InDetPerfPlot_TrkInJet > m_trkInJetPlots_matched
Definition: InDetRttPlots.h:194
InDetRttPlotConfig::doHitsMatchedTracksPlots
bool doHitsMatchedTracksPlots
Definition: InDetRttPlots.h:78
InDetRttPlotConfig::doResolutionPlotPrim
bool doResolutionPlotPrim
Resolution and "matched track" plots - filled if both reco and truth exist.
Definition: InDetRttPlots.h:75
MagicNumbers.h
InDetRttPlots::m_effSiSpacePointsSeedMaker_LargeD0Plots
std::unique_ptr< InDetPerfPlot_Efficiency > m_effSiSpacePointsSeedMaker_LargeD0Plots
Definition: InDetRttPlots.h:207
InDetRttPlots::fillTechnicalEfficiency
void fillTechnicalEfficiency(const xAOD::TruthParticle &truth, const bool isGood, const unsigned int truthMu, const float actualMu, float weight)
Definition: InDetRttPlots.cxx:251
InDetRttPlotConfig::doVertexTruthMatchingPlots
bool doVertexTruthMatchingPlots
Vertexing plots - truth requirement.
Definition: InDetRttPlots.h:86
WriteCaloSwCorrections.cfg
cfg
Definition: WriteCaloSwCorrections.py:23
InDetRttPlotConfig::doMissingTruthFakePlots
bool doMissingTruthFakePlots
Definition: InDetRttPlots.h:64
InDetRttPlotConfig::doVerticesVsMuPlots
bool doVerticesVsMuPlots
Definition: InDetRttPlots.h:82
DataVector::stdcont
const PtrVector & stdcont() const
Return the underlying std::vector of the container.
InDetRttPlotConfig::doHitsRecoTracksPlots
bool doHitsRecoTracksPlots
Definition: InDetRttPlots.h:59
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:189
InDetRttPlots::fillDuplicate
void fillDuplicate(const xAOD::TruthParticle &truth, const std::vector< const xAOD::TrackParticle * > &tracks, float weight)
fill for duplicate plots
Definition: InDetRttPlots.cxx:260
xAOD::TRTStandalone
@ TRTStandalone
TRT Standalone.
Definition: TrackingPrimitives.h:125
InDetRttPlots::m_effPlots
std::unique_ptr< InDetPerfPlot_Efficiency > m_effPlots
Definition: InDetRttPlots.h:179
InDetRttPlots::m_fakeInDetExtensionProcessorPlots
std::unique_ptr< InDetPerfPlot_FakeRate > m_fakeInDetExtensionProcessorPlots
Definition: InDetRttPlots.h:210
InDetRttPlotConfig::doEffPlots
bool doEffPlots
Efficiency and duplicate plots - require truth, optionally matching reco
Definition: InDetRttPlots.h:70
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:209
InDetRttPlots::m_trkInJetPlots_unlinked
std::unique_ptr< InDetPerfPlot_TrkInJet > m_trkInJetPlots_unlinked
Definition: InDetRttPlots.h:198
InDetRttPlotConfig::doTrkInJetPlots_fake
bool doTrkInJetPlots_fake
Definition: InDetRttPlots.h:94
InDetRttPlotConfig::detailLevel
int detailLevel
detail level (kept for compatibility)
Definition: InDetRttPlots.h:110
InDetRttPlots::m_vertexTruthMatchingPlots
std::unique_ptr< InDetPerfPlot_VertexTruthMatching > m_vertexTruthMatchingPlots
Definition: InDetRttPlots.h:191
InDetRttPlotConfig::doTrackParameters
bool doTrackParameters
Plots for (selected) tracks, not necessarily truth matched.
Definition: InDetRttPlots.h:55
InDetRttPlots::m_hitsMatchedTracksPlots
std::unique_ptr< InDetPerfPlot_Hits > m_hitsMatchedTracksPlots
Definition: InDetRttPlots.h:188
xAOD::SiSPSeededFinder
@ SiSPSeededFinder
Tracks from SiSPSeedFinder.
Definition: TrackingPrimitives.h:85
InDetRttPlots::m_fakePlots
std::unique_ptr< InDetPerfPlot_FakeRate > m_fakePlots
Definition: InDetRttPlots.h:174
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:190
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:215
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:81
InDetRttPlots::m_trtExtensionPlots
std::unique_ptr< InDetPerfPlot_TRTExtension > m_trtExtensionPlots
Definition: InDetRttPlots.h:185
PlotBase::setDetailLevel
void setDetailLevel(int iDetailLevel)
Definition: PlotBase.cxx:55
TrackParticleContainer.h
InDetRttPlotConfig::doHitsFakeTracksPlots
bool doHitsFakeTracksPlots
Definition: InDetRttPlots.h:65
InDetRttPlotConfig::doTrackParametersPerAuthor
bool doTrackParametersPerAuthor
Definition: InDetRttPlots.h:103
InDetRttPlots::m_trkInJetPlots
std::unique_ptr< InDetPerfPlot_TrkInJet > m_trkInJetPlots
Definition: InDetRttPlots.h:192
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:377
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:207
InDetRttPlotConfig::isITk
bool isITk
Definition: InDetRttPlots.h:52
InDetRttPlotConfig::doTrkInJetPlots_unlinked
bool doTrkInJetPlots_unlinked
Definition: InDetRttPlots.h:96