ATLAS Offline Software
Loading...
Searching...
No Matches
TrigInDetTrackTruth.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6/**************************************************************************
7 **
8 ** File: TrigInDetTrackTruth.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:
18 **
19 **
20 **
21 **************************************************************************/
22#ifndef TRIGINDETTRACK_TRUTH_H
23#define TRIGINDETTRACK_TRUTH_H
24
26
29
33
34#include <iostream>
35
37
38 public:
39
44
48 {
49 // add this particle to the vector
50 m_true_part_vec.push_back(p_tru_part);
51
52 // add number of hits
53 m_nr_common_hits.push_back( hits );
54
55 // set the best match index (only 1 match so far)
59 };
60
61 // Destructor
62 virtual ~TrigInDetTrackTruth() { };
63
64 // accessors: to add links to GenParticles to object and get
65 // index if already filled; addMatch returns index of new entry
66 int addMatch(HepMcParticleLink p_tru_part, TrigIDHitStats hits);
67 int index(HepMcParticleLink&) const;
68
69 // to get quantities
70 const HepMcParticleLink* bestMatch() const;
71 const HepMcParticleLink* bestSiMatch() const;
72 const HepMcParticleLink* bestTRTMatch() const;
73 const HepMcParticleLink* truthMatch(unsigned int i) const;
74 unsigned int nrMatches() const;
75 unsigned int nrCommonHits(unsigned int i) const;
76 unsigned int nrCommonSiHits(unsigned int i) const;
77 unsigned int nrCommonTRTHits(unsigned int i) const;
78 unsigned int nrCommonHitsBestSi() const;
79 unsigned int nrCommonHitsBestTRT() const;
80
81 // to handle mother-daughter relationships within matching particles
82 int updateFamilyTree();
83 const std::vector< std::pair<unsigned int, unsigned int> >& getFamilyTree() const;
84 bool motherInChain(unsigned int) const;
85 int motherIndexInChain(unsigned int) const;
86 bool daughtersInChain(unsigned int) const;
87 std::vector<unsigned int> daughterIndicesInChain(unsigned int) const;
88
89 private:
92
93 // reference best match quantities
97
98 // vector of HepMcParticleLink pointers and matching quantities
99 std::vector<HepMcParticleLink> m_true_part_vec;
100 std::vector<TrigIDHitStats> m_nr_common_hits;
101 // vector<pair<int,int>> to act as bidirectional map "mother index <-> daughter index"
102 // where the indices refer to the GenPaticle positions in m_true_part_vec vector
103 std::vector< std::pair<unsigned int, unsigned int> > m_family_tree;
104
105
106};
107
108CLASS_DEF( TrigInDetTrackTruth , 243330893 , 1 )
109#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
const HepMcParticleLink * bestSiMatch() const
returns best match according to the number of hits
unsigned int nrCommonSiHits(unsigned int i) const
returns number of common hits from true particle i and TrigInDetTrack
std::vector< std::pair< unsigned int, unsigned int > > m_family_tree
bool daughtersInChain(unsigned int) const
given index of a GenParticle which matches the track returns true if it has stable a daughter which a...
unsigned int nrCommonTRTHits(unsigned int i) const
returns number of common hits from true particle i and TrigInDetTrack
int motherIndexInChain(unsigned int) const
given index of a GenParticle which matches the track returns index of its mother,...
friend class TrigInDetTrackTruthCnv_p1_test
unsigned int nrCommonHits(unsigned int i) const
returns number of common hits from true particle i and TrigInDetTrack
int updateFamilyTree()
accessor to fill family tree: for each HepMcParticleLink in the internal vector of HepMC::GenParticle...
unsigned int nrCommonHitsBestSi() const
returns total number of common hits from best match true particle and TrigInDetTrack
const HepMcParticleLink * bestTRTMatch() const
returns best match according to the number of hits
unsigned int nrCommonHitsBestTRT() const
returns total number of common hits from best match true particle and TrigInDetTrack
const std::vector< std::pair< unsigned int, unsigned int > > & getFamilyTree() const
returns copy of family tree "map"
unsigned int nrMatches() const
returns number of matching particles
bool motherInChain(unsigned int) const
given index of a GenParticle which matches the track returns true if its mother also matches the trac...
std::vector< TrigIDHitStats > m_nr_common_hits
friend class TrigInDetTrackTruthCnv_p1
std::vector< unsigned int > daughterIndicesInChain(unsigned int) const
given index of a GenParticle which matches the track returns vector with indices of its daughters,...
int addMatch(HepMcParticleLink p_tru_part, TrigIDHitStats hits)
accessor to fill object: returns index of new entry in vectors
TrigInDetTrackTruth()
Constructors: POOL needs default constructor.
const HepMcParticleLink * truthMatch(unsigned int i) const
returns matching true particle number i
TrigInDetTrackTruth(const HepMcParticleLink &p_tru_part, TrigIDHitStats hits)
initialized constructor: easier way to construct an instance if there is just one true particle assoc...
const HepMcParticleLink * bestMatch() const
returns best match according to the number of hits
std::vector< HepMcParticleLink > m_true_part_vec
Definition index.py:1