ATLAS Offline Software
Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
Trk::TrackParametersIdHelper Class Reference

helper class to encode and decode a TrackParametersIdentifier More...

#include <TrackParametersIdHelper.h>

Collaboration diagram for Trk::TrackParametersIdHelper:

Public Member Functions

 TrackParametersIdHelper ()=default
 
TrackParametersIdentifier encode (AtlasDetDescr::AtlasDetTechnology, CaloSampling::CaloSample, bool isEntryToVolume) const
 Encodes a TrackParametersIdentifier from AtlasDetDescr::AtlasDetTechnology and CaloSampling::CaloSample and a bool indicating whether this is an entry or exit layer. More...
 
TrackParametersIdentifier encodeInValidIdentifier () const
 create invalid identifier More...
 
bool isValid (TrackParametersIdentifier id) const
 returns true if the id is valid More...
 
bool isEntryToVolume (TrackParametersIdentifier id) const
 returns true if the id belongs to the volume entrance More...
 
AtlasDetDescr::AtlasDetTechnology technology (TrackParametersIdentifier id) const
 AtlasDetTechnology encoded in id, returns AtlasDetDescr::fUndefined if id is not valid. More...
 
CaloSampling::CaloSample caloSample (TrackParametersIdentifier id) const
 CaloSample encoded in id, returns CaloSampling::Unknown if id is not valid
More...
 

Private Member Functions

void setVersion (TrackParametersIdentifier &id) const
 set version bits More...
 

Static Private Attributes

static const unsigned int m_version = 0
 
static const BitField< unsigned int > m_validField
 
static const BitField< unsigned int > m_versionField
 
static const BitField< unsigned int > m_technologyField
 
static const BitField< unsigned int > m_isEntryToLayerField
 
static const BitField< unsigned int > m_caloSamplingField
 

Detailed Description

helper class to encode and decode a TrackParametersIdentifier

Definition at line 18 of file TrackParametersIdHelper.h.

Constructor & Destructor Documentation

◆ TrackParametersIdHelper()

Trk::TrackParametersIdHelper::TrackParametersIdHelper ( )
default

Member Function Documentation

◆ caloSample()

CaloSampling::CaloSample Trk::TrackParametersIdHelper::caloSample ( TrackParametersIdentifier  id) const
inline

CaloSample encoded in id, returns CaloSampling::Unknown if id is not valid

Definition at line 91 of file TrackParametersIdHelper.h.

91  {
92  // check if identifier is valid
93  if( !isValid(id) ) { return CaloSampling::Unknown;}
94  return static_cast<CaloSampling::CaloSample>(m_caloSamplingField.decode(id));
95  }

◆ encode()

TrackParametersIdentifier Trk::TrackParametersIdHelper::encode ( AtlasDetDescr::AtlasDetTechnology  tech,
CaloSampling::CaloSample  sample,
bool  isEntryToVolume 
) const
inline

Encodes a TrackParametersIdentifier from AtlasDetDescr::AtlasDetTechnology and CaloSampling::CaloSample and a bool indicating whether this is an entry or exit layer.

Checks consistency of technology and calo sample and will create an invalid identifier is any of the inputs is inconsistent

Definition at line 60 of file TrackParametersIdHelper.h.

62  {
64  // check whether techology matches calo
65  if( tech < AtlasDetDescr::fFirstAtlasCaloTechnology || tech > AtlasDetDescr::fLastAtlasCaloTechnology ){
66  m_validField.encode(1,id);
67  }else{
68  m_technologyField.encode(tech,id);
69  unsigned int ientry = isEntryToVolume ? 1 : 0;
70  m_isEntryToLayerField.encode(ientry,id);
72  setVersion(id);
73  }
74  return id;
75  }

◆ encodeInValidIdentifier()

TrackParametersIdentifier Trk::TrackParametersIdHelper::encodeInValidIdentifier ( ) const
inline

create invalid identifier

Definition at line 101 of file TrackParametersIdHelper.h.

101  {
103  m_validField.encode(1,id);
104  return id;
105  }

◆ isEntryToVolume()

bool Trk::TrackParametersIdHelper::isEntryToVolume ( TrackParametersIdentifier  id) const
inline

returns true if the id belongs to the volume entrance

Definition at line 81 of file TrackParametersIdHelper.h.

81  {
82  return m_isEntryToLayerField.decode(id);
83  }

◆ isValid()

bool Trk::TrackParametersIdHelper::isValid ( TrackParametersIdentifier  id) const
inline

returns true if the id is valid

Definition at line 77 of file TrackParametersIdHelper.h.

77  {
78  return !m_validField.decode(id);
79  }

◆ setVersion()

void Trk::TrackParametersIdHelper::setVersion ( TrackParametersIdentifier id) const
inlineprivate

set version bits

Definition at line 97 of file TrackParametersIdHelper.h.

97  {
99  }

◆ technology()

AtlasDetDescr::AtlasDetTechnology Trk::TrackParametersIdHelper::technology ( TrackParametersIdentifier  id) const
inline

AtlasDetTechnology encoded in id, returns AtlasDetDescr::fUndefined if id is not valid.

Definition at line 85 of file TrackParametersIdHelper.h.

85  {
86  // check if identifier is valid
87  if( !isValid(id) ) { return AtlasDetDescr::fUndefined;}
89  }

Member Data Documentation

◆ m_caloSamplingField

const BitField< unsigned int > Trk::TrackParametersIdHelper::m_caloSamplingField
staticprivate

Definition at line 56 of file TrackParametersIdHelper.h.

◆ m_isEntryToLayerField

const BitField< unsigned int > Trk::TrackParametersIdHelper::m_isEntryToLayerField
staticprivate

Definition at line 55 of file TrackParametersIdHelper.h.

◆ m_technologyField

const BitField< unsigned int > Trk::TrackParametersIdHelper::m_technologyField
staticprivate

Definition at line 53 of file TrackParametersIdHelper.h.

◆ m_validField

const BitField< unsigned int > Trk::TrackParametersIdHelper::m_validField
staticprivate

Definition at line 51 of file TrackParametersIdHelper.h.

◆ m_version

const unsigned int Trk::TrackParametersIdHelper::m_version = 0
staticprivate

Definition at line 50 of file TrackParametersIdHelper.h.

◆ m_versionField

const BitField< unsigned int > Trk::TrackParametersIdHelper::m_versionField
staticprivate

Definition at line 52 of file TrackParametersIdHelper.h.


The documentation for this class was generated from the following files:
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
Trk::TrackParametersIdHelper::isValid
bool isValid(TrackParametersIdentifier id) const
returns true if the id is valid
Definition: TrackParametersIdHelper.h:77
AtlasDetDescr::fUndefined
@ fUndefined
Definition: AtlasDetTechnology.h:30
Trk::TrackParametersIdHelper::m_isEntryToLayerField
static const BitField< unsigned int > m_isEntryToLayerField
Definition: TrackParametersIdHelper.h:55
Trk::TrackParametersIdHelper::m_technologyField
static const BitField< unsigned int > m_technologyField
Definition: TrackParametersIdHelper.h:53
Trk::BitField::encode
bool encode(unsigned int value, T &id) const
encode a value into id, return false if the value is out of range
Definition: BitField.h:37
AtlasDetDescr::fLastAtlasCaloTechnology
@ fLastAtlasCaloTechnology
Definition: AtlasDetTechnology.h:46
Trk::TrackParametersIdHelper::isEntryToVolume
bool isEntryToVolume(TrackParametersIdentifier id) const
returns true if the id belongs to the volume entrance
Definition: TrackParametersIdHelper.h:81
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:116
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
Trk::TrackParametersIdHelper::m_versionField
static const BitField< unsigned int > m_versionField
Definition: TrackParametersIdHelper.h:52
Trk::TrackParametersIdHelper::m_caloSamplingField
static const BitField< unsigned int > m_caloSamplingField
Definition: TrackParametersIdHelper.h:56
AtlasDetDescr::AtlasDetTechnology
AtlasDetTechnology
Definition: AtlasDetTechnology.h:28
TrackParametersIdentifier
unsigned int TrackParametersIdentifier
Definition: TrackParametersIdHelper.h:13
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
Trk::BitField::decode
unsigned int decode(T id) const
returns the result of decode the input id
Definition: BitField.h:51
Trk::TrackParametersIdHelper::m_validField
static const BitField< unsigned int > m_validField
Definition: TrackParametersIdHelper.h:51
Trk::TrackParametersIdHelper::m_version
static const unsigned int m_version
Definition: TrackParametersIdHelper.h:50
Trk::TrackParametersIdHelper::setVersion
void setVersion(TrackParametersIdentifier &id) const
set version bits
Definition: TrackParametersIdHelper.h:97