ATLAS Offline Software
TrackStatHelper.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // TrackStatHelper.cxx
7 // Authors: Sven Vahsen
9 
10 // Private utility class used by IDTrackStat to do track and hit counting
11 // Since I'm likely to changes the interface as needed,
12 // I would not recommend anyone to use this class outside of IDTrackStat
13 //
14 // to-do-list
15 // o remove TrackCollection argument to addEvent. Is this really needed for the truthmatching?
16 // o add DR cut to the fake track cut
17 //
18 
21 #include "AtlasHepMC/GenVertex.h"
22 #include "AtlasHepMC/GenEvent.h"
23 #include "CLHEP/Geometry/Point3D.h"
25 #include "InDetIdentifier/SCT_ID.h"
30 #include "TrkTrack/Track.h"
33 #include <cstring>
34 #include <iomanip>
35 #include <sstream>
36 #include <utility>
37 #include <vector>
38 
39 namespace Trk {
40 
41  class RoT_Extractor {
42  public:
43  static void extract(std::vector<const RIO_OnTrack*>& rots, const std::vector<const MeasurementBase*>& measurements);
44  };
45 
46 }
47 
48 
49 // summary types for which statistics are gathered.
50 // should be synchronised with ETrackSummaryTypes
64 };
65 
66 // Table column labels. should be synchronised with ETrackSummaryTypes
67 const char * const InDet::TrackStatHelper::s_summaryTypeName[kNSummaryTypes] = {
68  "blay",
69  "pix",
70  "hole",
71  "gang",
72  "SCT",
73  "hole",
74  "DHole",
75  "TRT",
76  "outl",
77  "TRHi",
78  "outl",
79  "alloutl"};
80 
82  std::stringstream out;
83  for (unsigned int stype_i=0; stype_i < kNSummaryTypes; ++stype_i ) {
84  out << std::setw(std::max(6,static_cast<int>(strlen(s_summaryTypeName[stype_i])+1))) << s_summaryTypeName[stype_i];
85  }
86  return out.str();
87 }
88 
89 
90 static const std::string track_types_string[InDet::N_TRACKTYPES]= {"all",
91  "primary",
92  "secondary",
93  "truncated",
94  "lowPb1",
95  "lowPb2",
96  "noLink",
97  "matched",
98  "matchedPrimary",
99  "matchedSecondary",
100  "multipleMatches"
101  };//LT added 06.21
102 
103 InDet::TrackStatHelper::TrackStatHelper(const std::string& TrackCollectionKey, const std::string& TrackTruthCollectionKey, bool careAboutTruth):
104  m_TrackCollectionKey (std::move(TrackCollectionKey)),
105  m_TrackTruthCollectionKey (std::move(TrackTruthCollectionKey)),
106  m_truthMissing (false),
107  m_careAboutTruth (careAboutTruth)
108 {
109  this->reset();
110 }
111 
112 
114 {
115  m_cuts = ct;
116 
117 }
118 
120  std::vector <const Trk::Track *> & rec,
121  const std::vector <std::pair<HepMC::ConstGenParticlePtr,int> > & gen,
122  const TrackTruthCollection * truthMap,
123  const AtlasDetectorID * const idHelper,
124  const PixelID * pixelID,
125  const SCT_ID * sctID,
126  const Trk::IExtendedTrackSummaryTool* trkSummaryTool,
127  bool useTrackSummary,
128  const unsigned int * inTimeStart,
129  const unsigned int * inTimeEnd) const
130 {
131 
132  recoToTruthMap rttMap;
133 
134  recoToTruthMap::const_iterator imap;
135 
136  m_events ++;
137 
138  float Eta = 0;
140  int Author = 0;
141  int recoClassification = 0;
142  bool truth_missing=false;
143 
144  TracksCounter tracks;
146  TrackSummaryCounter trackSummarySum;
147  bool author_found [Trk::TrackInfo::NumberOfTrackFitters];
148  std::bitset<Trk::TrackInfo::NumberOfTrackRecoInfo> reco_info;
149  std::bitset<Trk::TrackInfo::NumberOfTrackProperties> pattern_properties;
150  for (unsigned int i=0; i < Trk::TrackInfo::NumberOfTrackFitters; ++i) { author_found[i]=false; }
151 
152  // ------------ reconstructed tracks -----------------
153  for (const Trk::Track* track : rec) {
154 
155  const Trk::TrackParameters* para = track->trackParameters()->front();
156  recoClassification = -999;
157  int thisEventIndex = -999;
158 
159  Author = track->info().trackFitter();
161  author_found[Author] = true;
162  reco_info |= track->info().patternRecognition();
163  pattern_properties |= track->info().properties();
164  }
165  else {
166  //FIX author_problem++;
167  }
168  if (!para) {
170  }
171  else {
172  Eta = std::abs(para->eta());
175  else if (Eta < m_cuts.maxEtaEndcap) Region = ETA_ENDCAP;
177  else Region = ETA_OUTSIDE;
178  }
179 
181  {
182  continue; // Only want to tally tracks that are within the detector volume.
183  }
184 
185  TrackTruthCollection::const_iterator found;
186  TrackTruth trtruth;
187  double trprob = 0;
188 
189  if (!truthMap) {
190  // no truthmap
191  truth_missing=true;
192  }
193  else {
195  tracklink.setElement(track);
196  tracklink.setStorableObject(*recTracks);
197  const ElementLink<TrackCollection> tracklink2=tracklink;
198 
199  found = truthMap->find(tracklink2);
200  if(!(found == truthMap->end())){
201  trtruth=found->second;
202  HepMcParticleLink hmpl = trtruth.particleLink();
203  thisEventIndex = hmpl.eventIndex();
204  rttMap.insert(std::pair<HepMcParticleLink,float>(hmpl,trtruth.probability()));
205  // ME: remember prob
206  trprob = trtruth.probability();
207  }
208 
209  }
210 
211 
212  if(!PassTrackCuts(para)) continue;
213 
216  // signal only tracks for the denominator in signal efficiencies
217  if (thisEventIndex==0)
218  {
221  }
222 
223  // process track summary
224 
225  std::unique_ptr<Trk::TrackSummary> cleanup;
226  const Trk::TrackSummary* summary = track->trackSummary();
227 
228  if (useTrackSummary) {
229  if (!track->trackSummary()) {
230  cleanup = trkSummaryTool->summary(*track);
231  summary=cleanup.get();
232  }
233 
234  setSummaryStat(TRACK_ALL, Region, summary, trackSummarySum);
235  }
236 
237  // check if current reco track has more than a specified fraction of hits
238  // from a generated track. [If not, it will be counted as a fake
239  // track in the statistics report.]
240 
241  if (!truthMap) {
242  truth_missing=true;
243  }
244  else {// no truthmap
245 
246  if (found == truthMap->end()) {
247  // m_truthMissing=true;
248  // no truth might happen with new truth !
252  }
253  else{ // no link
254 
255  // ME : change logic, secondaries from G4 processes are truncated
256  const HepMcParticleLink& HMPL=trtruth.particleLink();
257  if (! HMPL.isValid()) {
261  }
262  else {
263  //classify track as coming from primary, secondary or truncated gen particle
264 #ifdef HEPMC3
266 #else
267  const HepMC::GenParticle *particle = HMPL.cptr();
268 #endif
269  recoClassification = ClassifyParticle(particle, trprob);
270 
271  if (trprob < m_cuts.fakeTrackCut)
272  {
275  if (thisEventIndex==0)
276  {
279  }
280  setSummaryStat(TRACK_LOWTRUTHPROB, Region, summary, trackSummarySum);
281  }
282  if (trprob < m_cuts.fakeTrackCut2) {
285  if (thisEventIndex==0)
286  {
289  }
290  setSummaryStat(TRACK_LOWTRUTHPROB2, Region, summary, trackSummarySum);
291  }
292  } // end else on !isVadid
293  }
294  }
295 
296  // ------------------ hits on reconstructed tracks ---------------
297 
298  EHitsCounter part_type = ( recoClassification==TRACK_PRIMARY
299  ? kHits_pri
300  : ( recoClassification==TRACK_SECONDARY
301  ? kHits_sec
302  : kNHitsCounter));
303  for (const Trk::TrackStateOnSurface* hit : *track->trackStateOnSurfaces()) {
304  if(hit){
305  const Trk::MeasurementBase* mesh =hit->measurementOnTrack();
306  if (mesh) {
307  const Trk::RIO_OnTrack* rio{} ;
309  assert(dynamic_cast<const Trk::RIO_OnTrack*>(mesh)!=nullptr);
310  rio = static_cast<const Trk::RIO_OnTrack*>(mesh);
311  } else {
312  // try CompetingROT:
314  assert(dynamic_cast<const Trk::CompetingRIOsOnTrack*>(mesh) !=nullptr);
315  auto comprot = static_cast<const Trk::CompetingRIOsOnTrack*>(mesh);
316  rio = &comprot->rioOnTrack(comprot->indexOfMaxAssignProb());
317  }
318  }
319 
320 
321  if (rio) {
322  // skip outliers
323  if (!hit->type(Trk::TrackStateOnSurface::Measurement))
324  continue;
325 
326  hits.m_counter[kHits_rec][HIT_ALL][Region]++;
327  hits.m_counter[kHits_rec][HIT_ALL][ETA_ALL]++;
328  if(part_type<kNHitsCounter){
329  hits.m_counter[part_type][HIT_ALL][Region]++;
330  hits.m_counter[part_type][HIT_ALL][ETA_ALL]++;
331  }
332 
333  Identifier id = rio->identify();
334  int HitDet = HIT_UNKNOWN;
335  int HitLayer = N_HITTYPES;
336  bool part_type_for_all=true;
337  if (idHelper->is_trt(id)){
338  HitDet=HIT_TRT_ALL;
339  }
340  else if (idHelper->is_sct(id)){
341  HitDet=HIT_SCT_ALL;
342  if (sctID) {
343  switch (sctID->layer_disk(id)) {
344  case 0: HitLayer = HIT_SCT1; break;
345  case 1: HitLayer = HIT_SCT2; break;
346  case 2: HitLayer = HIT_SCT3; break;
347  case 3: HitLayer = HIT_SCT4; break;
348  case 4: case 5: case 6: case 7: case 8: HitLayer = HIT_SCT5TO9; break;
349  default: HitLayer = HIT_UNKNOWN; break;
350  }
351  }
352  }
353  else if (idHelper->is_pixel(id)){
354  part_type_for_all=false;
355  HitDet = HIT_PIXEL_ALL;
356  if (pixelID) {
357  switch (pixelID->layer_disk(id)) {
358  case 0: HitLayer = HIT_PIX1; break;
359  case 1: HitLayer = HIT_PIX2; break;
360  case 2: HitLayer = HIT_PIX3; break;
361  default: HitLayer = HIT_UNKNOWN;
362  }
363  }
364  }
365 
366  hits.m_counter[kHits_rec][HitDet][Region]++;
367  hits.m_counter[kHits_rec][HitDet][ETA_ALL]++;
368  if(part_type_for_all && part_type<kNHitsCounter){
369  hits.m_counter[part_type][HitDet][Region]++;
370  hits.m_counter[part_type][HitDet][ETA_ALL]++;
371  }
372 
373  if (HitLayer<N_HITTYPES) {
374  hits.m_counter[kHits_rec][HitLayer][Region]++;
375  hits.m_counter[kHits_rec][HitLayer][ETA_ALL]++;
376  if(part_type<kNHitsCounter){
377  hits.m_counter[part_type][HitLayer][Region]++;
378  hits.m_counter[part_type][HitLayer][ETA_ALL]++;
379  }
380  }
381  }
382  }
383  }
384  }
385  }
386 
387  // ------------------------- generated tracks, including pileup -----------------------------
388 
389  Eta = 0;
390  Region = ETA_ALL;
391  int classification=-999;
392  for (auto truth = gen.begin(); truth != gen.end(); ++truth) {
393  classification=-999;
394  bool inTimePileup = truth->second == 0 || (truth->second >= (int)*inTimeStart && truth->second <= (int)*inTimeEnd);
395 
396  auto particle = truth->first;
397 
398  //determine eta region
399  Eta = std::abs(particle->momentum().pseudoRapidity());
402  else if (Eta < m_cuts.maxEtaEndcap) Region = ETA_ENDCAP;
404  else Region = ETA_OUTSIDE;
406  {
407  continue; // Only want to tally tracks that are within the detector volume.
408  }
410  tracks.m_counter[kTracks_gen][TRACK_ALL][ETA_ALL] ++;
411  if (inTimePileup) tracks.m_counter[kTracks_gen][TRACK_ALL_SIGNAL][ETA_ALL]++; // "SIGNAL" is misnomer here
412  if (inTimePileup) tracks.m_counter[kTracks_gen][TRACK_ALL_SIGNAL][Region]++;
413 
414  //classify gen as primary, secondary or truncated
415  classification = ClassifyParticle(particle,1.);
416 
417  if(classification==TRACK_PRIMARY){
420  }
421  if(classification==TRACK_SECONDARY){
424  }
425 
426  //see if gen track has at least 1 matching reco track with high enough probability
427  bool matched = false;
428  int nmatched = 0;
429 
430  HepMcParticleLink hmpl2(particle,particle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM);
431  recoToTruthMap::iterator rttIter=rttMap.find(hmpl2);
432  if(rttIter != rttMap.end()){
433  for(imap = rttMap.lower_bound(hmpl2); imap !=rttMap.upper_bound(hmpl2); ++imap){
434  if(imap->second > m_cuts.matchTrackCut){
435  matched = true;
436  nmatched++;
437  }
438  }
439  }
440  if (matched) {
443  if (inTimePileup)
444  {
447  }
448  if(nmatched > 1){
449  tracks.m_counter[kTracks_gen][TRACK_MULTMATCH][Region] += nmatched-1;
450  tracks.m_counter[kTracks_gen][TRACK_MULTMATCH][ETA_ALL]+= nmatched-1;
451  }
452  if(classification==TRACK_PRIMARY){
455  if(nmatched > 1){
456  tracks.m_counter[kTracks_gen][TRACK_MULTMATCH_PRIMARY][Region] += nmatched-1;
457  tracks.m_counter[kTracks_gen][TRACK_MULTMATCH_PRIMARY][ETA_ALL] += nmatched-1;
458  }
459  }
460  if(classification==TRACK_SECONDARY){
463  if(nmatched > 1){
464  tracks.m_counter[kTracks_gen][TRACK_MULTMATCH_SECONDARY][Region] += nmatched-1;
465  tracks.m_counter[kTracks_gen][TRACK_MULTMATCH_SECONDARY][ETA_ALL] += nmatched-1;
466  }
467  }
468  }
469  }
470 
471  // ------------------------- generated tracks, just signal event -----------------------------
472  // For efficiencies.
473 
474  Eta = 0;
475  Region = ETA_ALL;
476  classification=-999;
477 
478  for (auto truth = gen.begin(); truth != gen.end(); ++truth)
479  {
480  if (truth->second != 0) // only signal event GenParticles
481  continue;
482 
483  classification=-999;
484 
485  auto particle = truth->first;
486 
487  //determine eta region
488  Eta = std::abs(particle->momentum().pseudoRapidity());
491  else if (Eta < m_cuts.maxEtaEndcap) Region = ETA_ENDCAP;
493  else Region = ETA_OUTSIDE;
495  {
496  continue; // Only want to tally tracks that are within the detector volume.
497  }
500 
501  //classify gen partilce as primary, secondary or truncated
502  classification = ClassifyParticle(particle,1.);
503 
504  if(classification==TRACK_PRIMARY){
507  }
508  if(classification==TRACK_SECONDARY){
511  }
512 
513  //see if gen track has at least 1 matching reco track with high enough probability
514  bool matched = false;
515  int nmatched = 0;
516 
517  HepMcParticleLink hmpl2(particle,truth->second,HepMcParticleLink::IS_EVENTNUM); // FIXME truth->second is actually the position of the GenEvent in the McEventCollection!! See InDetRecStatisticsAlg::selectGenSignal(...) method (only client of TrackStatsHelper)
518  recoToTruthMap::iterator rttIter=rttMap.find(hmpl2);
519  if(rttIter != rttMap.end()){
520  for(imap = rttMap.lower_bound(hmpl2); imap !=rttMap.upper_bound(hmpl2); ++imap){
521  if(imap->second > m_cuts.matchTrackCut){
522  matched = true;
523  nmatched++;
524  }
525  }
526  }
527  if (matched) {
530  if(nmatched > 1){
531  tracks.m_counter[kTracks_gen_signal][TRACK_MULTMATCH][Region] += nmatched-1;
532  tracks.m_counter[kTracks_gen_signal][TRACK_MULTMATCH][ETA_ALL]+= nmatched-1;
533  }
534  if(classification==TRACK_PRIMARY){
537  if(nmatched > 1){
540  }
541  }
542  if(classification==TRACK_SECONDARY){
545  if(nmatched > 1){
548  }
549  }
550  }
551  }
552 
553  if (truth_missing) {
554  m_truthMissing = truth_missing;
555  }
556  m_tracks += tracks;
557  m_hits += hits;
558  m_trackSummarySum += trackSummarySum;
559  for (unsigned int i=0; i < Trk::TrackInfo::NumberOfTrackFitters; ++i) {
560  if (author_found[i]) {
561  m_author_found[i] = author_found[i];
562  }
563  }
564  {
565  std::lock_guard<std::mutex> lock(m_authorMutex);
566  m_recoInfo |= reco_info;
567  m_patternProperties |= pattern_properties;
568  }
569 }
570 
572  m_events = 0;
573  m_hits.reset();
574  m_tracks.reset();
575  m_trackSummarySum.reset();
576 
577  for (int i=0; i<Trk::TrackInfo::NumberOfTrackFitters; i++) {
578  m_author_found[i] = false;
579  }
580  m_truthMissing=false;
581 }
582 
583 
584 void InDet::TrackStatHelper::print(MsgStream &out) const {
585 
586  out << " Printing Statistics for " << key();
587 
588  out << "TrackCollection \"" << key() << "\" " << "\n" ;
589 
590  if (m_events > 0) {
591  out << "(TrackAuthors:";
592  std::vector<std::string> author_string;
593  author_string.reserve(Trk::TrackInfo::NumberOfTrackFitters);
594  for (int i=0; i<Trk::TrackInfo::NumberOfTrackFitters; ++i) {
595  author_string.push_back( Trk::TrackInfo(static_cast<Trk::TrackInfo::TrackFitter>(i),
597  m_patternProperties,
598  m_recoInfo).dumpInfo() );
599  }
600  for (int i=0; i<Trk::TrackInfo::NumberOfTrackFitters; i++){
601  if (m_author_found[i]){
602  out << " " << author_string[i];
603  }
604  }
605  out << " )" << std::endl
606  << "TrackTruthCollection \"" << Truthkey() << "\"" << std::endl;
607 
608  if (m_truthMissing)
609  {
610  if (m_careAboutTruth)
611  out << " WARNING: TrackTruth missing for part of this TrackCollection, no efficiencies or fakerates included.!" << std::endl;
612  else
613  out << " INFO: Intentionally no TrackTruth for this TrackCollection, no efficiencies or fakerates included." << std::endl;
614  }
615  if (!m_truthMissing)
616  {
617  out << " \t\t\t ................................tracks................................" << std::endl;
618  out << " \t\t\tn/event\tSEff.pr\tSEff.sd\tSLowP1\tSLowP2\tLowP1\tLowP2\tnoLink\tmultM\t" << std::endl;
619  out << " total "; printRegion1(out,ETA_ALL);
620  out << " in barrel "; printRegion1(out,ETA_BARREL);
621  out << " in trans. "; printRegion1(out,ETA_TRANSITION);
622  out << " in endcap "; printRegion1(out,ETA_ENDCAP);
623  out << " in forwa."; printRegion1(out,ETA_FORWARD);
624 
625  }
626  else // no truth
627  {
628  out << "\t" << "tracks, n/event:" << std::endl;
629  out << "\t\t" << "total" << std::setiosflags(std::ios::fixed | std::ios::showpoint) <<
630  std::setw(7) << std::setprecision(2) << "\t" << m_tracks.m_counter[kTracks_rec][TRACK_ALL][ETA_ALL]/(float) m_events << std::endl << std::setprecision(-1);
631  out << "\t\t" << "in barrel" << std::setiosflags(std::ios::fixed | std::ios::showpoint) <<
632  std::setw(7) << std::setprecision(2) << "\t" << m_tracks.m_counter[kTracks_rec][TRACK_ALL][ETA_BARREL]/(float) m_events << std::endl << std::setprecision(-1);
633  out << "\t\t" << "in trans." << std::setiosflags(std::ios::fixed | std::ios::showpoint) <<
634  std::setw(7) << std::setprecision(2) << "\t" << m_tracks.m_counter[kTracks_rec][TRACK_ALL][ETA_TRANSITION]/(float) m_events << std::endl << std::setprecision(-1);
635  out << "\t\t" << "in endcap" << std::setiosflags(std::ios::fixed | std::ios::showpoint) <<
636  std::setw(7) << std::setprecision(2) << "\t" << m_tracks.m_counter[kTracks_rec][TRACK_ALL][ETA_ENDCAP]/(float) m_events << std::endl << std::setprecision(-1);
637  out << "\t\t" << "in forwa." << std::setiosflags(std::ios::fixed | std::ios::showpoint) <<
638  std::setw(7) << std::setprecision(2) << "\t" << m_tracks.m_counter[kTracks_rec][TRACK_ALL][ETA_FORWARD]/(float) m_events << std::endl << std::setprecision(-1);
639  }
640  out << " \t\t\t ....................................hits/track............................" << std::endl;
641  out << " \t\t\t\ttotal\tPIX1\tPIX2\tPIX3\tSCT1\tSCT2\tSCT3\tSCT4\tSCT5to9\tStraws" << std::endl;
642  out << " total "; printRegion2(out,ETA_ALL, (float) m_tracks.m_counter[kTracks_rec][TRACK_ALL][ETA_ALL]);
643  out << " in barrel "; printRegion2(out,ETA_BARREL, (float) m_tracks.m_counter[kTracks_rec][TRACK_ALL][ETA_BARREL]);
644  out << " in trans. "; printRegion2(out,ETA_TRANSITION, (float) m_tracks.m_counter[kTracks_rec][TRACK_ALL][ETA_TRANSITION] );
645  out << " in endcap "; printRegion2(out,ETA_ENDCAP, (float) m_tracks.m_counter[kTracks_rec][TRACK_ALL][ETA_ENDCAP] );
646  out << " in forwa. "; printRegion2(out,ETA_FORWARD, (float) m_tracks.m_counter[kTracks_rec][TRACK_ALL][ETA_FORWARD] );
647 
648  }
649  else
650  out << ": NO EVENTS PROCESSED! " << std::endl;
651 }
652 
653 void InDet::TrackStatHelper::printRegion1(MsgStream &out, enum eta_region region) const {
654  out << std::setiosflags(std::ios::fixed | std::ios::showpoint) << std::setw(7) << std::setprecision(2)
655  << "\t" << m_tracks.m_counter[kTracks_rec][TRACK_ALL][region]/(float) m_events;
656 
657  if (m_tracks.m_counter[kTracks_gen_signal][TRACK_PRIMARY][region]) {
658  out << "\t" << std::setprecision(4)
659  << m_tracks.m_counter[kTracks_gen_signal][TRACK_MATCHED_PRIMARY][region]/ (float) m_tracks.m_counter[kTracks_gen_signal][TRACK_PRIMARY][region] // track efficiency wrt. gen primary in signal
660  << std::setprecision(2);
661  }
662  else {
663  out << "\t" << "n/a" ;
664  }
665  if (m_tracks.m_counter[kTracks_gen_signal][TRACK_SECONDARY][region]) {
666  out << "\t" << std::setprecision(4)
667  << m_tracks.m_counter[kTracks_gen_signal][TRACK_MATCHED_SECONDARY][region]/ (float) m_tracks.m_counter[kTracks_gen_signal][TRACK_SECONDARY][region] // track efficiency wrt. gen secondary in signal
668  << std::setprecision(2);
669  }
670  else {
671  out << "\t" << "n/a" ;
672  }
673 
674  if (m_tracks.m_counter[kTracks_rec][TRACK_ALL_SIGNAL][region]) {
675  out << "\t" << 100*(m_tracks.m_counter[kTracks_rec][TRACK_LOWTRUTHPROB_SIGNAL][region]/ (float) m_tracks.m_counter[kTracks_rec][TRACK_ALL_SIGNAL][region]) << "%" // track fake rate for signal only
676  << "\t" << 100*(m_tracks.m_counter[kTracks_rec][TRACK_LOWTRUTHPROB2_SIGNAL][region]/ (float) m_tracks.m_counter[kTracks_rec][TRACK_ALL_SIGNAL][region]) << "%"; // track fake rate for signal only
677  }
678  else {
679  out << "\t" << "n/a\tn/a" ;
680  }
681 
682  if (m_tracks.m_counter[kTracks_rec][TRACK_ALL][region]) {
683  out << "\t" << 100*(m_tracks.m_counter[kTracks_rec][TRACK_LOWTRUTHPROB][region]/ (float) m_tracks.m_counter[kTracks_rec][TRACK_ALL][region]) << "%" // track fake rate
684  << "\t" << 100*(m_tracks.m_counter[kTracks_rec][TRACK_LOWTRUTHPROB2][region]/ (float) m_tracks.m_counter[kTracks_rec][TRACK_ALL][region]) << "%" // track fake rate
685  << "\t" << 100*(m_tracks.m_counter[kTracks_rec][TRACK_NOHEPMCPARTICLELINK][region]/ (float) m_tracks.m_counter[kTracks_rec][TRACK_ALL][region]) << "%" // rate of tracks without HepMcParticleLink
686  << "\t" << 100*(m_tracks.m_counter[kTracks_gen][TRACK_MULTMATCH][region]/ (float) m_tracks.m_counter[kTracks_rec][TRACK_ALL][region]) << "%"; // rate of tracks matched to the same truth track
687 
688  }
689  else{
690  out << "\tn/a\tn/a\tn/a";
691  }
692  out << std::endl << std::setprecision(-1);
693 }
694 
695 void InDet::TrackStatHelper::printRegion2(MsgStream &out, enum eta_region region, float denominator) const {
696  out << std::setiosflags(std::ios::fixed | std::ios::showpoint) << std::setw(7) << std::setprecision(2);
697  if (denominator > 0) {
698  out << std::setiosflags(std::ios::fixed | std::ios::showpoint) << std::setw(4) << std::setprecision(1)
699  <<" \t\t" << float(m_hits.m_counter[kHits_rec][HIT_ALL ][region]/denominator) << std::setprecision(2)
700  << "\t" << float(m_hits.m_counter[kHits_rec][HIT_PIX1 ][region]/denominator)
701  << "\t" << float(m_hits.m_counter[kHits_rec][HIT_PIX2 ][region]/denominator)
702  << "\t" << float(m_hits.m_counter[kHits_rec][HIT_PIX3 ][region]/denominator)
703  << "\t" << float(m_hits.m_counter[kHits_rec][HIT_SCT1 ][region]/denominator)
704  << "\t" << float(m_hits.m_counter[kHits_rec][HIT_SCT2 ][region]/denominator)
705  << "\t" << float(m_hits.m_counter[kHits_rec][HIT_SCT3 ][region]/denominator)
706  << "\t" << float(m_hits.m_counter[kHits_rec][HIT_SCT4 ][region]/denominator)
707  << "\t" << float(m_hits.m_counter[kHits_rec][HIT_SCT5TO9][region]/denominator)
708  << "\t" << float(m_hits.m_counter[kHits_rec][HIT_TRT_ALL][region]/denominator)
709  << std::endl << std::setprecision(-1);
710  }
711  else {
712  out << " Unable to calculate: Denominator=0." << std::endl << std::setprecision(-1);
713  }
714 }
715 
717  enum track_types track_type ,
718  enum eta_region eta_region ) const
719 {
720  long ex_denom = m_trackSummarySum.m_counter[kNTrackSummaryOK][track_type][eta_region][kNumberOfPixelHits]
721  + m_trackSummarySum.m_counter[kNTrackSummaryBAD][track_type][eta_region][kNumberOfPixelHits];
722  if (ex_denom > 0)
723  {
724  out << std::setiosflags(std::ios::fixed | std::ios::showpoint)
725  << std::setw(8) << track_types_string[track_type]
726  << std::setw(25) << key();
727 
728  if (m_events)
729  out << std::setw(6) << std::setprecision(2) << m_tracks.m_counter[kTracks_rec][track_type][eta_region]/(float) m_events;
730  else
731  out << std::setw(6) << "n/a";
732  for (unsigned int stype_i=0; stype_i< kNSummaryTypes; ++stype_i) {
733  out << std::setw(std::max(6,static_cast<int>(strlen(s_summaryTypeName[stype_i])+1)))
734  << std::setprecision(2); printTrackSummaryAverage(out, track_type , eta_region, stype_i );
735  }
736  out << std::endl << std::setprecision(-1);
737  return true; // yes, printed output
738  }
739  else
740  return false; // no, didn't print output
741 }
742 
744  enum track_types track_type ,
745  enum eta_region eta_region,
746  int summary_type ) const
747 {
748  assert( summary_type < kNSummaryTypes);
749  long denom = m_trackSummarySum.m_counter[kNTrackSummaryOK][track_type][eta_region][summary_type]
750  + m_trackSummarySum.m_counter[kNTrackSummaryBAD][track_type][eta_region][summary_type];
751 
752  if (denom > 0) {
753  out << float ( m_trackSummarySum.m_counter[kTrackSummarySum][track_type][eta_region][summary_type]/ (float) denom);
754  }
755  else {
756  out << "n/a";
757  }
758 }
759 
761  out << "TrackCollection \"" << key() << "\" " << std::endl;
762  if (m_events > 0) {
763  out << "(TrackAuthors:";
764  std::vector<std::string> author_string;
765  author_string.reserve(Trk::TrackInfo::NumberOfTrackFitters);
766  for (int i=0; i<Trk::TrackInfo::NumberOfTrackFitters; i++) {
767  author_string.push_back( Trk::TrackInfo(static_cast<Trk::TrackInfo::TrackFitter>(i),
769  m_patternProperties,
770  m_recoInfo).dumpInfo() );
771  }
772  for (int i=0; i<Trk::TrackInfo::NumberOfTrackFitters; i++){
773  if (m_author_found[i]){
774  out << " " << author_string[i];
775  }
776  }
777  out << " )" << std::endl
778  << "TrackTruthCollection \"" << Truthkey() << "\"" << std::endl;
779 
780  if (m_truthMissing)
781  {
782  if (m_careAboutTruth)
783  out << " WARNING: TrackTruth missing for part of this TrackCollection --> No secondaries information printed!" << std::endl;
784  else
785  out << " INFO: Intentionally no TrackTruth for this TrackCollection. (No secondaries information printed.)" << std::endl;
786  }
787  if (!m_truthMissing)
788  {
789  out << " \t\t\t\t ......................truth mached tracks statistics....................." << std::endl;
790  out << " \t\t\t\tn/event\teff.\ttotal\tPIX1\tPIX2\tPIX3\tSCT1\tSCT2\tSCT3\tSCT4\tSCT5to9\tStraws" << std::endl;
791 
792 
793  out << " total secondaries ";
795  out << " secondaries in barrel ";
797  out << " secondaries in trans. ";
799  out << " secondaries in endcap ";
801  out << " secondaries in forwa. ";
803  }
804  }
805  else out << ": NO EVENTS PROCESSED! " << std::endl;
806 }
807 
809  enum eta_region region,
810  float denominator) const {
811  out << std::setiosflags(std::ios::fixed | std::ios::showpoint) << std::setw(7) << std::setprecision(2)
812  << "\t" << m_tracks.m_counter[kTracks_gen][TRACK_MATCHED_SECONDARY][region]/(float) m_events; // tracks / event
813  if (m_tracks.m_counter[kTracks_gen][TRACK_SECONDARY][region]) {
814  out << "\t" << m_tracks.m_counter[kTracks_gen][TRACK_MATCHED_SECONDARY][region]/ (float) m_tracks.m_counter[kTracks_gen][TRACK_SECONDARY][region]; // track efficiency
815  }
816  else {
817  out << "\t" << "n/a" ;
818  }
819 
820  if (denominator > 0) {
821  out << std::setiosflags(std::ios::fixed | std::ios::showpoint) << std::setw(4) << std::setprecision(1)
822  <<" " << float(m_hits.m_counter[kHits_sec][HIT_ALL ][region]/denominator) << std::setprecision(2)
823  << "\t" << float(m_hits.m_counter[kHits_sec][HIT_PIX1 ][region]/denominator)
824  << "\t" << float(m_hits.m_counter[kHits_sec][HIT_PIX2 ][region]/denominator)
825  << "\t" << float(m_hits.m_counter[kHits_sec][HIT_PIX3 ][region]/denominator)
826  << "\t" << float(m_hits.m_counter[kHits_sec][HIT_SCT1 ][region]/denominator)
827  << "\t" << float(m_hits.m_counter[kHits_sec][HIT_SCT2 ][region]/denominator)
828  << "\t" << float(m_hits.m_counter[kHits_sec][HIT_SCT3 ][region]/denominator)
829  << "\t" << float(m_hits.m_counter[kHits_sec][HIT_SCT4 ][region]/denominator)
830  << "\t" << float(m_hits.m_counter[kHits_sec][HIT_SCT5TO9][region]/denominator)
831  << "\t" << float(m_hits.m_counter[kHits_sec][HIT_TRT_ALL][region]/denominator)
832  << std::endl << std::setprecision(-1);
833  }
834  else {
835  out << " Unable to calculate: Denominator=0." << std::endl << std::setprecision(-1);
836  }
837 }
838 
839 
840 
842  bool passed = false;
843  if(para->pT() > m_cuts.minPt && std::abs(para->eta()) < m_cuts.maxEtaFORWARD)passed = true;
844 
845 
846  return passed;
847 
848 }
849 
851 
852  int partClass=-999;
853 
854  // ME: only classify matched tracks
855  if (prob <= m_cuts.matchTrackCut) return partClass;
856 
857  //classify as primary, secondary or truncated
858  bool primary=false;
859  bool secondary=false;
860  bool truncated=false;
861 
862  if (particle->production_vertex()){
863 
864  // primary vertex inside innermost layer?
865  HepGeom::Point3D<double> startVertex(particle->production_vertex()->position().x(),
866  particle->production_vertex()->position().y(),
867  particle->production_vertex()->position().z());
868  if ( std::abs(startVertex.perp()) < m_cuts.maxRStartPrimary
869  && std::abs(startVertex.z()) < m_cuts.maxZStartPrimary) {
870  if (particle->end_vertex() == nullptr) {
871  primary=true;
872  }
873  else {
874  HepGeom::Point3D<double> endVertex(particle->end_vertex()->position().x(),
875  particle->end_vertex()->position().y(),
876  particle->end_vertex()->position().z());
877  if ( endVertex.perp() > m_cuts.minREndPrimary
878  || std::abs(startVertex.z()) > m_cuts.minZEndPrimary){
879  primary=true;
880  }
881  else {
882  truncated = true;
883  }
884  }
885  }
886 
887  else if ( startVertex.perp() < m_cuts.maxRStartSecondary && std::abs(startVertex.z()) < m_cuts.maxZStartSecondary) {
888  if (particle->end_vertex() == nullptr) {
889  secondary=true;
890  }
891  else {
892  HepGeom::Point3D<double> endVertex(particle->end_vertex()->position().x(),
893  particle->end_vertex()->position().y(),
894  particle->end_vertex()->position().z());
895 
896  if (endVertex.perp() > m_cuts.minREndSecondary
897  || std::abs(endVertex.z()) > m_cuts.minZEndSecondary) {
898  secondary=true;
899  }
900  }
901  }
902  }//end classification
903 
904  if(secondary)partClass=TRACK_SECONDARY;
905  if(primary)partClass=TRACK_PRIMARY;
906  if(truncated)partClass=TRACK_TRUNCATED;
907 
908  return partClass;
909 }
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
AtlasDetectorID::is_pixel
bool is_pixel(Identifier id) const
Definition: AtlasDetectorID.h:760
Trk::numberOfPixelHits
@ numberOfPixelHits
number of pixel layers on track with absence of hits
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:57
InDet::TrackStatHelper::s_summaryTypeName
static const char *const s_summaryTypeName[kNSummaryTypes]
table column labels for summary
Definition: TrackStatHelper.h:291
InDet::eta_region
eta_region
Definition: TrackStatHelper.h:74
InDet::TrackStatHelper::m_careAboutTruth
bool m_careAboutTruth
Definition: TrackStatHelper.h:328
InDet::HIT_SCT1
@ HIT_SCT1
Definition: TrackStatHelper.h:65
ITrackSummaryTool.h
InDet::TRACK_LOWTRUTHPROB2_SIGNAL
@ TRACK_LOWTRUTHPROB2_SIGNAL
Definition: TrackStatHelper.h:53
Trk::TrackInfo
Contains information about the 'fitter' of this track.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:32
InDet::TRACK_LOWTRUTHPROB_SIGNAL
@ TRACK_LOWTRUTHPROB_SIGNAL
Definition: TrackStatHelper.h:52
InDet::TRACK_MATCHED
@ TRACK_MATCHED
Definition: TrackStatHelper.h:45
InDet::HIT_ALL
@ HIT_ALL
Definition: TrackStatHelper.h:59
SCT_ID.h
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
InDet::TRACK_ALL
@ TRACK_ALL
Definition: TrackStatHelper.h:38
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
Trk::numberOfTRTHighThresholdHits
@ numberOfTRTHighThresholdHits
total number of TRT hits which pass the high threshold
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:87
GenEvent.h
InDet::TrackStatHelper::getSummaryTypeHeader
static std::string getSummaryTypeHeader()
Definition: TrackStatHelper.cxx:81
InDet::TRACK_MATCHED_SIGNAL
@ TRACK_MATCHED_SIGNAL
Definition: TrackStatHelper.h:54
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
Trk::numberOfTRTHighThresholdOutliers
@ numberOfTRTHighThresholdOutliers
number of dead TRT straws crossed
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:93
Trk::numberOfInnermostPixelLayerHits
@ numberOfInnermostPixelLayerHits
these are the hits in the 1st pixel layer
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:53
TrackParameters.h
InDet::TrackStatHelper::key
const std::string & key() const
Returns TrackCollection Key.
Definition: TrackStatHelper.h:177
TrigCompositeUtils::passed
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
Definition: TrigCompositeUtilsRoot.cxx:117
CompetingRIOsOnTrack.h
InDet::TRACK_NOHEPMCPARTICLELINK
@ TRACK_NOHEPMCPARTICLELINK
Definition: TrackStatHelper.h:44
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
InDet::TrackStatHelper::kTracks_rec
@ kTracks_rec
number of reconstructed tracks for a given type and eta region
Definition: TrackStatHelper.h:245
AtlasDetectorID::is_sct
bool is_sct(Identifier id) const
Definition: AtlasDetectorID.h:770
InDet::TrackStatHelper::printRegion2
void printRegion2(MsgStream &out, enum eta_region, float denominator) const
Definition: TrackStatHelper.cxx:695
InDet::TrackStatHelper::m_cuts
struct cuts m_cuts
Definition: TrackStatHelper.h:329
InDet::cuts::maxEtaFORWARD
float maxEtaFORWARD
Definition: TrackStatHelper.h:88
GenVertex.h
InDet::TrackStatHelper::printSecondary
void printSecondary(MsgStream &out) const
Prints all of the statistics information, calls printRegion, printTrackSummaryRegion,...
Definition: TrackStatHelper.cxx:760
InDet::cuts
Definition: TrackStatHelper.h:83
InDet::TrackStatHelper::m_authorMutex
std::mutex m_authorMutex
Definition: TrackStatHelper.h:331
InDet::cuts::minZEndSecondary
float minZEndSecondary
Definition: TrackStatHelper.h:99
InDet::TRACK_MATCHED_SECONDARY
@ TRACK_MATCHED_SECONDARY
Definition: TrackStatHelper.h:47
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
InDet::TrackStatHelper::Counter4D
Definition: TrackStatHelper.h:216
InDet::cuts::matchTrackCut
float matchTrackCut
Truth probability has to be greater than this for track to be considered matched
Definition: TrackStatHelper.h:91
InDet::cuts::minZEndPrimary
float minZEndPrimary
Definition: TrackStatHelper.h:98
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
Trk::numberOfOutliersOnTrack
@ numberOfOutliersOnTrack
100 times the standard deviation of the chi2 from the surfaces
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:148
InDet::ETA_BARREL
@ ETA_BARREL
Definition: TrackStatHelper.h:75
InDet::TrackStatHelper::printRegion1
void printRegion1(MsgStream &out, enum eta_region) const
Prints ntracks per event,efficiencies,fake rates, and general hit information for given eta region.
Definition: TrackStatHelper.cxx:653
AtlasDetectorID::is_trt
bool is_trt(Identifier id) const
Definition: AtlasDetectorID.h:782
Trk::undefined
@ undefined
Definition: ParticleHypothesis.h:38
InDet::TrackStatHelper::setSummaryStat
void setSummaryStat(track_types track_i, eta_region region_i, const Trk::TrackSummary *summary, TrackSummaryCounter &trackSummarySum) const
Definition: TrackStatHelper.h:307
InDet::TrackStatHelper::printTrackSummaryRegion
bool printTrackSummaryRegion(MsgStream &out, enum track_types, enum eta_region) const
Sets up detailed statistics part of table, calls printTrackSummaryRegion.
Definition: TrackStatHelper.cxx:716
covarianceTool.prob
prob
Definition: covarianceTool.py:678
Trk::numberOfSCTHoles
@ numberOfSCTHoles
number of Holes in both sides of a SCT module
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:73
InDet::HIT_PIX1
@ HIT_PIX1
Definition: TrackStatHelper.h:61
InDet::ETA_OUTSIDE
@ ETA_OUTSIDE
Definition: TrackStatHelper.h:78
InDet::N_HITTYPES
@ N_HITTYPES
Definition: TrackStatHelper.h:72
master.gen
gen
Definition: master.py:32
Trk::RoT_Extractor
Small utility to cast MeasurementBase (either in a vector or single) into RIO_OnTrack.
Definition: TrackStatHelper.cxx:41
Trk::RoT_Extractor::extract
static void extract(std::vector< const RIO_OnTrack * > &rots, const std::vector< const MeasurementBase * > &measurements)
InDet::TRACK_LOWTRUTHPROB2
@ TRACK_LOWTRUTHPROB2
Definition: TrackStatHelper.h:43
InDet::TrackStatHelper::m_author_found
std::atomic< bool > m_author_found[Trk::TrackInfo::NumberOfTrackFitters]
Number of tracking authors found.
Definition: TrackStatHelper.h:186
Track.h
InDet::TrackStatHelper::kTracks_gen
@ kTracks_gen
number of generated tracks for a given type and eta region, looping over genevents to include possibl...
Definition: TrackStatHelper.h:246
InDet::TRACK_TRUNCATED
@ TRACK_TRUNCATED
Definition: TrackStatHelper.h:41
InDet::cuts::minPt
float minPt
Definition: TrackStatHelper.h:100
InDet::TrackStatHelper::SetCuts
void SetCuts(const struct cuts &)
Sets the cuts such as the eta regions (barrel, transition,endcap) and the hit fraction fake cuts and ...
Definition: TrackStatHelper.cxx:113
AtlasDetectorID.h
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Trk::CompetingRIOsOnTrack::rioOnTrack
virtual const RIO_OnTrack & rioOnTrack(unsigned int) const =0
returns the RIO_OnTrack (also known as ROT) objects depending on the integer.
InDet::TRACK_MATCHED_PRIMARY
@ TRACK_MATCHED_PRIMARY
Definition: TrackStatHelper.h:46
InDet::TrackStatHelper::m_events
std::atomic< long > m_events
Number of events.
Definition: TrackStatHelper.h:187
InDet::cuts::maxRStartSecondary
float maxRStartSecondary
Definition: TrackStatHelper.h:93
TrackTruthCollection
Definition: TrackTruthCollection.h:21
InDet::TRACK_MULTMATCH
@ TRACK_MULTMATCH
Definition: TrackStatHelper.h:48
StateLessPT_NewConfig.primary
primary
Definition: StateLessPT_NewConfig.py:228
InDet::cuts::maxZStartSecondary
float maxZStartSecondary
Definition: TrackStatHelper.h:95
InDet::HIT_UNKNOWN
@ HIT_UNKNOWN
Definition: TrackStatHelper.h:71
InDet::TrackStatHelper::kHits_pri
@ kHits_pri
number of hits from primary tracks for a given type and eta region
Definition: TrackStatHelper.h:256
Trk::TrackInfo::TrackFitter
TrackFitter
enums to identify who created this track and what propertis does it have.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:39
TrackTruthCollection.h
lumiFormat.i
int i
Definition: lumiFormat.py:85
Trk::MeasurementBaseType::CompetingRIOsOnTrack
@ CompetingRIOsOnTrack
Definition: MeasurementBase.h:50
InDet::HIT_PIX2
@ HIT_PIX2
Definition: TrackStatHelper.h:62
Trk::numberOfTRTOutliers
@ numberOfTRTOutliers
number of TRT holes
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:81
InDet::TRACK_ALL_SIGNAL
@ TRACK_ALL_SIGNAL
Definition: TrackStatHelper.h:51
Trk::numberOfSCTHits
@ numberOfSCTHits
number of SCT holes
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:71
InDet::TrackStatHelper::kNSummaryTypes
@ kNSummaryTypes
Definition: TrackStatHelper.h:287
InDet::HIT_SCT4
@ HIT_SCT4
Definition: TrackStatHelper.h:68
InDet::ETA_FORWARD
@ ETA_FORWARD
Definition: TrackStatHelper.h:79
Trk::IExtendedTrackSummaryTool::summary
virtual std::unique_ptr< Trk::TrackSummary > summary(const EventContext &ctx, const Track &track) const =0
InDet::TrackStatHelper::kTrackSummarySum
@ kTrackSummarySum
Track Summary Values for each track type, region and summary type.
Definition: TrackStatHelper.h:264
Trk::CompetingRIOsOnTrack
Base class for all CompetingRIOsOnTack implementations, extends the common MeasurementBase.
Definition: CompetingRIOsOnTrack.h:64
InDet::TrackStatHelper::print
void print(MsgStream &out) const
Prints all of the statistics information, calls printRegion, printTrackSummaryRegion,...
Definition: TrackStatHelper.cxx:584
InDet::HIT_PIX3
@ HIT_PIX3
Definition: TrackStatHelper.h:63
Region
Region
Definition: TrigL2HitResidual.h:14
InDet::cuts::maxEtaBarrel
float maxEtaBarrel
Definition: TrackStatHelper.h:84
Trk::MeasurementBase::type
virtual bool type(MeasurementBaseType::Type type) const =0
Interface method checking the type.
InDet::TRACK_LOWTRUTHPROB
@ TRACK_LOWTRUTHPROB
Definition: TrackStatHelper.h:42
Trk::ParametersBase
Definition: ParametersBase.h:55
InDet::TrackStatHelper::printRegionSecondary
void printRegionSecondary(MsgStream &out, enum eta_region, float denominator) const
Prints ntracks per event,efficiencies,fake rates, and general hit information for given eta region.
Definition: TrackStatHelper.cxx:808
InDet::HIT_SCT5TO9
@ HIT_SCT5TO9
Definition: TrackStatHelper.h:69
ReadTripsProbsFromCool.denominator
denominator
Definition: ReadTripsProbsFromCool.py:96
DataVector< Trk::Track >
InDet::TrackStatHelper::kNTrackSummaryBAD
@ kNTrackSummaryBAD
Number of tracks with track summary bad for given type,eta,summary type.
Definition: TrackStatHelper.h:266
InDet::TrackStatHelper::kNTrackSummaryOK
@ kNTrackSummaryOK
Number of tracks with track summary OK for given type,eta,summary type.
Definition: TrackStatHelper.h:265
compute_lumi.denom
denom
Definition: compute_lumi.py:76
TrackTruth::particleLink
const HepMcParticleLink & particleLink() const
Definition: TrackTruth.h:26
calibdata.ct
ct
Definition: calibdata.py:418
InDet::TrackStatHelper::m_truthMissing
std::atomic< bool > m_truthMissing
Flag for if track truth is missing.
Definition: TrackStatHelper.h:327
Trk::numberOfPixelHoles
@ numberOfPixelHoles
number of pixels which have a ganged ambiguity.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:59
InDet::cuts::maxZStartPrimary
float maxZStartPrimary
Definition: TrackStatHelper.h:94
Trk::MeasurementBase
Definition: MeasurementBase.h:58
Trk::numberOfGangedPixels
@ numberOfGangedPixels
number of Ganged Pixels flagged as fakes
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:61
PixelID::layer_disk
int layer_disk(const Identifier &id) const
Definition: PixelID.h:626
InDet::ETA_ALL
@ ETA_ALL
Definition: TrackStatHelper.h:74
InDet::track_types
track_types
Definition: TrackStatHelper.h:38
Trk::numberOfTRTHits
@ numberOfTRTHits
number of TRT outliers
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:79
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
InDet::cuts::minREndSecondary
float minREndSecondary
Definition: TrackStatHelper.h:97
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::ParametersBase::pT
double pT() const
Access method for transverse momentum.
TrackTruth.h
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
InDet::TrackStatHelper::Truthkey
const std::string & Truthkey() const
Returns Truth TrackCollection Key.
Definition: TrackStatHelper.h:179
Trk::TrackSummary
A summary of the information contained by a track.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:287
InDet::TrackStatHelper::EHitsCounter
EHitsCounter
Definition: TrackStatHelper.h:254
RIO_OnTrack.h
InDet::cuts::maxRStartPrimary
float maxRStartPrimary
Definition: TrackStatHelper.h:92
InDet::TrackStatHelper::s_summaryTypes
static const Trk::SummaryType s_summaryTypes[kNSummaryTypes]
summary types for which statistics are gathered
Definition: TrackStatHelper.h:289
InDet::TrackStatHelper::Counter
Definition: TrackStatHelper.h:190
SCT_ID::layer_disk
int layer_disk(const Identifier &id) const
Definition: SCT_ID.h:734
python.ElectronD3PDObject.matched
matched
Definition: ElectronD3PDObject.py:138
InDet::HIT_SCT_ALL
@ HIT_SCT_ALL
Definition: TrackStatHelper.h:64
InDet::TrackStatHelper::kTracks_gen_signal
@ kTracks_gen_signal
number of generated tracks for a given type and eta region, just from first genevent
Definition: TrackStatHelper.h:247
InDet::TrackStatHelper::ClassifyParticle
int ClassifyParticle(const HepMC::ConstGenParticlePtr &particle, const double prob) const
classifies gen particle as primary, secondary or truncated
Definition: TrackStatHelper.cxx:850
Trk::MeasurementBaseType::RIO_OnTrack
@ RIO_OnTrack
Definition: MeasurementBase.h:49
InDet::TRACK_SECONDARY
@ TRACK_SECONDARY
Definition: TrackStatHelper.h:40
InDet::cuts::minREndPrimary
float minREndPrimary
Definition: TrackStatHelper.h:96
InDet::TrackStatHelper::kNHitsCounter
@ kNHitsCounter
Definition: TrackStatHelper.h:258
InDet::TrackStatHelper::recoToTruthMap
std::multimap< HepMcParticleLink, float > recoToTruthMap
map containing reco track and matched truth track barcode
Definition: TrackStatHelper.h:335
InDet::TrackStatHelper::PassTrackCuts
bool PassTrackCuts(const Trk::TrackParameters *para) const
defines 'good' reco tracks
Definition: TrackStatHelper.cxx:841
InDet::TrackStatHelper::Counter::m_counter
T_Int m_counter[N_Categories][N_Types][N_Regions]
Definition: TrackStatHelper.h:212
InDet::cuts::maxEtaTransition
float maxEtaTransition
Maxiumu eta for transition region.
Definition: TrackStatHelper.h:85
InDet::TRACK_PRIMARY
@ TRACK_PRIMARY
Definition: TrackStatHelper.h:39
InDet::cuts::fakeTrackCut
float fakeTrackCut
fraction of hits per track that come from single matched truth track.
Definition: TrackStatHelper.h:89
InDet::TrackStatHelper::kHits_sec
@ kHits_sec
number of hits from secondary tracks for a given type and eta region
Definition: TrackStatHelper.h:257
InDet::ETA_UNKNOWN
@ ETA_UNKNOWN
Definition: TrackStatHelper.h:80
InDet::ETA_TRANSITION
@ ETA_TRANSITION
Definition: TrackStatHelper.h:76
TrackTruth
MC particle associated with a reco track + the quality of match.
Definition: TrackTruth.h:14
InDet::TrackStatHelper::TrackStatHelper
TrackStatHelper(const std::string &, const std::string &, bool careAboutTruth=true)
Constructor.
Definition: TrackStatHelper.cxx:103
CondAlgsOpts.found
int found
Definition: CondAlgsOpts.py:101
InDet::HIT_SCT2
@ HIT_SCT2
Definition: TrackStatHelper.h:66
SCT_ID
Definition: SCT_ID.h:68
InDet::TrackStatHelper::kHits_rec
@ kHits_rec
number of reconstructed hits for a given type and eta region
Definition: TrackStatHelper.h:255
TrackStatHelper.h
TrackTruth::probability
float probability() const
Definition: TrackTruth.h:28
InDet::HIT_PIXEL_ALL
@ HIT_PIXEL_ALL
Definition: TrackStatHelper.h:60
InDet::N_TRACKTYPES
@ N_TRACKTYPES
Definition: TrackStatHelper.h:55
InDet::TRACK_MULTMATCH_SECONDARY
@ TRACK_MULTMATCH_SECONDARY
Definition: TrackStatHelper.h:50
InDet::TrackStatHelper::addEvent
void addEvent(const TrackCollection *, std::vector< const Trk::Track * > &, const std::vector< std::pair< HepMC::ConstGenParticlePtr, int > > &, const TrackTruthCollection *, const AtlasDetectorID *const, const PixelID *, const SCT_ID *, const Trk::IExtendedTrackSummaryTool *, bool, const unsigned int *, const unsigned int *) const
Adds hit, track and matching information for each event.
Definition: TrackStatHelper.cxx:119
InDet::TrackStatHelper::reset
void reset()
Resets the track collection information, called in the constructor.
Definition: TrackStatHelper.cxx:571
InDet::cuts::maxEtaEndcap
float maxEtaEndcap
Maximum eta for endcap.
Definition: TrackStatHelper.h:86
Trk::ParametersBase::eta
double eta() const
Access method for pseudorapidity - from momentum.
InDet::HIT_TRT_ALL
@ HIT_TRT_ALL
Definition: TrackStatHelper.h:70
InDet::cuts::fakeTrackCut2
float fakeTrackCut2
2nd value for fraction of hits per track that come from single matched truth track.
Definition: TrackStatHelper.h:90
Trk::SummaryType
SummaryType
enumerates the different types of information stored in Summary.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:45
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
InDet::HIT_SCT3
@ HIT_SCT3
Definition: TrackStatHelper.h:67
Trk::IExtendedTrackSummaryTool
Interface for condensing Trk::Track properties and associated hits to a (non-fittable) foot print,...
Definition: IExtendedTrackSummaryTool.h:22
ParticleJetParams::Author
Author
Definition: ParticleJetParamDefs.h:33
PixelID
Definition: PixelID.h:67
Trk::TrackInfo::NumberOfTrackFitters
@ NumberOfTrackFitters
maximum number of enums
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:71
Trk::numberOfSCTDoubleHoles
@ numberOfSCTDoubleHoles
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:75
InDet::TrackStatHelper::kNumberOfPixelHits
@ kNumberOfPixelHits
Definition: TrackStatHelper.h:276
readCCLHist.float
float
Definition: readCCLHist.py:83
InDet::cuts::minEtaFORWARD
float minEtaFORWARD
Definition: TrackStatHelper.h:87
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57
Trk::TrackStateOnSurface::Measurement
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
Definition: TrackStateOnSurface.h:101
Eta
@ Eta
Definition: RPCdef.h:8
InDet::ETA_ENDCAP
@ ETA_ENDCAP
Definition: TrackStatHelper.h:77
InDet::TrackStatHelper::printTrackSummaryAverage
void printTrackSummaryAverage(MsgStream &out, enum track_types, enum eta_region, int summary_type) const
Prints information from TrackSummaryTool.
Definition: TrackStatHelper.cxx:743
GenParticle
@ GenParticle
Definition: TruthClasses.h:30
InDet::TRACK_MULTMATCH_PRIMARY
@ TRACK_MULTMATCH_PRIMARY
Definition: TrackStatHelper.h:49
Identifier
Definition: IdentifierFieldParser.cxx:14
SCT_Monitoring::summary
@ summary
Definition: SCT_MonitoringNumbers.h:65