84 (*m_log) << MSG::DEBUG <<
" TileGeoSectionBuilder::fillSection ModuleNcp= "<<ModuleNcp<<
endmsg;
86 double tan_delta_phi_2 = std::tan(delta_phi/2*Gaudi::Units::deg);
94 const GeoMaterial* matAluminium{
nullptr};
99 double dX1 =0., dX2 =0., dY1 =0., dY2 =0., dZ1 =0., dZ2 =0.;
100 std::string volname =
"";
103 float PosXcut =0., PosYcut =0., PosY =0., Rmore =0.;
104 float Radius =0., YcorA =0., YcorB =0., lenPla =0., Blia =0.;
107 float phi = (double(ModuleNcp-1) + 0.5)*delta_phi;
111 if (ModuleNcp>=35 && ModuleNcp<=37) SideFl = -1;
113 GeoTrf::Transform3D TransCut2(GeoTrf::Transform3D::Identity());
114 GeoTrf::Transform3D TransCutL(GeoTrf::Transform3D::Identity());
115 GeoTrf::Transform3D TransCutR(GeoTrf::Transform3D::Identity());
117 GeoIntrusivePtr<const GeoShapeUnion> CutA{
nullptr};
118 GeoIntrusivePtr<GeoShape> CutB{
nullptr};
121 if (sec_number==2 &&
m_dbManager->BoolCuts() && ((ModuleNcp>=35 && ModuleNcp<=37) || (ModuleNcp>=60 && ModuleNcp<=62))) {
122 volname =
"CutB";
m_dbManager->SetCurrentCuts(volname);
125 Rmore = 0.8*Gaudi::Units::cm;
134 checking(
"CutB1",
false, 1, dX1,dX2,dY1,dY2,dZ1);
135 GeoTrd* CutB1 =
new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
140 volname =
"Cut1up";
m_dbManager->SetCurrentCuts(volname);
149 checking(
"Cut1up",
false, 1, dX1,dX2,dY1,dY2,dZ1);
150 GeoTrd* Cut1up =
new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
152 volname =
"Cut2down";
m_dbManager->SetCurrentCuts(volname);
159 checking(
"Cut2down",
false, 1, dX1,dX2,dY1,dY2,dZ2);
160 GeoTrd* Cut1down =
new GeoTrd(dX1,dX2,dY1,dY2,dZ2);
162 GeoTrf::Translate3D yPosA(0.,0.,-dZ1-dZ2);
164 const GeoShapeUnion& CutA1 = Cut1up->add(*Cut1down<<yPosA);
169 if (ModuleNcp==35||ModuleNcp==62) { YcorA = 5*Gaudi::Units::cm; YcorB = 5*Gaudi::Units::cm; lenPla =0.8*Gaudi::Units::cm, Blia = 17.4*Gaudi::Units::cm;}
170 if (ModuleNcp==36||ModuleNcp==61) { YcorA = 6.5*Gaudi::Units::cm; YcorB = 6*Gaudi::Units::cm; lenPla =1.7*Gaudi::Units::cm; Blia = 16.9*Gaudi::Units::cm;}
171 if (ModuleNcp==37||ModuleNcp==60) { YcorA = 8*Gaudi::Units::cm; YcorB = 9*Gaudi::Units::cm; lenPla =2.8*Gaudi::Units::cm; Blia = 16.4*Gaudi::Units::cm;}
173 TransCut2 = GeoTrf::TranslateZ3D(-Radius)
174 * GeoTrf::RotateX3D((90-
phi)*Gaudi::Units::deg) * GeoTrf::RotateY3D(180*Gaudi::Units::deg)
175 * GeoTrf::Translate3D(0.1*Gaudi::Units::cm,SideFl*17.5*Gaudi::Units::cm,-PosY+YcorA);
180 GeoTrf::Vector3D ptTmp = TransCut2*GeoTrf::Vector3D(0.,0.,0.);
181 TransCut2 = GeoTrf::TranslateX3D(2*ptTmp.x())*GeoTrf::RotateZ3D(180*Gaudi::Units::deg)*TransCut2;
184 if (ModuleNcp>=60 && ModuleNcp<=62) {
185 TransCutL = GeoTrf::TranslateZ3D(-Radius)
186 * GeoTrf::RotateY3D(180*Gaudi::Units::deg) * GeoTrf::RotateX3D(
phi*Gaudi::Units::deg)
187 * GeoTrf::Translate3D(-1.4*Gaudi::Units::cm,PosYcut+YcorB,-PosXcut-Blia);
191 GeoTrf::Vector3D ptTmp = TransCutL*GeoTrf::Vector3D(0.,0.,0.);
192 TransCutL = GeoTrf::TranslateX3D(2*ptTmp.x())*GeoTrf::RotateZ3D(180*Gaudi::Units::deg)*TransCutL;
195 }
else if (ModuleNcp>=35 && ModuleNcp<=37) {
196 TransCutR = GeoTrf::TranslateZ3D(-Radius)
197 * GeoTrf::RotateY3D(180*Gaudi::Units::deg) * GeoTrf::RotateX3D(
phi*Gaudi::Units::deg)
198 * GeoTrf::Translate3D(-1.4*Gaudi::Units::cm,PosYcut+YcorB,PosXcut+Blia)
199 * GeoTrf::RotateY3D(180*Gaudi::Units::deg);
202 GeoTrf::Vector3D ptTmp = TransCutR*GeoTrf::Vector3D(0.,0.,0.);
203 TransCutR = GeoTrf::TranslateX3D(2*ptTmp.x())*GeoTrf::RotateZ3D(180*Gaudi::Units::deg)*TransCutR;
207 if (
m_log->level()<=MSG::DEBUG)
208 (*m_log) << MSG::DEBUG <<
" _fillSection: CutA and CutB Ok"<<
endmsg;
214 double thicknessGirderMother = 0.0;
215 double specialModuleZShift = 0.0;
221 if ((Id4 == 7) && (sec_number == 3))
224 double heightGirderMother = (tile_rmax -
m_dbManager->TILBrmax())*Gaudi::Units::cm;
225 double dy1GirderMother =
m_dbManager->TILBrmax() * tan_delta_phi_2 * Gaudi::Units::cm;
226 double dy2GirderMother = tile_rmax * tan_delta_phi_2 * Gaudi::Units::cm;
231 if ((Id4 == 7) && (sec_number == 3)) {
236 thicknessGirderMother/2,thicknessGirderMother/2,dy1GirderMother,dy2GirderMother,heightGirderMother/2);
238 GeoTrd* girderMother =
new GeoTrd(thicknessGirderMother/2,
239 thicknessGirderMother/2,
242 heightGirderMother/2);
244 GeoLogVol* lvGirderMother =
new GeoLogVol(
"GirderMother",girderMother,matAir);
245 PVLink pvGirderMother =
new GeoPhysVol(lvGirderMother);
251 thicknessGirderMother*(1./Gaudi::Units::cm));
253 GeoTransform* tfGirderMother{
nullptr};
256 tfGirderMother =
new GeoTransform(GeoTrf::Translate3D((
m_dbManager->TILBdzend()-
m_dbManager->TILBdzend2())*Gaudi::Units::cm/2, 0.,
259 tfGirderMother =
new GeoTransform(GeoTrf::Translate3D((
m_dbManager->TILBdzend()-
m_dbManager->TILBdzend2())*Gaudi::Units::cm/2, 0.,
260 (
m_dbManager->TILBrmax()-rminb)*Gaudi::Units::cm/2));
262 mother->add(tfGirderMother);
263 mother->add(pvGirderMother);
265 if (
m_log->level()<=MSG::DEBUG)
266 (*m_log) << MSG::DEBUG <<
" _fillSection: GirderMother Ok "<<
endmsg;
271 double thicknessFrontPlate, heightFrontPlate, dy1FrontPlate, dy2FrontPlate;
278 thicknessFrontPlate = (
m_dbManager->TILBdzmodul() - zlen_itc2)*Gaudi::Units::cm;
280 if (thicknessFrontPlate > rless) {
281 heightFrontPlate =
m_dbManager->TILBdrfront()*Gaudi::Units::cm;
282 dy1FrontPlate = (rminb*tan_delta_phi_2 -
m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
285 if (
m_log->level()<=MSG::DEBUG)
286 (*m_log) << MSG::DEBUG <<
" FrontPlateSh dX1,dX2= "<<thicknessFrontPlate/2<<
", "<<thicknessFrontPlate/2
287 <<
" dY1,dY2= "<<dy1FrontPlate<<
" "<<dy2FrontPlate<<
" dZ= "<<heightFrontPlate/2
290 GeoTrd* frontPlateSh =
new GeoTrd(thicknessFrontPlate/2,
291 thicknessFrontPlate/2,
296 GeoLogVol* lvFrontPlateSh =
new GeoLogVol(
"FrontPlateSh",frontPlateSh,matIron);
297 PVLink pvFrontPlateSh =
new GeoPhysVol(lvFrontPlateSh);
298 GeoTransform* tfFrontPlateSh =
new GeoTransform(GeoTrf::Translate3D(
299 -
m_dbManager->TILBdzmodul()/2*Gaudi::Units::cm+thicknessFrontPlate/2, 0.,
300 (rminb - tile_rmax)/2*Gaudi::Units::cm));
302 mother->add(tfFrontPlateSh);
303 mother->add(pvFrontPlateSh);
306 if (
m_log->level()<=MSG::DEBUG)
307 (*m_log) << MSG::DEBUG <<
" FrontPlateSh was lost "<<
endmsg;
310 }
else if (sec_number==2 && (
m_dbManager->BoolCuts() &&
311 ((ModuleNcp>=35 && ModuleNcp<=37)||(ModuleNcp>=60 && ModuleNcp<=62)) )) {
313 std::string volname =
"";
314 double dXCutA = 0, dXCutB = 0;
316 volname =
"Cut1up";
m_dbManager->SetCurrentCuts(volname);
319 volname =
"CutB";
m_dbManager->SetCurrentCuts(volname);
323 heightFrontPlate =
m_dbManager->TILBdrfront()*Gaudi::Units::cm;
324 dy1FrontPlate = (rminb*tan_delta_phi_2 -
m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
327 GeoTrd* frontPlate =
new GeoTrd(thicknessFrontPlate/2 -(dXCutA+dXCutB),
328 thicknessFrontPlate/2 -(dXCutA+dXCutB),
343 GeoLogVol* lvFrontPlate =
new GeoLogVol(
"FrontPlate",frontPlate,matIron);
344 PVLink pvFrontPlate =
new GeoPhysVol(lvFrontPlate);
345 GeoTransform* tfFrontPlate =
new GeoTransform(GeoTrf::Translate3D(
349 mother->add(tfFrontPlate);
350 mother->add(pvFrontPlate);
352 if (
m_log->level()<=MSG::DEBUG)
353 (*m_log) << MSG::DEBUG<<
" _fillSection: FrontPlate Cut Ok "<<
endmsg;
358 heightFrontPlate =
m_dbManager->TILBdrfront()*Gaudi::Units::cm;
359 dy1FrontPlate = (rminb*tan_delta_phi_2 -
m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
362 GeoTrd* frontPlate =
new GeoTrd(thicknessFrontPlate/2,
363 thicknessFrontPlate/2,
368 GeoLogVol* lvFrontPlate =
new GeoLogVol(
"FrontPlate",frontPlate,matIron);
369 PVLink pvFrontPlate =
new GeoPhysVol(lvFrontPlate);
370 GeoTransform* tfFrontPlate =
new GeoTransform(GeoTrf::Translate3D(
374 mother->add(tfFrontPlate);
375 mother->add(pvFrontPlate);
380 double dy1EndPlate, dy2EndPlate, thicknessEndPlate, heightEndPlate;
383 double heightEPHole =
m_dbManager->TILBflangex()*Gaudi::Units::cm;
384 double dyEPHole =
m_dbManager->TILBflangex()*Gaudi::Units::cm/2;
387 GeoTrf::Transform3D cutOutTransformation(GeoTrf::Transform3D::Identity());
389 GeoIntrusivePtr<GeoTransform> tfEndPlateSh{
nullptr};
395 dy1EndPlate = rminb * tan_delta_phi_2 * Gaudi::Units::cm;
396 dy2EndPlate =
m_dbManager->TILBrmax() * tan_delta_phi_2 * Gaudi::Units::cm;
397 thicknessEndPlate =
m_dbManager->TILBdzend1() * Gaudi::Units::cm;
398 heightEndPlate = (
m_dbManager->TILBrmax() - rminb) * Gaudi::Units::cm;
403 GeoTrd* endPlateSh =
new GeoTrd(thicknessEndPlate/2,
408 GeoLogVol* lvEndPlateSh{
nullptr};
411 if (sec_number==2 && ((ModuleNcp>=35 && ModuleNcp<=37)||(ModuleNcp>=60 && ModuleNcp<=62)) ) {
416 GeoTrd* endPlateShCut =
new GeoTrd(thicknessEndPlate,
423 double rotationAngle ;
424 double shiftCutPlate ;
425 int rotationSign = 1;
426 if (ModuleNcp > 50) rotationSign *= -1;
427 if ( neg ) rotationSign *= -1;
430 if ( ( ModuleNcp == 37 ) || ( ModuleNcp == 60 ) ) {
431 rotationAngle = (180.0 - 25.3125 )* Gaudi::Units::deg ;
432 shiftCutPlate = 38.7 * Gaudi::Units::mm;
434 cutOutTransformation =
435 GeoTrf::Translate3D(0,0, -heightEndPlate/2.) *
436 GeoTrf::RotateX3D( 90 * Gaudi::Units::deg ) *
437 GeoTrf::Translate3D(0.,0., -rotationSign * (dy2EndPlate + shiftCutPlate ) ) *
438 GeoTrf::RotateX3D( rotationSign * rotationAngle ) ;
440 const GeoShape & endPlateShCutted3760 = (endPlateSh->subtract( (*endPlateShCut)<< cutOutTransformation ) ) ;
441 lvEndPlateSh =
new GeoLogVol(
"EndPlateSh", &(endPlateShCutted3760) , matIron);
443 }
else if ( ( ModuleNcp == 36 ) || ( ModuleNcp == 61 ) ) {
444 rotationAngle = - ( 116.4832 - 90. )* Gaudi::Units::deg ;
445 shiftCutPlate = ( (
m_dbManager->TILBrmax() - rminb )*Gaudi::Units::cm - 1448.4 * Gaudi::Units::mm);
447 cutOutTransformation =
448 GeoTrf::Translate3D( 0, 0, -heightEndPlate/2. ) *
449 GeoTrf::Translate3D( 0, 0, - (dy2EndPlate - shiftCutPlate + 0.5*dy2EndPlate*(1.- std::cos(rotationAngle*Gaudi::Units::rad))) ) *
450 GeoTrf::RotateX3D( rotationSign * rotationAngle ) ;
452 const GeoShape & endPlateShCutted3661 = (endPlateSh->subtract( (*endPlateShCut)<< cutOutTransformation ) ) ;
453 lvEndPlateSh =
new GeoLogVol(
"EndPlateSh", &(endPlateShCutted3661) , matIron);
455 }
else if ( ( ModuleNcp == 35 ) || ( ModuleNcp == 62 ) ) {
456 rotationAngle = - ( 104.0625 - 90.0 )* Gaudi::Units::deg ;
457 shiftCutPlate = ( (
m_dbManager->TILBrmax() - rminb )*Gaudi::Units::cm - 1534.6 * Gaudi::Units::mm);
459 cutOutTransformation =
460 GeoTrf::Translate3D( 0, 0, -heightEndPlate/2. ) *
461 GeoTrf::Translate3D( 0, 0, - (dy2EndPlate - shiftCutPlate) ) *
462 GeoTrf::RotateX3D( rotationSign * rotationAngle ) ;
464 const GeoShape & endPlateShCutted3562 = (endPlateSh->subtract( (*endPlateShCut)<< cutOutTransformation ) ) ;
465 lvEndPlateSh =
new GeoLogVol(
"EndPlateSh", &(endPlateShCutted3562) , matIron);
471 (*m_log) << MSG::ERROR <<
" TileGeoSectionBuilder::fillSection . Wrong Module in cut-out region. ModuleNcp= "<<ModuleNcp<<
endmsg;
472 lvEndPlateSh =
new GeoLogVol(
"EndPlateSh", endPlateSh , matIron);
476 lvEndPlateSh =
new GeoLogVol(
"EndPlateSh", endPlateSh , matIron);
485 PVLink pvEndPlateSh =
new GeoPhysVol(lvEndPlateSh);
487 tfEndPlateSh =
new GeoTransform(GeoTrf::Translate3D(
488 specialModuleZShift +
490 (
m_dbManager->TILBrmax() - tile_rmax)*Gaudi::Units::cm/2));
492 mother->add(tfEndPlateSh);
493 mother->add(pvEndPlateSh);
495 if (
m_log->level()<=MSG::DEBUG)
496 (*m_log) << MSG::DEBUG <<
" _fillSection: ext.barrel EndPlateSh Ok "<<
endmsg;
500 dy1EndPlate = rminb * tan_delta_phi_2 * Gaudi::Units::cm;
501 dy2EndPlate = tile_rmax * tan_delta_phi_2 * Gaudi::Units::cm;
502 thicknessEndPlate =
m_dbManager->TILBdzend1() * Gaudi::Units::cm;
503 heightEndPlate = (tile_rmax-rminb)*Gaudi::Units::cm;
505 GeoTrd* endPlate1 =
new GeoTrd(thicknessEndPlate/2,
511 GeoLogVol* lvEndPlate1 =
new GeoLogVol(
"EndPlate1",endPlate1,matIron);
512 PVLink pvEndPlate1 =
new GeoPhysVol(lvEndPlate1);
516 GeoTrd* epHole1 =
new GeoTrd (thicknessEndPlate/2,
522 GeoLogVol* lvEPHole1 =
new GeoLogVol(
"EPHole1",epHole1,matAir);
523 PVLink pvEPHole1 =
new GeoPhysVol(lvEPHole1);
524 GeoTransform* tfEPHole1 =
new GeoTransform(GeoTrf::Translate3D(0.,0.,
525 (
m_dbManager->TILBflangey()-(tile_rmax + rminb)/2)*Gaudi::Units::cm));
526 pvEndPlate1->add(tfEPHole1);
527 pvEndPlate1->add(pvEPHole1);
530 GeoTransform* tfEndPlate1 =
new GeoTransform(GeoTrf::Translate3D(
532 mother->add(tfEndPlate1);
533 mother->add(pvEndPlate1);
535 if (
m_log->level()<=MSG::DEBUG)
536 (*m_log) << MSG::DEBUG <<
" _fillSection: Ordinary EndPlateSh Ok "<<
endmsg;
541 GeoIntrusivePtr<GeoTransform> tfEndPlate2{
nullptr};
545 double radShift =lenPla;
546 double rminbT=rminb + radShift;
548 dy1EndPlate = rminb * tan_delta_phi_2 * Gaudi::Units::cm;
549 dy2EndPlate = tile_rmax * tan_delta_phi_2 * Gaudi::Units::cm;
550 thicknessEndPlate =
m_dbManager->TILBdzend2() * Gaudi::Units::cm;
551 heightEndPlate = (tile_rmax-rminb) * Gaudi::Units::cm;
554 GeoLogVol* lvEndPlate2{
nullptr};
555 GeoTrd* endPlate2 =
new GeoTrd(thicknessEndPlate/2,
561 tfEndPlate2 =
new GeoTransform(GeoTrf::Translate3D(
564 if (sec_number==2 && ((ModuleNcp>=35 && ModuleNcp<=37)||(ModuleNcp>=60 && ModuleNcp<=62)) ) {
566 GeoTrd* endPlate2Cut =
new GeoTrd(thicknessEndPlate,
571 double rotationAngle ;
572 double shiftCutPlate ;
573 int rotationSign = 1;
574 if (ModuleNcp > 50) rotationSign *= -1;
575 if ( neg ) rotationSign *= -1;
577 if ( ( ModuleNcp == 37 ) || ( ModuleNcp == 60 ) ) {
578 rotationAngle = - ( 115.3125 - 90.0 )* Gaudi::Units::deg ;
579 shiftCutPlate = ( (
m_dbManager->TILBrmax() - rminb )*Gaudi::Units::cm - 1364.0 * Gaudi::Units::mm);
581 cutOutTransformation =
582 GeoTrf::Translate3D( 0, 0, -heightEndPlate/2. ) *
583 GeoTrf::Translate3D( 0, 0, - (dy2EndPlate - shiftCutPlate) ) *
584 GeoTrf::RotateX3D( rotationSign * rotationAngle ) ;
586 const GeoShape & endPlate2Cutted3760 = (endPlate2->subtract( (*endPlate2Cut)<< cutOutTransformation ) ) ;
587 lvEndPlate2 =
new GeoLogVol(
"EndPlate2", &(endPlate2Cutted3760) , matIron);
589 }
else if ( ( ModuleNcp == 36 ) || ( ModuleNcp == 61 ) ) {
590 rotationAngle = - ( 109.6875 - 90.0 )* Gaudi::Units::deg ;
591 shiftCutPlate = ( (
m_dbManager->TILBrmax() - rminb )*Gaudi::Units::cm - 1464.0 * Gaudi::Units::mm);
593 cutOutTransformation =
594 GeoTrf::Translate3D( 0, 0, -heightEndPlate/2. ) *
595 GeoTrf::Translate3D( 0, 0, - (dy2EndPlate - shiftCutPlate) ) *
596 GeoTrf::RotateX3D( rotationSign * rotationAngle ) ;
598 const GeoShape & endPlate2Cutted3661 = (endPlate2->subtract( (*endPlate2Cut)<< cutOutTransformation ) ) ;
599 lvEndPlate2 =
new GeoLogVol(
"EndPlate2", &(endPlate2Cutted3661) , matIron);
601 }
else if ( ( ModuleNcp == 35 ) || ( ModuleNcp == 62 ) ) {
602 rotationAngle = - ( 104.0625 - 90.0 )* Gaudi::Units::deg ;
603 shiftCutPlate = ( (
m_dbManager->TILBrmax() - rminb )*Gaudi::Units::cm - ( 1915.0 -385.0 )* Gaudi::Units::mm);
605 cutOutTransformation =
606 GeoTrf::Translate3D( 0, 0, -heightEndPlate/2. ) *
607 GeoTrf::Translate3D( 0, 0, - (dy2EndPlate - shiftCutPlate) ) *
608 GeoTrf::RotateX3D( rotationSign * rotationAngle ) ;
610 const GeoShape & endPlate2Cutted3562 = (endPlate2->subtract( (*endPlate2Cut)<< cutOutTransformation ) ) ;
611 lvEndPlate2 =
new GeoLogVol(
"EndPlate2", &(endPlate2Cutted3562) , matIron);
623 lvEndPlate2 =
new GeoLogVol(
"EndPlate2",endPlate2,matIron);
626 PVLink pvEndPlate2 =
new GeoPhysVol(lvEndPlate2);
630 dyEPHole =
m_dbManager->TILBflangex()*Gaudi::Units::cm/2;
632 GeoTrd* epHole2 =
new GeoTrd (thicknessEndPlate/2,
638 GeoLogVol* lvEPHole2 =
new GeoLogVol(
"EPHole2",epHole2,matAir);
639 PVLink pvEPHole2 =
new GeoPhysVol(lvEPHole2);
640 GeoTransform* tfEPHole2 =
new GeoTransform(GeoTrf::Translate3D(0.,0.,
641 (
m_dbManager->TILBflangey()-(tile_rmax + rminbT)/2)*Gaudi::Units::cm));
642 pvEndPlate2->add(tfEPHole2);
643 pvEndPlate2->add(pvEPHole2);
646 mother->add(tfEndPlate2);
647 mother->add(pvEndPlate2);
649 if (
m_log->level()<=MSG::DEBUG)
650 (*m_log) << MSG::DEBUG <<
" _fillSection: EndPlate2 Ok "<<
endmsg;
657 double dy1Absorber = (
m_dbManager->TILBrmin()*tan_delta_phi_2 -
m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
658 double dy2Absorber = (
m_dbManager->TILBrmax()*tan_delta_phi_2 -
m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
661 thicknessAbsorber/2,thicknessAbsorber/2,dy1Absorber,dy2Absorber,heightAbsorber/2);
664 double thicknessPeriod =0, thicknessAbsorber1 =0, thicknessAbsorber2 =0, thicknessAbsorber3 =0;
665 double PosAbsor1 =0, PosAbsor2 =0, PosAbsor3 =0;
666 int nA1 =32, nA2 = 0, nA3 =16;
668 GeoTrd *absorber{
nullptr}, *absorber1{
nullptr}, *absorber3{
nullptr};
669 GeoLogVol *lvAbsorber{
nullptr}, *lvAbsorber1{
nullptr}, *lvAbsorber3{
nullptr};
670 PVLink pvAbsorber{
nullptr}, pvAbsorber1{
nullptr}, pvAbsorber3{
nullptr},
671 pvTmp_Absorber1{
nullptr}, pvTmp_Absorber3{
nullptr};
674 switch (sec_number) {
678 thicknessPeriod = 2.*(
m_dbManager->TILBdzmast() +
m_dbManager->TILBdzspac() + 2.*dzglue)*Gaudi::Units::cm;
683 thicknessAbsorber1 = nA1*thicknessPeriod;
684 PosAbsor1 = thicknessAbsorber/2 - thicknessAbsorber1/2;
686 thicknessAbsorber2 = nA2*thicknessPeriod;
687 PosAbsor2 = thicknessAbsorber/2 - thicknessAbsorber1 - thicknessAbsorber2/2;
689 thicknessAbsorber3 = nA3*thicknessPeriod;
690 PosAbsor3 = thicknessAbsorber/2 - thicknessAbsorber1 - thicknessAbsorber2 - thicknessAbsorber3/2;
692 if (
m_log->level()<=MSG::DEBUG)
693 (*m_log) << MSG::DEBUG <<
" Number of periods per Module: N= "<<nA1+nA2+nA3
694 <<
" Middle absorber, numbers of periods = "<<nA2
698 absorber1 =
new GeoTrd(thicknessAbsorber1/2, thicknessAbsorber1/2,
699 dy1Absorber, dy2Absorber,
702 lvAbsorber1 =
new GeoLogVol(
"Absorber",absorber1,matIron);
703 pvAbsorber1 =
new GeoPhysVol(lvAbsorber1);
706 absorber =
new GeoTrd(thicknessAbsorber2/2, thicknessAbsorber2/2,
707 dy1Absorber, dy2Absorber,
710 lvAbsorber =
new GeoLogVol(
"Absorber",absorber,matIron);
711 pvAbsorber =
new GeoPhysVol(lvAbsorber);
715 absorber3 =
new GeoTrd(thicknessAbsorber3/2, thicknessAbsorber3/2,
716 dy1Absorber, dy2Absorber,
719 lvAbsorber3 =
new GeoLogVol(
"Absorber",absorber3,matIron);
720 pvAbsorber3 =
new GeoPhysVol(lvAbsorber3);
723 if (
m_log->level()<=MSG::DEBUG)
724 (*m_log) << MSG::DEBUG <<
" _fillSection: Ex.Barrel pvAbsorber 1,3 Ok "<<
endmsg;
730 absorber =
new GeoTrd(thicknessAbsorber/2, thicknessAbsorber/2,
731 dy1Absorber, dy2Absorber,
735 lvAbsorber =
new GeoLogVol(
"Absorber",absorber,matIron);
738 lvAbsorber =
new GeoLogVol(
"Absorber",absorber,matAir);
740 pvAbsorber =
new GeoPhysVol(lvAbsorber);
742 if (
m_log->level()<=MSG::DEBUG) {
744 (*m_log) << MSG::DEBUG <<
" _fillSection: default pvAbsorber Ok "<<
endmsg;
746 (*m_log) << MSG::DEBUG <<
" _fillSection: special pvAbsorber made from Air Ok "<<
endmsg;
754 double thicknessAbsorberChild;
757 GeoTrd* period{
nullptr};
758 GeoLogVol* lvPeriod{
nullptr};
759 PVLink pvPeriod{
nullptr};
760 GeoTransform* tfPeriod{
nullptr};
761 GeoSerialTransformer* stPeriod{
nullptr};
763 GeoTrd* absorberChild{
nullptr};
764 GeoLogVol* lvAbsorberChild{
nullptr};
765 PVLink pvAbsorberChild{
nullptr};
766 GeoTransform* tfAbsorberChild{
nullptr};
769 switch (sec_number) {
777 thicknessPeriod = 2.*(
m_dbManager->TILBdzmast() +
m_dbManager->TILBdzspac() + 2.*dzglue)*Gaudi::Units::cm;
778 MLOG(
DEBUG) <<
"BARREL Section -- m_dbManager->TILBdzmast(): " <<
m_dbManager->TILBdzmast() <<
", m_dbManager->TILBdzspac(): " <<
m_dbManager->TILBdzspac()
779 <<
", dzglue: " << dzglue <<
" ==> thicknessPeriod: " << thicknessPeriod <<
endmsg;
785 thicknessPeriod/2,thicknessPeriod/2,dy1Absorber,dy2Absorber,heightAbsorber/2);
787 period =
new GeoTrd(thicknessPeriod/2,
793 lvPeriod =
new GeoLogVol(
"Period",period,matIron);
794 pvPeriod =
new GeoPhysVol(lvPeriod);
797 thicknessPeriod*(1./Gaudi::Units::cm),
803 thicknessAbsorberChild = thicknessPeriod*(
m_dbManager->TILBnperiod()-1);
804 absorberChild =
new GeoTrd(thicknessAbsorberChild/2,
805 thicknessAbsorberChild/2,
809 lvAbsorberChild =
new GeoLogVol(
"AbsorberChild",absorberChild,matAir);
810 pvAbsorberChild =
new GeoPhysVol(lvAbsorberChild);
813 GENFUNCTION periodPos1 = (thicknessPeriod*(2*periodInd+1)-thicknessAbsorberChild)/2;
814 TRANSFUNCTION xfReplica1 = Pow(GeoTrf::TranslateX3D(1.),periodPos1);
816 (thicknessAbsorberChild - thicknessAbsorber)/2);
818 stPeriod =
new GeoSerialTransformer(pvPeriod,
822 pvAbsorberChild->add(
new GeoSerialIdentifier(0));
823 pvAbsorberChild->add(stPeriod);
826 tfAbsorberChild =
new GeoTransform(GeoTrf::Translate3D((thicknessAbsorberChild - thicknessAbsorber)/2,0.,0.));
827 pvAbsorber->add(tfAbsorberChild);
828 pvAbsorber->add(pvAbsorberChild);
831 thicknessPeriod = (
m_dbManager->TILBdzmast() + 2.*
m_dbManager->TILBdzspac() + 2.*dzglue)*Gaudi::Units::cm;
834 thicknessPeriod/2,thicknessPeriod/2,dy1Absorber,dy2Absorber,heightAbsorber/2);
836 period =
new GeoTrd(thicknessPeriod/2,
841 lvPeriod =
new GeoLogVol(
"Period",period,matIron);
842 pvPeriod =
new GeoPhysVol(lvPeriod);
845 thicknessPeriod*(1./Gaudi::Units::cm),
851 thicknessAbsorberChild = thicknessPeriod;
852 absorberChild =
new GeoTrd(thicknessAbsorberChild/2,
853 thicknessAbsorberChild/2,
857 lvAbsorberChild =
new GeoLogVol(
"AbsorberChild",absorberChild,matAir);
858 pvAbsorberChild =
new GeoPhysVol(lvAbsorberChild);
861 (-thicknessAbsorberChild + thicknessAbsorber)/2);
864 tfPeriod =
new GeoTransform(GeoTrf::Translate3D(0.,0.,0.));
866 pvAbsorberChild->add(
new GeoIdentifierTag(
m_dbManager->TILBnperiod()-1));
867 pvAbsorberChild->add(tfPeriod);
868 pvAbsorberChild->add(pvPeriod);
871 tfAbsorberChild =
new GeoTransform(GeoTrf::Translate3D((-thicknessAbsorberChild + thicknessAbsorber)/2,0.,0.));
872 pvAbsorber->add(tfAbsorberChild);
873 pvAbsorber->add(pvAbsorberChild);
880 thicknessPeriod = 2. * (
m_dbManager->TILBdzmast() +
m_dbManager->TILBdzspac() + 2.*dzglue) * Gaudi::Units::cm;
881 MLOG(
DEBUG) <<
"EXTENDED BARREL Section -- m_dbManager->TILBdzmast(): " <<
m_dbManager->TILBdzmast() <<
", m_dbManager->TILBdzspac(): " <<
m_dbManager->TILBdzspac()
882 <<
", dzglue: " << dzglue <<
" ==> thicknessPeriod: " << thicknessPeriod <<
endmsg;
885 thicknessPeriod/2,thicknessPeriod/2,dy1Absorber,dy2Absorber,heightAbsorber/2);
887 period =
new GeoTrd(thicknessPeriod/2,
892 lvPeriod =
new GeoLogVol(
"Period",period,matIron);
893 pvPeriod =
new GeoPhysVol(lvPeriod);
898 thicknessPeriod*(1./Gaudi::Units::cm),
906 GENFUNCTION periodPos1 = (thicknessPeriod*(2*periodInd+1)-thicknessAbsorber1)/2;
907 TRANSFUNCTION xfReplica1 = Pow(GeoTrf::TranslateX3D(1.),periodPos1);
909 (-thicknessAbsorber+thicknessAbsorber1)/2.);
911 stPeriod =
new GeoSerialTransformer(pvPeriod,&xfReplica1,nA1);
913 pvAbsorber1->add(
new GeoSerialIdentifier(0));
914 pvAbsorber1->add(stPeriod);
918 if ((ModuleNcp>=35 && ModuleNcp<=37) || (ModuleNcp>=60 && ModuleNcp<=62)) {
920 GeoCutVolAction action1(*CutA, TransCut2);
921 pvAbsorber1->apply(&action1);
922 pvTmp_Absorber1 = action1.getPV();
924 if (
m_log->level()<=MSG::DEBUG)
925 (*m_log) << MSG::DEBUG <<
" _fillSection: CutA Ok "<<
endmsg;
928 if (
m_log->level()<=MSG::DEBUG)
929 (*m_log) << MSG::DEBUG <<
" _fillSection: Absorber1 Ok "<<
endmsg;
932 GENFUNCTION periodPos2 = (thicknessPeriod*(2*periodInd+1)-thicknessAbsorber2)/2;
933 TRANSFUNCTION xfReplica2 = Pow(GeoTrf::TranslateX3D(1.),periodPos2);
935 (-thicknessAbsorber+thicknessAbsorber2)/2.+thicknessAbsorber1);
937 stPeriod =
new GeoSerialTransformer(pvPeriod,&xfReplica2,nA2);
939 pvAbsorber->add(
new GeoSerialIdentifier(nA1));
940 pvAbsorber->add(stPeriod);
942 if (
m_log->level()<=MSG::DEBUG)
943 (*m_log) << MSG::DEBUG <<
" _fillSection: pvAbsorber Ok "<<
endmsg;
947 GENFUNCTION periodPos3 = (thicknessPeriod*(2*periodInd+1)-thicknessAbsorber3)/2;
948 TRANSFUNCTION xfReplica3 = Pow(GeoTrf::TranslateX3D(1.),periodPos3);
950 (-thicknessAbsorber+thicknessAbsorber3)/2.+thicknessAbsorber2+thicknessAbsorber1);
952 stPeriod =
new GeoSerialTransformer(pvPeriod,&xfReplica3,nA3);
954 pvAbsorber3->add(
new GeoSerialIdentifier(nA1+nA2));
955 pvAbsorber3->add(stPeriod);
958 if (ModuleNcp>=60 && ModuleNcp<=62) {
961 GeoCutVolAction action2(*CutB, TransCutL);
962 pvAbsorber3->apply(&action2);
963 pvTmp_Absorber3 = action2.getPV();
964 if (
m_log->level()<=MSG::DEBUG)
965 (*m_log) << MSG::DEBUG <<
" _fillSection: CutB L Ok "<<
endmsg;
967 }
else if (ModuleNcp>=35 && ModuleNcp<=37) {
970 GeoCutVolAction action3(*CutB, TransCutR);
971 pvAbsorber3->apply(&action3);
972 pvTmp_Absorber3 = action3.getPV();
973 if (
m_log->level()<=MSG::DEBUG)
974 (*m_log) << MSG::DEBUG <<
" _fillSection: CutB R Ok "<<
endmsg;
977 if (
m_log->level()<=MSG::DEBUG) {
978 (*m_log) << MSG::DEBUG <<
" _fillSection: Absorber3 Ok "<<
endmsg;
992 thicknessPeriod = 2.*(
m_dbManager->TILBdzmast() +
m_dbManager->TILBdzspac() + 2.*dzglue)*Gaudi::Units::cm;
993 MLOG(
DEBUG) <<
"PLUG Section 1 -- m_dbManager->TILBdzmast(): " <<
m_dbManager->TILBdzmast() <<
", m_dbManager->TILBdzspac(): " <<
m_dbManager->TILBdzspac()
994 <<
", dzglue: " << dzglue <<
" ==> thicknessPeriod: " << thicknessPeriod <<
endmsg;
996 checking(
"Period 3 (ITC1 special)",
true, 4,
997 thicknessPeriod/2,thicknessPeriod/2,dy1Absorber,dy2Absorber,heightAbsorber/2);
999 period =
new GeoTrd(thicknessPeriod/2,
1004 lvPeriod =
new GeoLogVol(
"Period",period,matIron);
1005 pvPeriod =
new GeoPhysVol(lvPeriod);
1008 thicknessPeriod*(1./Gaudi::Units::cm),
1013 thicknessAbsorberChild = thicknessPeriod*(
m_dbManager->TILBnperiod()-1);
1015 absorberChild =
new GeoTrd(thicknessAbsorberChild/2,
1016 thicknessAbsorberChild/2,
1020 lvAbsorberChild =
new GeoLogVol(
"AbsorberChild",absorberChild,matAir);
1021 pvAbsorberChild =
new GeoPhysVol(lvAbsorberChild);
1024 GENFUNCTION periodPosITC1sp = (thicknessPeriod*(2*periodInd+1)-thicknessAbsorberChild)/2;
1025 TRANSFUNCTION xfReplicaITC1sp = Pow(GeoTrf::TranslateX3D(1.),periodPosITC1sp);
1027 (thicknessAbsorberChild - thicknessAbsorber)/2);
1029 stPeriod =
new GeoSerialTransformer(pvPeriod,
1033 pvAbsorberChild->add(
new GeoSerialIdentifier(0));
1034 pvAbsorberChild->add(stPeriod);
1037 tfAbsorberChild =
new GeoTransform(GeoTrf::Translate3D((thicknessAbsorberChild - thicknessAbsorber)/2,0.,0.));
1038 pvAbsorber->add(tfAbsorberChild);
1039 pvAbsorber->add(pvAbsorberChild);
1043 thicknessPeriod =
m_dbManager->TILBdzspac()*Gaudi::Units::cm;
1045 checking(
"Period 5 (ITC1 special)",
true, 4,
1046 thicknessPeriod/2,thicknessPeriod/2,dy1Absorber,dy2Absorber,heightAbsorber/2);
1048 period =
new GeoTrd(thicknessPeriod/2,
1053 lvPeriod =
new GeoLogVol(
"Period",period,matIron);
1054 pvPeriod =
new GeoPhysVol(lvPeriod);
1057 thicknessPeriod*(1./Gaudi::Units::cm),
1062 thicknessAbsorberChild = thicknessPeriod;
1063 absorberChild =
new GeoTrd(thicknessAbsorberChild/2,
1064 thicknessAbsorberChild/2,
1068 lvAbsorberChild =
new GeoLogVol(
"AbsorberChild",absorberChild,matAir);
1069 pvAbsorberChild =
new GeoPhysVol(lvAbsorberChild);
1072 (-thicknessAbsorberChild + thicknessAbsorber)/2);
1075 tfPeriod =
new GeoTransform(GeoTrf::Translate3D(0.,0.,0.));
1076 pvAbsorberChild->add(
new GeoIdentifierTag(
m_dbManager->TILBnperiod()-1));
1077 pvAbsorberChild->add(tfPeriod);
1078 pvAbsorberChild->add(pvPeriod);
1081 tfAbsorberChild =
new GeoTransform(GeoTrf::Translate3D((-thicknessAbsorberChild + thicknessAbsorber)/2,0.,0.));
1082 pvAbsorber->add(tfAbsorberChild);
1083 pvAbsorber->add(pvAbsorberChild);
1085 if (
m_log->level()<=MSG::DEBUG)
1086 (*m_log) << MSG::DEBUG <<
" _fillSection: Absorber (ITC plug special) Ok "<<
endmsg;
1089 thicknessPeriod = 2.*(
m_dbManager->TILBdzmast() +
m_dbManager->TILBdzspac() + 2.*dzglue)*Gaudi::Units::cm;
1092 thicknessPeriod/2,thicknessPeriod/2,dy1Absorber,dy2Absorber,heightAbsorber/2);
1094 period =
new GeoTrd(thicknessPeriod/2,
1099 lvPeriod =
new GeoLogVol(
"Period",period,matIron);
1100 pvPeriod =
new GeoPhysVol(lvPeriod);
1103 thicknessPeriod*(1./Gaudi::Units::cm),
1109 GENFUNCTION periodPos3 = (thicknessPeriod*(2*periodInd+1)-thicknessAbsorber)/2;
1110 TRANSFUNCTION xfReplica3 = Pow(GeoTrf::TranslateX3D(1.),periodPos3);
1119 if (
m_log->level()<=MSG::DEBUG)
1120 (*m_log) << MSG::DEBUG <<
" SCNTitem= "<<
m_dbManager->SCNTitem()<<
" NbPeriod= "<<NbPeriod<<
endmsg;
1121 stPeriod =
new GeoSerialTransformer(pvPeriod,
1125 pvAbsorber->add(
new GeoSerialIdentifier(0));
1126 pvAbsorber->add(stPeriod);
1127 if (
m_log->level()<=MSG::DEBUG)
1128 (*m_log) << MSG::DEBUG <<
" _fillSection: Absorber (case 3) Ok "<<
endmsg;
1139 thicknessPeriod = 2.*(
m_dbManager->TILBdzmast() +
m_dbManager->TILBdzspac() + 2.*dzglue)*Gaudi::Units::cm;
1140 MLOG(
DEBUG) <<
"PLUG Section 2 -- m_dbManager->TILBdzmast(): " <<
m_dbManager->TILBdzmast() <<
", m_dbManager->TILBdzspac(): " <<
m_dbManager->TILBdzspac()
1141 <<
", dzglue: " << dzglue <<
" ==> thicknessPeriod: " << thicknessPeriod <<
endmsg;
1144 thicknessPeriod/2,thicknessPeriod/2,dy1Absorber,dy2Absorber,heightAbsorber/2);
1146 period =
new GeoTrd(thicknessPeriod/2,
1151 lvPeriod =
new GeoLogVol(
"Period",period,matIron);
1152 pvPeriod =
new GeoPhysVol(lvPeriod);
1155 thicknessPeriod*(1./Gaudi::Units::cm),
1161 thicknessAbsorberChild = thicknessPeriod*(
m_dbManager->TILBnperiod()-1);
1162 absorberChild =
new GeoTrd(thicknessAbsorberChild/2,
1163 thicknessAbsorberChild/2,
1167 lvAbsorberChild =
new GeoLogVol(
"AbsorberChild",absorberChild,matAir);
1168 pvAbsorberChild =
new GeoPhysVol(lvAbsorberChild);
1171 GENFUNCTION periodPos1 = (thicknessPeriod*(2*periodInd+1)-thicknessAbsorberChild)/2;
1172 TRANSFUNCTION xfReplica1 = Pow(GeoTrf::TranslateX3D(1.),periodPos1);
1174 (thicknessAbsorberChild - thicknessAbsorber)/2);
1176 stPeriod =
new GeoSerialTransformer(pvPeriod,
1180 pvAbsorberChild->add(
new GeoSerialIdentifier(0));
1181 pvAbsorberChild->add(stPeriod);
1184 tfAbsorberChild =
new GeoTransform(GeoTrf::Translate3D((thicknessAbsorberChild - thicknessAbsorber)/2,0.,0.));
1185 pvAbsorber->add(tfAbsorberChild);
1186 pvAbsorber->add(pvAbsorberChild);
1189 thicknessPeriod =
m_dbManager->TILBdzspac()*Gaudi::Units::cm;
1192 thicknessPeriod/2,thicknessPeriod/2,dy1Absorber,dy2Absorber,heightAbsorber/2);
1194 period =
new GeoTrd(thicknessPeriod/2,
1199 lvPeriod =
new GeoLogVol(
"Period",period,matIron);
1200 pvPeriod =
new GeoPhysVol(lvPeriod);
1203 thicknessPeriod*(1./Gaudi::Units::cm),
1208 thicknessAbsorberChild = thicknessPeriod;
1209 absorberChild =
new GeoTrd(thicknessAbsorberChild/2,
1210 thicknessAbsorberChild/2,
1214 lvAbsorberChild =
new GeoLogVol(
"AbsorberChild",absorberChild,matAir);
1215 pvAbsorberChild =
new GeoPhysVol(lvAbsorberChild);
1218 (-thicknessAbsorberChild + thicknessAbsorber)/2);
1221 tfPeriod =
new GeoTransform(GeoTrf::Translate3D(0.,0.,0.));
1222 pvAbsorberChild->add(
new GeoIdentifierTag(
m_dbManager->TILBnperiod()-1));
1223 pvAbsorberChild->add(tfPeriod);
1224 pvAbsorberChild->add(pvPeriod);
1227 tfAbsorberChild =
new GeoTransform(GeoTrf::Translate3D((-thicknessAbsorberChild + thicknessAbsorber)/2,0.,0.));
1228 pvAbsorber->add(tfAbsorberChild);
1229 pvAbsorber->add(pvAbsorberChild);
1231 if (
m_log->level()<=MSG::DEBUG)
1232 (*m_log) << MSG::DEBUG <<
" _fillSection: Absorber (case 4) Ok "<<
endmsg;
1246 (*m_log) << MSG::ERROR <<
"TileGeoSectionBuilder::fillSection: Unexpected section = "
1251 thicknessPeriod = thicknessAbsorber;
1252 MLOG(
DEBUG) <<
"DEFAULT Section -- thicknessAbsorber: " << thicknessAbsorber <<
" ==> thicknessPeriod: " << thicknessPeriod <<
endmsg;
1255 thicknessPeriod/2,thicknessPeriod/2,dy1Absorber,dy2Absorber,heightAbsorber/2);
1257 double dy1Period =
m_dbManager->TILBflangex()/2.*Gaudi::Units::cm;
1258 double dy2Period =
m_dbManager->TILBflangey()/2.*Gaudi::Units::cm;
1259 if (dy1Period <= 0.0 || dy2Period <= 0.0 || dy1Period > dy1Absorber || dy2Period > dy2Absorber || dy1Period >= dy2Period ) {
1260 dy1Period = dy1Absorber;
1261 dy2Period = dy2Absorber;
1264 period =
new GeoTrd(thicknessPeriod/2,
1270 lvPeriod =
new GeoLogVol(
"Period",period,matAluminium);
1271 pvPeriod =
new GeoPhysVol(lvPeriod);
1274 thicknessPeriod*(1./Gaudi::Units::cm),
1282 tfPeriod =
new GeoTransform(GeoTrf::Translate3D(0.,0.,0.));
1283 pvAbsorber->add(
new GeoIdentifierTag(0));
1284 pvAbsorber->add(tfPeriod);
1285 pvAbsorber->add(pvPeriod);
1287 if (
m_log->level()<=MSG::DEBUG)
1288 (*m_log) << MSG::DEBUG <<
" _fillSection: Absorber (case default) Ok "<<
endmsg;
1294 GeoTransform *tfAbsorber{
nullptr}, *tfAbsorber1{
nullptr}, *tfAbsorber3{
nullptr};
1297 double dZAbsorber = (
m_dbManager->TILBrmax() - tile_rmax);
1299 if (sec_number==3) {
1301 tfAbsorber =
new GeoTransform(GeoTrf::Translate3D( specialModuleZShift + dXAbsorber*Gaudi::Units::cm/2, 0., dZAbsorber*Gaudi::Units::cm/2));
1302 mother->add(tfAbsorber);
1303 mother->add(pvAbsorber);
1305 }
else if (sec_number==2) {
1306 if (
m_log->level()<=MSG::DEBUG)
1307 (*m_log) << MSG::DEBUG <<
" _fillsection Ex.barrel in "<<
endmsg;
1309 tfAbsorber1 =
new GeoTransform(GeoTrf::Translate3D(dXAbsorber*Gaudi::Units::cm/2 - PosAbsor1, 0.,
1310 (dZAbsorber +
m_dbManager->TILBrmin() - rminb)*Gaudi::Units::cm/2));
1311 mother->add(tfAbsorber1);
1312 if (
m_dbManager->BoolCuts() && ((ModuleNcp>=35 && ModuleNcp<=37) || (ModuleNcp>=60 && ModuleNcp<=62)) ) {
1313 mother->add(pvTmp_Absorber1);
1315 mother->add(pvAbsorber1);
1318 if (
m_log->level()<=MSG::DEBUG)
1319 (*m_log) << MSG::DEBUG <<
" _fillsection ext.barrel pvAbsorber1 Ok"<<
endmsg;
1321 tfAbsorber =
new GeoTransform(GeoTrf::Translate3D(dXAbsorber*Gaudi::Units::cm/2 - PosAbsor2, 0.,
1322 (dZAbsorber +
m_dbManager->TILBrmin() - rminb)*Gaudi::Units::cm/2));
1323 mother->add(tfAbsorber);
1324 mother->add(pvAbsorber);
1326 if (
m_log->level()<=MSG::DEBUG)
1327 (*m_log) << MSG::DEBUG <<
" _fillsection ext.barrel pvAbsorber Ok"<<
endmsg;
1329 tfAbsorber3 =
new GeoTransform(GeoTrf::Translate3D(dXAbsorber*Gaudi::Units::cm/2 - PosAbsor3, 0.,
1330 (dZAbsorber +
m_dbManager->TILBrmin() - rminb)*Gaudi::Units::cm/2));
1331 mother->add(tfAbsorber3);
1332 if (
m_dbManager->BoolCuts() && ((ModuleNcp>=35 && ModuleNcp<=37) || (ModuleNcp>=60 && ModuleNcp<=62)) ) {
1333 mother->add(pvTmp_Absorber3);
1335 mother->add(pvAbsorber3);
1338 if (
m_log->level()<=MSG::DEBUG)
1339 (*m_log) << MSG::DEBUG <<
" _fillsection ext.barrel pvAbsorber3 Ok"<<
endmsg;
1342 tfAbsorber =
new GeoTransform(GeoTrf::Translate3D(dXAbsorber*Gaudi::Units::cm/2, 0.,
1343 (dZAbsorber +
m_dbManager->TILBrmin() - rminb)*Gaudi::Units::cm/2));
1344 mother->add(tfAbsorber);
1345 mother->add(pvAbsorber);
1346 if (
m_log->level()<=MSG::DEBUG)
1347 (*m_log) << MSG::DEBUG <<
" _fillsection other pvAbsorber Ok"<<
endmsg;
1445 double corrected_dz)
1447 bool boolNeg =
false;
1449 if (ModuleNcp > 99) {
1450 ModuleNcp = ModuleNcp/100;
1477 m_matLArServices =
new GeoMaterial(
"LArServices", 2.5*GeoModelKernelUnits::gram/Gaudi::Units::cm3);
1487 m_matIronHalfDens =
new GeoMaterial(
"LArIronBox", 4.5*GeoModelKernelUnits::gram/Gaudi::Units::cm3);
1496 GeoTrd* fingerElementTrd{
nullptr};
1497 GeoTrap* fingerElementTrap{
nullptr};
1499 GeoBox *fingerCablesL{
nullptr}, *fingerCablesR{
nullptr};
1500 PVLink pvFingerElement{
nullptr}, pvFingerCablesL{
nullptr}, pvFingerCablesR{
nullptr};
1501 GeoLogVol *lvFingerElement{
nullptr}, *lvFingerCablesL{
nullptr}, *lvFingerCablesR{
nullptr};
1502 GeoTransform* tfFingerElement{
nullptr}, *tfFingerCables{
nullptr};
1504 GeoTransform* ZrotateMod{
nullptr};
1505 GeoTransform* yrotateMod{
nullptr};
1506 GeoTransform* zrotateMod{
nullptr};
1508 const GeoMaterial *currentMaterial{
nullptr}, *leftMaterial{
nullptr}, *rightMaterial{
nullptr};
1509 std::string currentName, leftName, rightName;
1511 int CurrentTicg = 100*sec_number + 1;
1513 double AirVolumeShift = 0.0;
1514 double AirVolumeSize = corrected_dz;
1516 for (j = CurrentTicg; j < (CurrentTicg +
m_dbManager->TIFGnelem()); j++) {
1526 if (corrected_dz > 0.) {
1527 if (j-CurrentTicg==0) {
1528 AirVolumeShift = (elementDz-corrected_dz)/2 - elementZPozition;
1529 AirVolumeSize = elementDz;
1530 if (
m_log->level()<=MSG::DEBUG) {
1531 (*m_log) << MSG::DEBUG <<
"TileFinger: OldAirVolumeCenter ="<<elementZPozition <<
endmsg;
1532 (*m_log) << MSG::DEBUG <<
"TileFinger: NewAirVolumeCenter ="<<elementZPozition+AirVolumeShift <<
endmsg;
1533 (*m_log) << MSG::DEBUG <<
"TileFinger: AirVolumeShift ="<< AirVolumeShift <<
endmsg;
1534 (*m_log) << MSG::DEBUG <<
"TileFinger: AirVolumeSize ="<< AirVolumeSize <<
endmsg;
1538 if (elementZPozition*2-AirVolumeSize<-0.01) {
1539 elementZPozition += AirVolumeShift;
1542 if (
m_log->level()<=MSG::DEBUG)
1543 (*m_log) << MSG::DEBUG <<
"TileFinger: OldCoverThickness ="<<elementDz <<
endmsg;
1544 elementDz = corrected_dz - AirVolumeSize;
1545 if (
m_log->level()<=MSG::DEBUG) {
1546 (*m_log) << MSG::DEBUG <<
"TileFinger: NewCoverThickness ="<<elementDz <<
endmsg;
1547 (*m_log) << MSG::DEBUG <<
"TileFinger: OldCoverCenter ="<<elementZPozition <<
endmsg;
1549 elementZPozition = (corrected_dz-elementDz)/2;
1550 if (
m_log->level()<=MSG::DEBUG)
1551 (*m_log) << MSG::DEBUG <<
"TileFinger: NewCoverCenter ="<<elementZPozition <<
endmsg;
1558 currentMaterial = matIron;
1559 currentName =
"FingerIron";
1564 currentMaterial = matAluminium;
1565 currentName =
"FingerAluminum";
1570 currentMaterial = matElBoard;
1571 currentName =
"FingerElectronics";
1576 (*m_log) << MSG::ERROR <<
"TileGeoSectionBuilder::fillFinger: unexpected material = "
1583 fingerElementTrd =
new GeoTrd(elementDz/2*Gaudi::Units::cm,
1584 elementDz/2*Gaudi::Units::cm,
1585 elementDy1/2*Gaudi::Units::cm,
1586 elementDy2/2*Gaudi::Units::cm,
1587 elementHeight/2*Gaudi::Units::cm);
1588 lvFingerElement =
new GeoLogVol(currentName,fingerElementTrd,currentMaterial);
1592 fingerElementTrap =
new GeoTrap(elementDz/2*Gaudi::Units::cm,
1595 elementHeight/2*Gaudi::Units::cm,
1596 elementDy2/2*Gaudi::Units::cm,
1597 elementDy1/2*Gaudi::Units::cm,
1598 std::atan((elementDy1-elementDy2)/(2.*elementHeight)),
1599 elementHeight/2*Gaudi::Units::cm,
1600 elementDy2/2*Gaudi::Units::cm,
1601 elementDy1/2*Gaudi::Units::cm,
1602 std::atan((elementDy1-elementDy2)/(2.*elementHeight)));
1604 lvFingerElement =
new GeoLogVol(currentName,fingerElementTrap,currentMaterial);
1607 (*m_log) << MSG::ERROR <<
"TileGeoSectionBuilder::fillFinger: unexpected shape = "
1613 pvFingerElement =
new GeoPhysVol(lvFingerElement);
1614 tfFingerElement =
new GeoTransform(GeoTrf::Translate3D(elementZPozition*Gaudi::Units::cm,
1615 elementOffset*Gaudi::Units::cm,
1616 (elementRC-(tilb_rmax + tile_rmax)/2)*Gaudi::Units::cm));
1618 mother->add(tfFingerElement);
1620 if (elementOffset<0) {
1621 ZrotateMod =
new GeoTransform(GeoTrf::RotateZ3D(180*Gaudi::Units::deg));
1622 mother->add(ZrotateMod);
1625 zrotateMod =
new GeoTransform(GeoTrf::RotateZ3D(90*Gaudi::Units::deg));
1626 yrotateMod =
new GeoTransform(GeoTrf::RotateY3D(-90*Gaudi::Units::deg));
1627 mother->add(yrotateMod);
1628 mother->add(zrotateMod);
1631 mother->add(
new GeoIdentifierTag(ModuleNcp));
1632 mother->add(pvFingerElement);
1635 if (testbeam)
return;
1639 int Isector =0, LRflag =0;
1641 if ((ModuleNcp/4 - (
float)ModuleNcp/4) != 0) {
1642 Isector = (int)ModuleNcp/4;
1644 Isector = (int)ModuleNcp/4-1;
1646 LRflag = ModuleNcp-4*Isector;
1655 double dXleft =35., dXright = 35.;
1656 double dZleft = elementDz/2, dZright = dZleft;
1657 double dZsaddleL = elementDz/4, dZsaddleR = dZsaddleL;
1661 rightName = leftName =
"LArCables";
1664 dZright = elementDz, dXright = 35;
1667 rightName =
"LArService";
1669 }
else if (LRflag == 4) {
1670 dZleft = elementDz, dXleft = 35;
1673 leftName =
"LArService";
1676 if (sec_number == 1) {
1677 if ( (ModuleNcp >=40 && ModuleNcp <=41) || (ModuleNcp >=56 && ModuleNcp <=57) ) {
1678 dZright = dZleft = 8.5;
1679 dZsaddleL = dZsaddleR = 13.7;
1680 rightMaterial = leftMaterial = iron;
1681 rightName = leftName =
"BarrelSaddleSupport";
1685 if ( (ModuleNcp >=39 && ModuleNcp <=42) || (ModuleNcp >=55 && ModuleNcp <=58) ) {
1686 dZright = dZleft = 8.5;
1687 dZsaddleR = dZsaddleL = 13.7;
1688 rightMaterial = leftMaterial = iron;
1689 rightName = leftName =
"ExtBarrelSaddleSupport";
1693 if (
m_log->level()<=MSG::DEBUG)
1694 (*m_log) << MSG::DEBUG <<
" Finger : number= "<<sec_number<<
" ModuleNcp = " <<ModuleNcp<<
" Sector= "<< Isector
1695 <<
" LRflag= " << LRflag <<
" Neg "<< boolNeg
1698 GeoTransform *rotateY =
new GeoTransform(GeoTrf::RotateY3D(90*Gaudi::Units::deg));
1699 GeoTransform *rotateZ =
new GeoTransform(GeoTrf::RotateZ3D(3*Gaudi::Units::deg));
1700 GeoTransform *rotateZm =
new GeoTransform(GeoTrf::RotateZ3D(-3*Gaudi::Units::deg));
1703 fingerCablesL =
new GeoBox(dXleft/2*Gaudi::Units::cm, dY/2*Gaudi::Units::cm, dZleft/2*Gaudi::Units::cm);
1704 lvFingerCablesL =
new GeoLogVol(leftName,fingerCablesL,leftMaterial);
1705 pvFingerCablesL =
new GeoPhysVol(lvFingerCablesL);
1708 fingerCablesR =
new GeoBox(dXright/2*Gaudi::Units::cm, dY/2*Gaudi::Units::cm, dZright/2*Gaudi::Units::cm);
1709 lvFingerCablesR =
new GeoLogVol(rightName,fingerCablesR,rightMaterial);
1710 pvFingerCablesR =
new GeoPhysVol(lvFingerCablesR);
1712 double YpoFinger =0;
1715 YpoFinger = -elementOffset+5.4;
1717 YpoFinger = elementOffset-5.4;
1720 tfFingerCables =
new GeoTransform(GeoTrf::Translate3D(elementZPozition*Gaudi::Units::cm +0.5*Gaudi::Units::cm -dZsaddleL*Gaudi::Units::cm,
1721 YpoFinger*Gaudi::Units::cm,
1722 (elementRC-(tilb_rmax + tile_rmax)/2)*Gaudi::Units::cm));
1723 mother->add(tfFingerCables);
1727 mother->add(rotateY);
1728 mother->add(rotateZm);
1730 mother->add(rotateY);
1731 mother->add(rotateZ);
1734 mother->add(
new GeoIdentifierTag(ModuleNcp));
1735 mother->add(pvFingerCablesL);
1738 YpoFinger = elementOffset-5.4;
1740 YpoFinger = -elementOffset+5.4;
1743 tfFingerCables =
new GeoTransform(GeoTrf::Translate3D(elementZPozition*Gaudi::Units::cm +0.5*Gaudi::Units::cm -dZsaddleR*Gaudi::Units::cm,
1744 YpoFinger*Gaudi::Units::cm,
1745 (elementRC-(tilb_rmax + tile_rmax)/2)*Gaudi::Units::cm));
1746 mother->add(tfFingerCables);
1750 mother->add(rotateY);
1751 mother->add(rotateZ);
1753 mother->add(rotateY);
1754 mother->add(rotateZm);
1757 mother->add(
new GeoIdentifierTag(ModuleNcp));
1758 mother->add(pvFingerCablesR);
1765 double tan_delta_phi_2,
1770 int CurrentScin = 0;
1771 const GeoShape* glue{
nullptr};
1772 GeoLogVol* lvGlue{
nullptr};
1773 PVLink pvGlue{
nullptr};
1774 GeoTransform* tfGlue{
nullptr};
1776 double scintiWrapInZ, scintiWrapInR, scintiThickness, scintiDeltaInPhi;
1777 double scintiHeight, scintiRC, scintiZPos, dy1Scintillator, dy2Scintillator;
1778 const GeoShape* scintillator{
nullptr};
1779 GeoLogVol* lvScintillator{
nullptr};
1780 PVLink pvScintillator{
nullptr};
1781 GeoTransform* tfScintillator{
nullptr};
1783 double thicknessWrapper, heightWrapper, dy1Wrapper, dy2Wrapper;
1784 const GeoShape* wrapper{
nullptr};
1785 GeoLogVol* lvWrapper{
nullptr};
1786 PVLink pvWrapper{
nullptr};
1787 GeoTransform* tfWrapper{
nullptr};
1789 (*m_log) << MSG::VERBOSE <<
" TileGeoSectionBuilder::fillPeriod"<<
endmsg;
1807 CurrentScin = 100*2 + 1;
1817 (*m_log) << MSG::VERBOSE <<
" TILBsection= "<<
m_dbManager->TILBsection()<<
endmsg;
1818 (*m_log) << MSG::VERBOSE <<
" CurrentScin= "<<CurrentScin<<
" TILBcurscint= "<<
m_dbManager->TILBcurscint()
1820 (*m_log) << MSG::VERBOSE <<
" period_type= "<<period_type <<
endmsg;
1826 const GeoMaterial* matScin =
nullptr;
1833 if (matScin !=
nullptr) {
1834 (*m_log) << MSG::VERBOSE <<
"Using Polyvinyltoluene for section = " <<
m_dbManager->TILBsection() <<
endmsg;
1836 (*m_log) << MSG::VERBOSE <<
"Using Polystyrene for section = " <<
m_dbManager->TILBsection() <<
endmsg;
1843 double csHoleR = 0.45 * Gaudi::Units::cm;
1844 double csTubeOuterR = 0.4 * Gaudi::Units::cm;
1845 double csTubeInnerR = 0.3 * Gaudi::Units::cm;
1846 double csTubeOffCorr = 1.35 * Gaudi::Units::cm;
1848 double thicknessMother2 = thickness/2.*Gaudi::Units::cm;
1854 if (dzglue>0.0 && period_type<4 && !removeGlue) {
1857 double dzglue2 = dzglue/2*Gaudi::Units::cm;
1858 dzglue2 = floor(dzglue2*1.0e+10)*1.0e-10;
1861 printdouble(
" period thickness/2 = ",thickness/2*Gaudi::Units::cm);
1862 printdouble(
" glue thickness/2 = ",dzglue/2*Gaudi::Units::cm);
1866 double dy1Glue = (
m_dbManager->TILBrmin() * tan_delta_phi_2 -
m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
1867 double dy2Glue = (
m_dbManager->TILBrmax() * tan_delta_phi_2 -
m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
1871 dzglue2,dzglue2,dy1Glue,dy2Glue,heightGlue2);
1873 glue =
new GeoTrd(dzglue2,dzglue2,dy1Glue,dy2Glue,heightGlue2);
1877 for (j = CurrentScin; j < (CurrentScin +
m_dbManager->TILBnscin()); j++) {
1880 double off0 =
m_dbManager->SCNTrc()*Gaudi::Units::cm - heightMother2;
1881 double off =
m_dbManager->SCNTdr()/2.*Gaudi::Units::cm - csTubeOffCorr;
1883 GeoTrf::Transform3D tfHole1 = GeoTrf::Translate3D(0.,0.,(off0-off)) * GeoTrf::RotateY3D(-90*Gaudi::Units::deg);
1884 GeoTrf::Transform3D tfHole2 = GeoTrf::Translate3D(0.,0.,(off0+off)) * GeoTrf::RotateY3D(-90*Gaudi::Units::deg);
1887 GeoShape *air1 =
new GeoTubs(csTubeOuterR, csHoleR, thicknessMother2, 0.,360.0 * Gaudi::Units::deg);
1888 GeoShape *air2 =
new GeoTubs(csTubeOuterR, csHoleR, thicknessMother2, 0.,360.0 * Gaudi::Units::deg);
1889 GeoShape *air3 =
new GeoTubs(0., csTubeInnerR, thicknessMother2, 0.,360.0 * Gaudi::Units::deg);
1891 GeoLogVol * lvAir1 =
new GeoLogVol(
"CsTubeAir1",air1,matAir);
1892 GeoLogVol * lvAir2 =
new GeoLogVol(
"CsTubeAir2",air2,matAir);
1893 GeoLogVol * lvAir3 =
new GeoLogVol(
"CsTubeAir3",air3,matAir);
1894 GeoPhysVol * pvAir1 =
new GeoPhysVol(lvAir1);
1895 GeoPhysVol * pvAir2 =
new GeoPhysVol(lvAir2);
1896 GeoPhysVol * pvAir3 =
new GeoPhysVol(lvAir3);
1898 GeoTransform* tftube1 =
new GeoTransform(tfHole1);
1899 GeoTransform* tftube2 =
new GeoTransform(tfHole2);
1900 GeoTransform* tftube3 =
new GeoTransform(tfHole2);
1902 mother->add(tftube1);
1903 mother->add(pvAir1);
1904 mother->add(tftube2);
1905 mother->add(pvAir2);
1906 mother->add(tftube3);
1907 mother->add(pvAir3);
1911 glue =
makeHoles(glue, csHoleR, dzglue2, off, off0);
1915 lvGlue =
new GeoLogVol(
"Glue",glue,matGlue);
1916 pvGlue =
new GeoPhysVol(lvGlue);
1919 switch(period_type) {
1928 tfGlue =
new GeoTransform(GeoTrf::Translate3D((-3.*dzglue/2-
m_dbManager->TILBdzmast())*Gaudi::Units::cm,0.,0.));
1929 mother->add(tfGlue);
1930 mother->add(pvGlue);
1933 printdouble(
" glue position = ",-dzglue/2*Gaudi::Units::cm);
1934 tfGlue =
new GeoTransform(GeoTrf::Translate3D(-dzglue/2*Gaudi::Units::cm,0.,0.));
1935 mother->add(tfGlue);
1936 mother->add(pvGlue);
1940 tfGlue =
new GeoTransform(GeoTrf::Translate3D((dzglue/2+
m_dbManager->TILBdzspac())*Gaudi::Units::cm,0.,0.));
1941 mother->add(tfGlue);
1942 mother->add(pvGlue);
1945 printdouble(
" glue position = ",(thickness-dzglue)/2*Gaudi::Units::cm);
1946 tfGlue =
new GeoTransform(GeoTrf::Translate3D((thickness-dzglue)/2*Gaudi::Units::cm,0.,0.));
1947 mother->add(tfGlue);
1948 mother->add(pvGlue);
1951 for (j = CurrentScin; j < (CurrentScin +
m_dbManager->TILBnscin()); j++) {
1952 GeoIdentifierTag* idTag =
new GeoIdentifierTag(j-CurrentScin);
1963 thicknessWrapper = (
m_dbManager->TILBdzspac() <= (scintiThickness + 2*scintiWrapInZ)) ?
1964 (scintiThickness + 2*scintiWrapInZ)*Gaudi::Units::cm:
m_dbManager->TILBdzspac()*Gaudi::Units::cm;
1968 heightWrapper = (scintiHeight + 2*scintiWrapInR)*Gaudi::Units::cm;
1969 dy1Wrapper = ((scintiRC - scintiHeight/2 - scintiWrapInR +
m_dbManager->TILBrmin()) *
1970 tan_delta_phi_2 -
m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
1971 dy2Wrapper = ((scintiRC + scintiHeight/2 + scintiWrapInR +
m_dbManager->TILBrmin()) *
1972 tan_delta_phi_2 -
m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
1975 thicknessWrapper/2,thicknessWrapper/2,dy1Wrapper,dy2Wrapper,heightWrapper/2);
1977 wrapper =
new GeoTrd(thicknessWrapper/2,
1984 wrapper =
makeHoles(wrapper, csHoleR, thicknessWrapper/2, scintiHeight/2.*Gaudi::Units::cm - csTubeOffCorr);
1986 lvWrapper =
new GeoLogVol(
"Wrapper",wrapper,matAir);
1987 pvWrapper =
new GeoPhysVol(lvWrapper);
1990 dy1Scintillator = ((scintiRC - scintiHeight/2 +
m_dbManager->TILBrmin()) *
1991 tan_delta_phi_2 -
m_dbManager->TILBphigap()/2 - scintiDeltaInPhi)*Gaudi::Units::cm;
1992 dy2Scintillator = ((scintiRC + scintiHeight/2 +
m_dbManager->TILBrmin()) *
1993 tan_delta_phi_2 -
m_dbManager->TILBphigap()/2 - scintiDeltaInPhi)*Gaudi::Units::cm;
1995 checking(
"Scintillator 0",
true, 6,
1996 scintiThickness/2*Gaudi::Units::cm,scintiThickness/2*Gaudi::Units::cm,dy1Scintillator,dy2Scintillator,scintiHeight/2*Gaudi::Units::cm);
1998 scintillator =
new GeoTrd(scintiThickness/2*Gaudi::Units::cm,
1999 scintiThickness/2*Gaudi::Units::cm,
2002 scintiHeight/2*Gaudi::Units::cm);
2005 scintillator =
makeHolesScint(scintillator, csHoleR, scintiThickness/2 * Gaudi::Units::cm, scintiHeight/2.*Gaudi::Units::cm - csTubeOffCorr);
2007 lvScintillator =
new GeoLogVol(
"Scintillator",scintillator,matScin);
2008 pvScintillator =
new GeoPhysVol(lvScintillator);
2011 tfScintillator =
new GeoTransform(GeoTrf::Translate3D(0.,0.,0.));
2012 pvWrapper->add(idTag);
2013 pvWrapper->add(tfScintillator);
2014 pvWrapper->add(pvScintillator);
2018 (*m_log) << MSG::VERBOSE <<
" X scintiZPos= "<<scintiZPos;
2020 (*m_log) << MSG::VERBOSE <<
" Y scintiRC= "<<scintiRC <<
endmsg;
2023 tfWrapper =
new GeoTransform(GeoTrf::Translate3D((scintiZPos*thickness+
m_dbManager->TILBdzspac()/2)*Gaudi::Units::cm,
2027 mother->add(tfWrapper);
2028 mother->add(pvWrapper);
2040 tfGlue =
new GeoTransform(GeoTrf::Translate3D((dzglue +
m_dbManager->TILBdzmast())*Gaudi::Units::cm/2,0.,0.));
2041 mother->add(tfGlue);
2042 mother->add(pvGlue);
2046 tfGlue =
new GeoTransform(GeoTrf::Translate3D(-(dzglue +
m_dbManager->TILBdzmast())*Gaudi::Units::cm/2,0.,0.));
2047 mother->add(tfGlue);
2048 mother->add(pvGlue);
2051 for (j = CurrentScin; j < (CurrentScin +
m_dbManager->TILBnscin()); j++) {
2052 GeoIdentifierTag* idTag =
new GeoIdentifierTag(j-CurrentScin);
2063 thicknessWrapper = (
m_dbManager->TILBdzspac() <= (scintiThickness + 2*scintiWrapInZ)) ?
2064 (scintiThickness + 2*scintiWrapInZ)*Gaudi::Units::cm:
m_dbManager->TILBdzspac()*Gaudi::Units::cm;
2068 heightWrapper = (scintiHeight + 2*scintiWrapInR)*Gaudi::Units::cm;
2069 dy1Wrapper = ((scintiRC - scintiHeight/2 - scintiWrapInR +
m_dbManager->TILBrmin()) *
2070 tan_delta_phi_2 -
m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
2071 dy2Wrapper = ((scintiRC + scintiHeight/2 + scintiWrapInR +
m_dbManager->TILBrmin()) *
2072 tan_delta_phi_2 -
m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
2075 thicknessWrapper/2,thicknessWrapper/2,dy1Wrapper,dy2Wrapper,heightWrapper/2);
2077 wrapper =
new GeoTrd(thicknessWrapper/2,
2084 wrapper =
makeHoles(wrapper, csHoleR, thicknessWrapper/2, scintiHeight/2.*Gaudi::Units::cm - csTubeOffCorr);
2086 lvWrapper =
new GeoLogVol(
"Wrapper",wrapper,matAir);
2087 pvWrapper =
new GeoPhysVol(lvWrapper);
2090 dy1Scintillator = ((scintiRC - scintiHeight/2 +
m_dbManager->TILBrmin()) *
2091 tan_delta_phi_2 -
m_dbManager->TILBphigap()/2 - scintiDeltaInPhi)*Gaudi::Units::cm;
2092 dy2Scintillator = ((scintiRC + scintiHeight/2 +
m_dbManager->TILBrmin()) *
2093 tan_delta_phi_2 -
m_dbManager->TILBphigap()/2 - scintiDeltaInPhi)*Gaudi::Units::cm;
2095 checking(
"Scintillator 1",
true, 6,
2096 scintiThickness/2*Gaudi::Units::cm,scintiThickness/2*Gaudi::Units::cm,dy1Scintillator,dy2Scintillator,scintiHeight/2*Gaudi::Units::cm);
2098 scintillator =
new GeoTrd(scintiThickness/2*Gaudi::Units::cm,
2099 scintiThickness/2*Gaudi::Units::cm,
2102 scintiHeight/2*Gaudi::Units::cm);
2105 scintillator =
makeHolesScint(scintillator, csHoleR, scintiThickness/2 * Gaudi::Units::cm, scintiHeight/2.*Gaudi::Units::cm - csTubeOffCorr);
2107 lvScintillator =
new GeoLogVol(
"Scintillator",scintillator,matScin);
2108 pvScintillator =
new GeoPhysVol(lvScintillator);
2111 tfScintillator =
new GeoTransform(GeoTrf::Translate3D(0.,0.,0.));
2112 pvWrapper->add(idTag);
2113 pvWrapper->add(tfScintillator);
2114 pvWrapper->add(pvScintillator);
2118 (*m_log) << MSG::VERBOSE <<
" X scintiZPos= "<<scintiZPos;
2120 (*m_log) << MSG::VERBOSE <<
" Y scintiRC= "<<scintiRC <<
endmsg;
2123 tfWrapper =
new GeoTransform(GeoTrf::Translate3D((2*scintiZPos+0.5)*(thickness-
m_dbManager->TILBdzspac())*Gaudi::Units::cm,
2127 mother->add(tfWrapper);
2128 mother->add(pvWrapper);
2139 printdouble(
" glue position = ",(-thickness + dzglue)*Gaudi::Units::cm/2);
2140 tfGlue =
new GeoTransform(GeoTrf::Translate3D((-thickness + dzglue)*Gaudi::Units::cm/2,0.,0.));
2141 mother->add(tfGlue);
2142 mother->add(pvGlue);
2146 tfGlue =
new GeoTransform(GeoTrf::Translate3D(((-thickness + 3*dzglue)+
m_dbManager->TILBdzmast())/2*Gaudi::Units::cm,0.,0.));
2147 mother->add(tfGlue);
2148 mother->add(pvGlue);
2151 printdouble(
" glue position = ",dzglue/2*Gaudi::Units::cm);
2152 tfGlue =
new GeoTransform(GeoTrf::Translate3D(dzglue/2*Gaudi::Units::cm,0.,0.));
2153 mother->add(tfGlue);
2154 mother->add(pvGlue);
2158 tfGlue =
new GeoTransform(GeoTrf::Translate3D((3.*dzglue/2 +
m_dbManager->TILBdzmast())*Gaudi::Units::cm,0.,0.));
2159 mother->add(tfGlue);
2160 mother->add(pvGlue);
2163 for (j = CurrentScin; j < (CurrentScin +
m_dbManager->TILBnscin()); j++) {
2164 GeoIdentifierTag* idTag =
new GeoIdentifierTag(j-CurrentScin);
2175 thicknessWrapper = (
m_dbManager->TILBdzspac() <= (scintiThickness + 2*scintiWrapInZ)) ?
2176 (scintiThickness + 2*scintiWrapInZ)*Gaudi::Units::cm:
m_dbManager->TILBdzspac()*Gaudi::Units::cm;
2180 heightWrapper = (scintiHeight + 2*scintiWrapInR)*Gaudi::Units::cm;
2182 dy1Wrapper = ((scintiRC - scintiHeight/2 - scintiWrapInR +
m_dbManager->TILBrmin()) *
2183 tan_delta_phi_2 -
m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
2184 dy2Wrapper = ((scintiRC + scintiHeight/2 + scintiWrapInR +
m_dbManager->TILBrmin()) *
2185 tan_delta_phi_2 -
m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
2188 thicknessWrapper/2,thicknessWrapper/2,dy1Wrapper,dy2Wrapper,heightWrapper/2);
2190 wrapper =
new GeoTrd(thicknessWrapper/2,
2197 wrapper =
makeHoles(wrapper, csHoleR, thicknessWrapper/2, scintiHeight/2.*Gaudi::Units::cm - csTubeOffCorr);
2199 lvWrapper =
new GeoLogVol(
"Wrapper",wrapper,matAir);
2200 pvWrapper =
new GeoPhysVol(lvWrapper);
2203 dy1Scintillator = ((scintiRC - scintiHeight/2 +
m_dbManager->TILBrmin()) *
2204 tan_delta_phi_2 -
m_dbManager->TILBphigap()/2 - scintiDeltaInPhi)*Gaudi::Units::cm;
2205 dy2Scintillator = ((scintiRC + scintiHeight/2 +
m_dbManager->TILBrmin()) *
2206 tan_delta_phi_2 -
m_dbManager->TILBphigap()/2 - scintiDeltaInPhi)*Gaudi::Units::cm;
2208 checking(
"Scintillator 2",
true, 6,
2209 scintiThickness/2*Gaudi::Units::cm,scintiThickness/2*Gaudi::Units::cm,dy1Scintillator,dy2Scintillator,scintiHeight/2*Gaudi::Units::cm);
2211 scintillator =
new GeoTrd(scintiThickness/2*Gaudi::Units::cm,
2212 scintiThickness/2*Gaudi::Units::cm,
2215 scintiHeight/2*Gaudi::Units::cm);
2218 scintillator =
makeHolesScint(scintillator, csHoleR, scintiThickness/2 * Gaudi::Units::cm, scintiHeight/2.*Gaudi::Units::cm - csTubeOffCorr);
2220 lvScintillator =
new GeoLogVol(
"Scintillator",scintillator,matScin);
2221 pvScintillator =
new GeoPhysVol(lvScintillator);
2224 tfScintillator =
new GeoTransform(GeoTrf::Translate3D(0.,0.,0.));
2225 pvWrapper->add(idTag);
2226 pvWrapper->add(tfScintillator);
2227 pvWrapper->add(pvScintillator);
2231 (*m_log) << MSG::VERBOSE <<
" X scintiZPos= "<<scintiZPos;
2233 (*m_log) << MSG::VERBOSE <<
" Y scintiRC= "<<scintiRC <<
endmsg;
2236 tfWrapper =
new GeoTransform(GeoTrf::Translate3D((scintiZPos*thickness-
m_dbManager->TILBdzspac()/2)*Gaudi::Units::cm,
2240 mother->add(tfWrapper);
2241 mother->add(pvWrapper);
2249 for (j = CurrentScin; j < (CurrentScin +
m_dbManager->TILBnscin()); j++) {
2260 thicknessWrapper = (
m_dbManager->TILBdzspac() <= (scintiThickness + 2*scintiWrapInZ)) ?
2261 (scintiThickness + 2*scintiWrapInZ)*Gaudi::Units::cm:
m_dbManager->TILBdzspac()*Gaudi::Units::cm;
2265 GeoIdentifierTag* idTag =
new GeoIdentifierTag(j-CurrentScin);
2267 heightWrapper = (scintiHeight + 2*scintiWrapInR)*Gaudi::Units::cm;
2268 dy1Wrapper = ((scintiRC - scintiHeight/2 - scintiWrapInR +
m_dbManager->TILBrmin()) *
2269 tan_delta_phi_2 -
m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
2270 dy2Wrapper = ((scintiRC + scintiHeight/2 + scintiWrapInR +
m_dbManager->TILBrmin()) *
2271 tan_delta_phi_2 -
m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
2274 thicknessWrapper/2,thicknessWrapper/2,dy1Wrapper,dy2Wrapper,heightWrapper/2);
2276 wrapper =
new GeoTrd(thicknessWrapper/2,
2283 wrapper =
makeHoles(wrapper, csHoleR, thicknessWrapper/2, scintiHeight/2.*Gaudi::Units::cm - csTubeOffCorr);
2285 lvWrapper =
new GeoLogVol(
"Wrapper",wrapper,matAir);
2286 pvWrapper =
new GeoPhysVol(lvWrapper);
2289 dy1Scintillator = ((scintiRC - scintiHeight/2 +
m_dbManager->TILBrmin()) *
2290 tan_delta_phi_2 -
m_dbManager->TILBphigap()/2 - scintiDeltaInPhi)*Gaudi::Units::cm;
2291 dy2Scintillator = ((scintiRC + scintiHeight/2 +
m_dbManager->TILBrmin()) *
2292 tan_delta_phi_2 -
m_dbManager->TILBphigap()/2 - scintiDeltaInPhi)*Gaudi::Units::cm;
2294 checking(
"Scintillator 3",
true, 6,
2295 scintiThickness/2*Gaudi::Units::cm,scintiThickness/2*Gaudi::Units::cm,dy1Scintillator,dy2Scintillator,scintiHeight/2*Gaudi::Units::cm);
2297 scintillator =
new GeoTrd(scintiThickness/2*Gaudi::Units::cm,
2298 scintiThickness/2*Gaudi::Units::cm,
2301 scintiHeight/2*Gaudi::Units::cm);
2304 scintillator =
makeHolesScint(scintillator, csHoleR, scintiThickness/2 * Gaudi::Units::cm, scintiHeight/2.*Gaudi::Units::cm - csTubeOffCorr);
2306 lvScintillator =
new GeoLogVol(
"Scintillator",scintillator,matScin);
2307 pvScintillator =
new GeoPhysVol(lvScintillator);
2310 tfScintillator =
new GeoTransform(GeoTrf::Translate3D(0.,0.,0.));
2311 pvWrapper->add(idTag);
2312 pvWrapper->add(tfScintillator);
2313 pvWrapper->add(pvScintillator);
2317 (*m_log) << MSG::VERBOSE <<
" X scintiZPos= "<<0.0 <<
endmsg;
2318 (*m_log) << MSG::VERBOSE <<
" Y scintiRC= "<<scintiRC <<
endmsg;
2321 tfWrapper =
new GeoTransform(GeoTrf::Translate3D(0.,
2325 mother->add(tfWrapper);
2326 mother->add(pvWrapper);
2336 double dy1Period = period->getYHalfLength1();
2337 double tanphi = (period->getYHalfLength2()-dy1Period)/period->getZHalfLength()/2.;
2338 if (
m_log->level()<=MSG::DEBUG)
2339 if (std::abs(tanphi-tan_delta_phi_2) > 1.e-5)
2340 (*m_log) << MSG::DEBUG <<
"Different tan_delta_phi_2 " << tanphi <<
" " << tan_delta_phi_2 <<
endmsg;
2342 for (j = CurrentScin; j < (CurrentScin +
m_dbManager->TILBnscin()); j++) {
2343 GeoIdentifierTag* idTag =
new GeoIdentifierTag(j-CurrentScin);
2355 heightWrapper = (scintiHeight + 2*scintiWrapInR)*Gaudi::Units::cm;
2356 thicknessWrapper = (scintiThickness + 2*scintiWrapInZ)*Gaudi::Units::cm;
2359 double thicknessEnvelope = (
m_dbManager->TILBdzmodul()*Gaudi::Units::cm - thicknessWrapper);
2360 dy1Wrapper = dy1Period - thicknessEnvelope + ((scintiRC - scintiHeight/2. - scintiWrapInR)*tanphi)*Gaudi::Units::cm;
2361 dy2Wrapper = dy1Period - thicknessEnvelope + ((scintiRC + scintiHeight/2. + scintiWrapInR)*tanphi)*Gaudi::Units::cm;
2363 if (
m_log->level()<=MSG::DEBUG)
2364 (*m_log) << MSG::DEBUG <<
"Envelope thickness is " << thicknessEnvelope <<
endmsg;
2366 thicknessWrapper/2,thicknessWrapper/2,dy1Wrapper,dy2Wrapper,heightWrapper/2);
2368 wrapper =
new GeoTrd(thicknessWrapper/2,
2373 lvWrapper =
new GeoLogVol(
"Wrapper",wrapper,matAir);
2374 pvWrapper =
new GeoPhysVol(lvWrapper);
2377 dy1Scintillator = dy1Period - thicknessEnvelope + ((scintiRC - scintiHeight/2.)*tanphi - scintiDeltaInPhi)*Gaudi::Units::cm;
2378 dy2Scintillator = dy1Period - thicknessEnvelope + ((scintiRC + scintiHeight/2.)*tanphi - scintiDeltaInPhi)*Gaudi::Units::cm;
2380 checking(
"Scintillator 4",
true, 6,
2381 scintiThickness/2*Gaudi::Units::cm,scintiThickness/2*Gaudi::Units::cm,dy1Scintillator,dy2Scintillator,scintiHeight/2*Gaudi::Units::cm);
2383 scintillator =
new GeoTrd(scintiThickness/2*Gaudi::Units::cm,
2384 scintiThickness/2*Gaudi::Units::cm,
2387 scintiHeight/2*Gaudi::Units::cm);
2388 lvScintillator =
new GeoLogVol(
"Scintillator",scintillator,matScin);
2389 pvScintillator =
new GeoPhysVol(lvScintillator);
2392 tfScintillator =
new GeoTransform(GeoTrf::Translate3D(0.,0.,0.));
2393 pvWrapper->add(idTag);
2394 pvWrapper->add(tfScintillator);
2395 pvWrapper->add(pvScintillator);
2399 (*m_log) << MSG::VERBOSE <<
" X scintiZPos= "<<0.0 <<
endmsg;
2400 (*m_log) << MSG::VERBOSE <<
" Y scintiRC= "<<scintiRC <<
endmsg;
2403 tfWrapper =
new GeoTransform(GeoTrf::Translate3D(0.,
2407 mother->add(tfWrapper);
2408 mother->add(pvWrapper);
2715 MLOG(
DEBUG) <<
"TileGeoSectionBuilder::computeCellDim for detector="
2719 std::vector<double> rmins;
2720 std::vector<double> rmaxs;
2721 std::vector<double> zmins;
2722 std::vector<double> zmaxs;
2726 std::vector<int> samples;
2730 unsigned int CurrentScin;
2732 int nSide, nTower, nSample=0;
2733 unsigned int nFirstRow, nLastRow, nRows;
2735 double dzCell, dzPeriod;
2737 double zEnd1 =0,zEnd2 =0,zEnd1Lim =0,zEnd2Lim =0;
2740 float minTilesInRow;
2761 if (addPlates) rMin -=
m_dbManager->TILBdrfront() *Gaudi::Units::cm;
2764 (*m_log) << MSG::ERROR <<
"TileGeoSectionBuilder::computeCellDim: Error return from TileDddbManager::TILBsection() " <<
endmsg;
2767 CurrentScin = 100*
section + 1;
2774 for (
unsigned int j = CurrentScin; j < (CurrentScin +
m_dbManager->TILBnscin()); j++) {
2777 if ( (j == CurrentScin +
m_dbManager->TILBnscin() - 1) && addPlates ) {
2785 tileSize=round(tileSize);
2789 rmins.push_back(rMin);
2790 rmaxs.push_back(rMax);
2798 zEnd1 = (-
m_dbManager->TILBdzmodul()/2)*Gaudi::Units::cm;
2799 zEnd2 = (
m_dbManager->TILBdzmodul()/2)*Gaudi::Units::cm;
2810 zmaxs.push_back(0.);
2815 samples.push_back((
int)
m_dbManager->TICLsample());
2822 if (currentSample==samples[
index])
break;
2823 if (
index==samples.size()) samples.push_back(currentSample);
2827 (*m_log) << MSG::ERROR <<
"TileGeoSectionBuilder::computeCellDim: No TICL structures for the detector: "
2834 currentSample = samples[
index];
2836 if (
m_dbManager->SetFirstTiclInDetSamp(detector, currentSample)) {
2840 nLastRow = nFirstRow + 2;
2844 nRows = nLastRow - nFirstRow + 1;
2849 for (
unsigned int jj=1; jj<nRows; jj++) {
2850 if (
m_dbManager->TICLntilesrow(jj)!=minTilesInRow)
2857 dzCell = minTilesInRow * dzPeriod;
2859 dzCell = (minTilesInRow + 0.5) * dzPeriod;
2861 MLOG(
DEBUG) <<
"dzCell: " << dzCell <<
" minTilesInRow: " << minTilesInRow <<
" isSquare: " << isSquare <<
" dzPeriod: " << dzPeriod <<
endmsg;
2863 for (
unsigned int jj=nFirstRow; jj<=nLastRow; jj++)
2864 zmaxs[jj-1] = zmins[jj-1] + dzCell;
2871 int firstC = nLastRow + 1;
2874 minTilesInRow =
m_dbManager->TICLntilesrow(firstC-nFirstRow);
2876 for (
unsigned int jj=firstC-nFirstRow+1; jj<=nLastRow-nFirstRow; jj++) {
2877 if (
m_dbManager->TICLntilesrow(jj)!=minTilesInRow)
2884 dzCell = minTilesInRow*dzPeriod;
2886 dzCell = (minTilesInRow + 0.5)*dzPeriod;
2889 MLOG(
DEBUG) <<
"BC - dzCell: " << dzCell <<
" minTilesInRow: " << minTilesInRow <<
" isSquare: " << isSquare <<
endmsg;
2891 for (
unsigned int jj=firstC; jj<=nLastRow; jj++)
2892 zmaxs[jj-1] = zmins[jj-1] + dzCell;
2904 for (
unsigned int jj=nFirstRow; jj<=nLastRow; jj++) {
2905 double Zmin=zmins[jj-1];
2906 double Zmax=zmaxs[jj-1];
2908 if (Zmin<zEnd1Lim) Zmin=zEnd1;
2909 else if (Zmin>zEnd2Lim) Zmin=zEnd2;
2910 if (Zmax<zEnd1Lim) Zmax=zEnd1;
2911 else if (Zmax>zEnd2Lim) Zmax=zEnd2;
2914 cellDim->
addRMin(rmins[jj-1]);
2915 cellDim->
addRMax(rmaxs[jj-1]);
2916 cellDim->
addZMin(Zmin+zShiftPos);
2917 cellDim->
addZMax(Zmax+zShiftPos);
2920 cellDimNeg->addRMin(rmins[jj-1]);
2921 cellDimNeg->addRMax(rmaxs[jj-1]);
2922 cellDimNeg->addZMin(-Zmax-zShiftNeg);
2923 cellDimNeg->addZMax(-Zmin-zShiftNeg);
2925 MLOG(
DEBUG) <<
"Zmin: " << Zmin <<
" Zmax: " << Zmax <<
" zShiftPos: " << zShiftPos <<
" zShiftNeg: " << zShiftNeg <<
endmsg;
2928 if (jj==nFirstRow || (BCcell && jj==nLastRow))
2929 MLOG(
DEBUG) <<
"Zmin: " << Zmin <<
" Zmax: " << Zmax <<
" zShift: " << zShiftPos <<
endmsg;
2933 for (
unsigned int jj=nFirstRow; jj<=nLastRow; jj++)
2934 zmins[jj-1] = zmaxs[jj-1];
2942 nSample = currentSample - 1;
2946 manager->add_cellDim(detector, nSide, nTower, nSample, cellDim);
2950 cellDimNeg->computeVolume();
2951 manager->add_cellDim(detector, 1, nTower, nSample, cellDim);
2952 manager->add_cellDim(detector, -1, nTower, nSample, cellDimNeg);
2960 std::cout << std::setiosflags(std::ios::fixed)
2961 << std::setw(9) << std::setprecision(2);
2962 std::cout <<
"\n **** Cell dimensions computed for : ";
2963 std::cout <<
"(" << detector <<
", "
2966 << nSample <<
")\n";
2967 std::cout <<
" >> CellDim contains " << cellDim->
getNRows() <<
" rows\n";
2968 for (
unsigned int jj=0; jj<cellDim->
getNRows(); jj++)
2969 std::cout << cellDim->
getRMin(jj) <<
" "
2970 << cellDim->
getRMax(jj) <<
" "
2971 << cellDim->
getZMin(jj) <<
" "
2972 << cellDim->
getZMax(jj) <<
"\n";
2973 std::cout <<
" >> Cell Volume is " << cellDim->
getVolume()*(1./Gaudi::Units::cm3) <<
" cm^3\n";
2976 std::cout <<
" >> CellDimNeg contains " << cellDimNeg->getNRows() <<
" rows\n";
2977 for (
unsigned int jj=0; jj<cellDimNeg->getNRows(); jj++)
2978 std::cout << cellDimNeg->getRMin(jj) <<
" "
2979 << cellDimNeg->getRMax(jj) <<
" "
2980 << cellDimNeg->getZMin(jj) <<
" "
2981 << cellDimNeg->getZMax(jj) <<
"\n";
2982 std::cout <<
" >> CellNeg Volume is " << cellDimNeg->getVolume()*(1./Gaudi::Units::cm3) <<
" cm^3\n";
2984 std::cout <<
"\n" << std::resetiosflags(std::ios::fixed);
2991 (*m_log) << MSG::ERROR <<
"TileGeoSectionBuilder::computeCellDim: No TICL structures in detector: "
2992 << detector <<
" for sample: " << nSample <<
endmsg;
3001 for (
unsigned int sec=0; sec<2; sec++) {
3017 if (addPlates) rMin -=
m_dbManager->TILBdrfront() *Gaudi::Units::cm;
3020 for (
unsigned int j = CurrentScin; j < (CurrentScin +
m_dbManager->TILBnscin()); j++) {
3023 if ( (j == CurrentScin +
m_dbManager->TILBnscin() - 1) && addPlates ) {
3027 if (addPlates && sec)
3028 rMax -=
m_dbManager->TILBdrfront()*Gaudi::Units::cm;
3034 tileSize=round(tileSize);
3038 rmins.push_back(rMin);
3039 rmaxs.push_back(rMax);
3058 (*m_log) << MSG::ERROR <<
"TileGeoSectionBuilder::computeCellDim: Bad return from TILBnscin" <<
endmsg;
3061 unsigned int nscin =
static_cast<unsigned int>(
m_dbManager->TILBnscin());
3065 for (
unsigned int jj=0; jj<nscin; jj++) {
3068 cellDim->
addZMin(zmins[jj]+zShiftPos);
3069 cellDim->
addZMax(zmaxs[jj]+zShiftPos);
3071 cellDimNeg->addRMin(rmins[jj]);
3072 cellDimNeg->addRMax(rmaxs[jj]);
3073 cellDimNeg->addZMin(-zmaxs[jj]-zShiftNeg);
3074 cellDimNeg->addZMax(-zmins[jj]-zShiftNeg);
3076 MLOG(
DEBUG) <<
"Zmin: " << zmins[0] <<
" Zmax: " << zmaxs[0] <<
" zShiftPos: " << zShiftPos <<
" zShiftNeg: " << zShiftNeg <<
endmsg;
3082 cellDimNeg->computeVolume();
3083 manager->add_cellDim(detector, 1, nTower, nSample, cellDim);
3084 manager->add_cellDim(detector, -1, nTower, nSample, cellDimNeg);
3088 std::cout << std::setiosflags(std::ios::fixed)
3089 << std::setw(9) << std::setprecision(2);
3090 std::cout <<
"\n **** Cell dimension computed for : ";
3091 std::cout <<
"(" << detector <<
", "
3094 << nSample <<
")\n";
3095 std::cout <<
" >> CellDim contains " << cellDim->
getNRows() <<
" rows\n";
3096 for (
unsigned int jj=0; jj<cellDim->
getNRows(); jj++)
3097 std::cout << cellDim->
getRMin(jj) <<
" "
3098 << cellDim->
getRMax(jj) <<
" "
3099 << cellDim->
getZMin(jj) <<
" "
3100 << cellDim->
getZMax(jj) <<
"\n";
3101 std::cout<<
" >> Cell Volume is " << cellDim->
getVolume()*(1./Gaudi::Units::cm3) <<
" cm^3\n";
3103 std::cout <<
" >> CellDimNeg contains " << cellDimNeg->getNRows() <<
" rows\n";
3104 for (
unsigned int jj=0; jj<cellDimNeg->getNRows(); jj++)
3105 std::cout << cellDimNeg->getRMin(jj) <<
" "
3106 << cellDimNeg->getRMax(jj) <<
" "
3107 << cellDimNeg->getZMin(jj) <<
" "
3108 << cellDimNeg->getZMax(jj) <<
"\n";
3109 std::cout <<
" >> CellNeg Volume is " << cellDimNeg->getVolume()*(1./Gaudi::Units::cm3) <<
" cm^3\n";
3110 std::cout <<
"\n" << std::resetiosflags(std::ios::fixed);
3115 for (
unsigned int sec=0; sec<2; sec++) {
3129 double rMIN =
m_dbManager->TILBrmin()*Gaudi::Units::cm;
3130 double rMAX =
m_dbManager->TILBrmax()*Gaudi::Units::cm;
3133 for (
unsigned int j = CurrentScin; j < (CurrentScin +
m_dbManager->TILBnscin()); j++) {
3136 double rCenter = rMIN +
m_dbManager->SCNTrc()*Gaudi::Units::cm;
3139 if (j==CurrentScin) {
3141 rMax = rCenter + dR2;
3143 rMin = rCenter - dR2;
3147 rMin = rCenter - dR2;
3148 rMax = rCenter + dR2;
3151 rmins.push_back(rMin);
3152 rmaxs.push_back(rMax);
3159 for (
unsigned int jj = 0; jj < (
unsigned int)
m_dbManager->TILBnscin(); jj++) {
3160 if (sec==0 && jj==0)
3174 cellDimNeg->addRMin(rmins[
m_dbManager->TILBnscin() - jj - 1]);
3175 cellDimNeg->addRMax(rmaxs[
m_dbManager->TILBnscin() - jj - 1]);
3176 cellDimNeg->addZMin(-zmaxs[
m_dbManager->TILBnscin() - jj - 1]-zShiftNeg);
3177 cellDimNeg->addZMax(-zmins[
m_dbManager->TILBnscin() - jj - 1]-zShiftNeg);
3179 MLOG(
DEBUG) <<
"Zmin: " << zmins[
m_dbManager->TILBnscin() - jj - 1] <<
" Zmax: " << zmaxs[
m_dbManager->TILBnscin() - jj - 1] <<
" zShiftPos: " << zShiftPos <<
" zShiftNeg: " << zShiftNeg <<
endmsg;
3185 cellDimNeg->computeVolume();
3186 manager->add_cellDim(detector, 1, nTower, nSample, cellDim);
3187 manager->add_cellDim(detector, -1, nTower, nSample, cellDimNeg);
3191 boost::io::ios_base_all_saver coutsave (std::cout);
3192 std::cout << std::setiosflags(std::ios::fixed)
3193 << std::setw(9) << std::setprecision(2);
3194 std::cout <<
"\n **** Cell dimension computed for : ";
3195 std::cout <<
"(" << detector <<
", "
3198 << nSample <<
")\n";
3199 std::cout <<
" >> CellDim contains " << cellDim->
getNRows() <<
" rows\n";
3200 for (
unsigned int jj=0; jj<cellDim->
getNRows(); jj++)
3201 std::cout << cellDim->
getRMin(jj) <<
" "
3202 << cellDim->
getRMax(jj) <<
" "
3203 << cellDim->
getZMin(jj) <<
" "
3204 << cellDim->
getZMax(jj) <<
"\n";
3205 std::cout <<
" >> Cell Volume is " << cellDim->
getVolume()*(1./Gaudi::Units::cm3) <<
" cm^3\n";
3207 std::cout <<
" >> CellDimNeg contains " << cellDimNeg->getNRows() <<
" rows\n";
3208 for (
unsigned int jj=0; jj<cellDimNeg->getNRows(); jj++)
3209 std::cout << cellDimNeg->getRMin(jj) <<
" "
3210 << cellDimNeg->getRMax(jj) <<
" "
3211 << cellDimNeg->getZMin(jj) <<
" "
3212 << cellDimNeg->getZMax(jj) <<
"\n";
3213 std::cout <<
" >> CellNeg Volume is " << cellDimNeg->getVolume()*(1./Gaudi::Units::cm3) <<
" cm^3\n";