ATLAS Offline Software
Loading...
Searching...
No Matches
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
enum  
 N is the number of fields to use from the identifier. More...
typedef MdtTubeId IdentifierType
 define type IdentifierType
typedef MdtTubeHash HashType
 define type HashType
typedef MdtTubeHash ValueType
 needed for MultiDimArray<> instantiation

Public Member Functions

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

Static Public Member Functions

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

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 31 of file MdtTubeInChamberIdFields.h.

◆ HashType

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

define type HashType

Definition at line 35 of file IdHashTableHelper.h.

◆ IdentifierType

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

define type IdentifierType

Definition at line 33 of file IdHashTableHelper.h.

◆ ValueType

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

needed for MultiDimArray<> instantiation

Definition at line 37 of file IdHashTableHelper.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

enum the identifier fiels

Enumerator
kTubeField 
kLayerField 
kMultilayerField 

Definition at line 33 of file MdtTubeInChamberIdFields.h.

◆ 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 31 of file IdHashTableHelper.h.

31{ NFIELDS = N, NMAX=UINT_MAX };
Helper base class for instantiation of templated class IdentifierHashTable.

Member Function Documentation

◆ defaultHash()

HashType IdHashTableHelper< N, MdtTubeId, MdtTubeHash >::defaultHash ( )
staticinherited

Returns default (=invalid) hash.

◆ defaultIdentifier()

IdentifierType IdHashTableHelper< N, MdtTubeId, MdtTubeHash >::defaultIdentifier ( )
staticinherited

Return default (=invalid) identifier.

◆ defaultValue()

ValueType IdHashTableHelper< N, MdtTubeId, MdtTubeHash >::defaultValue ( )
staticinherited

Return default hash.

Needed for class MultiDimArray.

◆ getId()

const IdentifierType & IdHashTableHelper< N, MdtTubeId, MdtTubeHash >::getId ( ) const
inherited

Get the identifier.

◆ isValid()

bool IdHashTableHelper< N, MdtTubeId, MdtTubeHash >::isValid ( const IdentifierType & )
staticinherited

◆ operator[]()

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

Return the value encoded in field.

No range check!

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

◆ 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 {
42 BaseClass::setFields( fields );
43 MdtTubeId id( fields[kMultilayerField], fields[kLayerField], fields[kTubeField] );
44 BaseClass::setId( id );
45}

◆ setDefaults()

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

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.

◆ setField()

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

Set field at index to value.

No range check!

◆ setFields()

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

Set fields from array.

◆ setId()

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

Set (only) the identifier.

Member Data Documentation

◆ m_fields

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

Definition at line 78 of file IdHashTableHelper.h.

◆ m_id

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

Definition at line 77 of file IdHashTableHelper.h.

◆ s_defaultHash

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

Definition at line 83 of file IdHashTableHelper.h.

◆ s_defaultId

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

Definition at line 82 of file IdHashTableHelper.h.


The documentation for this class was generated from the following file: