61{
62 SmartIF<StoreGateSvc>
detStore{Gaudi::svcLocator()->service(
"DetectorStore")};
64 throw std::runtime_error("Error in LArDetectorFactory, cannot access DetectorStore");
65 }
66
67 StoredMaterialManager* materialManager = nullptr;
68 if (StatusCode::SUCCESS !=
detStore->retrieve(materialManager, std::string(
"MATERIALS"))) {
69 throw std::runtime_error("Error in BarrelPresamplerConstruction, stored MaterialManager is not found.");
70 }
71
72 const GeoMaterial *Copper = materialManager->
getMaterial(
"std::Copper");
73 if (!Copper) throw std::runtime_error("Error in BarrelPresamplerConstruction, std::Copper is not found.");
74
75 const GeoMaterial *Iron = materialManager->
getMaterial(
"std::Iron");
76 if (!Iron) throw std::runtime_error("Error in BarrelPresamplerConstruction, std::Iron is not found.");
77
78 const GeoMaterial *Lead = materialManager->
getMaterial(
"std::Lead");
79 if (!Lead) throw std::runtime_error("Error in BarrelPresamplerConstruction, std::Lead is not found.");
80
81 const GeoMaterial *LAr = materialManager->
getMaterial(
"std::LiquidArgon");
82 if (!LAr) throw std::runtime_error("Error in BarrelPresamplerConstruction, std::LiquidArgon is not found.");
83
84 const GeoMaterial *Air = materialManager->
getMaterial(
"std::Air");
85 if (!Air) throw std::runtime_error("Error in BarrelPresamplerConstruction, std::Air is not found.");
86
87 const GeoMaterial *Kapton = materialManager->
getMaterial(
"std::Kapton");
88 if (!Kapton) throw std::runtime_error("Error in BarrelPresamplerConstruction, std::Kapton is not found.");
89 const GeoMaterial *Glue = materialManager->
getMaterial(
"LAr::Glue");
90 if (!Glue) throw std::runtime_error("Error in BarrelPresamplerConstruction, LAr::Glue is not found.");
91
92 const GeoMaterial *G10 = materialManager->
getMaterial(
"LAr::G10");
93 if (!G10) throw std::runtime_error("Error in BarrelPresamplerConstruction, LAr::G10 is not found.");
94
95 const GeoMaterial *FR4 = materialManager->
getMaterial(
"LAr::FR4");
96 if (!FR4) throw std::runtime_error("Error in BarrelPresamplerConstruction, LAr::FR4 is not found.");
97
98 const GeoMaterial *MBMat = materialManager->
getMaterial(
"LAr::MBMat");
99 if (!MBMat) throw std::runtime_error("Error in BarrelPresamplerConstruction, LAr::MBMat is not found.");
100
101 const GeoMaterial *AnodeMat = materialManager->
getMaterial(
"LAr::AnodeMat");
102 if (!AnodeMat) throw std::runtime_error("Error in BarrelPresamplerConstruction, LAr::AnodeMat is not found.");
103
104 const GeoMaterial *CathodeMat = materialManager->
getMaterial(
"LAr::CathodeMat");
105 if (!CathodeMat) throw std::runtime_error("Error in BarrelPresamplerConstruction, LAr::CathodeMat is not found.");
106
107 const GeoMaterial *ConnecMat = materialManager->
getMaterial(
"LAr::ConnecMat");
108 if (!ConnecMat) throw std::runtime_error("Error in BarrelPresamplerConstruction, LAr::ConnecMat is not found.");
109
110 double rMinPresamplerMother =1410*Gaudi::Units::mm;
111 double rMaxPresamplerMother =1447*Gaudi::Units::mm-0.001*Gaudi::Units::mm;
112 double presamplerMother_length=1549*Gaudi::Units::mm;
113 double Phi_min=0.*Gaudi::Units::deg;
114 double Phi_span=360.*Gaudi::Units::deg;
115 int nbsectors=32;
116
117 if (itb==1) {
118 Phi_min=-0.5*Gaudi::Units::deg;
119 Phi_span=23.5*Gaudi::Units::deg;
120 nbsectors=2;
121 }
122
124
131
138
145
152
159
166
173
180
181
182 std::string
basename =
"LAr::Barrel::Presampler";
183 {
184 GeoTubs *tubs = new GeoTubs(rMinPresamplerMother, rMaxPresamplerMother, presamplerMother_length,Phi_min, Phi_span);
185 GeoLogVol* logVol =
new GeoLogVol(
basename,tubs,LAr);
188 }
189
190
192
193 double epsil = 0.007*Gaudi::Units::mm;
194
195
196 double cmm = (1-0.0026)*Gaudi::Units::mm;
197
198 double mod_leng[8];
199 for(int ii=0; ii<8; ii++ ) mod_leng[ii]=mod[ii][0]*cmm+2*epsil;
200
201 double mod_heig[8];
202 double larheight = 13*Gaudi::Units::mm;
203
204 double prep1_th = 1.*Gaudi::Units::mm;
205 double prep2_th = 4.5*Gaudi::Units::mm;
206 double smallLength = 275.6*Gaudi::Units::mm;
207 double bigLength = 277.5;
208 double prep1_height = (smallLength/2+1.)*cmm;
209 double larheight2 = larheight*
cos(-mod[1][3]*Gaudi::Units::deg)*Gaudi::Units::mm;
210 mod_heig[0]= (larheight+prep1_th+prep2_th)*cmm+4*epsil;
211 mod_heig[1]= (larheight2+prep1_th+prep2_th)*cmm+5.*epsil;
212 for(
int i=2;
i<8;
i++ ) mod_heig[i] = mod_heig[0];
213
214 double shell_th = 0.4*Gaudi::Units::mm;
215 double rail_th = 8.6*Gaudi::Units::mm;
216 double mech_clear = 0.5*Gaudi::Units::mm;
217
218
219 double mb_length = 3100.3;
220 double sector_length = mb_length*cmm +9.*epsil;
221 double sector_height = mod_heig[0]+(shell_th+rail_th)*cmm+mech_clear*Gaudi::Units::mm+3*epsil;
222
223 unsigned int nsectors=32;
224 double mod_xm = prep1_height+epsil;
225 double mod_xp = (bigLength/2+1.+prep2_th*
tan((360./(2*nsectors))*Gaudi::Units::deg))*cmm;
226 double sect_xm = mod_xm+epsil;
227 double sect_xp = sect_xm+sector_height*
tan((360./(2*nsectors))*Gaudi::Units::deg);
228 double rpres = 1426.*Gaudi::Units::mm;
229
230 double zpres = -presamplerMother_length+sector_length/2+epsil;
231
232 GeoTrd *trd = new GeoTrd(sect_xm, sect_xp, sector_length/2, sector_length/2, sector_height/2);
233
234 GeoLogVol *logVol =
new GeoLogVol (
basename+
"::Sector",trd,LAr);
235 GeoPhysVol *sectorPhysVol = new GeoPhysVol(logVol);
236
237 GeoGenfun::Variable
I;
238 double dphiSector = (360.*Gaudi::Units::deg)/nsectors;
239 GeoGenfun::GENFUNCTION
f = dphiSector*
I+0.5*dphiSector;
240 GeoXF::TRANSFUNCTION
t = GeoXF::Pow(GeoTrf::RotateZ3D(1.0),f)*GeoTrf::TranslateX3D(rpres)*GeoTrf::TranslateZ3D(zpres)*GeoTrf::RotateZ3D(90*Gaudi::Units::deg)*GeoTrf::RotateX3D(90*Gaudi::Units::deg);
241 GeoSerialTransformer *
st =
new GeoSerialTransformer(sectorPhysVol,&t, nbsectors);
242
245
246
247
248
249
250
251
252
253
254
255 double delta01 = 0.5*larheight*
tan(-mod[1][3]*Gaudi::Units::deg);
256 mod_leng[0]=mod_leng[0]-delta01;
257 mod_leng[1]=mod_leng[1]+delta01;
258 GeoIntrusivePtr<GeoPhysVol> pvModule[8];
259 {
260
261 double modYPrev=0, modLenPrev=0;
262 for (
int m=0;
m<8;
m++) {
263
264
265 double modLen=mod_leng[
m];
266
267
268 double modY= (
m==0) ? -sector_length/2+modLen/2+epsil : modYPrev + modLenPrev /2 + modLen/2 +epsil;
269 double modZ= (
m==1) ? -sector_height/2+shell_th*cmm+mech_clear+mod_heig[0]/2+epsil+(mod_heig[0]-mod_heig[1])/2 : -sector_height/2+shell_th*cmm+mech_clear+mod_heig[0]/2+epsil;
270
271 GeoTrd * trd = new GeoTrd(mod_xm,mod_xp,modLen/2,modLen/2,mod_heig[m]/2);
272 GeoLogVol *logVol =
new GeoLogVol(
basename+
"::Module",trd,LAr);
273 pvModule[
m] =
new GeoPhysVol(logVol);
274
275 GeoTransform *xf = new GeoTransform(GeoTrf::Translate3D(0.0, modY, modZ));
276 sectorPhysVol->add(xf);
277 sectorPhysVol->add(pvModule[m]);
278
279 modYPrev=modY;
280 modLenPrev=modLen;
281
282 }
283 }
284
286 double prot_y = (shell_leng/2)*cmm;
287 double glX = 0.*Gaudi::Units::mm;
288 double glY = -sector_length/2+prot_y+epsil;
289
290
291 {
292 GeoBox *box = new GeoBox((smallLength/2+1.)*cmm, (shell_leng/2)*cmm,(shell_th/2)*cmm);
293 GeoLogVol *logVol=
new GeoLogVol(
basename+
"::ProtectionShell",box,FR4);
294 GeoIntrusivePtr<GeoPhysVol>physVol = new GeoPhysVol(logVol);
295
296 double glZ = -sector_height/2+(shell_th/2)*cmm+epsil;
297
298 GeoTransform *xf = new GeoTransform(GeoTrf::Translate3D(glX,glY, glZ));
299 sectorPhysVol->add(xf);
300 sectorPhysVol->add(physVol);
301 }
302
303 double mb_th = 2.2;
304 double rail_pos = 22.;
305 double rail_width = 24.;
306 double prot_th = 0.5;
307 double widthFront = 2.8;
308 double mb_width = 169.;
309 double heightIn = 1.5;
310 double heightOut = 5.;
311
312 double modz[8], mody[8];
313 mody[0] = -sector_length/2+mod_leng[0]/2+epsil;
314 modz[0] = -sector_height/2+shell_th*cmm+mech_clear+mod_heig[0]/2+epsil;
315 modz[1] = modz[0]+(mod_heig[0]-mod_heig[1])/2;
316 for(
int i=1;
i<8;
i++)
317 mody[i] = mody[i-1]+mod_leng[i-1]/2+mod_leng[i]/2+epsil;
318
319 for(
int i=2;
i<8;
i++) modz[i]= modz[0];
320
321 double mbZ = modz[0]+mod_heig[0]/2+(mb_th/2)*cmm+epsil;
322
323
324 {
325 GeoBox* MB = new GeoBox((mb_width/2)*cmm,(mb_length/2)*cmm,(mb_th/2)*cmm);
326 GeoLogVol *logVol=
new GeoLogVol(
basename+
"::MotherBoard",MB,MBMat);
327 GeoIntrusivePtr<GeoPhysVol>physVol = new GeoPhysVol(logVol);
328
329 GeoTransform* xf = new GeoTransform(GeoTrf::TranslateZ3D(mbZ));
330 sectorPhysVol->add(xf);
331 sectorPhysVol->add(physVol);
332 }
333
334
335 {
336 double prot_x = (bigLength/2+1.-rail_pos-rail_width+epsil)*cmm;
337 double prot_y = (shell_leng/2)*cmm;
338 double prot_z = (prot_th/2)*cmm;
339
340 GeoBox* plate = new GeoBox(prot_x,prot_y,prot_z);
341 GeoLogVol *logVol=
new GeoLogVol(
basename+
"::ProtectionPlate",plate,FR4);
342 GeoIntrusivePtr<GeoPhysVol>physVol = new GeoPhysVol(logVol);
343
344 GeoTransform* xf = new GeoTransform(GeoTrf::Translate3D(glX,glY,mbZ+(mb_th/2+heightOut+prot_th/2)*cmm+2*epsil));
345 sectorPhysVol->add(xf);
346 sectorPhysVol->add(physVol);
347 }
348
349
350 {
351 double conn_xm = (widthFront/2)*cmm;
352 double conn_xp = (mb_width/2)*cmm;
353 double conn_ym= (heightIn/2)*cmm;
354 double conn_yp =(heightOut/2)*cmm;
355 double conn_leng = (mb_length/2)*cmm;
356
357 GeoTrd* connectics = new GeoTrd(conn_xm,conn_xp,conn_ym,conn_yp,conn_leng);
358 GeoLogVol *logVol=
new GeoLogVol(
basename+
"::Connectics",connectics,ConnecMat);
359 GeoIntrusivePtr<GeoPhysVol>physVol = new GeoPhysVol(logVol);
360
361 double connZ = mbZ+(mb_th/2+heightOut/2)*cmm+epsil;
362 GeoTransform* xf1 = new GeoTransform(GeoTrf::TranslateZ3D(connZ));
363 GeoTransform* xf2 = new GeoTransform(GeoTrf::RotateX3D(-90*Gaudi::Units::deg));
364
365 sectorPhysVol->add(xf1);
366 sectorPhysVol->add(xf2);
367 sectorPhysVol->add(physVol);
368 }
369
370
371 {
372 GeoBox* rail = new GeoBox((rail_width/2)*cmm,(shell_leng/2)*cmm,(rail_th/2)*cmm);
373 GeoLogVol *logVol=
new GeoLogVol(
basename+
"::Rail",rail,FR4);
374 GeoIntrusivePtr<GeoPhysVol>physVol = new GeoPhysVol(logVol);
375
376 double railX = (bigLength/2+1-rail_pos-rail_width/2)*cmm+epsil;
377 double railZ = modz[0]+mod_heig[0]/2+(rail_th/2)*cmm+epsil;
378
379 GeoTransform* xf1 = new GeoTransform(GeoTrf::Translate3D(railX,glY,railZ));
380 GeoTransform* xf2 = new GeoTransform(GeoTrf::Translate3D(-railX,glY,railZ));
381
382 sectorPhysVol->add(xf1);
383 sectorPhysVol->add(physVol);
384
385 sectorPhysVol->add(xf2);
386 sectorPhysVol->add(physVol);
387 }
388
389
390
391
392
393
394 double anode_th = 0.330;
395 double cathode_th = 0.270;
396
397 double heig_elec1 = (larheight/
cos(-mod[0][3]*Gaudi::Units::deg)-0.5*anode_th/
cos(mod[0][3]*Gaudi::Units::deg))*cmm;
398 double heig_elec3 = (larheight-0.5*cathode_th/
cos(mod[1][3]*Gaudi::Units::deg))*cmm;
399
400 GeoTrd* catho1 = new GeoTrd(smallLength/2*cmm,bigLength/2*cmm,cathode_th/2*cmm,cathode_th/2*cmm,heig_elec1/2*cmm);
401 GeoLogVol* LV_catho1 =
new GeoLogVol(
basename+
"::Cathode1",catho1,CathodeMat);
402 GeoIntrusivePtr<GeoPhysVol>PV_catho1 = new GeoPhysVol(LV_catho1);
403
404 GeoTrd* catho3 = new GeoTrd(smallLength/2 *cmm,bigLength/2 *cmm,cathode_th/2 *cmm,cathode_th/2 *cmm,heig_elec3/2);
405 GeoLogVol* LV_catho3 =
new GeoLogVol(
basename+
"::Cathode3",catho3,CathodeMat);
406 GeoIntrusivePtr<GeoPhysVol>PV_catho3 = new GeoPhysVol(LV_catho3);
407
408 GeoTrd* ano1 = new GeoTrd(smallLength/2 *cmm,bigLength/2 *cmm,anode_th/2 *cmm,anode_th/2 *cmm,heig_elec1/2);
409 GeoLogVol* LV_ano1 =
new GeoLogVol(
basename+
"::Anode1",ano1,AnodeMat);
410 GeoIntrusivePtr<GeoPhysVol>PV_ano1 = new GeoPhysVol(LV_ano1);
411
412 GeoTrd* ano3 = new GeoTrd(smallLength/2 *cmm,bigLength/2 *cmm,anode_th/2 *cmm,anode_th/2 *cmm,heig_elec3/2);
413 GeoLogVol* LV_ano3 =
new GeoLogVol(
basename+
"::Anode3",ano3,AnodeMat);
414 GeoIntrusivePtr<GeoPhysVol>PV_ano3 = new GeoPhysVol(LV_ano3);
415
416
417 double prep2_height = (bigLength/2+1.)*cmm;
418 double prep1_z = (prep1_th/2)*cmm;
419 double prep2_z = (prep2_th/2)*cmm;
420 double prep_length[8];
421 for(
int i=0;
i<8;
i++ ) prep_length[i] = mod_leng[i]-2.*epsil;
422
423 std::array<GeoIntrusivePtr<GeoPhysVol>,8> PV_Prep1{}, PV_Prep2{};
424
425 for(
int i=0;
i<8;
i++ )
426 {
427 GeoBox* box1 = new GeoBox(prep1_height,prep_length[i]/2,prep1_z);
428 GeoLogVol* logVol1 =
new GeoLogVol(
basename+
"::Prep1",box1,FR4);
429 PV_Prep1[
i] =
new GeoPhysVol(logVol1);
430
431 GeoBox* box2 = new GeoBox(prep2_height,prep_length[i]/2,prep2_z);
432 GeoLogVol* logVol2 =
new GeoLogVol(
basename+
"::Prep2",box2,FR4);
433 PV_Prep2[
i] =
new GeoPhysVol(logVol2);
434 }
435
436
437 std::array<double, 8> prep1_pos{};
438 std::array<double, 8> prep2_pos{};
439 double elec_trans = -2*prep2_z+mod_heig[0]/2-(larheight/2)*cmm-3*epsil;
440 for(
int i=0;
i<8;
i++ )
441 {
442 prep1_pos[
i] = prep1_z-mod_heig[
i]/2+epsil;
443 prep2_pos[
i] = -prep2_z+mod_heig[
i]/2-epsil;
444 }
445
446 double YStartA[8],YStartC[8];
447
448 for(
int i=0;
i<8;
i++ )
449 {
450 YStartC[
i] = -mod_leng[
i]/2+(
mod[
i][5]+cathode_th/2)*cmm;
451 YStartA[
i] = YStartC[
i]+(
mod[
i][4]/2)*cmm;
452 }
453
454
455
456 YStartC[1] += delta01;
457 YStartA[1] += delta01;
458
459 for(
int i=0;
i<8;
i++)
460 {
461 GeoTransform* xfPrep1 = new GeoTransform(GeoTrf::TranslateZ3D(prep1_pos[i]));
462 GeoTransform* xfPrep2 = new GeoTransform(GeoTrf::TranslateZ3D(prep2_pos[i]));
463
464 pvModule[
i]->add(xfPrep1);
465 pvModule[
i]->add(PV_Prep1[i]);
466 pvModule[
i]->add(xfPrep2);
467 pvModule[
i]->add(PV_Prep2[i]);
468
469
470
471
472 GeoGenfun::Variable
I;
473 GeoGenfun::GENFUNCTION cathoGF = YStartC[
i]+
I*
mod[
i][4]*cmm;
474 GeoGenfun::GENFUNCTION anoGF = YStartA[
i]+
I*
mod[
i][4]*cmm;
475
476 GeoXF::TRANSFUNCTION cathoTF = GeoXF::Pow(GeoTrf::TranslateY3D(1.),cathoGF)*GeoTrf::TranslateZ3D(elec_trans)*GeoTrf::RotateX3D(-mod[i][3]*Gaudi::Units::deg);
477 GeoXF::TRANSFUNCTION anoTF = GeoXF::Pow(GeoTrf::TranslateY3D(1.),anoGF)*GeoTrf::TranslateZ3D(elec_trans)*GeoTrf::RotateX3D(-mod[i][3]*Gaudi::Units::deg);
478
479
480 GeoSerialTransformer *cathoST,*anoST;
481 if(i==0)
482 {
483 cathoST = new GeoSerialTransformer(PV_catho1,&cathoTF,static_cast<unsigned int>(mod[i][2]));
484 anoST = new GeoSerialTransformer(PV_ano1,&anoTF,static_cast<unsigned int>(mod[i][1]));
485 }
486 else
487 {
488 cathoST = new GeoSerialTransformer(PV_catho3,&cathoTF,static_cast<unsigned int>(mod[i][2]));
489 anoST = new GeoSerialTransformer(PV_ano3,&anoTF,static_cast<unsigned int>(mod[i][1]));
490 }
491
492 pvModule[
i]->add(cathoST);
493 pvModule[
i]->add(anoST);
494 }
495
496 }
497
498}
GeoIntrusivePtr< GeoFullPhysVol > m_psPhysicalNeg
const LArGeo::VDetectorParameters * m_parameters
GeoIntrusivePtr< GeoFullPhysVol > m_psPhysicalPos
virtual const GeoMaterial * getMaterial(const std::string &name)=0
std::string basename(std::string name)