67 (*m_log) << MSG::INFO <<
" Entering TileTBFactory::create()" <<
endmsg;
71 if (StatusCode::SUCCESS !=
m_detectorStore->retrieve(theMaterialManager,
"MATERIALS")) {
72 (*m_log) << MSG::ERROR <<
"Could not find Material Manager MATERIALS" <<
endmsg;
75 const GeoMaterial* matAir = theMaterialManager->
getMaterial(
"std::Air");
89 double thicknessWedgeMother, heightWedgeMother, dy1WedgeMother, dy2WedgeMother;
96 double PhiMax = -360.0;
97 double PhiMin = +360.0;
98 double RInMin = 999999.9;
101 bool IfEBNeg =
false;
102 bool IfEBPos =
false;
103 double tileTBEnvThickness = 0;
104 double ZLengthEBarrelNeg =0, ZLengthEBarrelPos =0;
109 double EBFingerLength = dbManager->
TIFGdz();
111 double BFingerLength = dbManager->
TIFGdz();
115 double FingerRmin = dbManager->
TILBrmax();
118 for (
int i = 0; i < n_env ; ++i) {
133 PhiMin = std::min(PhiMin, dbManager->
GetEnvDPhi());
135 RInMin = std::min(RInMin, dbManager->
GetEnvRin());
136 ROutMax= std::max(ROutMax, dbManager->
GetEnvRout());
139 (*m_log) << MSG::DEBUG <<
"tileTBEnvThickness 1 " << tileTBEnvThickness <<
endmsg;
147 (*m_log) << MSG::DEBUG <<
"tileTBEnvThickness 2 " << tileTBEnvThickness <<
endmsg;
155 (*m_log) << MSG::DEBUG <<
"tileTBEnvThickness 3 " << tileTBEnvThickness <<
endmsg;
159 if ((!IfEBNeg)&&(!IfEBPos)) {
161 tileTBEnvThickness += 2 * fabs(dbManager->
GetEnvDZ());
164 (*m_log) << MSG::DEBUG <<
"Presence of barrel " << ((IfB) ?
"true" :
"false") <<
endmsg;
165 (*m_log) << MSG::DEBUG <<
"Presence of positive ext.barrel " << ((IfEBPos) ?
"true" :
"false") <<
endmsg;
166 (*m_log) << MSG::DEBUG <<
"Presence of negative ext.barrel " << ((IfEBNeg) ?
"true" :
"false") <<
endmsg;
168 (*m_log) << MSG::DEBUG <<
"tileTBEnvThickness " << tileTBEnvThickness <<
endmsg;
176 GeoTubs* tileTBEnv =
new GeoTubs(RInMin * Gaudi::Units::cm,
177 ROutMax * Gaudi::Units::cm,
178 tileTBEnvThickness/2.0 * Gaudi::Units::cm,
179 PhiMin*Gaudi::Units::deg,
180 (PhiMax - PhiMin)*Gaudi::Units::deg);
182 (*m_log) << MSG::DEBUG <<
"TileTB envelope parameters: "
183 <<
" length=" << tileTBEnvThickness <<
" cm"
184 <<
" Rmin=" << RInMin <<
" cm"
185 <<
" Rmax=" << ROutMax <<
" cm"
186 <<
" PhiMin=" << PhiMin <<
" deg"
187 <<
" PhiMax=" << PhiMax <<
" deg"
190 GeoLogVol* lvTileTBEnv =
new GeoLogVol(
"TileTBEnv",tileTBEnv,matAir);
191 GeoFullPhysVol* pvTileTBEnv =
new GeoFullPhysVol(lvTileTBEnv);
193 GeoFullPhysVol *pvBarrelMother =0;
194 GeoFullPhysVol *pvEBarrelMotherNeg =0, *pvEBarrelMotherPos =0;
195 GeoFullPhysVol *pvFingerMotherNeg =0, *pvFingerMotherPos =0;
196 GeoFullPhysVol *pvEFingerMotherNeg =0, *pvEFingerMotherPos =0;
197 GeoFullPhysVol *pvITCMotherPos =0, *pvITCMotherNeg =0;
200 for (
int EnvCounter = 0; EnvCounter < NumberOfEnv; ++EnvCounter) {
216 GeoTubs* GeneralMother =
new GeoTubs((dbManager->
GetEnvRin()) * Gaudi::Units::cm,
218 (dbManager->
GetEnvZLength() - 2 * BFingerLength)/2.0 * Gaudi::Units::cm,
219 0.0 * Gaudi::Units::deg,
220 NumberOfMod*
deltaPhi*Gaudi::Units::deg);
222 GeoTubs* barrelMother = GeneralMother;
223 GeoLogVol* lvBarrelMother =
new GeoLogVol(
"Barrel",barrelMother,matAir);
224 pvBarrelMother =
new GeoFullPhysVol(lvBarrelMother);
226 (*m_log) << MSG::DEBUG <<
"Barrel envelope parameters: "
227 <<
" length=" << (dbManager->
GetEnvZLength() - 2 * BFingerLength) <<
" cm"
228 <<
" Rmin=" << (dbManager->
GetEnvRin()) <<
" cm"
229 <<
" Rmax=" << (dbManager->
GetEnvRout()) <<
" cm"
230 <<
" nMod=" << NumberOfMod
236 GeoTubs* fingerMother =
new GeoTubs(FingerRmin*Gaudi::Units::cm,
238 BFingerLength/2.*Gaudi::Units::cm,
239 0.0 * Gaudi::Units::deg,
240 NumberOfMod*
deltaPhi*Gaudi::Units::deg);
242 GeoLogVol* lvFingerMother =
new GeoLogVol(
"Finger",fingerMother,matAir);
243 pvFingerMotherPos =
new GeoFullPhysVol(lvFingerMother);
244 pvFingerMotherNeg =
new GeoFullPhysVol(lvFingerMother);
246 (*m_log) << MSG::DEBUG <<
"Barrel finger envelope parameters: "
247 <<
" length=" << BFingerLength <<
" cm"
248 <<
" Rmin=" << FingerRmin <<
" cm"
249 <<
" Rmax=" << (dbManager->
GetEnvRout()) <<
" cm"
250 <<
" nMod=" << NumberOfMod
255 GeoTubs* GeneralMother =
new GeoTubs((dbManager->
GetEnvRin()) * Gaudi::Units::cm,
257 (dbManager->
GetEnvZLength() - EBFingerLength)/2.0 * Gaudi::Units::cm,
258 0.0 * Gaudi::Units::deg,
259 NumberOfMod*
deltaPhi*Gaudi::Units::deg);
261 GeoTubs* ebarrelMotherPos = GeneralMother;
262 GeoLogVol* lvEBarrelMotherPos =
new GeoLogVol(
"EBarrel",ebarrelMotherPos,matAir);
263 pvEBarrelMotherPos =
new GeoFullPhysVol(lvEBarrelMotherPos);
265 (*m_log) << MSG::DEBUG <<
"Positive ext.barrel envelope parameters: "
266 <<
" length=" << (dbManager->
GetEnvZLength() - EBFingerLength) <<
" cm"
267 <<
" Rmin=" << (dbManager->
GetEnvRin()) <<
" cm"
268 <<
" Rmax=" << (dbManager->
GetEnvRout()) <<
" cm"
269 <<
" nMod=" << NumberOfMod
273 GeoTubs* fingerMother =
new GeoTubs(FingerRmin*Gaudi::Units::cm,
275 EBFingerLength/2.*Gaudi::Units::cm,
276 0.0 * Gaudi::Units::deg,
277 NumberOfMod*
deltaPhi*Gaudi::Units::deg);
279 GeoLogVol* lvEFingerMother =
new GeoLogVol(
"EFinger",fingerMother,matAir);
280 pvEFingerMotherPos =
new GeoFullPhysVol(lvEFingerMother);
282 (*m_log) << MSG::DEBUG <<
"Positive ext.barrel finger envelope parameters: "
283 <<
" length=" << EBFingerLength <<
" cm"
284 <<
" Rmin=" << FingerRmin <<
" cm"
285 <<
" Rmax=" << (dbManager->
GetEnvRout()) <<
" cm"
286 <<
" nMod=" << NumberOfMod
291 GeoTubs* GeneralMother =
new GeoTubs((dbManager->
GetEnvRin()) * Gaudi::Units::cm,
293 (dbManager->
GetEnvZLength() - EBFingerLength)/2.0 * Gaudi::Units::cm,
294 0.0 * Gaudi::Units::deg,
295 NumberOfMod*
deltaPhi*Gaudi::Units::deg);
296 GeoTubs* ebarrelMotherNeg = GeneralMother;
297 GeoLogVol* lvEBarrelMotherNeg =
new GeoLogVol(
"EBarrel",ebarrelMotherNeg,matAir);
298 pvEBarrelMotherNeg =
new GeoFullPhysVol(lvEBarrelMotherNeg);
300 (*m_log) << MSG::DEBUG <<
"Negative ext.barrel envelope parameters: "
301 <<
" length=" << (dbManager->
GetEnvZLength() - EBFingerLength) <<
" cm"
302 <<
" Rmin=" << (dbManager->
GetEnvRin()) <<
" cm"
303 <<
" Rmax=" << (dbManager->
GetEnvRout()) <<
" cm"
304 <<
" nMod=" << NumberOfMod
308 GeoTubs* fingerMother =
new GeoTubs(FingerRmin*Gaudi::Units::cm,
310 EBFingerLength/2.*Gaudi::Units::cm,
311 0.0 * Gaudi::Units::deg,
312 NumberOfMod*
deltaPhi*Gaudi::Units::deg);
314 GeoLogVol* lvEFingerMother =
new GeoLogVol(
"EFinger",fingerMother,matAir);
315 pvEFingerMotherNeg =
new GeoFullPhysVol(lvEFingerMother);
317 (*m_log) << MSG::DEBUG <<
"Negative ext.barrel finger envelope parameters: "
318 <<
" length=" << EBFingerLength <<
" cm"
319 <<
" Rmin=" << FingerRmin <<
" cm"
320 <<
" Rmax=" << (dbManager->
GetEnvRout()) <<
" cm"
321 <<
" nMod=" << NumberOfMod
326 GeoTubs* GeneralMother =
new GeoTubs((dbManager->
GetEnvRin()) * Gaudi::Units::cm,
329 0.0 * Gaudi::Units::deg,
330 NumberOfMod*
deltaPhi*Gaudi::Units::deg);
332 GeoTubs* itcMother = GeneralMother;
333 GeoLogVol* lvITCMother =
new GeoLogVol(
"ITC",itcMother,matAir);
334 pvITCMotherPos =
new GeoFullPhysVol(lvITCMother);
336 (*m_log) << MSG::DEBUG <<
"Positive ITC envelope parameters: "
338 <<
" Rmin=" << (dbManager->
GetEnvRin()) <<
" cm"
339 <<
" Rmax=" << (dbManager->
GetEnvRout()) <<
" cm"
340 <<
" nMod=" << NumberOfMod
345 GeoTubs* GeneralMother =
new GeoTubs((dbManager->
GetEnvRin()) * Gaudi::Units::cm,
348 0.0 * Gaudi::Units::deg,
349 NumberOfMod*
deltaPhi*Gaudi::Units::deg);
351 GeoTubs* itcMotherNeg = GeneralMother;
352 GeoLogVol* lvITCMotherNeg =
new GeoLogVol(
"ITC",itcMotherNeg,matAir);
353 pvITCMotherNeg =
new GeoFullPhysVol(lvITCMotherNeg);
355 (*m_log) << MSG::DEBUG <<
"Negative ITC envelope parameters: "
357 <<
" Rmin=" << (dbManager->
GetEnvRin()) <<
" cm"
358 <<
" Rmax=" << (dbManager->
GetEnvRout()) <<
" cm"
359 <<
" nMod=" << NumberOfMod
370 for (
int ModCounter = 0; ModCounter < NumberOfMod; ModCounter+=NumberOfMod) {
374 (*m_log) << MSG::DEBUG
375 <<
"ModCounter is " << ModCounter
376 <<
" ModType is " << ModType
377 <<
" ModPositionNumber is " << ModPositionNumber
381 GENFUNCTION phiInd =
deltaPhi*(varInd + ModCounter + 0.5) * Gaudi::Units::deg;
386 if ( EnvType == 1 || EnvType == 0 ) {
388 thicknessWedgeMother = dbManager->
TILBdzmodul() * Gaudi::Units::cm;
390 dy1WedgeMother = dbManager->
TILBrminimal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
391 dy2WedgeMother = dbManager->
TILBrmaximal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
395 GeoTrd* barrelModuleMother =
new GeoTrd(thicknessWedgeMother/2.,
396 thicknessWedgeMother/2.,
399 heightWedgeMother/2.);
401 GeoLogVol* lvBarrelModuleMother =
new GeoLogVol(
"BarrelModule",barrelModuleMother,matAir);
402 PVLink pvBarrelModuleMother =
new GeoPhysVol(lvBarrelModuleMother);
412 TRANSFUNCTION xfBarrelModuleMother = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->
TILBrmaximal()+dbManager->
TILBrminimal())/2.*Gaudi::Units::cm)*GeoTrf::RotateX3D(180*Gaudi::Units::deg)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
414 GeoSerialTransformer* stBarrelModuleMother =
new GeoSerialTransformer(pvBarrelModuleMother,
415 &xfBarrelModuleMother,
418 pvBarrelMother->add(
new GeoSerialIdentifier(ModPositionNumber));
419 pvBarrelMother->add(stBarrelModuleMother);
421 (*m_log) << MSG::ERROR <<
"pvBarrelMother is null in " << __func__ <<
endmsg;
432 thicknessWedgeMother = dbManager->
TIFGdz() * Gaudi::Units::cm;
433 heightWedgeMother = (dbManager->
TILErmax() - dbManager->
TILBrmax()) * Gaudi::Units::cm;
434 dy1WedgeMother = dbManager->
TILBrmax() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
435 dy2WedgeMother = dbManager->
TILErmax() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
437 GeoTrd* fingerModuleMother =
new GeoTrd(thicknessWedgeMother/2.,
438 thicknessWedgeMother/2.,
441 heightWedgeMother/2.);
443 GeoLogVol* lvFingerModuleMother =
new GeoLogVol(
"FingerModule",fingerModuleMother,matAir);
444 PVLink pvFingerModuleMother =
new GeoPhysVol(lvFingerModuleMother);
447 sectionBuilder->
fillFinger(pvFingerModuleMother, 1,
453 thicknessWedgeMother*(1./Gaudi::Units::cm));
456 TRANSFUNCTION xfFingerModuleMotherPos = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->
TILErmax()+dbManager->
TILBrmax())/2.*Gaudi::Units::cm)*GeoTrf::RotateX3D(180*Gaudi::Units::deg)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
458 GeoSerialTransformer* stFingerModuleMotherPos =
new GeoSerialTransformer(pvFingerModuleMother,
459 &xfFingerModuleMotherPos,
461 pvFingerMotherPos->add(
new GeoSerialIdentifier(ModPositionNumber));
462 pvFingerMotherPos->add(stFingerModuleMotherPos);
464 TRANSFUNCTION xfFingerModuleMotherNeg = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->
TILErmax()+dbManager->
TILBrmax())/2.*Gaudi::Units::cm)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
466 GeoSerialTransformer* stFingerModuleMotherNeg =
new GeoSerialTransformer(pvFingerModuleMother,
467 &xfFingerModuleMotherNeg,
469 pvFingerMotherNeg->add(
new GeoSerialIdentifier(ModPositionNumber));
470 pvFingerMotherNeg->add(stFingerModuleMotherNeg);
476 if ((ModType == 2)&&(EnvType == 3)) {
479 thicknessWedgeMother = dbManager->
TILBdzmodul() * Gaudi::Units::cm;
481 dy1WedgeMother = dbManager->
TILBrminimal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
482 dy2WedgeMother = dbManager->
TILBrmaximal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
486 GeoTrd* ebarrelModuleMotherPos =
new GeoTrd(thicknessWedgeMother/2.,
487 thicknessWedgeMother/2.,
490 heightWedgeMother/2.);
492 GeoLogVol* lvEBarrelModuleMotherPos =
new GeoLogVol(
"EBarrelModule",ebarrelModuleMotherPos,matAir);
493 PVLink pvEBarrelModuleMotherPos =
new GeoPhysVol(lvEBarrelModuleMotherPos);
496 sectionBuilder->
fillSection(pvEBarrelModuleMotherPos,
503 TRANSFUNCTION xfEBarrelModuleMotherPos = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->
TILBrmaximal()+dbManager->
TILBrminimal())/2.*Gaudi::Units::cm)*GeoTrf::RotateX3D(180*Gaudi::Units::deg)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
505 GeoSerialTransformer* stEBarrelModuleMotherPos =
new GeoSerialTransformer(pvEBarrelModuleMotherPos,
506 &xfEBarrelModuleMotherPos,
508 pvEBarrelMotherPos->add(
new GeoSerialIdentifier(ModPositionNumber));
509 pvEBarrelMotherPos->add(stEBarrelModuleMotherPos);
517 thicknessWedgeMother = dbManager->
TIFGdz() * Gaudi::Units::cm;
518 heightWedgeMother = (dbManager->
TILErmax() - dbManager->
TILBrmax()) * Gaudi::Units::cm;
519 dy1WedgeMother = dbManager->
TILBrmax() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
520 dy2WedgeMother = dbManager->
TILErmax() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
522 GeoTrd* efingerModuleMother =
new GeoTrd(thicknessWedgeMother/2.,
523 thicknessWedgeMother/2.,
526 heightWedgeMother/2.);
528 GeoLogVol* lvEFingerModuleMother =
new GeoLogVol(
"EFingerModule",efingerModuleMother,matAir);
529 PVLink pvEFingerModuleMother =
new GeoPhysVol(lvEFingerModuleMother);
532 sectionBuilder->
fillFinger(pvEFingerModuleMother,
541 TRANSFUNCTION xfEFingerModuleMotherPos = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->
TILErmax()+dbManager->
TILBrmax())/2.*Gaudi::Units::cm)*GeoTrf::RotateX3D(180*Gaudi::Units::deg)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
543 GeoSerialTransformer* stEFingerModuleMotherPos =
new GeoSerialTransformer(pvEFingerModuleMother,
544 &xfEFingerModuleMotherPos,
546 pvEFingerMotherPos->add(
new GeoSerialIdentifier(ModPositionNumber));
547 pvEFingerMotherPos->add(stEFingerModuleMotherPos);
553 if ((ModType == 2)&&(EnvType == 2)) {
556 thicknessWedgeMother = dbManager->
TILBdzmodul() * Gaudi::Units::cm;
558 dy1WedgeMother = dbManager->
TILBrminimal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
559 dy2WedgeMother = dbManager->
TILBrmaximal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
563 GeoTrd* ebarrelModuleMotherNeg =
new GeoTrd(thicknessWedgeMother/2.,
564 thicknessWedgeMother/2.,
567 heightWedgeMother/2.);
569 GeoLogVol* lvEBarrelModuleMotherNeg =
new GeoLogVol(
"EBarrelModule",ebarrelModuleMotherNeg,matAir);
570 PVLink pvEBarrelModuleMotherNeg =
new GeoPhysVol(lvEBarrelModuleMotherNeg);
573 sectionBuilder->
fillSection(pvEBarrelModuleMotherNeg,
580 TRANSFUNCTION xfEBarrelModuleMotherNeg = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->
TILBrmaximal()+dbManager->
TILBrminimal())/2.*Gaudi::Units::cm)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
582 GeoSerialTransformer* stEBarrelModuleMotherNeg =
new GeoSerialTransformer(pvEBarrelModuleMotherNeg,
583 &xfEBarrelModuleMotherNeg,
585 pvEBarrelMotherNeg->add(
new GeoSerialIdentifier(ModPositionNumber));
586 pvEBarrelMotherNeg->add(stEBarrelModuleMotherNeg);
595 thicknessWedgeMother = dbManager->
TIFGdz() * Gaudi::Units::cm;
596 heightWedgeMother = (dbManager->
TILErmax() - dbManager->
TILBrmax()) * Gaudi::Units::cm;
597 dy1WedgeMother = dbManager->
TILBrmax() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
598 dy2WedgeMother = dbManager->
TILErmax() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
600 GeoTrd* efingerModuleMother =
new GeoTrd(thicknessWedgeMother/2.,
601 thicknessWedgeMother/2.,
604 heightWedgeMother/2.);
606 GeoLogVol* lvEFingerModuleMother =
new GeoLogVol(
"EFingerModule",efingerModuleMother,matAir);
607 PVLink pvEFingerModuleMother =
new GeoPhysVol(lvEFingerModuleMother);
610 sectionBuilder->
fillFinger(pvEFingerModuleMother,
617 TRANSFUNCTION xfEFingerModuleMotherNeg = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->
TILErmax()+dbManager->
TILBrmax())/2.*Gaudi::Units::cm)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
619 GeoSerialTransformer* stEFingerModuleMotherNeg =
new GeoSerialTransformer(pvEFingerModuleMother,
620 &xfEFingerModuleMotherNeg,
622 pvEFingerMotherNeg->add(
new GeoSerialIdentifier(ModPositionNumber));
623 pvEFingerMotherNeg->add(stEFingerModuleMotherNeg);
629 if (((ModType == 6050403)||(ModType == 403))&&(EnvType == 5)) {
637 thicknessWedgeMother = dbManager->
TILBdzmodul() * Gaudi::Units::cm;
638 heightWedgeMother = (dbManager->
TILBrmaximal() - rMinITC) * Gaudi::Units::cm;
639 dy1WedgeMother = rMinITC * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
640 dy2WedgeMother = dbManager->
TILBrmaximal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
642 GeoTrd* itcModuleMotherPos =
new GeoTrd(thicknessWedgeMother/2.,
643 thicknessWedgeMother/2.,
646 heightWedgeMother/2.);
648 GeoLogVol* lvITCModuleMotherPos =
new GeoLogVol(
"ITCModule",itcModuleMotherPos,matAir);
649 PVLink pvITCModuleMotherPos =
new GeoPhysVol(lvITCModuleMotherPos);
657 thicknessWedgeMother = dbManager->
TILBdzmodul() * Gaudi::Units::cm;
659 dy1WedgeMother = dbManager->
TILBrmin() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
660 dy2WedgeMother = dbManager->
TILBrmaximal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
664 GeoTrd* plug1SubMother =
new GeoTrd(thicknessWedgeMother/2.,
665 thicknessWedgeMother/2.,
668 heightWedgeMother/2.);
671 thicknessWedgeMother = (dbManager->
TILBdzmodul() - dzITC2) * Gaudi::Units::cm;
673 dy1WedgeMother = dbManager->
TILBrminimal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
674 dy2WedgeMother = dbManager->
TILBrmin() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
675 GeoTrd* plug2SubMother =
new GeoTrd(thicknessWedgeMother/2.,
676 thicknessWedgeMother/2.,
679 heightWedgeMother/2.);
681 GeoTrf::Translate3D plug1SubOffset(-dzITC2*Gaudi::Units::cm/2.,
685 const GeoShapeUnion& plug1ModuleMother = plug1SubMother->add(*plug2SubMother<<plug1SubOffset);
686 GeoLogVol* lvPlug1ModuleMother =
new GeoLogVol(
"Plug1Module",&plug1ModuleMother,matAir);
687 PVLink pvPlug1ModuleMother =
new GeoPhysVol(lvPlug1ModuleMother);
690 sectionBuilder->
fillSection(pvPlug1ModuleMother, 3,
698 GeoTransform* tfPlug1ModuleMother =
new GeoTransform(GeoTrf::Translate3D(0.,
700 (dbManager->
TILBrmin()-rMinITC)*Gaudi::Units::cm/2.));
703 pvITCModuleMotherPos->add(tfPlug1ModuleMother);
704 pvITCModuleMotherPos->add(pvPlug1ModuleMother);
708 thicknessWedgeMother = dbManager->
TILBdzmodul() * Gaudi::Units::cm;
710 dy1WedgeMother = dbManager->
TILBrminimal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
711 dy2WedgeMother = dbManager->
TILBrmaximal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
714 GeoTrd* plug2ModuleMother =
new GeoTrd(thicknessWedgeMother/2.,
715 thicknessWedgeMother/2.,
718 heightWedgeMother/2.);
720 GeoLogVol* lvPlug2ModuleMother =
new GeoLogVol(
"Plug2Module",plug2ModuleMother,matAir);
721 PVLink pvPlug2ModuleMother =
new GeoPhysVol(lvPlug2ModuleMother);
733 GeoTransform* tfPlug2ModuleMother =
new GeoTransform(GeoTrf::Translate3D((dbManager->
TILBdzmodul() - dzITC2)*Gaudi::Units::cm/2.,
736 pvITCModuleMotherPos->add(tfPlug2ModuleMother);
737 pvITCModuleMotherPos->add(pvPlug2ModuleMother);
739 TRANSFUNCTION xfITCModuleMotherPos = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->
TILBrmaximal()+rMinITC)/2.*Gaudi::Units::cm)*GeoTrf::RotateX3D(180*Gaudi::Units::deg)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
741 GeoSerialTransformer* stITCModuleMotherPos =
new GeoSerialTransformer(pvITCModuleMotherPos,
742 &xfITCModuleMotherPos,
744 pvITCMotherPos->add(
new GeoSerialIdentifier(ModPositionNumber));
745 pvITCMotherPos->add(stITCModuleMotherPos);
751 if (((ModType == 6050403)||(ModType == 403))&&(EnvType == 4)) {
759 thicknessWedgeMother = dbManager->
TILBdzmodul() * Gaudi::Units::cm;
760 heightWedgeMother = (dbManager->
TILBrmaximal() - rMinITC) * Gaudi::Units::cm;
761 dy1WedgeMother = rMinITC * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
762 dy2WedgeMother = dbManager->
TILBrmaximal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
764 GeoTrd* itcModuleMotherNeg =
new GeoTrd(thicknessWedgeMother/2.,
765 thicknessWedgeMother/2.,
768 heightWedgeMother/2.);
770 GeoLogVol* lvITCModuleMotherNeg =
new GeoLogVol(
"ITCModule",itcModuleMotherNeg,matAir);
771 PVLink pvITCModuleMotherNeg =
new GeoPhysVol(lvITCModuleMotherNeg);
779 thicknessWedgeMother = dbManager->
TILBdzmodul() * Gaudi::Units::cm;
781 dy1WedgeMother = dbManager->
TILBrmin() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
782 dy2WedgeMother = dbManager->
TILBrmaximal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
786 GeoTrd* plug1SubMother =
new GeoTrd(thicknessWedgeMother/2.,
787 thicknessWedgeMother/2.,
790 heightWedgeMother/2.);
793 thicknessWedgeMother = (dbManager->
TILBdzmodul() - dzITC2) * Gaudi::Units::cm;
795 dy1WedgeMother = dbManager->
TILBrminimal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
796 dy2WedgeMother = dbManager->
TILBrmin() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
797 GeoTrd* plug2SubMother =
new GeoTrd(thicknessWedgeMother/2.,
798 thicknessWedgeMother/2.,
801 heightWedgeMother/2.);
803 GeoTrf::Translate3D plug1SubOffset(-dzITC2*Gaudi::Units::cm/2.,
807 const GeoShapeUnion& plug1ModuleMother = plug1SubMother->add(*plug2SubMother<<plug1SubOffset);
808 GeoLogVol* lvPlug1ModuleMother =
new GeoLogVol(
"Plug1Module",&plug1ModuleMother,matAir);
809 PVLink pvPlug1ModuleMother =
new GeoPhysVol(lvPlug1ModuleMother);
821 GeoTransform* tfPlug1ModuleMother =
new GeoTransform(GeoTrf::Translate3D(0.,
823 (dbManager->
TILBrmin()-rMinITC)*Gaudi::Units::cm/2.));
826 pvITCModuleMotherNeg->add(tfPlug1ModuleMother);
827 pvITCModuleMotherNeg->add(pvPlug1ModuleMother);
831 thicknessWedgeMother = dbManager->
TILBdzmodul() * Gaudi::Units::cm;
833 dy1WedgeMother = dbManager->
TILBrminimal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
834 dy2WedgeMother = dbManager->
TILBrmaximal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
837 GeoTrd* plug2ModuleMother =
new GeoTrd(thicknessWedgeMother/2.,
838 thicknessWedgeMother/2.,
841 heightWedgeMother/2.);
843 GeoLogVol* lvPlug2ModuleMother =
new GeoLogVol(
"Plug2Module",plug2ModuleMother,matAir);
844 PVLink pvPlug2ModuleMother =
new GeoPhysVol(lvPlug2ModuleMother);
856 GeoTransform* tfPlug2ModuleMother =
new GeoTransform(GeoTrf::Translate3D((dbManager->
TILBdzmodul() - dzITC2)*Gaudi::Units::cm/2.,
859 pvITCModuleMotherNeg->add(tfPlug2ModuleMother);
860 pvITCModuleMotherNeg->add(pvPlug2ModuleMother);
862 TRANSFUNCTION xfITCModuleMotherNeg = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->
TILBrmaximal()+rMinITC)/2.*Gaudi::Units::cm)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
864 GeoSerialTransformer* stITCModuleMotherNeg =
new GeoSerialTransformer(pvITCModuleMotherNeg,
865 &xfITCModuleMotherNeg,
867 pvITCMotherNeg->add(
new GeoSerialIdentifier(ModPositionNumber));
868 pvITCMotherNeg->add(stITCModuleMotherNeg);
874 if (EnvType == 1 || EnvType == 0) {
875 GeoTransform* tfBarrelMother;
877 if ((IfEBPos&&IfEBNeg)||((!IfEBPos)&&(!IfEBNeg))) {
880 else if (IfEBPos&&(!IfEBNeg)) {
883 else if ((!IfEBPos)&&IfEBNeg) {
889 tfBarrelMother =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::RotateZ3D((dbManager->
GetEnvDPhi())*Gaudi::Units::deg));
890 (*m_log) << MSG::DEBUG <<
"Positioning barrel with translation " << ztrans <<
" cm" <<
endmsg;
891 GeoNameTag* ntBarrelModuleMother =
new GeoNameTag(
"Barrel");
893 pvTileTBEnv->add(tfBarrelMother);
894 pvTileTBEnv->add(ntBarrelModuleMother);
895 pvTileTBEnv->add(pvBarrelMother);
897 GeoTransform* tfFingerMotherPos;
899 if ((IfEBPos&&IfEBNeg)||((!IfEBPos)&&(!IfEBNeg))) {
902 else if ((!IfEBPos)&&IfEBNeg) {
903 ztrans = dbManager->
GetEnvDZ() + (tileTBEnvThickness/2. - BFingerLength/2.);
905 else if (IfEBPos&&(!IfEBNeg)) {
906 ztrans = dbManager->
GetEnvDZ() + (-tileTBEnvThickness/2. + dbManager->
GetEnvZLength() - BFingerLength/2.);
911 tfFingerMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::RotateZ3D((dbManager->
GetEnvDPhi())*Gaudi::Units::deg));
912 (*m_log) << MSG::DEBUG <<
"Positioning positive barrel finger with translation " << ztrans
914 GeoNameTag* ntFingerMotherPos =
new GeoNameTag(
"TileFingerPos");
915 pvTileTBEnv->add(tfFingerMotherPos);
916 pvTileTBEnv->add(ntFingerMotherPos);
917 pvTileTBEnv->add(pvFingerMotherPos);
919 GeoTransform* tfFingerMotherNeg;
921 if ((IfEBPos&&IfEBNeg)||((!IfEBPos)&&(!IfEBNeg))) {
924 else if (IfEBPos&&(!IfEBNeg)) {
925 ztrans = dbManager->
GetEnvDZ() + (-tileTBEnvThickness/2. + BFingerLength/2.);
927 else if ((!IfEBPos)&&IfEBNeg) {
928 ztrans = dbManager->
GetEnvDZ() + ( tileTBEnvThickness/2. - dbManager->
GetEnvZLength() + BFingerLength/2.);
933 tfFingerMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::RotateZ3D((dbManager->
GetEnvDPhi())*Gaudi::Units::deg));
934 (*m_log) << MSG::DEBUG <<
"Positioning negative barrel finger with translation " << ztrans
936 GeoNameTag* ntFingerMotherNeg =
new GeoNameTag(
"TileFingerNeg");
937 pvTileTBEnv->add(tfFingerMotherNeg);
938 pvTileTBEnv->add(ntFingerMotherNeg);
939 pvTileTBEnv->add(pvFingerMotherNeg);
945 ztrans = (tileTBEnvThickness/2. - dbManager->
GetEnvZLength()/2. - EBFingerLength/2.);
946 GeoTransform* tfEBarrelMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::RotateZ3D(dbManager->
GetEnvDPhi() * Gaudi::Units::deg));
947 (*m_log) << MSG::DEBUG <<
"Positioning positive ext.barrel with translation " << ztrans
950 GeoNameTag* ntEBarrelMotherPos =
new GeoNameTag(
"EBarrelPos");
951 pvTileTBEnv->add(tfEBarrelMotherPos);
952 pvTileTBEnv->add(ntEBarrelMotherPos);
953 pvTileTBEnv->add(pvEBarrelMotherPos);
955 ztrans = (tileTBEnvThickness/2. - EBFingerLength/2.);
956 GeoTransform* tfEFingerMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::RotateZ3D(dbManager->
GetEnvDPhi() * Gaudi::Units::deg));
957 (*m_log) << MSG::DEBUG <<
"Positioning positive ext.barrel finger with translation " << ztrans
960 GeoNameTag* ntEFingerMotherPos =
new GeoNameTag(
"TileEFingerPos");
961 pvTileTBEnv->add(tfEFingerMotherPos);
962 pvTileTBEnv->add(ntEFingerMotherPos);
963 pvTileTBEnv->add(pvEFingerMotherPos);
968 ztrans = (-tileTBEnvThickness/2. + dbManager->
GetEnvZLength()/2. + EBFingerLength/2.);
969 GeoTransform* tfEBarrelMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::RotateZ3D(dbManager->
GetEnvDPhi() * Gaudi::Units::deg));
970 (*m_log) << MSG::DEBUG <<
"Positioning negative ext.barrel with translation " << ztrans
973 GeoNameTag* ntEBarrelMotherNeg =
new GeoNameTag(
"EBarrelNeg");
974 pvTileTBEnv->add(tfEBarrelMotherNeg);
975 pvTileTBEnv->add(ntEBarrelMotherNeg);
976 pvTileTBEnv->add(pvEBarrelMotherNeg);
978 ztrans = (-tileTBEnvThickness/2. + EBFingerLength/2.);
979 GeoTransform* tfEFingerMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::RotateZ3D(dbManager->
GetEnvDPhi() * Gaudi::Units::deg));
980 (*m_log) << MSG::DEBUG <<
"Positioning negative ext.barrel finger with translation " << ztrans
983 GeoNameTag* ntEFingerMotherNeg =
new GeoNameTag(
"TileEFingerNeg");
984 pvTileTBEnv->add(tfEFingerMotherNeg);
985 pvTileTBEnv->add(ntEFingerMotherNeg);
986 pvTileTBEnv->add(pvEFingerMotherNeg);
991 ztrans = (tileTBEnvThickness/2. - ZLengthEBarrelPos - dbManager->
GetEnvZLength()/2.);
992 GeoTransform* tfITCMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::RotateZ3D(dbManager->
GetEnvDPhi() * Gaudi::Units::deg));
993 (*m_log) << MSG::DEBUG <<
"Positioning positive ITC with translation " << ztrans
996 GeoNameTag* ntITCMotherPos =
new GeoNameTag(
"ITCPos");
997 pvTileTBEnv->add(tfITCMotherPos);
998 pvTileTBEnv->add(ntITCMotherPos);
999 pvTileTBEnv->add(pvITCMotherPos);
1003 ztrans = (-tileTBEnvThickness/2. + ZLengthEBarrelNeg + dbManager->
GetEnvZLength()/2.);
1004 GeoTransform* tfITCMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::RotateZ3D(dbManager->
GetEnvDPhi() * Gaudi::Units::deg));
1005 (*m_log) << MSG::DEBUG <<
"Positioning negative ITC with translation " << ztrans
1008 GeoNameTag* ntITCMotherNeg =
new GeoNameTag(
"ITCNeg");
1009 pvTileTBEnv->add(tfITCMotherNeg);
1010 pvTileTBEnv->add(ntITCMotherNeg);
1011 pvTileTBEnv->add(pvITCMotherNeg);
1017 int nModulesInSection[6] = {0,0,0,0,0,0};
1018 float zShiftInSection[6] = {0.0,0.0,0.0,0.0,0.0,0.0,};
1021 for (
int EnvCounter = 0; EnvCounter < NumberOfEnv; ++EnvCounter) {
1025 float Zshift = dbManager->
GetEnvZShift() * Gaudi::Units::cm;
1026 (*m_log) << MSG::DEBUG
1027 <<
"EnvCounter is " << EnvCounter
1028 <<
" EnvType is " << EnvType
1029 <<
" Nmodules is " << NumberOfMod
1030 <<
" Zshift is " << Zshift*(1./Gaudi::Units::cm) <<
" cm"
1033 if (EnvType == 1 || EnvType == 0) {
1034 nModulesInSection[0] = nModulesInSection[1] = NumberOfMod;
1035 zShiftInSection[0] = zShiftInSection[1] = Zshift;
1036 }
else if ((EnvType >0) and (EnvType < 6)) {
1037 nModulesInSection[EnvType] = NumberOfMod;
1038 zShiftInSection[EnvType] = Zshift;
1048 int side[6] = {0,1,0,1,0,1};
1050 for (
int ii=0; ii<6; ++ii) {
1056 zShiftInSection[ii+1],
1057 zShiftInSection[ii]);
1066 nModulesInSection[ii],
1067 zShiftInSection[ii]);
1070 descriptor->
set(idRegion);
1074 cabling->setConnected(dete[ii],side[ii],0,nModulesInSection[ii]);
1079 GeoNameTag* nTag =
new GeoNameTag(
"Tile");
1081 world->add(pvTileTBEnv);
1084 delete sectionBuilder;