ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | Private Member Functions | Friends | List of all members
Muon::MuonClusterOnTrack Class Referenceabstract

Base class for Muon cluster RIO_OnTracks. More...

#include <MuonClusterOnTrack.h>

Inheritance diagram for Muon::MuonClusterOnTrack:
Collaboration diagram for Muon::MuonClusterOnTrack:

Public Member Functions

 MuonClusterOnTrack ()
 Pool constructor. More...
 
 MuonClusterOnTrack (Trk::LocalParameters &&locpos, Amg::MatrixX &&locerr, const Identifier &id, const double positionAlongStrip)
 Constructor with parameters. More...
 
 MuonClusterOnTrack (const MuonClusterOnTrack &)
 
MuonClusterOnTrackoperator= (const MuonClusterOnTrack &)
 
virtual ~MuonClusterOnTrack ()
 Destructor. More...
 
virtual MuonClusterOnTrackclone () const override=0
 Clone this ROT. More...
 
virtual const MuonClusterprepRawData () const override=0
 Returns the Trk::PrepRawData - is a MuonCluster in this scope. More...
 
virtual const Amg::Vector3DglobalPosition () const override
 Returns global position. More...
 
virtual double positionAlongStrip () const
 
virtual IdentifierHash collectionHash () const
 Returns the hashID of the PRD collection. More...
 
virtual IdentifierHash idDE () const override
 Returns an invalid hash. More...
 
virtual bool rioType (Trk::RIO_OnTrackType::Type type) const override final
 Method checking the Rio On Track type. More...
 
virtual MsgStream & dump (MsgStream &stream) const override
 Dumps information about the PRD. More...
 
virtual std::ostream & dump (std::ostream &stream) const override
 Dumps information about the PRD. More...
 
virtual const MuonGM::MuonClusterReadoutElementdetectorElement () const override=0
 Returns the detector element, associated with the PRD of this class. More...
 
std::unique_ptr< RIO_OnTrackuniqueClone () const
 NVI clone returning unique_ptr. More...
 
virtual const SurfaceassociatedSurface () const override=0
 returns the surface for the local to global transformation More...
 
virtual bool type (MeasurementBaseType::Type type) const override final
 Extended method checking the type. More...
 
Identifier identify () const
 return the identifier -extends MeasurementBase More...
 
const LocalParameters & localParameters () const
 Interface method to get the LocalParameters. More...
 
const Amg::MatrixXlocalCovariance () const
 Interface method to get the localError. More...
 

Static Public Member Functions

static std::size_t numberOfInstantiations ()
 

Static Public Attributes

static std::atomic_size_t s_numberOfInstantiations
 

Protected Attributes

CxxUtils::CachedUniquePtr< const Amg::Vector3Dm_globalPosition
 cache global position, the global position has to be calculated in the inheriting classes More...
 
double m_positionAlongStrip
 The position along the strip - used to calculate the GlobalPosition. More...
 
Identifier m_identifier {}
 Identifier of the RIO_OnTrack (comes from the associated Trk::PrepRawData) More...
 
LocalParameters m_localParams
 
Amg::MatrixX m_localCovariance
 

Private Member Functions

virtual void setValues (const Trk::TrkDetElementBase *, const Trk::PrepRawData *) override=0
 Used by custom convertors. More...
 

Friends

class ::MuonClusterOnTrackCnv_p1
 

Detailed Description

Base class for Muon cluster RIO_OnTracks.

Definition at line 34 of file MuonClusterOnTrack.h.

Constructor & Destructor Documentation

◆ MuonClusterOnTrack() [1/3]

Muon::MuonClusterOnTrack::MuonClusterOnTrack ( )

Pool constructor.

Definition at line 22 of file MuonClusterOnTrack.cxx.

22  :
26 { }

◆ MuonClusterOnTrack() [2/3]

Muon::MuonClusterOnTrack::MuonClusterOnTrack ( Trk::LocalParameters &&  locpos,
Amg::MatrixX &&  locerr,
const Identifier id,
const double  positionAlongStrip 
)

Constructor with parameters.

Definition at line 39 of file MuonClusterOnTrack.cxx.

44  : RIO_OnTrack(std::move(locpos), std::move(locerr), id), // call base class constructor

◆ MuonClusterOnTrack() [3/3]

Muon::MuonClusterOnTrack::MuonClusterOnTrack ( const MuonClusterOnTrack rot)

Definition at line 29 of file MuonClusterOnTrack.cxx.

29  :
30  Trk::RIO_OnTrack(rot),
32 {
33  m_positionAlongStrip = rot.m_positionAlongStrip;
34  if (rot.m_globalPosition) m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*rot.m_globalPosition));
35 }

◆ ~MuonClusterOnTrack()

Muon::MuonClusterOnTrack::~MuonClusterOnTrack ( )
virtualdefault

Destructor.

Member Function Documentation

◆ associatedSurface()

virtual const Surface& Trk::RIO_OnTrack::associatedSurface ( ) const
overridepure virtualinherited

◆ clone()

virtual MuonClusterOnTrack* Muon::MuonClusterOnTrack::clone ( ) const
overridepure virtual

◆ collectionHash()

IdentifierHash Muon::MuonClusterOnTrack::collectionHash ( ) const
inlinevirtual

Returns the hashID of the PRD collection.

Definition at line 111 of file MuonClusterOnTrack.h.

111  {
112  if( this->prepRawData() ) return prepRawData()->collectionHash();
113  return IdentifierHash();
114  }

◆ detectorElement()

virtual const MuonGM::MuonClusterReadoutElement* Muon::MuonClusterOnTrack::detectorElement ( ) const
overridepure virtual

Returns the detector element, associated with the PRD of this class.

Implements Trk::RIO_OnTrack.

Implemented in Muon::CscClusterOnTrack, Muon::RpcClusterOnTrack, Muon::sTgcClusterOnTrack, Muon::TgcClusterOnTrack, and Muon::MMClusterOnTrack.

◆ dump() [1/2]

MsgStream & Muon::MuonClusterOnTrack::dump ( MsgStream &  stream) const
overridevirtual

Dumps information about the PRD.

Reimplemented from Trk::RIO_OnTrack.

Reimplemented in Muon::CscClusterOnTrack, Muon::RpcClusterOnTrack, Muon::sTgcClusterOnTrack, Muon::TgcClusterOnTrack, and Muon::MMClusterOnTrack.

Definition at line 62 of file MuonClusterOnTrack.cxx.

63 {
64  stream << MSG::INFO<<"MuonClusterOnTrack {"<<std::endl;
65 
67 
68  stream << "Global position (x,y,z) = (";
69  stream <<this->globalPosition().x()<<", "
70  <<this->globalPosition().y()<<", "
71  <<this->globalPosition().z()<<")"<<std::endl;
72  stream << "Position along strip: "<<m_positionAlongStrip<<std::endl;
73  stream<<"}"<<endmsg;
74  return stream;
75 }

◆ dump() [2/2]

std::ostream & Muon::MuonClusterOnTrack::dump ( std::ostream &  stream) const
overridevirtual

Dumps information about the PRD.

Reimplemented from Trk::RIO_OnTrack.

Reimplemented in Muon::CscClusterOnTrack, Muon::RpcClusterOnTrack, Muon::sTgcClusterOnTrack, Muon::TgcClusterOnTrack, and Muon::MMClusterOnTrack.

Definition at line 77 of file MuonClusterOnTrack.cxx.

78 {
79  stream << "MuonClusterOnTrack {"<<std::endl;
80  std::ios_base::fmtflags originalFormat = stream.flags();
81 
83 
84  stream << std::setiosflags(std::ios::fixed)<< std::setprecision(3);
85 
86  stream << "Position along strip: "<<m_positionAlongStrip<<std::endl;
87  stream<<"}"<<std::endl;
88  stream.flags( originalFormat );
89 
90  return stream;
91 }

◆ globalPosition()

const Amg::Vector3D & Muon::MuonClusterOnTrack::globalPosition ( ) const
overridevirtual

Returns global position.

Implements Trk::RIO_OnTrack.

Definition at line 93 of file MuonClusterOnTrack.cxx.

93  {
94  if (detectorElement()==nullptr){
95  // Not much we can do here - no detelement, so just return 0,0,0
96  m_globalPosition.set(std::make_unique<const Amg::Vector3D>(0.0,0.0,0.0));
97  }
98 
99  if (not m_globalPosition) {
100  // calculate global position from the position of the strip and the position along the strip
104  else
106 
108  detectorElement()->surface( identify() ).localToGlobal(lpos, gpos, gpos);
109 
110  m_globalPosition.set(std::make_unique<const Amg::Vector3D>(gpos));
111  }
112 
113  return *m_globalPosition;
114 }

◆ idDE()

IdentifierHash Muon::MuonClusterOnTrack::idDE ( ) const
inlineoverridevirtual

Returns an invalid hash.

Implements Trk::RIO_OnTrack.

Definition at line 116 of file MuonClusterOnTrack.h.

116  {
117  return IdentifierHash();
118  }

◆ identify()

Identifier Trk::RIO_OnTrack::identify ( ) const
inlineinherited

return the identifier -extends MeasurementBase

Definition at line 152 of file RIO_OnTrack.h.

153  { return m_identifier; }

◆ 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 }

◆ 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 }

◆ numberOfInstantiations()

static std::size_t Trk::ObjectCounter< Trk::RIO_OnTrack >::numberOfInstantiations ( )
inlinestaticinherited

Definition at line 25 of file TrkObjectCounter.h.

26  {
27 #ifndef NDEBUG
28  return s_numberOfInstantiations.load();
29 #endif
30  return 0;
31  }

◆ operator=()

MuonClusterOnTrack & Muon::MuonClusterOnTrack::operator= ( const MuonClusterOnTrack rot)

Definition at line 52 of file MuonClusterOnTrack.cxx.

52  {
53  if ( &rot != this) {
54  Trk::RIO_OnTrack::operator=(rot);//base class ass. op.
55  m_positionAlongStrip = rot.m_positionAlongStrip;
56  if (rot.m_globalPosition) m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*rot.m_globalPosition));
57  else if (m_globalPosition) m_globalPosition.release().reset();
58  }
59  return *this;
60 }

◆ positionAlongStrip()

virtual double Muon::MuonClusterOnTrack::positionAlongStrip ( ) const
inlinevirtual

Definition at line 68 of file MuonClusterOnTrack.h.

68  {
69  return m_positionAlongStrip;
70  }

◆ prepRawData()

virtual const MuonCluster* Muon::MuonClusterOnTrack::prepRawData ( ) const
overridepure virtual

◆ rioType()

virtual bool Muon::MuonClusterOnTrack::rioType ( Trk::RIO_OnTrackType::Type  type) const
inlinefinaloverridevirtual

Method checking the Rio On Track type.

Implements Trk::RIO_OnTrack.

Definition at line 78 of file MuonClusterOnTrack.h.

79  {
81  }

◆ setValues()

virtual void Muon::MuonClusterOnTrack::setValues ( const Trk::TrkDetElementBase ,
const Trk::PrepRawData  
)
overrideprivatepure virtual

◆ type()

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

Extended method checking the type.

Implements Trk::MeasurementBase.

Definition at line 110 of file RIO_OnTrack.h.

111  {
113  }

◆ uniqueClone()

std::unique_ptr<RIO_OnTrack> Trk::RIO_OnTrack::uniqueClone ( ) const
inlineinherited

NVI clone returning unique_ptr.

Definition at line 97 of file RIO_OnTrack.h.

97  {
98  return std::unique_ptr<RIO_OnTrack>(clone());
99  };

Friends And Related Function Documentation

◆ ::MuonClusterOnTrackCnv_p1

friend class ::MuonClusterOnTrackCnv_p1
friend

Definition at line 100 of file MuonClusterOnTrack.h.

Member Data Documentation

◆ m_globalPosition

CxxUtils::CachedUniquePtr<const Amg::Vector3D> Muon::MuonClusterOnTrack::m_globalPosition
protected

cache global position, the global position has to be calculated in the inheriting classes

Definition at line 94 of file MuonClusterOnTrack.h.

◆ m_identifier

Identifier Trk::RIO_OnTrack::m_identifier {}
protectedinherited

Identifier of the RIO_OnTrack (comes from the associated Trk::PrepRawData)

Definition at line 149 of file RIO_OnTrack.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.

◆ m_positionAlongStrip

double Muon::MuonClusterOnTrack::m_positionAlongStrip
protected

The position along the strip - used to calculate the GlobalPosition.

Definition at line 97 of file MuonClusterOnTrack.h.

◆ s_numberOfInstantiations

std::atomic_size_t Trk::ObjectCounter< Trk::RIO_OnTrack >::s_numberOfInstantiations
inlinestaticinherited

Definition at line 22 of file TrkObjectCounter.h.


The documentation for this class was generated from the following files:
Trk::RIO_OnTrackType::MuonCluster
@ MuonCluster
Definition: RIO_OnTrack.h:61
Trk::RIO_OnTrack::dump
virtual MsgStream & dump(MsgStream &out) const override
returns the some information about this RIO_OnTrack.
Definition: RIO_OnTrack.cxx:32
Muon::MuonClusterOnTrack::globalPosition
virtual const Amg::Vector3D & globalPosition() const override
Returns global position.
Definition: MuonClusterOnTrack.cxx:93
Trk::locX
@ locX
Definition: ParamDefs.h:37
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:38
Trk::RIO_OnTrack::clone
virtual RIO_OnTrack * clone() const override=0
Pseudo-constructor, needed to avoid excessive RTTI.
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
Muon::MuonClusterOnTrack::prepRawData
virtual const MuonCluster * prepRawData() const override=0
Returns the Trk::PrepRawData - is a MuonCluster in this scope.
Muon::MuonClusterOnTrack::m_globalPosition
CxxUtils::CachedUniquePtr< const Amg::Vector3D > m_globalPosition
cache global position, the global position has to be calculated in the inheriting classes
Definition: MuonClusterOnTrack.h:94
Muon::MuonCluster::collectionHash
virtual IdentifierHash collectionHash() const
Returns the IdentifierHash corresponding to the PRD collection in the PRD container.
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MuonCluster.h:104
MuonGM::MuonClusterReadoutElement::surface
virtual const Trk::PlaneSurface & surface() const override
access to chamber surface (phi orientation), uses the first gas gap
Definition: MuonClusterReadoutElement.h:123
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
Trk::RIO_OnTrack::type
virtual bool type(MeasurementBaseType::Type type) const override final
Extended method checking the type.
Definition: RIO_OnTrack.h:110
Muon::MuonClusterOnTrack::detectorElement
virtual const MuonGM::MuonClusterReadoutElement * detectorElement() const override=0
Returns the detector element, associated with the PRD of this class.
Trk::RIO_OnTrack::RIO_OnTrack
RIO_OnTrack()=default
Default Constructor for POOL.
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
contains
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition: hcg.cxx:111
Trk::RIO_OnTrack::operator=
RIO_OnTrack & operator=(const RIO_OnTrack &rot)=default
Assignment operator.
Trk::MeasurementBase::m_localParams
LocalParameters m_localParams
Definition: MeasurementBase.h:111
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::MeasurementBaseType::RIO_OnTrack
@ RIO_OnTrack
Definition: MeasurementBase.h:49
Trk::MeasurementBase::localParameters
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Definition: MeasurementBase.h:132
Trk::MeasurementBase::m_localCovariance
Amg::MatrixX m_localCovariance
Definition: MeasurementBase.h:112
Trk::ObjectCounter< Trk::RIO_OnTrack >::s_numberOfInstantiations
static std::atomic_size_t s_numberOfInstantiations
Definition: TrkObjectCounter.h:22
Trk::RIO_OnTrack::m_identifier
Identifier m_identifier
Identifier of the RIO_OnTrack (comes from the associated Trk::PrepRawData)
Definition: RIO_OnTrack.h:149
Trk::RIO_OnTrack::identify
Identifier identify() const
return the identifier -extends MeasurementBase
Definition: RIO_OnTrack.h:152
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
Muon::MuonClusterOnTrack::positionAlongStrip
virtual double positionAlongStrip() const
Definition: MuonClusterOnTrack.h:68
Trk::PlaneSurface::localToGlobal
virtual void localToGlobal(const Amg::Vector2D &locp, const Amg::Vector3D &mom, Amg::Vector3D &glob) const override final
Specified for PlaneSurface: LocalToGlobal method without dynamic memory allocation.
Definition: PlaneSurface.cxx:204
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
Muon::MuonClusterOnTrack::m_positionAlongStrip
double m_positionAlongStrip
The position along the strip - used to calculate the GlobalPosition.
Definition: MuonClusterOnTrack.h:97
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32