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 IdentifierHash &collectionHash, 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...
 
 MdtPrepData (const Identifier &id, const IdentifierHash &collectionHash, const Amg::Vector2D &driftRadius, Amg::MatrixX &&errDriftRadius, std::vector< Identifier > &&rdoList, const MuonGM::MdtReadoutElement *detEl, const int tdc, const int adc, const MdtDriftCircleStatus status)
 
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...
 
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
 Cached pointer to detector element (not deleted in destructor, not written to disk) More...
 
int m_tdc
 TDC value - typical TDC spectra can go from 0 up to 2500. More...
 
int m_adc
 ADC value - typical ADC spectra can go from 0 up to 250. More...
 
MdtDriftCircleStatus m_status
 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 36 of file MdtPrepData.h.

Constructor & Destructor Documentation

◆ MdtPrepData() [1/5]

Muon::MdtPrepData::MdtPrepData ( )

Definition at line 76 of file MdtPrepData.cxx.

77  :
78  PrepRawData(),
79  m_detEl( nullptr ),
80  m_tdc( 0 ),
81  m_adc( 0 ),
84 {}

◆ MdtPrepData() [2/5]

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

Definition at line 87 of file MdtPrepData.cxx.

88  :
89  PrepRawData( RIO ),
90  m_detEl(RIO.m_detEl),
91  m_tdc(RIO.m_tdc),
92  m_adc(RIO.m_adc),
93  m_status(RIO.m_status),
95 {}

◆ MdtPrepData() [3/5]

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

Definition at line 98 of file MdtPrepData.cxx.

99  :
100  PrepRawData( std::move(RIO) ),
101  m_detEl(RIO.m_detEl),
102  m_tdc(RIO.m_tdc),
103  m_adc(RIO.m_adc),
104  m_status(RIO.m_status),
106 {}

◆ MdtPrepData() [4/5]

Muon::MdtPrepData::MdtPrepData ( const Identifier id,
const IdentifierHash collectionHash,
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.

31  :
32  PrepRawData(id, driftRadius, errDriftRadius), //call base class constructor
33  m_detEl(detEl),
34  m_tdc(tdc),
35  m_adc(adc),
38 {
39 // assert(rdoList.size()==1);
40 // assert( rdoList[0]==id);
41 }

◆ MdtPrepData() [5/5]

Muon::MdtPrepData::MdtPrepData ( const Identifier id,
const IdentifierHash collectionHash,
const Amg::Vector2D driftRadius,
Amg::MatrixX &&  errDriftRadius,
std::vector< Identifier > &&  rdoList,
const MuonGM::MdtReadoutElement detEl,
const int  tdc,
const int  adc,
const MdtDriftCircleStatus  status 
)

Definition at line 44 of file MdtPrepData.cxx.

55  :
57  std::move(rdoList),
58  std::move(errDriftRadius)),
59  m_detEl(detEl),
60  m_tdc(tdc),
61  m_adc(adc),
64 {
65 // assert(rdoList.size()==1);
66 // assert( rdoList[0]==id);
67 }

◆ ~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 166 of file MdtPrepData.h.

167 {
168  return m_adc;
169 }

◆ collectionHash()

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

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

Definition at line 176 of file MdtPrepData.h.

177 {
178  return getHashAndIndex().collHash();
179 }

◆ 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 156 of file MdtPrepData.h.

157 {
158  return m_detEl;
159 }

◆ 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 139 of file MdtPrepData.cxx.

140  {
141  stream << MSG::INFO<<"MdtPrepData {"<<std::endl;
142 
144 
145  //MdtPrepData methods
146  stream <<"TDC = "<<this->tdc()<<", ";
147  stream <<"ADC = "<<this->adc()<<", ";
148  stream <<"status = "<<this->status()<<", ";
149  stream<<"} End MdtPrepData"<<endmsg;
150 
151  return stream;
152  }

◆ 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 154 of file MdtPrepData.cxx.

155  {
156  stream << "MdtPrepData {"<<std::endl;
157 
159 
160  //MdtPrepData methods
161  stream <<"TDC = "<<this->tdc()<<", ";
162  stream <<"ADC = "<<this->adc()<<", ";
163  stream <<"status = "<<this->status()<<", ";
164  stream<<"} End MdtPrepData"<<std::endl;
165  return stream;
166  }

◆ 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 149 of file MdtPrepData.h.

150 {
151  if (not m_globalPosition) m_globalPosition.set(std::make_unique<const Amg::Vector3D>(m_detEl->surface(identify()).center()));
152  return *m_globalPosition;
153 }

◆ 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 109 of file MdtPrepData.cxx.

110 {
111  if (&RIO !=this)
112  {
114  m_detEl = RIO.m_detEl;
115  m_tdc = RIO.m_tdc;
116  m_adc = RIO.m_adc;
117  m_status = RIO.m_status;
118  if (m_globalPosition) m_globalPosition.release().reset();
119  }
120  return *this;
121 }

◆ operator=() [2/2]

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

Definition at line 124 of file MdtPrepData.cxx.

125 {
126  if (&RIO !=this)
127  {
128  m_detEl = RIO.m_detEl;
129  m_tdc = RIO.m_tdc;
130  m_adc = RIO.m_adc;
131  m_status = RIO.m_status;
132  Trk::PrepRawData::operator=(std::move(RIO));
133  if (m_globalPosition)
134  m_globalPosition.release().reset();
135  }
136  return *this;
137 }

◆ 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 171 of file MdtPrepData.h.

172 {
173  return m_status;
174 }

◆ tdc()

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

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

Definition at line 161 of file MdtPrepData.h.

162 {
163  return m_tdc;
164 }

◆ type()

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

Interface method checking the type.

Implements Trk::PrepRawData.

Definition at line 99 of file MdtPrepData.h.

100  {
102  }

Friends And Related Function Documentation

◆ ::MdtPrepDataContainerCnv

friend class ::MdtPrepDataContainerCnv
friend

Definition at line 44 of file MdtPrepData.h.

◆ Muon::MdtPrepDataContainerCnv_p1

friend class Muon::MdtPrepDataContainerCnv_p1
friend

Definition at line 45 of file MdtPrepData.h.

Member Data Documentation

◆ m_adc

int Muon::MdtPrepData::m_adc
private

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

Definition at line 131 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
private

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

Definition at line 125 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 140 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
private

enum to hold 'status' of measurement

Definition at line 134 of file MdtPrepData.h.

◆ m_tdc

int Muon::MdtPrepData::m_tdc
private

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

Definition at line 128 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:131
Trk::PrepRawDataType::MdtPrepData
@ MdtPrepData
Muon::MdtPrepData::type
virtual bool type(Trk::PrepRawDataType type) const override
Interface method checking the type.
Definition: MdtPrepData.h:99
Trk::PrepRawData::dump
virtual MsgStream & dump(MsgStream &stream) const
dump information about the PRD object.
Definition: PrepRawData.cxx:79
Trk::PrepRawData::rdoList
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
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:125
Muon::MdtPrepData::adc
int adc() const
Returns the ADC (typically range is 0 to 250)
Definition: MdtPrepData.h:166
Muon::MdtPrepData::m_tdc
int m_tdc
TDC value - typical TDC spectra can go from 0 up to 2500.
Definition: MdtPrepData.h:128
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:134
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:161
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:140
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::MdtStatusUnDefined
@ MdtStatusUnDefined
Undefined.
Definition: MdtDriftCircleStatus.h:43
Muon::MdtPrepData::status
MdtDriftCircleStatus status() const
Returns the status of the measurement.
Definition: MdtPrepData.h:171
IdentContIndex::collHash
unsigned short collHash() const
Accessor to hash, obj index and combined index.
Definition: IdentContIndex.h:85