ATLAS Offline Software
Loading...
Searching...
No Matches
TRTCond::ExpandedIdentifier Class Reference

Identifier for TRT detector elements in the conditions code. More...

#include <ExpandedIdentifier.h>

Collaboration diagram for TRTCond::ExpandedIdentifier:

Public Types

enum  Level {
  DETECTOR =0 , BARRELEC =1 , LAYERWHEEL =2 , MODULE =3 ,
  STRAWLAYER =4 , STRAW =5
}
 enum to specify the granularity level More...

Public Member Functions

 ExpandedIdentifier ()=default
 default constructor
 ExpandedIdentifier (int bec, int layerorwheel, int module, int strawlayer, int straw, int l=STRAW)
 normal constructor
const size_t & index (size_t l) const
 returns const index at given level.
size_t & index (size_t l)
 returns index at given level
size_t level () const
 returns level
const std::string name (size_t l) const
 returns level name
void print (std::ostream &os=std::cout) const
 print the object
void write (std::ostream &os) const
 write the object to file
void read (std::istream &is)
 read the object from file
size_t becidtoindex (int becid) const
 returns subdetector index given the barrel_ec number
int becindextoid (size_t becindex) const
 returns barrel_ec number given the subdetector index
int id (size_t l) const
 returns TRT_ID index at given level

Private Attributes

size_t m_index [5] {}
 Index within levels higher than DETECTOR.
size_t m_level {STRAW}
 Granularity level.

Detailed Description

Identifier for TRT detector elements in the conditions code.

Author
Wouter Hulsbergen

Note that this identifier is for use by clients. Inside the code elements are numbered by indices that always start at 0.

Definition at line 29 of file InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ExpandedIdentifier.h.

Member Enumeration Documentation

◆ Level

Constructor & Destructor Documentation

◆ ExpandedIdentifier() [1/2]

TRTCond::ExpandedIdentifier::ExpandedIdentifier ( )
default

default constructor

◆ ExpandedIdentifier() [2/2]

TRTCond::ExpandedIdentifier::ExpandedIdentifier ( int bec,
int layerorwheel,
int module,
int strawlayer,
int straw,
int l = STRAW )
inline

normal constructor

Definition at line 43 of file InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ExpandedIdentifier.h.

44 : m_level(l) {
45 m_index[0] = becidtoindex(bec) ; // this is where we couild introduce a map
46 m_index[1] = layerorwheel ;
47 m_index[2] = module ;
48 m_index[3] = strawlayer ;
49 m_index[4] = straw ;
50 }
size_t becidtoindex(int becid) const
returns subdetector index given the barrel_ec number
@ straw
Definition HitInfo.h:82

Member Function Documentation

◆ becidtoindex()

size_t TRTCond::ExpandedIdentifier::becidtoindex ( int becid) const
inline

returns subdetector index given the barrel_ec number

Definition at line 79 of file InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ExpandedIdentifier.h.

79{ return becid<0 ? becid+2 : becid + 1 ; }

◆ becindextoid()

int TRTCond::ExpandedIdentifier::becindextoid ( size_t becindex) const
inline

returns barrel_ec number given the subdetector index

Definition at line 82 of file InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ExpandedIdentifier.h.

82{ return becindex<2 ? int(becindex)-2 : becindex-1; }

◆ id()

int TRTCond::ExpandedIdentifier::id ( size_t l) const
inline

returns TRT_ID index at given level

Definition at line 85 of file InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ExpandedIdentifier.h.

85{ return l==BARRELEC ? becindextoid(index(l)) : index(l) ; }
int becindextoid(size_t becindex) const
returns barrel_ec number given the subdetector index
l
Printing final latex table to .tex output file.

◆ index() [1/2]

size_t & TRTCond::ExpandedIdentifier::index ( size_t l)
inline

returns index at given level

Definition at line 58 of file InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ExpandedIdentifier.h.

58{ return m_index[l-1] ; }

◆ index() [2/2]

const size_t & TRTCond::ExpandedIdentifier::index ( size_t l) const
inline

returns const index at given level.

Note that internally there is no indexing of the DETECTOR level

Definition at line 55 of file InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ExpandedIdentifier.h.

55{ return m_index[l-1] ; }

◆ level()

size_t TRTCond::ExpandedIdentifier::level ( ) const
inline

◆ name()

const std::string TRTCond::ExpandedIdentifier::name ( size_t l) const
inline

returns level name

Definition at line 64 of file InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ExpandedIdentifier.h.

64 {
65 static const std::string names[] = {"detector","barrelec","layer_or_wheel","module","straw_layer","straw"} ;
66 return names[l] ;
67 }

◆ print()

void ExpandedIdentifier::print ( std::ostream & os = std::cout) const

print the object

Definition at line 11 of file InnerDetector/InDetConditions/TRT_ConditionsData/src/ExpandedIdentifier.cxx.

11 {
12 for(int i=BARRELEC; i<=STRAW; ++i) os << name(i) << "=" << int(id(i)) << "," ;
13 os << "level=" << level() << std::endl ;
14 }

◆ read()

void ExpandedIdentifier::read ( std::istream & is)

read the object from file

Definition at line 30 of file InnerDetector/InDetConditions/TRT_ConditionsData/src/ExpandedIdentifier.cxx.

30 {
31 int bec,layer,sector,strawlayer,straw ;
32 is >> bec >> layer >> sector >> strawlayer >> straw ;
33 int level = STRAW ;
34 if( straw<0 ) { level = STRAWLAYER ; straw = 0 ; }
35 if( strawlayer<0 ) { level = MODULE ; strawlayer = 0 ; }
36 if( sector<0 ) { level = LAYERWHEEL ; sector = 0 ; }
37 if( layer<0 ) { level = BARRELEC ; layer = 0 ; }
38 if( bec<-2 ) { level = DETECTOR ; bec = -2 ; }
39 *this = TRTCond::ExpandedIdentifier( bec,layer,sector,strawlayer,straw,level ) ;
40 }
@ layer
Definition HitInfo.h:79

◆ write()

void ExpandedIdentifier::write ( std::ostream & os) const

write the object to file

Definition at line 16 of file InnerDetector/InDetConditions/TRT_ConditionsData/src/ExpandedIdentifier.cxx.

16 {
17 int bec = level() >= BARRELEC ? id(BARRELEC) : -3 ;
18 int layer = level() >= LAYERWHEEL ? id(LAYERWHEEL) : -1 ;
19 int sector = level() >= MODULE ? id(MODULE) : -1 ;
20 int strawlayer = level() >= STRAWLAYER ? id(STRAWLAYER) : -1 ;
21 int straw = level() >= STRAW ? id(STRAW) : -1 ;
22 os << std::setiosflags(std::ios_base::right)
23 << std::setw(2) << bec
24 << std::setw(3) << layer
25 << std::setw(3) << sector
26 << std::setw(3) << strawlayer
27 << std::setw(3) << straw ;
28 }

Member Data Documentation

◆ m_index

size_t TRTCond::ExpandedIdentifier::m_index[5] {}
private

Index within levels higher than DETECTOR.

Definition at line 32 of file InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ExpandedIdentifier.h.

32{} ;

◆ m_level

size_t TRTCond::ExpandedIdentifier::m_level {STRAW}
private

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