ATLAS Offline Software
Loading...
Searching...
No Matches
InDet::CompetingPixelClustersOnTrack Class Reference

Class for competing PixelClusters, it extends the Trk::CompetingRIOsOnTrack base class. More...

#include <CompetingPixelClustersOnTrack.h>

Inheritance diagram for InDet::CompetingPixelClustersOnTrack:
Collaboration diagram for InDet::CompetingPixelClustersOnTrack:

Public Types

typedef double AssignmentProb
 Type def of Assignment probability: probability for a certain RIO_OnTrack to be assigned to the track.

Public Member Functions

 CompetingPixelClustersOnTrack ()
 Default Constructor for POOL.
 CompetingPixelClustersOnTrack (const CompetingPixelClustersOnTrack &compROT)
 Copy Constructor.
CompetingPixelClustersOnTrackoperator= (const CompetingPixelClustersOnTrack &compROT)
 Assignment operator.
CompetingPixelClustersOnTrackoperator= (CompetingPixelClustersOnTrack &&compROT) noexcept
 CompetingPixelClustersOnTrack (std::vector< const InDet::PixelClusterOnTrack * > &&childrots, std::vector< AssignmentProb > &&assgnProb)
 Constructor with all parameters: PLEASE do not use directly, but call InDet::CompetingPixelClustersOnTrackTool, otherwise inconsistency of the data will be very probable.
virtual ~CompetingPixelClustersOnTrack ()
 Destructor.
CompetingPixelClustersOnTrackclone () const
 needed to avoid excessive RTTI
std::unique_ptr< CompetingPixelClustersOnTrackuniqueClone () const
 NVI method returning unique_ptr clone.
const Trk::SurfaceassociatedSurface () const
 returns the surface for the local to global transformation .
const Amg::Vector3DglobalPosition () const
 Interface method to get the global Position.
unsigned int numberOfContainedROTs () const
 Number of RIO_OnTracks to be contained by this CompetingRIOsOnTrack.
const std::vector< const InDet::PixelClusterOnTrack * > & containedROTs () const
 returns the vector of PixelClusterOnTrack objects .
const InDet::PixelClusterOnTrackrioOnTrack (unsigned int) const
 returns the RIO_OnTrack (also known as ROT) objects depending on the integer
MsgStream & dump (MsgStream &out) const
 returns some information about this MeasurementBase/CompetingPixelClustersOnTrack.
std::ostream & dump (std::ostream &out) const
 returns some information about this MeasurementBase/CompetingPixelClustersOnTrack.
unsigned int indexOfMaxAssignProb () const
 Index of the ROT with the highest assignment probability.
AssignmentProb assignmentProbability (unsigned int indx) const
 returns the AssignmentProbability depending on the integer.
virtual void setLocalParametersAndErrorMatrix ()
 recalculate the LocalParameters and ErrorMatrix
virtual bool type (MeasurementBaseType::Type type) const override final
 Extended method checking the type.
const LocalParameters & localParameters () const
 Interface method to get the LocalParameters.
const Amg::MatrixXlocalCovariance () const
 Interface method to get the localError.

Protected Attributes

std::vector< AssignmentProbm_assignProb
 assignment probabilities of the ROTs
LocalParameters m_localParams
Amg::MatrixX m_localCovariance

Private Member Functions

void clearChildRotVector ()
 private method to clear the Trk::RIO_OnTrack vector
bool ROTsHaveCommonSurface (const bool withNonVanishingAssignProb=true) const
 Have all the contained ROTs a common associated surface?

Private Attributes

CxxUtils::CachedUniquePtr< const Amg::Vector3Dm_globalPosition
 The global Position.
std::vector< const InDet::PixelClusterOnTrack * > m_containedChildRots
 The vector of contained InDet::PixelClusterOnTrack objects.

Friends

class CompetingPixelClustersOnTrackTool
 InDet::CompetingPixelClustersOnTrackTool is a friend to allow for updates of the assignment probabilities.

Detailed Description

Class for competing PixelClusters, it extends the Trk::CompetingRIOsOnTrack base class.

This class is used by the Deterministic Annealing Filter to handle several PixelClusterOnTrack in one detector element, which compete against each other in being assigned to a track. In contrast to the InDet::CompetingTRT_DriftCirclesOnTrack all competing measurements of the InDet::CompetingPixelClustersOnTrack have to be on the same detector element (i.e. have a common associated surface). localParameters() and localErrorMatrix() return the mean values according to the weights (assignment probabilities).

Author
Sebas.nosp@m.tian.nosp@m..Flei.nosp@m.schm.nosp@m.ann@c.nosp@m.ern..nosp@m.ch

Definition at line 46 of file CompetingPixelClustersOnTrack.h.

Member Typedef Documentation

◆ AssignmentProb

Type def of Assignment probability: probability for a certain RIO_OnTrack to be assigned to the track.

Definition at line 69 of file CompetingRIOsOnTrack.h.

Constructor & Destructor Documentation

◆ CompetingPixelClustersOnTrack() [1/3]

InDet::CompetingPixelClustersOnTrack::CompetingPixelClustersOnTrack ( )

Default Constructor for POOL.

Definition at line 16 of file CompetingPixelClustersOnTrack.cxx.

17 : Trk::CompetingRIOsOnTrack()
20{
21}
CxxUtils::CachedUniquePtr< const Amg::Vector3D > m_globalPosition
The global Position.
std::vector< const InDet::PixelClusterOnTrack * > m_containedChildRots
The vector of contained InDet::PixelClusterOnTrack objects.

◆ CompetingPixelClustersOnTrack() [2/3]

InDet::CompetingPixelClustersOnTrack::CompetingPixelClustersOnTrack ( const CompetingPixelClustersOnTrack & compROT)

Copy Constructor.

Definition at line 24 of file CompetingPixelClustersOnTrack.cxx.

26 : Trk::CompetingRIOsOnTrack(compROT)
29{
30 std::vector<const InDet::PixelClusterOnTrack*>::const_iterator rotIter =
31 compROT.m_containedChildRots.begin();
32 for (; rotIter != compROT.m_containedChildRots.end(); ++rotIter) {
33 m_containedChildRots.push_back((*rotIter)->clone());
34 }
35 if (compROT.m_globalPosition) {
36 m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*compROT.m_globalPosition));
37 }
38}

◆ CompetingPixelClustersOnTrack() [3/3]

InDet::CompetingPixelClustersOnTrack::CompetingPixelClustersOnTrack ( std::vector< const InDet::PixelClusterOnTrack * > && childrots,
std::vector< AssignmentProb > && assgnProb )

Constructor with all parameters: PLEASE do not use directly, but call InDet::CompetingPixelClustersOnTrackTool, otherwise inconsistency of the data will be very probable.

Definition at line 41 of file CompetingPixelClustersOnTrack.cxx.

44 : Trk::CompetingRIOsOnTrack(std::move(assgnProb))
46 , m_containedChildRots(std::move(childrots))
47{
48 // initialize local position and error matrix
50}
virtual void setLocalParametersAndErrorMatrix()
recalculate the LocalParameters and ErrorMatrix

◆ ~CompetingPixelClustersOnTrack()

InDet::CompetingPixelClustersOnTrack::~CompetingPixelClustersOnTrack ( )
virtual

Destructor.

Definition at line 90 of file CompetingPixelClustersOnTrack.cxx.

91{
93}
void clearChildRotVector()
private method to clear the Trk::RIO_OnTrack vector

Member Function Documentation

◆ assignmentProbability()

CompetingRIOsOnTrack::AssignmentProb Trk::CompetingRIOsOnTrack::assignmentProbability ( unsigned int indx) const
inlineinherited

returns the AssignmentProbability depending on the integer.

  • extends MeasurementBase

Definition at line 139 of file CompetingRIOsOnTrack.h.

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}
std::vector< AssignmentProb > m_assignProb
assignment probabilities of the ROTs
virtual unsigned int numberOfContainedROTs() const =0
Number of RIO_OnTracks to be contained by this CompetingRIOsOnTrack.

◆ associatedSurface()

const Trk::Surface & InDet::CompetingPixelClustersOnTrack::associatedSurface ( ) const
inlinevirtual

returns the surface for the local to global transformation .

  • interface from MeasurementBase

Implements Trk::MeasurementBase.

Definition at line 129 of file CompetingPixelClustersOnTrack.h.

130{
131 return ((*(std::as_const(m_containedChildRots).begin()))->associatedSurface());
132}
const Trk::Surface & associatedSurface() const
returns the surface for the local to global transformation .

◆ clearChildRotVector()

void InDet::CompetingPixelClustersOnTrack::clearChildRotVector ( )
private

private method to clear the Trk::RIO_OnTrack vector

Definition at line 96 of file CompetingPixelClustersOnTrack.cxx.

97{
98 std::vector<const InDet::PixelClusterOnTrack*>::const_iterator rotIter =
100 for (; rotIter != m_containedChildRots.end(); ++rotIter)
101 delete (*rotIter);
102}

◆ clone()

CompetingPixelClustersOnTrack * InDet::CompetingPixelClustersOnTrack::clone ( ) const
inlinevirtual

needed to avoid excessive RTTI

Implements Trk::CompetingRIOsOnTrack.

Definition at line 123 of file CompetingPixelClustersOnTrack.h.

124{
125 return new InDet::CompetingPixelClustersOnTrack(*this);
126}

◆ containedROTs()

const std::vector< const InDet::PixelClusterOnTrack * > & InDet::CompetingPixelClustersOnTrack::containedROTs ( ) const
inline

returns the vector of PixelClusterOnTrack objects .

Definition at line 135 of file CompetingPixelClustersOnTrack.h.

136{
137 return (m_containedChildRots);
138}

◆ dump() [1/2]

MsgStream & InDet::CompetingPixelClustersOnTrack::dump ( MsgStream & out) const
virtual

returns some information about this MeasurementBase/CompetingPixelClustersOnTrack.

Reimplemented from Trk::CompetingRIOsOnTrack.

Definition at line 105 of file CompetingPixelClustersOnTrack.cxx.

106{
107 using std::ios;
108 out << "Trk::CompetingPixelClustersOnTrack with [" << numberOfContainedROTs()
109 << "] competing Pixel RIO_OnTrack objects" << std::endl;
111 out << " - GlobalPosition : ";
112 if (not m_globalPosition)
113 out << "null pointer" << std::endl;
114 else
116 return out;
117}
#define endmsg
unsigned int numberOfContainedROTs() const
Number of RIO_OnTracks to be contained by this CompetingRIOsOnTrack.
virtual MsgStream & dump(MsgStream &out) const override
returns the some information about the base class members (avoid code duplication)

◆ dump() [2/2]

std::ostream & InDet::CompetingPixelClustersOnTrack::dump ( std::ostream & out) const
virtual

returns some information about this MeasurementBase/CompetingPixelClustersOnTrack.

Reimplemented from Trk::CompetingRIOsOnTrack.

Definition at line 120 of file CompetingPixelClustersOnTrack.cxx.

121{
122 using std::ios;
123 out << "Trk::CompetingPixelClustersOnTrack with [" << numberOfContainedROTs()
124 << "] competing Pixel RIO_OnTrack objects" << std::endl;
126 out << " - GlobalPosition : ";
127 if (not m_globalPosition)
128 out << "null pointer" << std::endl;
129 else
130 out << *m_globalPosition << std::endl;
131 return out;
132}

◆ globalPosition()

const Amg::Vector3D & InDet::CompetingPixelClustersOnTrack::globalPosition ( ) const
virtual

Interface method to get the global Position.

  • interface from MeasurementBase

Implements Trk::MeasurementBase.

Definition at line 142 of file CompetingPixelClustersOnTrack.cxx.

143{
144 if (not m_globalPosition) {
145 m_globalPosition.set(std::make_unique<const Amg::Vector3D>(
146 associatedSurface().localToGlobal(localParameters())));
147 }
148 return *m_globalPosition;
149}
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.

◆ indexOfMaxAssignProb()

unsigned int Trk::CompetingRIOsOnTrack::indexOfMaxAssignProb ( ) const
inherited

Index of the ROT with the highest assignment probability.

  • extends MeasurementBase

Definition at line 101 of file CompetingRIOsOnTrack.cxx.

102{
103 unsigned int index = 0;
104 double maxAssgnProb = 0;
105 for (unsigned int i = 0; i < numberOfContainedROTs(); i++) {
106 if (m_assignProb[i] >= maxAssgnProb) {
107 index = i;
108 maxAssgnProb = m_assignProb[i];
109 }
110 }
111 return index;
112}
str index
Definition DeMoScan.py:362

◆ localCovariance()

const Amg::MatrixX & Trk::MeasurementBase::localCovariance ( ) const
inlineinherited

Interface method to get the localError.

Definition at line 138 of file MeasurementBase.h.

139{
140 return m_localCovariance;
141}
Amg::MatrixX m_localCovariance

◆ localParameters()

const Trk::LocalParameters & Trk::MeasurementBase::localParameters ( ) const
inlineinherited

Interface method to get the LocalParameters.

Definition at line 132 of file MeasurementBase.h.

133{
134 return m_localParams;
135}
LocalParameters m_localParams

◆ numberOfContainedROTs()

unsigned int InDet::CompetingPixelClustersOnTrack::numberOfContainedROTs ( ) const
inlinevirtual

Number of RIO_OnTracks to be contained by this CompetingRIOsOnTrack.

Implements Trk::CompetingRIOsOnTrack.

Definition at line 147 of file CompetingPixelClustersOnTrack.h.

148{
149 return m_containedChildRots.size();
150}

◆ operator=() [1/2]

InDet::CompetingPixelClustersOnTrack & InDet::CompetingPixelClustersOnTrack::operator= ( InDet::CompetingPixelClustersOnTrack && compROT)
noexcept

Definition at line 76 of file CompetingPixelClustersOnTrack.cxx.

78{
79 if (this != &compROT) {
80 // move operator of base class
82 // clear rots
84 m_containedChildRots = std::move(compROT.m_containedChildRots);
85 m_globalPosition = std::move(compROT.m_globalPosition);
86 }
87 return (*this);
88}
CompetingRIOsOnTrack & operator=(const CompetingRIOsOnTrack &compROT)=default
Assignment operator.

◆ operator=() [2/2]

InDet::CompetingPixelClustersOnTrack & InDet::CompetingPixelClustersOnTrack::operator= ( const CompetingPixelClustersOnTrack & compROT)

Assignment operator.

Definition at line 53 of file CompetingPixelClustersOnTrack.cxx.

55{
56 if (this != &compROT) {
57 // assignment operator of base class
59 // clear rots
62 if (compROT.m_globalPosition) {
63 m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*compROT.m_globalPosition));
64 } else if (m_globalPosition) {
65 m_globalPosition.release().reset();
66 }
67 std::vector<const InDet::PixelClusterOnTrack*>::const_iterator rotIter =
68 compROT.m_containedChildRots.begin();
69 for (; rotIter != compROT.m_containedChildRots.end(); ++rotIter)
70 m_containedChildRots.push_back((*rotIter)->clone());
71 }
72 return (*this);
73}

◆ rioOnTrack()

const InDet::PixelClusterOnTrack & InDet::CompetingPixelClustersOnTrack::rioOnTrack ( unsigned int indx) const
inlinevirtual

returns the RIO_OnTrack (also known as ROT) objects depending on the integer

Implements Trk::CompetingRIOsOnTrack.

Definition at line 141 of file CompetingPixelClustersOnTrack.h.

142{
143 return *std::as_const(m_containedChildRots)[indx];
144}

◆ ROTsHaveCommonSurface()

bool InDet::CompetingPixelClustersOnTrack::ROTsHaveCommonSurface ( const bool withNonVanishingAssignProb = true) const
privatevirtual

Have all the contained ROTs a common associated surface?

If withNonVanishingAssignProb==true just the ROTs with non-vanishing assignment probabilities are checked.

  • interface from CompetingRIOsOnTrack
  • CompetingPixelClustersOnTrack assume that all PixelClusters belong to the same detector element, so this function will always return true

Implements Trk::CompetingRIOsOnTrack.

Definition at line 136 of file CompetingPixelClustersOnTrack.cxx.

137{
138 return true;
139}

◆ setLocalParametersAndErrorMatrix()

void Trk::CompetingRIOsOnTrack::setLocalParametersAndErrorMatrix ( )
virtualinherited

recalculate the LocalParameters and ErrorMatrix

Reimplemented in InDet::CompetingSCT_ClustersOnTrack, and InDet::CompetingTRT_DriftCirclesOnTrack.

Definition at line 34 of file CompetingRIOsOnTrack.cxx.

35{
36
38 // std::cout << "CompROT - weight matrices: " << std::endl;
39 // std::cout << "CompROT - [1] " << rioOnTrack(0).localCovariance() << std::endl;
40 Amg::MatrixX meanWeightMatrix =
42 for (unsigned int i = 1; i < numberOfContainedROTs(); i++) {
43 meanWeightMatrix += assignmentProbability(i) * rioOnTrack(i).localCovariance().inverse();
44 // std::cout << "CompROT - ["<< i << "] " << rioOnTrack(i).localCovariance() <<
45 // std::endl;
46 }
47 // limit weight values against values too close to 0, otherwise inversion will fail!
48 if (meanWeightMatrix.trace() <= 1.0e-15) {
49 meanWeightMatrix = Amg::MatrixX(rioOnTrack(0).localCovariance().rows(),
51 meanWeightMatrix.setZero();
52 for (int i = 0; i < meanWeightMatrix.cols(); ++i) {
53 meanWeightMatrix(i, i) = 1.0e-10;
54 }
55 }
56 // std::cout << "CompROT - mean weight: " << meanWeightMatrix << std::endl;
57 m_localCovariance = meanWeightMatrix.inverse();
58 // std::cout << "CompROT - mean covariance: " << localCovariance() << std::endl;
59
60 if (numberOfContainedROTs() == 1) {
62 } else {
64 Amg::VectorX meanParams =
66 for (unsigned int i = 1; i < numberOfContainedROTs(); i++) {
67 weight = rioOnTrack(i).localCovariance().inverse();
68 meanParams =
70 }
71 // std::cout << "CompROT - sum params: " << meanParams << std::endl;
72 meanParams = localCovariance() * meanParams;
73 // std::cout << "CompROT - mean params: " << meanParams << std::endl;
74 int paramKey = rioOnTrack(0).localParameters().parameterKey();
75 if (paramKey == 1) {
76 Trk::DefinedParameter Par1(meanParams[Trk::loc1], Trk::loc1);
77 m_localParams = Trk::LocalParameters(Par1);
78 } else if (paramKey == 3) {
79 Trk::DefinedParameter Par1(meanParams[Trk::loc1], Trk::loc1);
80 Trk::DefinedParameter Par2(meanParams[Trk::loc2], Trk::loc2);
81 m_localParams = Trk::LocalParameters(Par1, Par2);
82 } else {
83 std::cout << "Trk::CompetingRIOsOnTrack: can not handle parameter key " << paramKey
84 << std::endl;
85 }
86 }
87 } else {
88 // --------------------------------------------------
89 // Warning: effective localParams cannot be calculated when ROTs don't lie on the
90 // associated surface without detector specific knowledge.
91 // --------------------------------------------------
92 // return 0;
93 std::cout
94 << "Trk::CompetingRIOsOnTrack: can not handle ROTs in different surfaces without "
95 "detector specific knowledge "
96 << std::endl;
97 }
98}
virtual bool ROTsHaveCommonSurface(const bool withNonVanishingAssignProb=true) const =0
query if all the contained ROTs have a common associated surface.
AssignmentProb assignmentProbability(unsigned int indx) const
returns the AssignmentProbability depending on the integer.
virtual const RIO_OnTrack & rioOnTrack(unsigned int) const =0
returns the RIO_OnTrack (also known as ROT) objects depending on the integer.
int parameterKey() const
Identifier key for matrix expansion/reduction.
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Matrix< double, Eigen::Dynamic, 1 > VectorX
Dynamic Vector - dynamic allocation.
@ loc2
generic first and second local coordinate
Definition ParamDefs.h:35
@ loc1
Definition ParamDefs.h:34
std::pair< double, ParamDefs > DefinedParameter
Typedef to of a std::pair<double, ParamDefs> to identify a passed-through double as a specific type o...

◆ type()

virtual bool Trk::CompetingRIOsOnTrack::type ( MeasurementBaseType::Type type) const
inlinefinaloverridevirtualinherited

Extended method checking the type.

Implements Trk::MeasurementBase.

Definition at line 116 of file CompetingRIOsOnTrack.h.

117 {
119 }
virtual bool type(MeasurementBaseType::Type type) const override final
Extended method checking the type.

◆ uniqueClone()

std::unique_ptr< CompetingPixelClustersOnTrack > InDet::CompetingPixelClustersOnTrack::uniqueClone ( ) const
inline

NVI method returning unique_ptr clone.

Definition at line 75 of file CompetingPixelClustersOnTrack.h.

76 {
77 return std::unique_ptr<CompetingPixelClustersOnTrack>(clone());
78 }
CompetingPixelClustersOnTrack * clone() const
needed to avoid excessive RTTI

◆ CompetingPixelClustersOnTrackTool

friend class CompetingPixelClustersOnTrackTool
friend

InDet::CompetingPixelClustersOnTrackTool is a friend to allow for updates of the assignment probabilities.

Definition at line 52 of file CompetingPixelClustersOnTrack.h.

Member Data Documentation

◆ m_assignProb

std::vector<AssignmentProb> Trk::CompetingRIOsOnTrack::m_assignProb
protectedinherited

assignment probabilities of the ROTs

Definition at line 125 of file CompetingRIOsOnTrack.h.

◆ m_containedChildRots

std::vector<const InDet::PixelClusterOnTrack*> InDet::CompetingPixelClustersOnTrack::m_containedChildRots
private

The vector of contained InDet::PixelClusterOnTrack objects.

Definition at line 111 of file CompetingPixelClustersOnTrack.h.

◆ m_globalPosition

CxxUtils::CachedUniquePtr<const Amg::Vector3D> InDet::CompetingPixelClustersOnTrack::m_globalPosition
private

The global Position.

Definition at line 108 of file CompetingPixelClustersOnTrack.h.

◆ m_localCovariance

Amg::MatrixX Trk::MeasurementBase::m_localCovariance
protectedinherited

Definition at line 112 of file MeasurementBase.h.

◆ m_localParams

LocalParameters Trk::MeasurementBase::m_localParams
protectedinherited

Definition at line 111 of file MeasurementBase.h.


The documentation for this class was generated from the following files: