ATLAS Offline Software
TrackInfo.icc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 namespace Trk {
6 // set methods
7 inline void
8 Trk::TrackInfo::setTrackProperties(const TrackProperties& property)
9 {
10  // std::cout<<"Set track properties "<<std::endl;
11  m_properties.set(property);
12  if (property == BremFitSuccessful && m_particleHypo == undefined) {
13  m_particleHypo = electron;
14  }
15 }
16 
17 inline void
18 Trk::TrackInfo::setPatternRecognitionInfo(
19  const TrackPatternRecoInfo& patternReco)
20 {
21  m_patternRecognition.set(patternReco);
22 }
23 
24 inline void
25 Trk::TrackInfo::setTrackFitter(const TrackFitter& fitter)
26 {
27  m_fitter = (fitter < NumberOfTrackFitters) ? fitter : Unknown;
28 }
29 
30 inline void
31 Trk::TrackInfo::setParticleHypothesis(const ParticleHypothesis& hypothesis)
32 {
33  m_particleHypo = hypothesis;
34 }
35 
36 // access methods
37 inline const Trk::TrackInfo::TrackFitter&
38 Trk::TrackInfo::trackFitter() const
39 {
40  return m_fitter;
41 }
42 
43 inline Trk::ParticleHypothesis
44 Trk::TrackInfo::particleHypothesis() const
45 {
46  return m_particleHypo;
47 }
48 
49 inline bool
50 Trk::TrackInfo::trackProperties(const TrackProperties& property) const
51 {
52  return m_properties.test(property);
53 }
54 
55 inline bool
56 Trk::TrackInfo::patternRecoInfo(const TrackPatternRecoInfo& pattern) const
57 {
58  return m_patternRecognition.test(pattern);
59 }
60 
61 inline TrackInfo*
62 TrackInfo::clone() const
63 {
64  return new TrackInfo(*this);
65 }
66 
67 inline std::string
68 TrackInfo::dumpBitsProperties() const
69 {
70  return m_properties
71  .to_string<char, std::char_traits<char>, std::allocator<char>>();
72 }
73 
74 inline std::string
75 TrackInfo::dumpBitsPatternRecoInfo() const
76 {
77  return m_patternRecognition
78  .to_string<char, std::char_traits<char>, std::allocator<char>>();
79 }
80 
81 inline const std::bitset<TrackInfo::NumberOfTrackProperties>&
82 TrackInfo::properties() const
83 {
84  return m_properties;
85 }
86 
87 inline const std::bitset<TrackInfo::NumberOfTrackRecoInfo>&
88 TrackInfo::patternRecognition() const
89 {
90  return m_patternRecognition;
91 }
92 
93 inline void
94 TrackInfo::addPatternRecoAndProperties(const TrackInfo& rhs)
95 {
96  // merging information by means of bitwise "or"
97  addPatternReco(rhs);
98  m_properties = m_properties | rhs.m_properties;
99 }
100 
101 inline void
102 TrackInfo::addPatternReco(const TrackInfo& rhs)
103 {
104  // merging information by means of bitwise "or"
105  m_patternRecognition = m_patternRecognition | rhs.m_patternRecognition;
106 }
107 
108 } // end of namespace Trk
109