ATLAS Offline Software
CompetingRIOsOnTrack.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // CompetingRIOsOnTrack.h, (c) ATLAS Detector software
8 
9 #ifndef COMPETINGRIOSONTRACK_H
10 #define COMPETINGRIOSONTRACK_H
11 
12 // Amg
15 
16 // Trk
19 #include <atomic>
20 #include <cassert>
21 #include <iosfwd>
22 #include <memory>
23 
24 class MsgStream;
26 
27 namespace Trk {
28 
29 class PrepRawData;
30 class RIO_OnTrack;
31 class TrkDetElementBase;
32 
64 {
65 
66 public:
69  typedef double AssignmentProb;
70 
74  CompetingRIOsOnTrack(std::vector<AssignmentProb>&& assgnProb);
76  CompetingRIOsOnTrack(const CompetingRIOsOnTrack& compROT) = default;
77  CompetingRIOsOnTrack(CompetingRIOsOnTrack&& compROT) noexcept = default;
80  CompetingRIOsOnTrack& operator=(CompetingRIOsOnTrack&& compROT) noexcept = default;
82  virtual ~CompetingRIOsOnTrack() = default;
83 
85  virtual CompetingRIOsOnTrack* clone() const override = 0;
86 
88  std::unique_ptr<CompetingRIOsOnTrack> uniqueClone() const
89  {
90  return std::unique_ptr<CompetingRIOsOnTrack>(clone());
91  }
92 
95  virtual unsigned int numberOfContainedROTs() const = 0;
96 
100  unsigned int indexOfMaxAssignProb() const;
101 
105  virtual const RIO_OnTrack& rioOnTrack(unsigned int) const = 0;
106 
110  AssignmentProb assignmentProbability(unsigned int indx) const;
111 
113  virtual void setLocalParametersAndErrorMatrix();
114 
116  virtual bool type(MeasurementBaseType::Type type) const override final
117  {
119  }
120 
121 protected:
122  friend class ::CompetingRIOsOnTrackCnv_p1;
123 
125  std::vector<AssignmentProb> m_assignProb;
126 
130  virtual bool ROTsHaveCommonSurface(const bool withNonVanishingAssignProb = true) const = 0;
131 
133  virtual MsgStream& dump(MsgStream& out) const override;
135  virtual std::ostream& dump(std::ostream& out) const override;
136 };
137 
140 {
141  assert(indx < numberOfContainedROTs());
142  if (indx < numberOfContainedROTs()) {
143  return m_assignProb[indx];
144  }
145  return 0; // could consider throwing an exception here - EJWM
146 }
147 
148 }
149 
150 #endif // COMPETINGRIOSONTRACK_H
151 
MeasurementBase.h
Trk::CompetingRIOsOnTrack::dump
virtual MsgStream & dump(MsgStream &out) const override
returns the some information about the base class members (avoid code duplication)
Definition: CompetingRIOsOnTrack.cxx:115
Trk::CompetingRIOsOnTrack::CompetingRIOsOnTrack
CompetingRIOsOnTrack(const CompetingRIOsOnTrack &compROT)=default
Copy Constructor.
Trk::CompetingRIOsOnTrack::CompetingRIOsOnTrack
CompetingRIOsOnTrack(CompetingRIOsOnTrack &&compROT) noexcept=default
Trk::CompetingRIOsOnTrack::uniqueClone
std::unique_ptr< CompetingRIOsOnTrack > uniqueClone() const
NVI Clone.
Definition: CompetingRIOsOnTrack.h:88
Trk::CompetingRIOsOnTrack::operator=
CompetingRIOsOnTrack & operator=(CompetingRIOsOnTrack &&compROT) noexcept=default
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
Trk::CompetingRIOsOnTrack::type
virtual bool type(MeasurementBaseType::Type type) const override final
Extended method checking the type.
Definition: CompetingRIOsOnTrack.h:116
Trk::CompetingRIOsOnTrack::setLocalParametersAndErrorMatrix
virtual void setLocalParametersAndErrorMatrix()
recalculate the LocalParameters and ErrorMatrix
Definition: CompetingRIOsOnTrack.cxx:34
GeoPrimitives.h
CompetingRIOsOnTrackCnv_p1
Definition: CompetingRIOsOnTrackCnv_p1.h:23
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.
Trk::CompetingRIOsOnTrack::operator=
CompetingRIOsOnTrack & operator=(const CompetingRIOsOnTrack &compROT)=default
Assignment operator.
Trk::CompetingRIOsOnTrack::numberOfContainedROTs
virtual unsigned int numberOfContainedROTs() const =0
Number of RIO_OnTracks to be contained by this CompetingRIOsOnTrack.
Trk::MeasurementBaseType::CompetingRIOsOnTrack
@ CompetingRIOsOnTrack
Definition: MeasurementBase.h:50
Trk::CompetingRIOsOnTrack
Base class for all CompetingRIOsOnTack implementations, extends the common MeasurementBase.
Definition: CompetingRIOsOnTrack.h:64
Trk::CompetingRIOsOnTrack::m_assignProb
std::vector< AssignmentProb > m_assignProb
assignment probabilities of the ROTs
Definition: CompetingRIOsOnTrack.h:125
Trk::MeasurementBase
Definition: MeasurementBase.h:58
EventPrimitives.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::CompetingRIOsOnTrack::clone
virtual CompetingRIOsOnTrack * clone() const override=0
Pseudo-constructor: needed to avoid excessive RTTI.
Trk::CompetingRIOsOnTrack::ROTsHaveCommonSurface
virtual bool ROTsHaveCommonSurface(const bool withNonVanishingAssignProb=true) const =0
query if all the contained ROTs have a common associated surface.
LocalParameters.h
Trk::MeasurementBaseType::RIO_OnTrack
@ RIO_OnTrack
Definition: MeasurementBase.h:49
Trk::CompetingRIOsOnTrack::AssignmentProb
double AssignmentProb
Type def of Assignment probability: probability for a certain RIO_OnTrack to be assigned to the track...
Definition: CompetingRIOsOnTrack.h:69
Trk::CompetingRIOsOnTrack::~CompetingRIOsOnTrack
virtual ~CompetingRIOsOnTrack()=default
Destructor.
Trk::CompetingRIOsOnTrack::CompetingRIOsOnTrack
CompetingRIOsOnTrack()
Default Constructor for POOL.
Definition: CompetingRIOsOnTrack.cxx:19
Trk::MeasurementBaseType::Type
Type
Definition: MeasurementBase.h:46
Trk::CompetingRIOsOnTrack::indexOfMaxAssignProb
unsigned int indexOfMaxAssignProb() const
Index of the ROT with the highest assignment probability.
Definition: CompetingRIOsOnTrack.cxx:101
Trk::CompetingRIOsOnTrack::assignmentProbability
AssignmentProb assignmentProbability(unsigned int indx) const
returns the AssignmentProbability depending on the integer.
Definition: CompetingRIOsOnTrack.h:139