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 147 of file LArReadoutModuleService.cxx.

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

◆ barrel_ec()

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

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

Definition at line 151 of file LArReadoutModuleService.cxx.

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

◆ 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 61 of file LArReadoutModuleService.cxx.

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

◆ cnvToString()

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

convert a HWIdentifier into a STL string

Definition at line 226 of file LArReadoutModuleService.cxx.

226 {
227 char * l_str = new char[200] ;
228 sprintf( l_str , "atlas_tb : %d, barrel_ec : %d, pos_neg: %d, em_hec_fcal: %d, rosId: %d, rodFragId: %d, rodCrate: %d, rodSlot: %d ",
229 atlas_tb(id) , barrel_ec(id) , pos_neg(id) , em_hec_fcal(id) , rosId(id) , rodFragId(id), rodCrate(id), rodSlot(id) ) ;
230 std::string str(l_str);
231 delete[] l_str ;
232 return str ;
233
234}
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 236 of file LArReadoutModuleService.cxx.

236 {
237 char * l_str = new char[200] ;
238 sprintf( l_str , "atlas_tb : %d, subDet : %x, rosId: %d, rodFragId: %d, rodCrate: %d, rodSlot: %d ",
239 atlas_tb(id) , subDet(id) , rosId(id) , rodFragId(id), rodCrate(id), rodSlot(id) ) ;
240 std::string str(l_str);
241 delete[] l_str ;
242 return str ;
243
244}
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 36 of file LArReadoutModuleService.cxx.

36 {
37
38
39 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) ;
40
41 if( errorReport.length() != 0 ) { // error detected
42 MsgStream msg(Athena::getMessageSvc(), " LArReadoutModuleService");
43 msg << MSG::ERROR << " createReadoutModuleID called with parameters: "
44 << l_atlas_tb << ", " << l_barrel_ec << ", " << l_pos_neg << ", " << l_em_hec_fcal
45 << ", " << l_rosId << ", " << l_rodFragId << ", " << l_rodCrate << ", " << l_rodSlot << endmsg;
46 msg << MSG::ERROR << errorReport << endmsg;
47 return {}; //Return (invalid) default instance
48 }
49
50 l_rodCrate = l_rodCrate-1;
51
52 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 +
53 l_rosId * s_rosId + l_rodFragId * s_rodFragId + l_rodCrate * s_rodCrate + l_rodSlot * s_rodSlot ;
54 HWIdentifier l_id(id_int) ;
55 return l_id ;
56}
#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 159 of file LArReadoutModuleService.cxx.

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

◆ pos_neg()

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

return side
positive side : 1
negative side : 0

Definition at line 155 of file LArReadoutModuleService.cxx.

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

◆ robFragId()

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

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

Definition at line 200 of file LArReadoutModuleService.cxx.

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

◆ rodCrate()

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

return ROD crate number

Definition at line 216 of file LArReadoutModuleService.cxx.

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

◆ rodFragId()

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

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

Definition at line 212 of file LArReadoutModuleService.cxx.

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

◆ rodSlot()

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

return ROD slot number

Definition at line 221 of file LArReadoutModuleService.cxx.

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

◆ rol()

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

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

Definition at line 204 of file LArReadoutModuleService.cxx.

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

◆ rosId()

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

return ROS identifier

Definition at line 208 of file LArReadoutModuleService.cxx.

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

◆ subDet()

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

return sub-detector identifier

Definition at line 163 of file LArReadoutModuleService.cxx.

163 {
164 int value=0 ;
165 int l_barrel_ec = ( ( ( (int) l_id.get_identifier32().get_compact() ) & 2 ) ) >> 1 ;
166 int l_pos_neg = ( ( ( (int) l_id.get_identifier32().get_compact() ) & 4 ) ) >> 2 ;
167 int l_emhf = ( ( ( (int) l_id.get_identifier32().get_compact() ) & 0x18 ) ) >> 3 ;
168 if(l_barrel_ec == 0) {
169 if(l_pos_neg == 1) {
171 } else {
173 }
174 }
175 else if(l_emhf == 0) {
176 if(l_pos_neg == 1) {
178 } else {
180 }
181 }
182 else if(l_emhf == 1) {
183 if(l_pos_neg == 1) {
185 } else {
187 }
188 }
189 else if(l_emhf == 2) {
190 if(l_pos_neg == 1) {
192 } else {
194 }
195 }
196
197 return value ;
198}

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: