ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
MdtTubeInChamberIdFields Class Reference

Helper class implementation to instantiate the templated IdentifierHashTable class. More...

#include <MdtTubeInChamberIdFields.h>

Inheritance diagram for MdtTubeInChamberIdFields:
Collaboration diagram for MdtTubeInChamberIdFields:

Public Types

enum  { kTubeField = 0, kLayerField = 1, kMultilayerField = 2 }
 enum the identifier fiels More...
 
typedef IdHashTableHelper< 3, MdtTubeId, MdtTubeHash > BaseClass
 define type BaseClasse More...
 
enum  
 N is the number of fields to use from the identifier. More...
 
typedef MdtTubeId IdentifierType
 define type IdentifierType More...
 
typedef MdtTubeHash HashType
 define type HashType More...
 
typedef MdtTubeHash ValueType
 needed for MultiDimArray<> instantiation More...
 

Public Member Functions

void setAll (const MdtTubeId &id)
 Set identifier and also the fields (using the internal helper). More...
 
void setAll (int fields[3])
 Set fields and also the identifier (using the internal helper) More...
 
const IdentifierTypegetId () const
 Get the identifier. More...
 
void setId (const IdentifierType &id)
 Set (only) the identifier. More...
 
int operator[] (unsigned int fieldIndex) const
 Return the value encoded in field. More...
 
void setField (int index, int value)
 Set field at index to value. More...
 
void setFields (int fields[N])
 Set fields from array. More...
 

Static Public Member Functions

static void setDefaults (const IdentifierType &defId, const HashType &defHash)
 Set the default (invalid) values for identifier and hash. More...
 
static bool isValid (const IdentifierType &)
 
static HashType defaultHash ()
 Returns default (=invalid) hash. More...
 
static IdentifierType defaultIdentifier ()
 Return default (=invalid) identifier. More...
 
static ValueType defaultValue ()
 Return default hash. More...
 

Private Attributes

IdentifierType m_id
 
int m_fields [N]
 

Static Private Attributes

static IdentifierType s_defaultId
 
static HashType s_defaultHash
 

Detailed Description

Helper class implementation to instantiate the templated IdentifierHashTable class.

The template parameter T is an external IdentifierHelper class to encode/decode the fields in the identifier.

Definition at line 28 of file MdtTubeInChamberIdFields.h.

Member Typedef Documentation

◆ BaseClass

typedef IdHashTableHelper<3,MdtTubeId,MdtTubeHash> MdtTubeInChamberIdFields::BaseClass

define type BaseClasse

Definition at line 38 of file MdtTubeInChamberIdFields.h.

◆ HashType

typedef MdtTubeHash IdHashTableHelper< N, MdtTubeId , MdtTubeHash >::HashType
inherited

define type HashType

Definition at line 42 of file IdHashTableHelper.h.

◆ IdentifierType

typedef MdtTubeId IdHashTableHelper< N, MdtTubeId , MdtTubeHash >::IdentifierType
inherited

define type IdentifierType

Definition at line 40 of file IdHashTableHelper.h.

◆ ValueType

typedef MdtTubeHash IdHashTableHelper< N, MdtTubeId , MdtTubeHash >::ValueType
inherited

needed for MultiDimArray<> instantiation

Definition at line 44 of file IdHashTableHelper.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited

N is the number of fields to use from the identifier.

NMAX is just to make sure we get unsigned int type of enum.

Definition at line 38 of file IdHashTableHelper.h.

73 :
74  //

◆ anonymous enum

anonymous enum

enum the identifier fiels

Enumerator
kTubeField 
kLayerField 
kMultilayerField 

Definition at line 40 of file MdtTubeInChamberIdFields.h.

Member Function Documentation

◆ defaultHash()

IdHashTableHelper< N, MdtTubeId , MdtTubeHash >::HashType IdHashTableHelper< N, MdtTubeId , MdtTubeHash >::defaultHash
inlinestaticinherited

Returns default (=invalid) hash.

Definition at line 75 of file IdHashTableHelper.h.

147  {
148  return s_defaultHash;
149 }

◆ defaultIdentifier()

IdHashTableHelper< N, MdtTubeId , MdtTubeHash >::IdentifierType IdHashTableHelper< N, MdtTubeId , MdtTubeHash >::defaultIdentifier
inlinestaticinherited

Return default (=invalid) identifier.

Definition at line 77 of file IdHashTableHelper.h.

153  {
154  return s_defaultId;
155 }

◆ defaultValue()

IdHashTableHelper< N, MdtTubeId , MdtTubeHash >::ValueType IdHashTableHelper< N, MdtTubeId , MdtTubeHash >::defaultValue
inlinestaticinherited

Return default hash.

Needed for class MultiDimArray.

Definition at line 79 of file IdHashTableHelper.h.

159  {
160  return defaultHash();
161 }

◆ getId()

const IdHashTableHelper< N, MdtTubeId , MdtTubeHash >::IdentifierType & IdHashTableHelper< N, MdtTubeId , MdtTubeHash >::getId
inlineinherited

Get the identifier.

Definition at line 57 of file IdHashTableHelper.h.

117  {
118  return m_id;
119 }

◆ isValid()

bool IdHashTableHelper< N, MdtTubeId , MdtTubeHash >::isValid ( const IdentifierType id)
inlinestaticinherited

Definition at line 73 of file IdHashTableHelper.h.

164  {
165  return id != s_defaultId;
166 }

◆ operator[]()

int IdHashTableHelper< N, MdtTubeId , MdtTubeHash >::operator[] ( unsigned int  fieldIndex) const
inlineinherited

Return the value encoded in field.

No range check!

Definition at line 61 of file IdHashTableHelper.h.

111  {
112  return m_fields[index];
113 }

◆ setAll() [1/2]

void MdtTubeInChamberIdFields::setAll ( const MdtTubeId &  id)
inline

Set identifier and also the fields (using the internal helper).

Definition at line 47 of file MdtTubeInChamberIdFields.h.

47  {
48  BaseClass::setId( id );
49  BaseClass::setField( kMultilayerField, id.multilayer() );
52 }

◆ setAll() [2/2]

void MdtTubeInChamberIdFields::setAll ( int  fields[3])
inline

Set fields and also the identifier (using the internal helper)

Definition at line 41 of file MdtTubeInChamberIdFields.h.

41  {
44  BaseClass::setId( id );
45 }

◆ setDefaults()

void IdHashTableHelper< N, MdtTubeId , MdtTubeHash >::setDefaults ( const IdentifierType defId,
const HashType defHash 
)
inlinestaticinherited

Set the default (invalid) values for identifier and hash.

Must be called (once per type T) if the default constructors of HashType or IdentifierType do not give a well defined (invalid!) value. This is typically the case for built-in types.

Definition at line 70 of file IdHashTableHelper.h.

140  {
141  s_defaultId = defId;
142  s_defaultHash = defHash;
143 }

◆ setField()

void IdHashTableHelper< N, MdtTubeId , MdtTubeHash >::setField ( int  index,
int  value 
)
inlineinherited

Set field at index to value.

No range check!

Definition at line 63 of file IdHashTableHelper.h.

128  {
129  m_fields[index] = value;
130 }

◆ setFields()

void IdHashTableHelper< N, MdtTubeId , MdtTubeHash >::setFields ( int  fields[N])
inlineinherited

Set fields from array.

Definition at line 65 of file IdHashTableHelper.h.

133  {
134  for ( unsigned int i = 0; i < N; ++i ) m_fields[i] = fields[i];
135 }

◆ setId()

void IdHashTableHelper< N, MdtTubeId , MdtTubeHash >::setId ( const IdentifierType id)
inlineinherited

Set (only) the identifier.

Definition at line 59 of file IdHashTableHelper.h.

123  {
124  m_id = id;
125 }

Member Data Documentation

◆ m_fields

int IdHashTableHelper< N, MdtTubeId , MdtTubeHash >::m_fields[N]
privateinherited

Definition at line 85 of file IdHashTableHelper.h.

◆ m_id

IdentifierType IdHashTableHelper< N, MdtTubeId , MdtTubeHash >::m_id
privateinherited

Definition at line 84 of file IdHashTableHelper.h.

◆ s_defaultHash

IdHashTableHelper< N, MdtTubeId , MdtTubeHash >::HashType IdHashTableHelper< N, MdtTubeId , MdtTubeHash >::s_defaultHash
staticprivateinherited

Definition at line 90 of file IdHashTableHelper.h.

◆ s_defaultId

IdHashTableHelper< N, MdtTubeId , MdtTubeHash >::IdentifierType IdHashTableHelper< N, MdtTubeId , MdtTubeHash >::s_defaultId
staticprivateinherited

Definition at line 89 of file IdHashTableHelper.h.


The documentation for this class was generated from the following file:
MdtTubeInChamberIdFields::kMultilayerField
@ kMultilayerField
Definition: MdtTubeInChamberIdFields.h:40
IdHashTableHelper< 3, MdtTubeId, MdtTubeHash >::m_fields
int m_fields[N]
Definition: IdHashTableHelper.h:85
IdHashTableHelper< 3, MdtTubeId, MdtTubeHash >::m_id
IdentifierType m_id
Definition: IdHashTableHelper.h:84
MdtTubeInChamberIdFields::kLayerField
@ kLayerField
Definition: MdtTubeInChamberIdFields.h:40
IdHashTableHelper< 3, MdtTubeId, MdtTubeHash >::setField
void setField(int index, int value)
Set field at index to value.
Definition: IdHashTableHelper.h:128
IdHashTableHelper< 3, MdtTubeId, MdtTubeHash >::setFields
void setFields(int fields[N])
Set fields from array.
Definition: IdHashTableHelper.h:133
athena.value
value
Definition: athena.py:124
JetTiledMap::N
@ N
Definition: TiledEtaPhiMap.h:44
MdtTubeInChamberIdFields::kTubeField
@ kTubeField
Definition: MdtTubeInChamberIdFields.h:40
IdHashTableHelper< 3, MdtTubeId, MdtTubeHash >::s_defaultId
static IdentifierType s_defaultId
Definition: IdHashTableHelper.h:89
lumiFormat.i
int i
Definition: lumiFormat.py:85
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
IdHashTableHelper< 3, MdtTubeId, MdtTubeHash >::defaultHash
static HashType defaultHash()
Returns default (=invalid) hash.
Definition: IdHashTableHelper.h:147
DeMoScan.index
string index
Definition: DeMoScan.py:364
IdHashTableHelper< 3, MdtTubeId, MdtTubeHash >::s_defaultHash
static HashType s_defaultHash
Definition: IdHashTableHelper.h:90
CaloCondBlobAlgs_fillNoiseFromASCII.fields
fields
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:106
calibdata.tube
tube
Definition: calibdata.py:31
IdHashTableHelper< 3, MdtTubeId, MdtTubeHash >::setId
void setId(const IdentifierType &id)
Set (only) the identifier.
Definition: IdHashTableHelper.h:123