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

Class to represent measurements from the Monitored Drift Tubes. More...

#include <MdtPrepData.h>

Inheritance diagram for Muon::MdtPrepData:
Collaboration diagram for Muon::MdtPrepData:

Public Member Functions

 MdtPrepData ()
 
 MdtPrepData (const MdtPrepData &)
 
 MdtPrepData (MdtPrepData &&) noexcept
 
MdtPrepDataoperator= (const MdtPrepData &)
 
MdtPrepDataoperator= (MdtPrepData &&) noexcept
 
 MdtPrepData (const Identifier &id, const Amg::Vector2D &driftRadius, const Amg::MatrixX &errDriftRadius, const MuonGM::MdtReadoutElement *detEl, const int tdc, const int adc, const MdtDriftCircleStatus status)
 Constructor with parameters: this class owns the pointers passed (except the MuonDetectorElement) More...
 
virtual ~MdtPrepData ()
 Destructor. More...
 
virtual const Amg::Vector3DglobalPosition () const
 Returns the global position of the CENTER of the drift tube (i.e. More...
 
virtual const MuonGM::MdtReadoutElementdetectorElement () const override
 Returns the detector element corresponding to this PRD. More...
 
virtual bool type (Trk::PrepRawDataType type) const override
 Interface method checking the type. More...
 
unsigned int dimension () const
 Returns the dimension of the MdtPrepData. More...
 
int tdc () const
 Returns the TDC (typically range is 0 to 2500). More...
 
int adc () const
 Returns the ADC (typically range is 0 to 250) More...
 
MdtDriftCircleStatus status () const
 Returns the status of the measurement. More...
 
virtual IdentifierHash collectionHash () const
 Returns the IdentifierHash corresponding to the Mdt tube which was hit. 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...
 
Identifier identify () const
 return the identifier More...
 
const Amg::Vector2DlocalPosition () const
 return the local position reference More...
 
const std::vector< Identifier > & rdoList () const
 return the List of rdo identifiers (pointers) More...
 
const Amg::MatrixXlocalCovariance () const
 return const ref to the error matrix More...
 
bool hasLocalCovariance () const
 returns localCovariance().size()!=0 More...
 
void setHashAndIndex (unsigned short collHash, unsigned short objIndex)
 TEMP for testing: might make some classes friends later ... More...
 
const IdentContIndexgetHashAndIndex () const
 

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 {}
 Global position of measurement. More...
 

Private Attributes

const MuonGM::MdtReadoutElementm_detEl {nullptr}
 Cached pointer to detector element (not deleted in destructor, not written to disk) More...
 
int m_tdc {0}
 TDC value - typical TDC spectra can go from 0 up to 2500. More...
 
int m_adc {0}
 ADC value - typical ADC spectra can go from 0 up to 250. More...
 
MdtDriftCircleStatus m_status {MdtDriftCircleStatus::MdtStatusUnDefined}
 enum to hold 'status' of measurement More...
 
Identifier m_clusId { 0 }
 PrepRawData ID, not const because of DataPool. More...
 
Amg::Vector2D m_localPos {}
 see derived classes for definition of meaning of LocalPosition More...
 
std::vector< Identifierm_rdoList {}
 Stores the identifiers of the RDOs. More...
 
Amg::MatrixX m_localCovariance {}
 See derived classes for definition of ErrorMatrix. More...
 
IdentContIndex m_indexAndHash
 Stores its own position (index) in collection plus the hash id for the collection (needed for the EL to IDC) More...
 

Friends

class ::MdtPrepDataContainerCnv
 
class Muon::MdtPrepDataContainerCnv_p1
 

Detailed Description

Class to represent measurements from the Monitored Drift Tubes.

Definition at line 32 of file MdtPrepData.h.

Constructor & Destructor Documentation

◆ MdtPrepData() [1/4]

Muon::MdtPrepData::MdtPrepData ( )
default

◆ MdtPrepData() [2/4]

Muon::MdtPrepData::MdtPrepData ( const MdtPrepData RIO)

Definition at line 44 of file MdtPrepData.cxx.

44  :
45  PrepRawData( RIO ),
46  m_detEl(RIO.m_detEl),
47  m_tdc(RIO.m_tdc),
48  m_adc(RIO.m_adc),
49  m_status(RIO.m_status) {}

◆ MdtPrepData() [3/4]

Muon::MdtPrepData::MdtPrepData ( MdtPrepData &&  RIO)
noexcept

Definition at line 52 of file MdtPrepData.cxx.

52  :
53  PrepRawData( std::move(RIO) ),
54  m_detEl(RIO.m_detEl),
55  m_tdc(RIO.m_tdc),
56  m_adc(RIO.m_adc),
57  m_status(RIO.m_status) {}

◆ MdtPrepData() [4/4]

Muon::MdtPrepData::MdtPrepData ( const Identifier id,
const Amg::Vector2D driftRadius,
const Amg::MatrixX errDriftRadius,
const MuonGM::MdtReadoutElement detEl,
const int  tdc,
const int  adc,
const MdtDriftCircleStatus  status 
)

Constructor with parameters: this class owns the pointers passed (except the MuonDetectorElement)

Parameters
idIdentifier of the tube which generated DriftCircle,
collectionHashIdentifierHash of the PRD collection in which the MdtPrepData is stored
driftRadiusthis local position object should contain the drift radius
errDriftRadiusthe error on the driftRadius (i.e. 1d error matix)
detElpointer to the associated detectr element (will not be owned by MdtPrepData - i.e. will not be deleted)
tdcTDC count
adcADC count
statusenum to indicate whether the measurement is masked, in time, etc (see MdtPrepDataStatus for details).

Definition at line 21 of file MdtPrepData.cxx.

27  :
28  PrepRawData(id, driftRadius, errDriftRadius), //call base class constructor
29  m_detEl(detEl),
30  m_tdc(tdc),
31  m_adc(adc),
33 
34 {
35 // assert(rdoList.size()==1);
36 // assert( rdoList[0]==id);
37 }

◆ ~MdtPrepData()

Muon::MdtPrepData::~MdtPrepData ( )
virtualdefault

Destructor.

Member Function Documentation

◆ adc()

int Muon::MdtPrepData::adc ( ) const
inline

Returns the ADC (typically range is 0 to 250)

Definition at line 146 of file MdtPrepData.h.

146 { return m_adc; }

◆ collectionHash()

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

Returns the IdentifierHash corresponding to the Mdt tube which was hit.

Definition at line 148 of file MdtPrepData.h.

148  {
149  return getHashAndIndex().collHash();
150 }

◆ detectorElement()

const MuonGM::MdtReadoutElement * Muon::MdtPrepData::detectorElement ( ) const
inlineoverridevirtual

Returns the detector element corresponding to this PRD.

The pointer will be zero if the det el is not defined (i.e. it was not passed in by the ctor)

Implements Trk::PrepRawData.

Definition at line 141 of file MdtPrepData.h.

141  {
142  return m_detEl;
143 }

◆ dimension()

unsigned int Muon::MdtPrepData::dimension ( ) const
inline

Returns the dimension of the MdtPrepData.

Ordinary prepData has dimension one twin drift circles have dimension 2

Definition at line 85 of file MdtPrepData.h.

85  {
86  return localCovariance().rows();
87  }

◆ dump() [1/2]

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

Dumps information about the PRD.

Reimplemented from Trk::PrepRawData.

Reimplemented in Muon::MdtTwinPrepData.

Definition at line 87 of file MdtPrepData.cxx.

88  {
89  stream << MSG::INFO<<"MdtPrepData {"<<std::endl;
90 
92 
93  //MdtPrepData methods
94  stream <<"TDC = "<<tdc()<<", ";
95  stream <<"ADC = "<<adc()<<", ";
96  stream <<"status = "<<status()<<", ";
97  stream<<"} End MdtPrepData"<<endmsg;
98 
99  return stream;
100  }

◆ dump() [2/2]

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

Dumps information about the PRD.

Reimplemented from Trk::PrepRawData.

Reimplemented in Muon::MdtTwinPrepData.

Definition at line 102 of file MdtPrepData.cxx.

103  {
104  stream << "MdtPrepData {"<<std::endl;
105 
107 
108  //MdtPrepData methods
109  stream <<"TDC = "<<tdc()<<", ";
110  stream <<"ADC = "<<adc()<<", ";
111  stream <<"status = "<<status()<<", ";
112  stream<<"} End MdtPrepData"<<std::endl;
113  return stream;
114  }

◆ getHashAndIndex()

const IdentContIndex& Trk::PrepRawData::getHashAndIndex ( ) const
inherited

◆ globalPosition()

const Amg::Vector3D & Muon::MdtPrepData::globalPosition ( ) const
inlinevirtual

Returns the global position of the CENTER of the drift tube (i.e.

it is important to realise that this is NOT the true position of the measurement). The reason that this is done here, and not simply through the detector element is that here it can be cached for better performance.

Reimplemented in Muon::MdtTwinPrepData.

Definition at line 133 of file MdtPrepData.h.

133  {
134  if (!m_globalPosition) {
135  m_globalPosition.set(std::make_unique<Amg::Vector3D>(m_detEl->surface(identify()).center()));
136  }
137  return *m_globalPosition;
138 }

◆ hasLocalCovariance()

bool Trk::PrepRawData::hasLocalCovariance ( ) const
inherited

◆ identify()

Identifier Trk::PrepRawData::identify ( ) const
inherited

return the identifier

◆ localCovariance()

const Amg::MatrixX& Trk::PrepRawData::localCovariance ( ) const
inherited

return const ref to the error matrix

◆ localPosition()

const Amg::Vector2D& Trk::PrepRawData::localPosition ( ) const
inherited

return the local position reference

◆ numberOfInstantiations()

static std::size_t Trk::ObjectCounter< Trk::PrepRawData >::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=() [1/2]

MdtPrepData & Muon::MdtPrepData::operator= ( const MdtPrepData RIO)

Definition at line 60 of file MdtPrepData.cxx.

60  {
61  if (&RIO !=this) {
63  m_detEl = RIO.m_detEl;
64  m_tdc = RIO.m_tdc;
65  m_adc = RIO.m_adc;
66  m_status = RIO.m_status;
67  if (m_globalPosition) m_globalPosition.release();
68  }
69  return *this;
70 }

◆ operator=() [2/2]

MdtPrepData & Muon::MdtPrepData::operator= ( MdtPrepData &&  RIO)
noexcept

Definition at line 73 of file MdtPrepData.cxx.

73  {
74  if (&RIO !=this) {
75  m_detEl = RIO.m_detEl;
76  m_tdc = RIO.m_tdc;
77  m_adc = RIO.m_adc;
78  m_status = RIO.m_status;
79  Trk::PrepRawData::operator=(std::move(RIO));
80  if (m_globalPosition) {
81  m_globalPosition.release();
82  }
83  }
84  return *this;
85 }

◆ rdoList()

const std::vector<Identifier>& Trk::PrepRawData::rdoList ( ) const
inherited

return the List of rdo identifiers (pointers)

◆ setHashAndIndex()

void Trk::PrepRawData::setHashAndIndex ( unsigned short  collHash,
unsigned short  objIndex 
)
inherited

TEMP for testing: might make some classes friends later ...

◆ status()

MdtDriftCircleStatus Muon::MdtPrepData::status ( ) const
inline

Returns the status of the measurement.

Definition at line 147 of file MdtPrepData.h.

147 { return m_status; }

◆ tdc()

int Muon::MdtPrepData::tdc ( ) const
inline

Returns the TDC (typically range is 0 to 2500).

Definition at line 145 of file MdtPrepData.h.

145 { return m_tdc; }

◆ type()

virtual bool Muon::MdtPrepData::type ( Trk::PrepRawDataType  type) const
inlineoverridevirtual

Interface method checking the type.

Implements Trk::PrepRawData.

Definition at line 80 of file MdtPrepData.h.

80  {
82  }

Friends And Related Function Documentation

◆ ::MdtPrepDataContainerCnv

friend class ::MdtPrepDataContainerCnv
friend

Definition at line 40 of file MdtPrepData.h.

◆ Muon::MdtPrepDataContainerCnv_p1

friend class Muon::MdtPrepDataContainerCnv_p1
friend

Definition at line 41 of file MdtPrepData.h.

Member Data Documentation

◆ m_adc

int Muon::MdtPrepData::m_adc {0}
private

ADC value - typical ADC spectra can go from 0 up to 250.

Definition at line 115 of file MdtPrepData.h.

◆ m_clusId

Identifier Trk::PrepRawData::m_clusId { 0 }
privateinherited

PrepRawData ID, not const because of DataPool.

Definition at line 151 of file PrepRawData.h.

◆ m_detEl

const MuonGM::MdtReadoutElement* Muon::MdtPrepData::m_detEl {nullptr}
private

Cached pointer to detector element (not deleted in destructor, not written to disk)

Definition at line 109 of file MdtPrepData.h.

◆ m_globalPosition

CxxUtils::CachedUniquePtr<const Amg::Vector3D> Muon::MdtPrepData::m_globalPosition {}
protected

Global position of measurement.

Calculated on demand and cached (not deleted in destructor, not written to disk)

Definition at line 124 of file MdtPrepData.h.

◆ m_indexAndHash

IdentContIndex Trk::PrepRawData::m_indexAndHash
privateinherited

Stores its own position (index) in collection plus the hash id for the collection (needed for the EL to IDC)

Definition at line 162 of file PrepRawData.h.

◆ m_localCovariance

Amg::MatrixX Trk::PrepRawData::m_localCovariance {}
privateinherited

See derived classes for definition of ErrorMatrix.

Definition at line 158 of file PrepRawData.h.

◆ m_localPos

Amg::Vector2D Trk::PrepRawData::m_localPos {}
privateinherited

see derived classes for definition of meaning of LocalPosition

Definition at line 154 of file PrepRawData.h.

◆ m_rdoList

std::vector<Identifier> Trk::PrepRawData::m_rdoList {}
privateinherited

Stores the identifiers of the RDOs.

Definition at line 156 of file PrepRawData.h.

◆ m_status

MdtDriftCircleStatus Muon::MdtPrepData::m_status {MdtDriftCircleStatus::MdtStatusUnDefined}
private

enum to hold 'status' of measurement

Definition at line 118 of file MdtPrepData.h.

◆ m_tdc

int Muon::MdtPrepData::m_tdc {0}
private

TDC value - typical TDC spectra can go from 0 up to 2500.

Definition at line 112 of file MdtPrepData.h.

◆ s_numberOfInstantiations

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

Definition at line 22 of file TrkObjectCounter.h.


The documentation for this class was generated from the following files:
Muon::MdtPrepData::m_adc
int m_adc
ADC value - typical ADC spectra can go from 0 up to 250.
Definition: MdtPrepData.h:115
Trk::PrepRawDataType::MdtPrepData
@ MdtPrepData
Muon::MdtPrepData::type
virtual bool type(Trk::PrepRawDataType type) const override
Interface method checking the type.
Definition: MdtPrepData.h:80
Trk::PrepRawData::dump
virtual MsgStream & dump(MsgStream &stream) const
dump information about the PRD object.
Definition: PrepRawData.cxx:79
Trk::PrepRawData::localCovariance
const Amg::MatrixX & localCovariance() const
return const ref to the error matrix
Muon::MdtPrepData::m_detEl
const MuonGM::MdtReadoutElement * m_detEl
Cached pointer to detector element (not deleted in destructor, not written to disk)
Definition: MdtPrepData.h:109
Muon::MdtPrepData::adc
int adc() const
Returns the ADC (typically range is 0 to 250)
Definition: MdtPrepData.h:146
Muon::MdtPrepData::m_tdc
int m_tdc
TDC value - typical TDC spectra can go from 0 up to 2500.
Definition: MdtPrepData.h:112
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
Muon::MdtPrepData::m_status
MdtDriftCircleStatus m_status
enum to hold 'status' of measurement
Definition: MdtPrepData.h:118
Trk::driftRadius
@ driftRadius
trt, straws
Definition: ParamDefs.h:53
Trk::PrepRawData::operator=
PrepRawData & operator=(const PrepRawData &)=default
Trk::PrepRawData::PrepRawData
PrepRawData()
public because of DataPool
Definition: PrepRawData.cxx:68
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
Muon::MdtPrepData::tdc
int tdc() const
Returns the TDC (typically range is 0 to 2500).
Definition: MdtPrepData.h:145
Trk::PrepRawData::getHashAndIndex
const IdentContIndex & getHashAndIndex() const
Trk::ObjectCounter< Trk::PrepRawData >::s_numberOfInstantiations
static std::atomic_size_t s_numberOfInstantiations
Definition: TrkObjectCounter.h:22
Muon::MdtPrepData::m_globalPosition
CxxUtils::CachedUniquePtr< const Amg::Vector3D > m_globalPosition
Global position of measurement.
Definition: MdtPrepData.h:124
MuonGM::MdtReadoutElement::surface
virtual const Trk::Surface & surface() const override final
Return surface associated with this detector element.
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:891
Muon::MdtPrepData::status
MdtDriftCircleStatus status() const
Returns the status of the measurement.
Definition: MdtPrepData.h:147
IdentContIndex::collHash
unsigned short collHash() const
Accessor to hash, obj index and combined index.
Definition: IdentContIndex.h:85