ATLAS Offline Software
Loading...
Searching...
No Matches
TrigInDetTrackTruthMap.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6/**************************************************************************
7 **
8 ** File: TrigInDetTrackTruthMap.h
9 **
10 ** Description: - Stores a vector of pointers to GenParticles which match
11 ** a TrigInDetTrack and associated matching quality
12 ** quantities (nr of common hits only, for now)
13 **
14 ** Author: R.Goncalo
15 **
16 ** Created: Sat Jan 18 19:55:56 GMT 2006
17 ** Modified: RG - 19 Jun 06 - changed the class to deal with persistency
18 ** it now behaves a bit like a:
19 ** map<ElementLink to TrigInDetTrack, TrigInDetTrackTruth>
20 **
21 **************************************************************************/
22#ifndef TRIGINDETTRACK_TRUTH_MAP_H
23#define TRIGINDETTRACK_TRUTH_MAP_H
24
26
28#include "AthLinks/ElementLinkVector.h"
29
34
35#include <iostream>
36
37
39
40
41 public:
42
48
49 // Destructor
51
52
54 void addMatch(const TrigInDetTrackCollection* trkColl,
55 unsigned int trk_indx,
56 TrigInDetTrackTruth& p_trk_tru);
57
59 // returns true if truth association exists for track
60 bool hasTruth(const TrigInDetTrack* p_trig_trk) const;
61
62 // returns the track truth association object
63 const TrigInDetTrackTruth* truth(const TrigInDetTrack* p_trig_trk) const;
64
65 // to make the map more useful: return the link to GenParticle which better
66 // matches this track according to number of common hits
67 const HepMcParticleLink* bestMatchSi(const TrigInDetTrack* p_trig_trk) const;
68 const HepMcParticleLink* bestMatchTRT(const TrigInDetTrack* p_trig_trk) const;
69
70 // return number of hits for best match
71 int bestMatchSiHits(const TrigInDetTrack* p_trig_trk) const;
72 int bestMatchTRTHits(const TrigInDetTrack* p_trig_trk) const;
73
74 void print() const;
75
76 size_t size() const;
77 const TrigInDetTrackTruth* truthi (size_t i) const;
79 const TrigInDetTrack* tracki (size_t i) const;
80
81 private:
84
85 // used to be map for fast lookup, but changed to use ElemLink as key
86 // std::vector< ElementLink< DataVector<TrigInDetTrack> > > m_elink_vec;
87 //std::vector< ElementLink< TrigInDetTrackCollection > > m_elink_vec;
89 std::vector< TrigInDetTrackTruth > m_truth_vec;
90};
91
92CLASS_DEF( TrigInDetTrackTruthMap , 78130186 , 1 )
93#endif
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
An STL vector of pointers that by default owns its pointed-to elements.
const HepMcParticleLink * bestMatchSi(const TrigInDetTrack *p_trig_trk) const
int bestMatchSiHits(const TrigInDetTrack *p_trig_trk) const
bool hasTruth(const TrigInDetTrack *p_trig_trk) const
methods to get truth-match objects
int bestMatchTRTHits(const TrigInDetTrack *p_trig_trk) const
const ElementLink< TrigInDetTrackCollection > trackiLink(size_t i) const
const TrigInDetTrack * tracki(size_t i) const
ElementLinkVector< TrigInDetTrackCollection > m_elink_vec
const HepMcParticleLink * bestMatchTRT(const TrigInDetTrack *p_trig_trk) const
const TrigInDetTrackTruth * truth(const TrigInDetTrack *p_trig_trk) const
TrigInDetTrackTruthMap()
Constructors: POOL needs default constructor.
const TrigInDetTrackTruth * truthi(size_t i) const
void addMatch(const TrigInDetTrackCollection *trkColl, unsigned int trk_indx, TrigInDetTrackTruth &p_trk_tru)
accessors to fill map
std::vector< TrigInDetTrackTruth > m_truth_vec
friend class TrigInDetTrackTruthMap_old_cnv
represents a LVL2 ID track