ATLAS Offline Software
Loading...
Searching...
No Matches
LArReadoutModuleService Class Reference

Service for creating and interpreting LAr readout modules identifiers. More...

#include <LArReadoutModuleService.h>

Collaboration diagram for LArReadoutModuleService:

Public Member Functions

 ~LArReadoutModuleService ()
 destructor

Static Public Member Functions

static HWIdentifier createReadoutModuleID (int atlas_tb, int barrel_ec, int pos_neg, int em_hec_fcal, int rosId, int rodFragId, int rodCrate, int rodSlot)
 create a HWIdentifier

valid parameter values
atlas_tb : 0 atlas , 1 test beam
barrel_ec : 0 barrel , 1 end-cap
pos_neg : 0 negative eta side (C side) , 1 positive eta side (A side)
em_hec_fcal : 0 em , 1 hec, 2 FCAL
rosId : 0 -> 27 (EMB), 0 -> 17 (EMEC), 0 -> 2 (HEC), 0 -> 1 (FCAL) rodFragId : 0 -> 223 (EMB), 0 -> 137 (EMEC), 0 -> 23 (HEC), 0 -> 13 (FCAL) rodCrate : 1 -> 4 (EMB), 1 -> 3 (EMEC), 1 (HEC), 1 (FCAL) rodSlot : 1 -> 14 (EMB), 1 -> 13 (EMEC), 1 -> 6 (HEC), 1 -> 4 (FCAL)

(reference: xls table by Fred Wickens)
static int atlas_tb (const HWIdentifier &id)
 return 0 for ATLAS , 1 for Test Beam
static int barrel_ec (const HWIdentifier &id)
 return location (0: barrel or 1: end cap )
static int pos_neg (const HWIdentifier &id)
 return side
positive side : 1
negative side : 0

static int em_hec_fcal (const HWIdentifier &id)
 return subdetector
em : 0, hec : 1, fcal : 2

static int subDet (const HWIdentifier &id)
 return sub-detector identifier

static int robFragId (const HWIdentifier &id)
 return ROB fragment identifier ( == ROL == RODFrag identifier )

static int rol (const HWIdentifier &id)
 return ROL identifier ( == RODFrag == ROBFrag identifier )

static int rosId (const HWIdentifier &id)
 return ROS identifier

static int rodFragId (const HWIdentifier &id)
 return ROD fragment identifier ( == ROL == ROB identifier )

static int rodCrate (const HWIdentifier &id)
 return ROD crate number

static int rodSlot (const HWIdentifier &id)
 return ROD slot number

static std::string cnvToString (const HWIdentifier &id)
 convert a HWIdentifier into a STL string
static std::string cnvToStringTDAQ (const HWIdentifier &id)
 convert a HWIdentifier into a STL string, TDAQ convention for sub-detector numbering
static std::string checkReadoutModuleValues (int atlas_tb, int barrel_ec, int pos_neg, int em_hec_fcal, int rosId, int rodFragId, int rodCrate, int rodSlot)

Static Private Attributes

static const unsigned int m_atlas_tb = 1
static const unsigned int m_barrel_ec = 2
static const unsigned int m_pos_neg = 4
static const unsigned int m_emhf = 8
static const unsigned int s_rosId = 32
static const unsigned int s_rodFragId = 1024
static const unsigned int s_rodCrate = 262144
static const unsigned int s_rodSlot = 1048576
static const int s_LAR_EM_BARREL_A_SIDE = 0x41
static const int s_LAR_EM_BARREL_C_SIDE = 0x42
static const int s_LAR_EM_ENDCAP_A_SIDE = 0x43
static const int s_LAR_EM_ENDCAP_C_SIDE = 0x44
static const int s_LAR_HAD_ENDCAP_A_SIDE = 0x45
static const int s_LAR_HAD_ENDCAP_C_SIDE = 0x46
static const int s_LAR_FCAL_A_SIDE = 0x47
static const int s_LAR_FCAL_C_SIDE = 0x48

Detailed Description

Service for creating and interpreting LAr readout modules identifiers.

Author
F. Ledroit
Version
00-00-00 @stereotype interface

Definition at line 20 of file LArReadoutModuleService.h.

Constructor & Destructor Documentation

◆ ~LArReadoutModuleService()

LArReadoutModuleService::~LArReadoutModuleService ( )
inline

destructor

Definition at line 125 of file LArReadoutModuleService.h.

125{ }

Member Function Documentation

◆ atlas_tb()

int LArReadoutModuleService::atlas_tb ( const HWIdentifier & id)
static

return 0 for ATLAS , 1 for Test Beam

Definition at line 146 of file LArReadoutModuleService.cxx.

146 {
147 return ( ((int) l_id.get_identifier32().get_compact()) & 1 ) ;
148}

◆ barrel_ec()

int LArReadoutModuleService::barrel_ec ( const HWIdentifier & id)
static

return location (0: barrel or 1: end cap )

Definition at line 150 of file LArReadoutModuleService.cxx.

150 {
151 return ( ( ( (int) l_id.get_identifier32().get_compact() ) & 2 ) ) >> 1 ;
152}

◆ checkReadoutModuleValues()

std::string LArReadoutModuleService::checkReadoutModuleValues ( int atlas_tb,
int barrel_ec,
int pos_neg,
int em_hec_fcal,
int rosId,
int rodFragId,
int rodCrate,
int rodSlot )
static

Definition at line 60 of file LArReadoutModuleService.cxx.

61{
62 std::string l_std_str = "";
63
64 if( l_atlas_tb > 1 || l_atlas_tb < 0 ) { // check of atlas_tb
65 l_std_str += std::string("atlas_tb out of range ,") ;
66 }
67 if( l_barrel_ec > 1 || l_barrel_ec < 0 ) { // check of barrel_ec
68 l_std_str += std::string("barrel_ec out of range ,") ;
69 }
70 if( l_pos_neg > 1 || l_pos_neg < 0 ) { // check of pos_neg
71 l_std_str += std::string("pos_neg out of range ,") ;
72 }
73 if( l_em_hec_fcal > 2 || l_em_hec_fcal < 0 ) { // check of em_hec_fcal
74 l_std_str += std::string("em_hec_fcal out of range ,") ;
75 }
76 // check of rodID, rodFragId, rodCrate and rodSlot
77 if( l_barrel_ec == 0 && l_em_hec_fcal == 0 ) {
78 // EMB
79 if( l_rosId > 27 || l_rosId < 0) {
80 l_std_str += std::string("rosId out of range ,") ;
81 }
82 if( l_rodFragId > 223 || l_rodFragId < 0) {
83 l_std_str += std::string("rodFragId out of range ,") ;
84 }
85 if( l_rodCrate > 4 || l_rodCrate < 1) {
86 l_std_str += std::string("rodCrate out of range ,") ;
87 }
88 if( l_rodSlot > 14 || l_rodSlot < 1) {
89 l_std_str += std::string("rodSlot out of range ,") ;
90 }
91 }
92 if( l_barrel_ec == 1 && l_em_hec_fcal == 0 ) {
93 // EMEC
94 if( l_rosId > 17 || l_rosId < 0) {
95 l_std_str += std::string("rosId out of range ,") ;
96 }
97 if( l_rodFragId > 137 || l_rodFragId < 0) {
98 l_std_str += std::string("rodFragId out of range ,") ;
99 }
100 if( l_rodCrate > 3 || l_rodCrate < 1) {
101 l_std_str += std::string("rodCrate out of range ,") ;
102 }
103 if( l_rodSlot > 13 || l_rodSlot < 1) {
104 l_std_str += std::string("rodSlot out of range ,") ;
105 }
106 }
107 if( l_barrel_ec == 1 && l_em_hec_fcal == 1 ) {
108 // HEC
109 if( l_rosId > 2 || l_rosId < 0) {
110 l_std_str += std::string("rosId out of range ,") ;
111 }
112 if( l_rodFragId > 23 || l_rodFragId < 0) {
113 l_std_str += std::string("rodFragId out of range ,") ;
114 }
115// if( l_rodCrate > 1 || l_rodCrate < 1) {
116 if( l_rodCrate > 2 || l_rodCrate < 1) {
117 l_std_str += std::string("rodCrate out of range ,") ;
118 }
119 if( l_rodSlot > 6 || l_rodSlot < 1) {
120 l_std_str += std::string("rodSlot out of range ,") ;
121 }
122 }
123 if( l_barrel_ec == 1 && l_em_hec_fcal == 2 ) {
124 // FCAL
125 if( l_rosId > 1 || l_rosId < 0) {
126 l_std_str += std::string("rosId out of range ,") ;
127 }
128 if( l_rodFragId > 13 || l_rodFragId < 0) {
129 l_std_str += std::string("rodFragId out of range ,") ;
130 }
131 if( l_rodCrate > 2 || l_rodCrate < 1) {
132// if( l_rodCrate > 1 || l_rodCrate < 1) {
133 l_std_str += std::string("rodCrate out of range ,") ;
134 }
135 if( l_rodSlot > 4 || l_rodSlot < 1) {
136 l_std_str += std::string("rodSlot out of range ,") ;
137 }
138 }
139
140
141 return l_std_str;
142
143}

◆ cnvToString()

std::string LArReadoutModuleService::cnvToString ( const HWIdentifier & id)
static

convert a HWIdentifier into a STL string

Definition at line 225 of file LArReadoutModuleService.cxx.

225 {
226 char * l_str = new char[200] ;
227 sprintf( l_str , "atlas_tb : %d, barrel_ec : %d, pos_neg: %d, em_hec_fcal: %d, rosId: %d, rodFragId: %d, rodCrate: %d, rodSlot: %d ",
228 atlas_tb(id) , barrel_ec(id) , pos_neg(id) , em_hec_fcal(id) , rosId(id) , rodFragId(id), rodCrate(id), rodSlot(id) ) ;
229 std::string str(l_str);
230 delete[] l_str ;
231 return str ;
232
233}
static int rodSlot(const HWIdentifier &id)
return ROD slot number
static int pos_neg(const HWIdentifier &id)
return side positive side : 1 negative side : 0
static int rodCrate(const HWIdentifier &id)
return ROD crate number
static int rosId(const HWIdentifier &id)
return ROS identifier
static int barrel_ec(const HWIdentifier &id)
return location (0: barrel or 1: end cap )
static int rodFragId(const HWIdentifier &id)
return ROD fragment identifier ( == ROL == ROB identifier )
static int em_hec_fcal(const HWIdentifier &id)
return subdetector em : 0, hec : 1, fcal : 2
static int atlas_tb(const HWIdentifier &id)
return 0 for ATLAS , 1 for Test Beam

◆ cnvToStringTDAQ()

std::string LArReadoutModuleService::cnvToStringTDAQ ( const HWIdentifier & id)
static

convert a HWIdentifier into a STL string, TDAQ convention for sub-detector numbering

Definition at line 235 of file LArReadoutModuleService.cxx.

235 {
236 char * l_str = new char[200] ;
237 sprintf( l_str , "atlas_tb : %d, subDet : %x, rosId: %d, rodFragId: %d, rodCrate: %d, rodSlot: %d ",
238 atlas_tb(id) , subDet(id) , rosId(id) , rodFragId(id), rodCrate(id), rodSlot(id) ) ;
239 std::string str(l_str);
240 delete[] l_str ;
241 return str ;
242
243}
static int subDet(const HWIdentifier &id)
return sub-detector identifier

◆ createReadoutModuleID()

HWIdentifier LArReadoutModuleService::createReadoutModuleID ( int atlas_tb,
int barrel_ec,
int pos_neg,
int em_hec_fcal,
int rosId,
int rodFragId,
int rodCrate,
int rodSlot )
static

create a HWIdentifier

valid parameter values
atlas_tb : 0 atlas , 1 test beam
barrel_ec : 0 barrel , 1 end-cap
pos_neg : 0 negative eta side (C side) , 1 positive eta side (A side)
em_hec_fcal : 0 em , 1 hec, 2 FCAL
rosId : 0 -> 27 (EMB), 0 -> 17 (EMEC), 0 -> 2 (HEC), 0 -> 1 (FCAL) rodFragId : 0 -> 223 (EMB), 0 -> 137 (EMEC), 0 -> 23 (HEC), 0 -> 13 (FCAL) rodCrate : 1 -> 4 (EMB), 1 -> 3 (EMEC), 1 (HEC), 1 (FCAL) rodSlot : 1 -> 14 (EMB), 1 -> 13 (EMEC), 1 -> 6 (HEC), 1 -> 4 (FCAL)

(reference: xls table by Fred Wickens)

Creates LArReadoutModuleID from explicit ReadoutModule descriptors.

Throw a LArID_Exception if one parameter is out of range.

// usage example 

try { 
 myCablingService->createLArReadoutModuleID( 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0) ;
}
catch( LArID_Exception & except ) { 
 ...
}

Definition at line 35 of file LArReadoutModuleService.cxx.

35 {
36
37
38 std::string errorReport = checkReadoutModuleValues(l_atlas_tb, l_barrel_ec, l_pos_neg, l_em_hec_fcal, l_rosId, l_rodFragId, l_rodCrate, l_rodSlot) ;
39
40 if( errorReport.length() != 0 ) { // error detected
41 MsgStream msg(Athena::getMessageSvc(), " LArReadoutModuleService");
42 msg << MSG::ERROR << " createReadoutModuleID called with parameters: "
43 << l_atlas_tb << ", " << l_barrel_ec << ", " << l_pos_neg << ", " << l_em_hec_fcal
44 << ", " << l_rosId << ", " << l_rodFragId << ", " << l_rodCrate << ", " << l_rodSlot << endmsg;
45 msg << MSG::ERROR << errorReport << endmsg;
46 return {}; //Return (invalid) default instance
47 }
48
49 l_rodCrate = l_rodCrate-1;
50
51 unsigned int id_int = l_atlas_tb * m_atlas_tb + l_barrel_ec * m_barrel_ec + l_pos_neg * m_pos_neg + l_em_hec_fcal * m_emhf +
52 l_rosId * s_rosId + l_rodFragId * s_rodFragId + l_rodCrate * s_rodCrate + l_rodSlot * s_rodSlot ;
53 HWIdentifier l_id(id_int) ;
54 return l_id ;
55}
#define endmsg
static const unsigned int s_rosId
static const unsigned int m_emhf
static const unsigned int m_atlas_tb
static const unsigned int m_pos_neg
static const unsigned int m_barrel_ec
static std::string checkReadoutModuleValues(int atlas_tb, int barrel_ec, int pos_neg, int em_hec_fcal, int rosId, int rodFragId, int rodCrate, int rodSlot)
static const unsigned int s_rodCrate
static const unsigned int s_rodSlot
static const unsigned int s_rodFragId
IMessageSvc * getMessageSvc(bool quiet=false)
MsgStream & msg
Definition testRead.cxx:32

◆ em_hec_fcal()

int LArReadoutModuleService::em_hec_fcal ( const HWIdentifier & id)
static

return subdetector
em : 0, hec : 1, fcal : 2

Definition at line 158 of file LArReadoutModuleService.cxx.

158 {
159 return ( ( ( (int) l_id.get_identifier32().get_compact() ) & 0x18 ) ) >> 3 ;
160}

◆ pos_neg()

int LArReadoutModuleService::pos_neg ( const HWIdentifier & id)
static

return side
positive side : 1
negative side : 0

Definition at line 154 of file LArReadoutModuleService.cxx.

154 {
155 return ( ( ( (int) l_id.get_identifier32().get_compact() ) & 4 ) ) >> 2 ;
156}

◆ robFragId()

int LArReadoutModuleService::robFragId ( const HWIdentifier & id)
static

return ROB fragment identifier ( == ROL == RODFrag identifier )

Definition at line 199 of file LArReadoutModuleService.cxx.

199 {
200 return ( ( ( (int) l_id.get_identifier32().get_compact() ) & 0x3fc00 ) ) >> 10 ;
201}

◆ rodCrate()

int LArReadoutModuleService::rodCrate ( const HWIdentifier & id)
static

return ROD crate number

Definition at line 215 of file LArReadoutModuleService.cxx.

215 {
216// Shift by 1, internally (0-3), external (1-4)
217 return ( ( ( ( (int) l_id.get_identifier32().get_compact() ) & 0xc0000 ) ) >> 18 ) + 1 ;
218}

◆ rodFragId()

int LArReadoutModuleService::rodFragId ( const HWIdentifier & id)
static

return ROD fragment identifier ( == ROL == ROB identifier )

Definition at line 211 of file LArReadoutModuleService.cxx.

211 {
212 return ( ( ( (int) l_id.get_identifier32().get_compact() ) & 0x3fc00 ) ) >> 10 ;
213}

◆ rodSlot()

int LArReadoutModuleService::rodSlot ( const HWIdentifier & id)
static

return ROD slot number

Definition at line 220 of file LArReadoutModuleService.cxx.

220 {
221 return ( ( ( (int) l_id.get_identifier32().get_compact() ) & 0xf00000 ) ) >> 20 ;
222}

◆ rol()

int LArReadoutModuleService::rol ( const HWIdentifier & id)
static

return ROL identifier ( == RODFrag == ROBFrag identifier )

Definition at line 203 of file LArReadoutModuleService.cxx.

203 {
204 return ( ( ( (int) l_id.get_identifier32().get_compact() ) & 0x3fc00 ) ) >> 10 ;
205}

◆ rosId()

int LArReadoutModuleService::rosId ( const HWIdentifier & id)
static

return ROS identifier

Definition at line 207 of file LArReadoutModuleService.cxx.

207 {
208 return ( ( ( (int) l_id.get_identifier32().get_compact() ) & 0x3e0 ) ) >> 5 ;
209}

◆ subDet()

int LArReadoutModuleService::subDet ( const HWIdentifier & id)
static

return sub-detector identifier

Definition at line 162 of file LArReadoutModuleService.cxx.

162 {
163 int value=0 ;
164 int l_barrel_ec = ( ( ( (int) l_id.get_identifier32().get_compact() ) & 2 ) ) >> 1 ;
165 int l_pos_neg = ( ( ( (int) l_id.get_identifier32().get_compact() ) & 4 ) ) >> 2 ;
166 int l_emhf = ( ( ( (int) l_id.get_identifier32().get_compact() ) & 0x18 ) ) >> 3 ;
167 if(l_barrel_ec == 0) {
168 if(l_pos_neg == 1) {
170 } else {
172 }
173 }
174 else if(l_emhf == 0) {
175 if(l_pos_neg == 1) {
177 } else {
179 }
180 }
181 else if(l_emhf == 1) {
182 if(l_pos_neg == 1) {
184 } else {
186 }
187 }
188 else if(l_emhf == 2) {
189 if(l_pos_neg == 1) {
191 } else {
193 }
194 }
195
196 return value ;
197}

Member Data Documentation

◆ m_atlas_tb

const unsigned int LArReadoutModuleService::m_atlas_tb = 1
staticprivate

Definition at line 128 of file LArReadoutModuleService.h.

◆ m_barrel_ec

const unsigned int LArReadoutModuleService::m_barrel_ec = 2
staticprivate

Definition at line 129 of file LArReadoutModuleService.h.

◆ m_emhf

const unsigned int LArReadoutModuleService::m_emhf = 8
staticprivate

Definition at line 133 of file LArReadoutModuleService.h.

◆ m_pos_neg

const unsigned int LArReadoutModuleService::m_pos_neg = 4
staticprivate

Definition at line 130 of file LArReadoutModuleService.h.

◆ s_LAR_EM_BARREL_A_SIDE

const int LArReadoutModuleService::s_LAR_EM_BARREL_A_SIDE = 0x41
staticprivate

Definition at line 139 of file LArReadoutModuleService.h.

◆ s_LAR_EM_BARREL_C_SIDE

const int LArReadoutModuleService::s_LAR_EM_BARREL_C_SIDE = 0x42
staticprivate

Definition at line 140 of file LArReadoutModuleService.h.

◆ s_LAR_EM_ENDCAP_A_SIDE

const int LArReadoutModuleService::s_LAR_EM_ENDCAP_A_SIDE = 0x43
staticprivate

Definition at line 141 of file LArReadoutModuleService.h.

◆ s_LAR_EM_ENDCAP_C_SIDE

const int LArReadoutModuleService::s_LAR_EM_ENDCAP_C_SIDE = 0x44
staticprivate

Definition at line 142 of file LArReadoutModuleService.h.

◆ s_LAR_FCAL_A_SIDE

const int LArReadoutModuleService::s_LAR_FCAL_A_SIDE = 0x47
staticprivate

Definition at line 145 of file LArReadoutModuleService.h.

◆ s_LAR_FCAL_C_SIDE

const int LArReadoutModuleService::s_LAR_FCAL_C_SIDE = 0x48
staticprivate

Definition at line 146 of file LArReadoutModuleService.h.

◆ s_LAR_HAD_ENDCAP_A_SIDE

const int LArReadoutModuleService::s_LAR_HAD_ENDCAP_A_SIDE = 0x45
staticprivate

Definition at line 143 of file LArReadoutModuleService.h.

◆ s_LAR_HAD_ENDCAP_C_SIDE

const int LArReadoutModuleService::s_LAR_HAD_ENDCAP_C_SIDE = 0x46
staticprivate

Definition at line 144 of file LArReadoutModuleService.h.

◆ s_rodCrate

const unsigned int LArReadoutModuleService::s_rodCrate = 262144
staticprivate

Definition at line 136 of file LArReadoutModuleService.h.

◆ s_rodFragId

const unsigned int LArReadoutModuleService::s_rodFragId = 1024
staticprivate

Definition at line 135 of file LArReadoutModuleService.h.

◆ s_rodSlot

const unsigned int LArReadoutModuleService::s_rodSlot = 1048576
staticprivate

Definition at line 137 of file LArReadoutModuleService.h.

◆ s_rosId

const unsigned int LArReadoutModuleService::s_rosId = 32
staticprivate

Definition at line 134 of file LArReadoutModuleService.h.


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