42{
43 MsgStream
log(msgSvc,
"buildLArReadoutGeometry");
44
49
50 {
52 std::string fcalModName[2][3]={{"FCAL1_NEG","FCAL2_NEG","FCAL3_NEG"},
53 {"FCAL1_POS","FCAL2_POS","FCAL3_POS"}};
54 for (
int e=0;
e<2;
e++) {
55 for (
int m=0;
m<3;
m++) {
58 if (
detStore->retrieve(vol,fcalModName[e][m])==StatusCode::SUCCESS) {
61 }
62 }
63 else {
64 log << MSG::DEBUG <<
" No Stored PV for " << fcalModName[
e][
m] <<
" in Detector Store" <<
endmsg;
65 }
66 }
67 }
68 }
69
70 {
72 for (
unsigned int s=0;
s<4;
s++) {
73 for (
unsigned int r=0;
r<2;
r++) {
74 unsigned int nPhi =
r==0? 2:1;
75 for (unsigned int endcap=0;endcap<2;endcap++) {
77 std::string nameTag= endcap==0 ? (
s<2 ?
"HEC1_NEG":
"HEC2_NEG") : (
s<2 ?
"HEC1_POS":
"HEC2_POS");
79 if (StatusCode::SUCCESS==detStore->retrieve(vol, nameTag)) {
80 unsigned int width = 32;
81 double startPhi = endcap==0? M_PI : 0;
82 double endPhi = endcap==0? -M_PI : 2*M_PI ;
83
84 CellBinning phiBinning(startPhi, endPhi, width*nPhi);
85 HECDetDescr *d = new HECDetDescr(hecDetectorManager,s,r,phiBinning);
86
87 HECDetectorRegion::DetectorSide side = (HECDetectorRegion::DetectorSide) endcap;
88 HECDetectorRegion *region = new HECDetectorRegion(vol->getPhysVol(),d,side,projectivityDisplacement);
89 hecDetectorManager->addDetectorRegion(region);
90 }
91 }
92 else
93 log << MSG::DEBUG <<
" No Stored PV for " << nameTag
94 <<
" in Detector Store" <<
endmsg;
95 }
96 }
97 }
98 }
99
100 {
104
105
106
107 for (
int e=0;
e<2;
e++) {
108
111
112
114
116 if (
detStore->retrieve(sPhys,e==0 ?
"EMEC_OUTER_WHEEL_NEG" :
"EMEC_OUTER_WHEEL_POS")==StatusCode::SUCCESS) {
117 GeoIntrusivePtr<GeoFullPhysVol>emecEnvelope=(GeoIntrusivePtr<GeoFullPhysVol>) sPhys->
getPhysVol();
118
119 {
120 CellBinning phiBinning(startPhi,endPhi,64);
124 }
125
126
127 {
128 CellBinning phiBinning(startPhi,endPhi,64);
132 }
133
134 {
135 CellBinning phiBinning(startPhi,endPhi,64);
139 }
140
141 {
142 CellBinning phiBinning(startPhi,endPhi,64);
146 }
147
148 {
149 CellBinning phiBinning(startPhi,endPhi,64);
153 }
154
155 {
156 CellBinning phiBinning(startPhi,endPhi,64);
160 }
161
162 {
163 CellBinning phiBinning(startPhi,endPhi,256);
167 }
168
169 {
170 CellBinning phiBinning(startPhi,endPhi,256);
174 }
175
176 {
177 CellBinning phiBinning(startPhi,endPhi,256);
181 }
182 }
183 }
184 else {
185 log << MSG::DEBUG <<
" No Stored PV for " << (
e==0 ?
"EMEC_OUTER_WHEEL_NEG" :
"EMEC_OUTER_WHEEL_POS")
186 <<
" in Detector Store" <<
endmsg;
187 }
188
190 if (
detStore->retrieve(sPhys,e==0 ?
"EMEC_INNER_WHEEL_NEG" :
"EMEC_INNER_WHEEL_POS")==StatusCode::SUCCESS) {
191
192 GeoIntrusivePtr<GeoFullPhysVol>emecEnvelope=(GeoIntrusivePtr<GeoFullPhysVol>) sPhys->
getPhysVol();
193
194
195 {
196 CellBinning phiBinning(startPhi,endPhi,64);
200 }
201
202
203 {
204 CellBinning phiBinning(startPhi,endPhi,64);
208 }
209
210 }
211 }
212 else {
213 log << MSG::DEBUG <<
" No Stored PV for " << (
e==0 ?
"EMEC_INNER_WHEEL_NEG" :
"EMEC_INNER_WHEEL_POS")
214 <<
" in Detector Store" <<
endmsg;
215 }
216
218
220 if (StatusCode::SUCCESS==
detStore->retrieve(sPresamplerEnvelope, e==0 ?
"PRESAMPLER_EC_NEG":
"PRESAMPLER_EC_POS" )) {
221 GeoIntrusivePtr<GeoFullPhysVol> PresamplerEnvelope=sPresamplerEnvelope->
getPhysVol();
222 CellBinning presamplerPhiBinning(startPhi,endPhi,64);
226 }
227 }
228 else {
229 log << MSG::DEBUG <<
" No Stored PV for " << (
e==0 ?
"PRESAMPLER_EC_NEG":
"PRESAMPLER_EC_POS")
230 <<
" in Detector Store" <<
endmsg;
231 }
232 }
233 }
234
235 {
237 int firstEndcap= testbeam==0 ? 0:1;
238 int endEndcap=2;
239
240 for (
int e= firstEndcap ;
e<endEndcap;
e++) {
241
244 int NDIV = 1;
245 if (testbeam==1) {
247 endPhi =22.5*
M_PI/180;
248 NDIV=16;
249 }
250
251
252 {
255 if (
detStore->retrieve(sPhys,e==0 ?
"EMB_NEG" :
"EMB_POS")==StatusCode::SUCCESS) {
256 CellBinning phiBinning(startPhi,endPhi,256/NDIV);
258 GeoIntrusivePtr<GeoFullPhysVol>embEnvelope=(GeoIntrusivePtr<GeoFullPhysVol>) sPhys->
getPhysVol();
261 }
262 }
263 else {
264 log << MSG::DEBUG <<
" No Stored PV for " << (
e==0 ?
"EMB_NEG" :
"EMB_POS" )<<
" in Detector Store" <<
endmsg;
265 }
266 }
267
268 {
271 if (
detStore->retrieve(sPhys,e==0 ?
"EMB_NEG" :
"EMB_POS")==StatusCode::SUCCESS) {
272 CellBinning phiBinning(startPhi,endPhi,256/NDIV);
274 GeoIntrusivePtr<GeoFullPhysVol>embEnvelope=(GeoIntrusivePtr<GeoFullPhysVol>) sPhys->
getPhysVol();
277 }
278 }
279 else {
280 log << MSG::DEBUG <<
" No Stored PV for " << (
e==0 ?
"EMB_NEG" :
"EMB_POS" )<<
" in Detector Store" <<
endmsg;
281 }
282 }
283
284 {
287 if (
detStore->retrieve(sPhys,e==0 ?
"EMB_NEG" :
"EMB_POS")==StatusCode::SUCCESS) {
288 CellBinning phiBinning(startPhi,endPhi,256/NDIV);
290 GeoIntrusivePtr<GeoFullPhysVol>embEnvelope=(GeoIntrusivePtr<GeoFullPhysVol>) sPhys->
getPhysVol();
293 }
294 }
295 else {
296 log << MSG::DEBUG <<
" No Stored PV for " << (
e==0 ?
"EMB_NEG" :
"EMB_POS") <<
" in Detector Store" <<
endmsg;
297 }
298 }
299
300 {
303 if (
detStore->retrieve(sPhys,e==0 ?
"EMB_NEG" :
"EMB_POS")==StatusCode::SUCCESS) {
304 CellBinning phiBinning(startPhi,endPhi,64/NDIV);
306 GeoIntrusivePtr<GeoFullPhysVol>embEnvelope=(GeoIntrusivePtr<GeoFullPhysVol>) sPhys->
getPhysVol();
309 }
310 }
311 else {
312 log << MSG::DEBUG <<
" No Stored PV for " << (
e==0 ?
"EMB_NEG" :
"EMB_POS") <<
" in Detector Store" <<
endmsg;
313 }
314 }
315
316 {
319 if (
detStore->retrieve(sPhys,e==0 ?
"EMB_NEG" :
"EMB_POS")==StatusCode::SUCCESS) {
320 CellBinning phiBinning(startPhi,endPhi,256/NDIV);
322 GeoIntrusivePtr<GeoFullPhysVol>embEnvelope=(GeoIntrusivePtr<GeoFullPhysVol>) sPhys->
getPhysVol();
325 }
326 }
327 else {
328 log << MSG::DEBUG <<
" No Stored PV for " << (
e==0 ?
"EMB_NEG" :
"EMB_POS") <<
" in Detector Store" <<
endmsg;
329 }
330 }
331
332 {
335 if (
detStore->retrieve(sPhys,e==0 ?
"EMB_NEG" :
"EMB_POS")==StatusCode::SUCCESS) {
336 CellBinning phiBinning(startPhi,endPhi,64/NDIV);
338 GeoIntrusivePtr<GeoFullPhysVol>embEnvelope=(GeoIntrusivePtr<GeoFullPhysVol>) sPhys->
getPhysVol();
341 }
342 }
343 else {
344 log << MSG::DEBUG <<
" No Stored PV for " << (
e==0 ?
"EMB_NEG" :
"EMB_POS") <<
" in Detector Store" <<
endmsg;
345 }
346 }
347 }
348 }
349
350 bool allOk{true};
351 StatusCode
sc =
detStore->record(embDetectorManager, embDetectorManager->getName());
353 log << MSG::ERROR <<
"Unable to record embDetectorManager" <<
endmsg;
354 allOk = false;
355 }
356
357 sc =
detStore->record(emecDetectorManager, emecDetectorManager->getName());
359 log << MSG::ERROR <<
"Unable to record emecDetectorManager" <<
endmsg;
360 allOk = false;
361 }
362
363 sc =
detStore->record(hecDetectorManager, hecDetectorManager->getName());
365 log << MSG::ERROR <<
"Unable to record hecDetectorManager" <<
endmsg;
366 allOk = false;
367 }
368
369 sc =
detStore->record(fcalDetectorManager, fcalDetectorManager->getName());
371 log << MSG::ERROR <<
"Unable to record fcalDetectorManager" <<
endmsg;
372 allOk = false;
373 }
374
375 if(!allOk) {
376 delete embDetectorManager;
377 delete emecDetectorManager;
378 delete hecDetectorManager;
379 delete fcalDetectorManager;
380
381 embDetectorManager=nullptr;
382 emecDetectorManager=nullptr;
383 hecDetectorManager=nullptr;
384 fcalDetectorManager=nullptr;
385 }
386
387 return std::make_tuple(embDetectorManager,emecDetectorManager,hecDetectorManager,fcalDetectorManager);
388}
Descriptor for regions of the electromagnetic barrel calorimeter.
A manager class providing access to readout geometry information for the electromagnetic barrel calor...
void addDetectorRegion(const EMBDetectorRegion *region)
Add a new Detector Region.
Descriptor for regions of the electromagnetic endcap calorimeter.
A manager class providing access to readout geometry information for the electromagnetic endcap calor...
void addDetectorRegion(const EMECDetectorRegion *region)
Add a new HEC Detector Region.
A manager class providing access to readout geometry information for the forward calorimeter.
void addModule(FCALModule *fcalModule)
Adds an FCAL Module.
A manager class providing access to readout geometry information for the hadronic endcap calorimeter.
const HECHVManager & getHECHVManager() const
const EMECHVManager & getEMECHVManager(IOType IO) const
const EMECPresamplerHVManager & getEMECPresamplerHVManager() const
const FCALHVManager & getFCALHVManager() const
const EMBHVManager & getEMBHVManager() const
const EMBPresamplerHVManager & getEMBPresamplerHVManager() const
GeoFullPhysVol * getPhysVol()
Destructor.
constexpr int nPhi
Default bin number of phi for vertex map.