ATLAS Offline Software
Loading...
Searching...
No Matches
TileDetectorFactory Class Reference

#include <TileDetectorFactory.h>

Inheritance diagram for TileDetectorFactory:
Collaboration diagram for TileDetectorFactory:

Public Member Functions

 TileDetectorFactory (StoreGateSvc *pDetStore, TileDetDescrManager *manager, const TileSwitches &switches, MsgStream *log)
 Constructor.
 ~TileDetectorFactory ()
 Destructor.
virtual void create (GeoPhysVol *world)
 Creation of Tile geometry.
virtual const TileDetDescrManagergetDetectorManager () const
 Access function to TileDetDescr geometry data.

Private Attributes

StoreGateSvcm_detectorStore
 Detector pointer to Store Gate service.
TileDetDescrManagerm_detectorManager
 Detector pointer to TileDetDescrManager.
MsgStream * m_log
 Get message SVC.
TileSwitches m_switches
 all switches
bool m_verbose
 Flag for activation verbose level for debugging.

Detailed Description

Definition at line 24 of file TileDetectorFactory.h.

Constructor & Destructor Documentation

◆ TileDetectorFactory()

TileDetectorFactory::TileDetectorFactory ( StoreGateSvc * pDetStore,
TileDetDescrManager * manager,
const TileSwitches & switches,
MsgStream * log )

Constructor.

Definition at line 42 of file TileDetectorFactory.cxx.

46 : m_detectorStore(pDetStore)
47 , m_detectorManager(manager)
48 , m_log(log)
49 , m_switches(switches)
50 , m_verbose(log->level()<=MSG::VERBOSE)
51{
52 m_switches.testBeam = false;
53}
StoreGateSvc * m_detectorStore
Detector pointer to Store Gate service.
MsgStream * m_log
Get message SVC.
TileSwitches m_switches
all switches
bool m_verbose
Flag for activation verbose level for debugging.
TileDetDescrManager * m_detectorManager
Detector pointer to TileDetDescrManager.

◆ ~TileDetectorFactory()

TileDetectorFactory::~TileDetectorFactory ( )

Destructor.

Definition at line 57 of file TileDetectorFactory.cxx.

58{
59}

Member Function Documentation

◆ create()

void TileDetectorFactory::create ( GeoPhysVol * world)
virtual

Creation of Tile geometry.

Definition at line 63 of file TileDetectorFactory.cxx.

64{
65 (*m_log) << MSG::INFO <<" Entering TileDetectorFactory::create()" << endmsg;
66
67 double dzGlue; //Thickness of glue layer in the absorber
68 double thicknessWedgeMother, heightWedgeMother, dy1WedgeMother, dy2WedgeMother;
69 double zEndSection;
70
71 int negSide = 0;
72 int posSide = 1;
73
74 const TileID* tileID = m_detectorManager->get_id();
75 int nregion = 0;
76
77 // -------- -------- MATERIAL MANAGER -------- ----------
78 StoredMaterialManager* theMaterialManager = nullptr;
79 if (StatusCode::SUCCESS != m_detectorStore->retrieve(theMaterialManager, "MATERIALS")) {
80 (*m_log) << MSG::ERROR << "Could not find Material Manager MATERIALS" << endmsg;
81 return;
82 }
83 const GeoMaterial* matAir = theMaterialManager->getMaterial("std::Air");
84
85 // -------- -------- SECTION BUILDER -------- ----------
86 TileDddbManager* dbManager = m_detectorManager->getDbManager();
87 TileGeoSectionBuilder* sectionBuilder = new TileGeoSectionBuilder(theMaterialManager,dbManager,m_switches,m_log);
88
89 // --------------- TILE ------- TILE --------- TILE ---------- TILE ------------
90 // Envelope creation.
91 // Building three tree tops for standard setup and only one for commissioning
92 GeoLogVol *lvTileEnvelopeBarrel = 0, *lvTileEnvelopePosEndcap = 0, *lvTileEnvelopeNegEndcap = 0;
93 GeoPhysVol *pvTileEnvelopeBarrel = 0, *pvTileEnvelopePosEndcap = 0, *pvTileEnvelopeNegEndcap = 0;
94
95 bool globalsExist = dbManager->GetNumberOfEnv()!=0;
96 int ModuleNcp =0;
97
99 // Z planes
101 double endCentralBarrel = dbManager->TILBdzmodul()/2.*Gaudi::Units::cm;
103 //sb double beginITC1 = (dbManager->TILBzoffset() + dbManager->TILEzshift() - dbManager->TILBdzmodul()/2.)*Gaudi::Units::cm;
105 double beginITC2 = (dbManager->TILBzoffset() + dbManager->TILEzshift() - dbManager->TILBdzmodul()/2.)*Gaudi::Units::cm;
107 double beginCrack = (dbManager->TILBzoffset() + dbManager->TILEzshift() - dbManager->TILBdzmodul()/2.)*Gaudi::Units::cm;
108 double endCrack = (dbManager->TILBzoffset() + dbManager->TILEzshift() + dbManager->TILBdzmodul()/2.)*Gaudi::Units::cm;
110 double endExtendedBarrel = (dbManager->TILBzoffset() + dbManager->TILEzshift() + dbManager->TILBdzmodul()/2.)*Gaudi::Units::cm;
111 double endTile = dbManager->TILEzmam()*Gaudi::Units::cm;
112
113 dbManager->SetCurrentTifg(1);
114 double endBarrelFinger = endCentralBarrel + dbManager->TIFGdz()*Gaudi::Units::cm;
115
116 // Offsets
117 /* sb
118 double shiftSec1 = (beginCrack + endCentralBarrel)/2.;
119 double shiftSec2 = (endCrack + beginCrack)/2.;
120 double shiftSec3 = (endExtendedBarrel + endCrack)/2.;
121 double shiftSec4 = (endTile + endExtendedBarrel)/2.;
122 */
123
124 // R minimals
126 double rminBarrel = dbManager->TILBrminimal()*Gaudi::Units::cm;
128 double rminITC1 = dbManager->TILBrminimal()*Gaudi::Units::cm;
130 double rminITC = dbManager->TILBrminimal()*Gaudi::Units::cm;
132 double rminCrack = dbManager->TILBrminimal()*Gaudi::Units::cm;
134 double rminExtended = dbManager->TILBrminimal()*Gaudi::Units::cm;
135 double rminFinger = dbManager->TILBrmax()*Gaudi::Units::cm;
136
137 // R maximal
138 double rmaxTotal = dbManager->TILErmam()*Gaudi::Units::cm;
139
140 GeoPcon* tileEnvPconeBarrel = new GeoPcon(0, 360*Gaudi::Units::deg);
141 GeoPcon* tileEnvPconePosEndcap = new GeoPcon(0, 360*Gaudi::Units::deg);
142 GeoPcon* tileEnvPconeNegEndcap = new GeoPcon(0, 360*Gaudi::Units::deg);
143
144 // Negative Endcap
145 tileEnvPconeNegEndcap->addPlane(-endTile,rminFinger,rmaxTotal);
146 tileEnvPconeNegEndcap->addPlane(-endExtendedBarrel,rminFinger,rmaxTotal);
147 tileEnvPconeNegEndcap->addPlane(-endExtendedBarrel,rminExtended,rmaxTotal);
148 tileEnvPconeNegEndcap->addPlane(-endCrack,rminExtended,rmaxTotal);
149 tileEnvPconeNegEndcap->addPlane(-endCrack,rminCrack,rmaxTotal);
150 tileEnvPconeNegEndcap->addPlane(-beginCrack,rminCrack,rmaxTotal);
151 tileEnvPconeNegEndcap->addPlane(-beginCrack,rminITC,rmaxTotal);
152 tileEnvPconeNegEndcap->addPlane(-beginITC2,rminITC,rmaxTotal);
153 tileEnvPconeNegEndcap->addPlane(-beginITC2,rminITC1,rmaxTotal);
154 tileEnvPconeNegEndcap->addPlane(-endBarrelFinger,rminITC1,rmaxTotal);
155 // Barrel
156
157 tileEnvPconeBarrel->addPlane(-endBarrelFinger,rminFinger,rmaxTotal);
158 tileEnvPconeBarrel->addPlane(-endCentralBarrel,rminFinger,rmaxTotal);
159 tileEnvPconeBarrel->addPlane(-endCentralBarrel,rminBarrel,rmaxTotal);
160 tileEnvPconeBarrel->addPlane(endCentralBarrel,rminBarrel,rmaxTotal);
161 tileEnvPconeBarrel->addPlane(endCentralBarrel,rminFinger,rmaxTotal);
162 tileEnvPconeBarrel->addPlane(endBarrelFinger,rminFinger,rmaxTotal);
163
164 // Positive Endcap
165 tileEnvPconePosEndcap->addPlane(endBarrelFinger,rminITC1,rmaxTotal);
166 tileEnvPconePosEndcap->addPlane(beginITC2,rminITC1,rmaxTotal);
167 tileEnvPconePosEndcap->addPlane(beginITC2,rminITC,rmaxTotal);
168 tileEnvPconePosEndcap->addPlane(beginCrack,rminITC,rmaxTotal);
169 tileEnvPconePosEndcap->addPlane(beginCrack,rminCrack,rmaxTotal);
170 tileEnvPconePosEndcap->addPlane(endCrack,rminCrack,rmaxTotal);
171 tileEnvPconePosEndcap->addPlane(endCrack,rminExtended,rmaxTotal);
172 tileEnvPconePosEndcap->addPlane(endExtendedBarrel,rminExtended,rmaxTotal);
173 tileEnvPconePosEndcap->addPlane(endExtendedBarrel,rminFinger,rmaxTotal);
174 tileEnvPconePosEndcap->addPlane(endTile,rminFinger,rmaxTotal);
175
176 lvTileEnvelopeBarrel = new GeoLogVol("TileCentralBarrel",tileEnvPconeBarrel,matAir);
177 lvTileEnvelopePosEndcap = new GeoLogVol("TileEndcapPos",tileEnvPconePosEndcap,matAir);
178 lvTileEnvelopeNegEndcap = new GeoLogVol("TileEndcapNeg",tileEnvPconeNegEndcap,matAir);
179
180 pvTileEnvelopeBarrel = new GeoPhysVol(lvTileEnvelopeBarrel);
181 pvTileEnvelopePosEndcap = new GeoPhysVol(lvTileEnvelopePosEndcap);
182 pvTileEnvelopeNegEndcap = new GeoPhysVol(lvTileEnvelopeNegEndcap);
183
184 /*
185 const GeoShape& bbqEnvelope = ((*tileEnvPconeBarrel)<<GeoTrf::TranslateX3D(1000.)).
186 add(((*tileEnvPconePosEndcap)<<GeoTrf::TranslateZ3D(0.))).
187 add(((*tileEnvPconeNegEndcap)<<GeoTrf::TranslateZ3D(0.)));
188 lvTileEnvelope = new GeoLogVol("Tile",&bbqEnvelope,matAir);
189 pvTileEnvelope = new GeoPhysVol(lvTileEnvelope);
190
191 pvTileEnvelope->add(new GeoTransform(GeoTrf::TranslateX3D(1000.)));
192 pvTileEnvelope->add(pvTileEnvelopeBarrel);
193 pvTileEnvelope->add(pvTileEnvelopePosEndcap);
194 pvTileEnvelope->add(pvTileEnvelopeNegEndcap);
195 */
196 } else {
198 dbManager->SetCurrentTifg(1);
199
200 // Z planes
201 double endCentralBarrel = dbManager->TILBdzmodul()/2.*Gaudi::Units::cm;
202 double endEnvelope = endCentralBarrel + dbManager->TIFGdz()*Gaudi::Units::cm;
203
204 // R minimals
205 double rminBarrel = dbManager->TILBrminimal()*Gaudi::Units::cm;
206 double rminFinger = dbManager->TILBrmax()*Gaudi::Units::cm;
207
208 // R maximal
209 double rmaxTotal = dbManager->TILErmam()*Gaudi::Units::cm;
210
211 GeoPcon* tileEnvPconeBarrel = new GeoPcon(0, 360*Gaudi::Units::deg);
212 tileEnvPconeBarrel->addPlane(-endEnvelope,rminFinger,rmaxTotal);
213 tileEnvPconeBarrel->addPlane(-endCentralBarrel,rminFinger,rmaxTotal);
214 tileEnvPconeBarrel->addPlane(-endCentralBarrel,rminBarrel,rmaxTotal);
215 tileEnvPconeBarrel->addPlane(endCentralBarrel,rminBarrel,rmaxTotal);
216 tileEnvPconeBarrel->addPlane(endCentralBarrel,rminFinger,rmaxTotal);
217 tileEnvPconeBarrel->addPlane(endEnvelope,rminFinger,rmaxTotal);
218
219 lvTileEnvelopeBarrel = new GeoLogVol("TileCentralBarrel",tileEnvPconeBarrel,matAir);
220 pvTileEnvelopeBarrel = new GeoPhysVol(lvTileEnvelopeBarrel);
221 }
222
223 //-------------------------------- SECTIONS --------------------------------
224 // Variables/functions for parameterizations
225
226 double deltaPhi = 360./dbManager->TILEnmodul();
227
228 Variable varInd;
229 GENFUNCTION phiInd = deltaPhi*(varInd+0.5)*Gaudi::Units::deg;
230
231 //------------------------------- B A R R E L --------------------------------------
232 // Tube - barrel mother
233
235
236 GeoTube* barrelMother = new GeoTube(dbManager->TILBrminimal()*Gaudi::Units::cm,
237 dbManager->TILErmam()*Gaudi::Units::cm,
238 dbManager->TILBdzmodul()/2.*Gaudi::Units::cm);
239
240 GeoLogVol* lvBarrelMother = new GeoLogVol("Barrel",barrelMother,matAir);
241 GeoFullPhysVol* pvBarrelMother = new GeoFullPhysVol(lvBarrelMother);
242
243 // Trd - module mother
244 thicknessWedgeMother = dbManager->TILBdzmodul() * Gaudi::Units::cm;
245 heightWedgeMother = (dbManager->TILBrmaximal() - dbManager->TILBrminimal()) * Gaudi::Units::cm;
246 dy1WedgeMother = dbManager->TILBrminimal() * tan(deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
247 dy2WedgeMother = dbManager->TILBrmaximal() * tan(deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
248
249 dzGlue = (dbManager->TILBdzmodul() - dbManager->TILBdzend1() - dbManager->TILBdzend2() - (dbManager->TILBnperiod()*2.*(dbManager->TILBdzmast() + dbManager->TILBdzspac()) - dbManager->TILBdzmast()))/(2.*(2.*dbManager->TILBnperiod() - 1));
250
251 GeoTrd* barrelModuleMother = new GeoTrd(thicknessWedgeMother/2.,
252 thicknessWedgeMother/2.,
253 dy1WedgeMother,
254 dy2WedgeMother,
255 heightWedgeMother/2.);
256
257 GeoLogVol* lvBarrelModuleMother = new GeoLogVol("BarrelModule",barrelModuleMother,matAir);
258 PVLink pvBarrelModuleMother = new GeoPhysVol(lvBarrelModuleMother);
259
260 // Fill the section
261 sectionBuilder->fillSection(pvBarrelModuleMother,
262 1,
263 dbManager->TILBrmaximal(),
264 dbManager->TILBrminimal(),
265 dzGlue,
266 deltaPhi);
267/*
268// Position N barrel modules inside barrel mother
269for (j=0; j<dbManager->TILEnmodul(); j++) {
270phi = j*deltaPhi;
271
272GeoTransform* zrotateMod = new GeoTransform(GeoTrf::RotateZ3D(phi*Gaudi::Units::deg));
273GeoTransform* xtransMod = new GeoTransform(GeoTrf::TranslateX3D((dbManager->TILBrmaximal() + dbManager->TILBrminimal())/2. * cm));
274GeoTransform* yrotateMod = new GeoTransform(GeoTrf::RotateY3D(90*Gaudi::Units::deg));
275
276pvBarrelMother->add(zrotateMod);
277pvBarrelMother->add(xtransMod);
278pvBarrelMother->add(yrotateMod);
279pvBarrelMother->add(pvBarrelModuleMother);
280}
281*/
282
283 // --- Using the parameterization -----
284 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);
285 GeoSerialTransformer* stBarrelModuleMother = new GeoSerialTransformer(pvBarrelModuleMother,
286 &xfBarrelModuleMother,
287 dbManager->TILEnmodul());
288
289 pvBarrelMother->add(new GeoSerialIdentifier(1));
290 pvBarrelMother->add(stBarrelModuleMother);
291
292 GeoNameTag* ntBarrelMother = new GeoNameTag("TileBarrel");
293 pvTileEnvelopeBarrel->add(ntBarrelMother);
294 pvTileEnvelopeBarrel->add(pvBarrelMother);
295 }
296
297 int nModules;
298 float zShift;
299
300 if (globalsExist) {
301 dbManager->SetCurrentEnvByType(1);
302 nModules=dbManager->GetEnvNModules();
303 zShift=dbManager->GetEnvZShift()*Gaudi::Units::cm;
304
305 sectionBuilder->computeCellDim(m_detectorManager,
307 m_switches.addPlatesToCell,
308 zShift, // shift for positive eta (normally zero)
309 zShift); // shift for negative eta is the same
310 } else {
311 nModules=dbManager->TILEnmodul();
312 zShift=0.0;
313 // do not compute cell volumes for old setups (before DC3),
314 // because cell-size table might be missing in DB
315 }
316
317 // -- Readout
318 // Create two descriptor objects corresponding to positive and negative half of central barrel
319 TileDetDescriptor* descriptor = new TileDetDescriptor();
320
321 sectionBuilder->fillDescriptor(descriptor,
323 negSide,
324 m_switches.testBeam,
325 m_switches.addPlatesToCell,
326 nModules,
327 zShift);
328
329 Identifier idRegion = tileID->region_id(nregion++);
330 descriptor->set(idRegion);
331
332 m_detectorManager->add(descriptor);
333 m_detectorManager->add(new TileDetDescrRegion(idRegion, descriptor));
334
335 descriptor = new TileDetDescriptor();
336
337 sectionBuilder->fillDescriptor(descriptor,
339 posSide,
340 m_switches.testBeam,
341 m_switches.addPlatesToCell,
342 nModules,
343 zShift);
344
345 idRegion = tileID->region_id(nregion++);
346 descriptor->set(idRegion);
347
348 m_detectorManager->add(descriptor);
349 m_detectorManager->add(new TileDetDescrRegion(idRegion, descriptor));
350
351 //-------------------------- E X T E N D E D B A R R E L ---------------------------------
352 // Tube - barrel mother
353
355
356 GeoTube* ebarrelMother = new GeoTube(dbManager->TILBrminimal()*Gaudi::Units::cm,
357 dbManager->TILErmam()*Gaudi::Units::cm,
358 dbManager->TILBdzmodul()/2.*Gaudi::Units::cm);
359
360 GeoLogVol* lvEBarrelMother = new GeoLogVol("EBarrel",ebarrelMother,matAir);
361 GeoFullPhysVol* pvEBarrelMotherPos = new GeoFullPhysVol(lvEBarrelMother);
362 GeoFullPhysVol* pvEBarrelMotherNeg = new GeoFullPhysVol(lvEBarrelMother);
363
364 // Trd - module mother
365 thicknessWedgeMother = dbManager->TILBdzmodul() * Gaudi::Units::cm;
366 heightWedgeMother = (dbManager->TILBrmaximal() - dbManager->TILBrminimal()) * Gaudi::Units::cm;
367 dy1WedgeMother = dbManager->TILBrminimal() * tan(deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
368 dy2WedgeMother = dbManager->TILBrmaximal() * tan(deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
369
370 dzGlue = (dbManager->TILBdzmodul() - dbManager->TILBdzend1() - dbManager->TILBdzend2() - dbManager->TILBnperiod()*2.*(dbManager->TILBdzmast() + dbManager->TILBdzspac()))/(4.*dbManager->TILBnperiod());
371
372 GeoTrd* ebarrelModuleMother = new GeoTrd(thicknessWedgeMother/2.,
373 thicknessWedgeMother/2.,
374 dy1WedgeMother,
375 dy2WedgeMother,
376 heightWedgeMother/2.);
377
378 GeoLogVol* lvEBarrelModuleMother = new GeoLogVol("EBarrelModule",ebarrelModuleMother,matAir);
379 PVLink pvEBarrelModuleMother = new GeoPhysVol(lvEBarrelModuleMother);
380
381 // Fill the section
382 sectionBuilder->fillSection(pvEBarrelModuleMother,
383 2,
384 dbManager->TILBrmaximal(),
385 dbManager->TILBrminimal(),
386 dzGlue,
387 deltaPhi);
388
389 // --- Position N modules inside mother (positive/negative) -----
390 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);
391 TRANSFUNCTION xfEBarrelModuleMotherNeg = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->TILBrmaximal()+dbManager->TILBrminimal())/2.*Gaudi::Units::cm)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
392
393 GeoSerialTransformer* stEBarrelModuleMotherPos = new GeoSerialTransformer(pvEBarrelModuleMother,
394 &xfEBarrelModuleMotherPos,
395 dbManager->TILEnmodul());
396
397 pvEBarrelMotherPos->add(new GeoSerialIdentifier(1));
398 pvEBarrelMotherPos->add(stEBarrelModuleMotherPos);
399
400
401 GeoSerialTransformer* stEBarrelModuleMotherNeg = new GeoSerialTransformer(pvEBarrelModuleMother,
402 &xfEBarrelModuleMotherNeg,
403 dbManager->TILEnmodul());
404
405 pvEBarrelMotherNeg->add(new GeoSerialIdentifier(1));
406 pvEBarrelMotherNeg->add(stEBarrelModuleMotherNeg);
407
408
409 GeoTransform* tfEBarrelMotherPos = new GeoTransform(GeoTrf::TranslateZ3D((dbManager->TILBzoffset()+dbManager->TILEzshift())*Gaudi::Units::cm));
410 GeoNameTag* ntEBarrelMotherPos = new GeoNameTag("TileEBarrelPos");
411 pvTileEnvelopePosEndcap->add(tfEBarrelMotherPos);
412 pvTileEnvelopePosEndcap->add(ntEBarrelMotherPos);
413 pvTileEnvelopePosEndcap->add(pvEBarrelMotherPos);
414
415
416 GeoTransform* tfEBarrelMotherNeg = new GeoTransform(GeoTrf::TranslateZ3D((-dbManager->TILBzoffset()-dbManager->TILEzshift())*Gaudi::Units::cm));
417 GeoNameTag* ntEBarrelMotherNeg = new GeoNameTag("TileEBarrelNeg");
418 pvTileEnvelopeNegEndcap->add(tfEBarrelMotherNeg);
419 pvTileEnvelopeNegEndcap->add(ntEBarrelMotherNeg);
420 pvTileEnvelopeNegEndcap->add(pvEBarrelMotherNeg);
421 }
422
423 int nModulesNeg,nModulesPos;
424 float zShiftNeg,zShiftPos;
425
426 if (globalsExist) {
427 dbManager->SetCurrentEnvByType(2);
428 nModulesNeg=dbManager->GetEnvNModules();
429 zShiftNeg=dbManager->GetEnvZShift()*Gaudi::Units::cm;
430 dbManager->SetCurrentEnvByType(3);
431 nModulesPos=dbManager->GetEnvNModules();
432 zShiftPos=dbManager->GetEnvZShift()*Gaudi::Units::cm;
433
434 sectionBuilder->computeCellDim(m_detectorManager,
436 m_switches.addPlatesToCell,
437 zShiftPos, // shift for positive eta
438 zShiftNeg); // shift for negative eta
439 } else {
440 nModulesPos=nModulesNeg=dbManager->TILEnmodul();
441 zShiftPos=zShiftNeg=dbManager->TILEzshift()*Gaudi::Units::cm;
442 // do not compute cell volumes for old setups (before DC3),
443 // because cell-size table might be missing in DB
444 }
445
446 // -- Readout
447 // Create two descriptor objects corresponding to positive and negative half of extended barrel
448 descriptor = new TileDetDescriptor();
449
450 sectionBuilder->fillDescriptor(descriptor,
452 negSide,
453 m_switches.testBeam,
454 m_switches.addPlatesToCell,
455 nModulesNeg,
456 zShiftNeg);
457
458 idRegion = tileID->region_id(nregion++);
459 descriptor->set(idRegion);
460
461 m_detectorManager->add(descriptor);
462 m_detectorManager->add(new TileDetDescrRegion(idRegion, descriptor));
463
464 descriptor = new TileDetDescriptor();
465
466 sectionBuilder->fillDescriptor(descriptor,
468 posSide,
469 m_switches.testBeam,
470 m_switches.addPlatesToCell,
471 nModulesPos,
472 zShiftPos);
473
474 idRegion = tileID->region_id(nregion++);
475 descriptor->set(idRegion);
476
477 m_detectorManager->add(descriptor);
478 m_detectorManager->add(new TileDetDescrRegion(idRegion, descriptor));
479
480 //-------------------------- I T C ---------------------------------
481 // Tube - barrel mother
482
484 //sb double rMinITC = dbManager->TILBrminimal();
485 double rMinITC2 = dbManager->TILBrminimal();
486 double rMaxITC2 = dbManager->TILBrmaximal();
487 double dzITC2 = dbManager->TILBdzmodul();
488
490
491 GeoTube* itcWheel1 = new GeoTube(dbManager->TILBrminimal()*Gaudi::Units::cm,
492 dbManager->TILErmam()*Gaudi::Units::cm,
493 dbManager->TILBdzmodul()/2.*Gaudi::Units::cm);
494
495 GeoTube* itcWheel2 = new GeoTube(rMinITC2*Gaudi::Units::cm,rMaxITC2*Gaudi::Units::cm,dzITC2/2.*Gaudi::Units::cm);
496 GeoTrf::Translate3D itcWheel2OffsetPos(0.,0.,(dbManager->TILBdzmodul()-dzITC2)/2*Gaudi::Units::cm);
497 GeoTrf::Translate3D itcWheel2OffsetNeg(0.,0.,(-dbManager->TILBdzmodul()+dzITC2)/2*Gaudi::Units::cm);
498
499 const GeoShapeUnion& itcMotherPos = itcWheel1->add(*itcWheel2<<itcWheel2OffsetPos);
500 const GeoShapeUnion& itcMotherNeg = itcWheel1->add(*itcWheel2<<itcWheel2OffsetNeg);
501
502 GeoLogVol* lvITCMotherPos = new GeoLogVol("ITC",&itcMotherPos,matAir);
503 GeoLogVol* lvITCMotherNeg = new GeoLogVol("ITC",&itcMotherNeg,matAir);
504 GeoFullPhysVol* pvITCMotherPos = new GeoFullPhysVol(lvITCMotherPos);
505 GeoFullPhysVol* pvITCMotherNeg = new GeoFullPhysVol(lvITCMotherNeg);
506
507
508 // Common mother for ITC1/2 modules
509
510 // -- first sub shape
511 thicknessWedgeMother = dbManager->TILBdzmodul() * Gaudi::Units::cm;
512 heightWedgeMother = (dbManager->TILBrmaximal() - dbManager->TILBrminimal()) * Gaudi::Units::cm;
513 dy1WedgeMother = dbManager->TILBrminimal()* tan(deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
514 dy2WedgeMother = dbManager->TILBrmaximal()* tan(deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
515
516 GeoTrd* itcModuleSub1 = new GeoTrd(thicknessWedgeMother/2.,
517 thicknessWedgeMother/2.,
518 dy1WedgeMother,
519 dy2WedgeMother,
520 heightWedgeMother/2.);
521
522 // -- second sub shape
523 thicknessWedgeMother = dzITC2 * Gaudi::Units::cm;
524 heightWedgeMother = (rMaxITC2 - rMinITC2) * Gaudi::Units::cm;
525 dy1WedgeMother = rMinITC2* tan(deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
526 dy2WedgeMother = rMaxITC2* tan(deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
527
528 GeoTrd* itcModuleSub2 = new GeoTrd(thicknessWedgeMother/2.,
529 thicknessWedgeMother/2.,
530 dy1WedgeMother,
531 dy2WedgeMother,
532 heightWedgeMother/2.);
533
534 GeoTrf::Translate3D itcModuleSubShift ((dbManager->TILBdzmodul()-dzITC2)/2*Gaudi::Units::cm,
535 0.,
536 ((rMinITC2+rMaxITC2)-(dbManager->TILBrmaximal()+dbManager->TILBrminimal()))/2.*Gaudi::Units::cm);
537
538 const GeoShapeUnion& itcModuleMother = itcModuleSub1->add(*itcModuleSub2<<itcModuleSubShift);
539
540 GeoLogVol* lvITCModuleMother = new GeoLogVol("ITCModule",&itcModuleMother,matAir);
541 PVLink pvITCModuleMother = new GeoPhysVol(lvITCModuleMother);
542
543 //Mother volume for ITC1
544 //In plug1 it's necessary to produce GeoShapeUnion for mother volume that is composed by two parts:
545 // 1. Mother for absorber and girder
546 // 2. Mother for frontplate (since it's short)
547
548 //First submother
549 thicknessWedgeMother = dbManager->TILBdzmodul() * Gaudi::Units::cm;
550 heightWedgeMother = (dbManager->TILBrmaximal() - dbManager->TILBrmin()) * Gaudi::Units::cm;
551 dy1WedgeMother = dbManager->TILBrmin() * tan(deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
552 dy2WedgeMother = dbManager->TILBrmaximal() * tan(deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
553
554 dzGlue = (dbManager->TILBdzmodul() - dbManager->TILBdzend1() - dbManager->TILBdzend2() - dbManager->TILBnperiod()*2.*(dbManager->TILBdzmast() + dbManager->TILBdzspac()))/(4.*dbManager->TILBnperiod());
555
556 GeoTrd* plug1SubMother = new GeoTrd(thicknessWedgeMother/2.,
557 thicknessWedgeMother/2.,
558 dy1WedgeMother,
559 dy2WedgeMother,
560 heightWedgeMother/2.);
561
562 //Second submother
563 thicknessWedgeMother = (dbManager->TILBdzmodul() - dzITC2) * Gaudi::Units::cm;
564 heightWedgeMother = (dbManager->TILBrmin() - dbManager->TILBrminimal()) * Gaudi::Units::cm;
565 dy1WedgeMother = dbManager->TILBrminimal() * tan(deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
566 dy2WedgeMother = dbManager->TILBrmin() * tan(deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
567
568 GeoTrd* plug2SubMother = new GeoTrd(thicknessWedgeMother/2.,
569 thicknessWedgeMother/2.,
570 dy1WedgeMother,
571 dy2WedgeMother,
572 heightWedgeMother/2.);
573
574 GeoTrf::Translate3D plug1SubOffset(-dzITC2*Gaudi::Units::cm/2.,
575 0.,
576 (dbManager->TILBrminimal()-dbManager->TILBrmaximal())*Gaudi::Units::cm/2.);
577
578 const GeoShapeUnion& plug1ModuleMother = plug1SubMother->add(*plug2SubMother<<plug1SubOffset);
579 GeoLogVol* lvPlug1ModuleMother = new GeoLogVol("Plug1Module",&plug1ModuleMother,matAir);
580 PVLink pvPlug1ModuleMother = new GeoPhysVol(lvPlug1ModuleMother);
581
582 // Fill the section
583 sectionBuilder->fillSection(pvPlug1ModuleMother, 3,
584 dbManager->TILBrmaximal(),
585 dbManager->TILBrminimal(),
586 dzGlue,
587 deltaPhi, ModuleNcp,
588 dzITC2);
589
590 GeoTransform* tfPlug1ModuleMother = new GeoTransform(GeoTrf::Translate3D(0.,
591 0.,
592 (dbManager->TILBrmin()-dbManager->TILBrminimal())*Gaudi::Units::cm/2.));
593
594 pvITCModuleMother->add(tfPlug1ModuleMother);
595 pvITCModuleMother->add(pvPlug1ModuleMother);
596
597 //Mother volume for ITC2
599
600 thicknessWedgeMother = dbManager->TILBdzmodul() * Gaudi::Units::cm;
601 heightWedgeMother = (dbManager->TILBrmaximal() - dbManager->TILBrminimal()) * Gaudi::Units::cm;
602 dy1WedgeMother = dbManager->TILBrminimal() * tan(deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
603 dy2WedgeMother = dbManager->TILBrmaximal() * tan(deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
604
605 dzGlue = (dbManager->TILBdzmodul() - dbManager->TILBdzend1() - dbManager->TILBdzend2() - ((dbManager->TILBnperiod()-1)*2.*(dbManager->TILBdzmast() + dbManager->TILBdzspac()) + dbManager->TILBdzspac()))/(4.*(dbManager->TILBnperiod() - 1));
606
607 GeoTrd* plug2ModuleMother = new GeoTrd(thicknessWedgeMother/2.,
608 thicknessWedgeMother/2.,
609 dy1WedgeMother,
610 dy2WedgeMother,
611 heightWedgeMother/2.);
612
613 GeoLogVol* lvPlug2ModuleMother = new GeoLogVol("Plug2Module",plug2ModuleMother,matAir);
614 PVLink pvPlug2ModuleMother = new GeoPhysVol(lvPlug2ModuleMother);
615
616 // Fill the section
617 sectionBuilder->fillSection(pvPlug2ModuleMother,
618 4,
619 dbManager->TILBrmaximal(),
620 dbManager->TILBrminimal(),
621 dzGlue,
622 deltaPhi);
623
625
626 GeoTransform* tfPlug2ModuleMother = new GeoTransform(itcModuleSubShift);
627
628 pvITCModuleMother->add(tfPlug2ModuleMother);
629 pvITCModuleMother->add(pvPlug2ModuleMother);
630
631 // --- Position N modules inside mother (positive/negative) -----
632 TRANSFUNCTION xfITCModuleMotherPos = 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);
633 TRANSFUNCTION xfITCModuleMotherNeg = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->TILBrmaximal()+dbManager->TILBrminimal())/2.*Gaudi::Units::cm)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
634
635 GeoSerialTransformer* stITCModuleMotherPos = new GeoSerialTransformer(pvITCModuleMother,
636 &xfITCModuleMotherPos,
637 dbManager->TILEnmodul());
638 pvITCMotherPos->add(new GeoSerialIdentifier(1));
639 pvITCMotherPos->add(stITCModuleMotherPos);
640
641 GeoSerialTransformer* stITCModuleMotherNeg = new GeoSerialTransformer(pvITCModuleMother,
642 &xfITCModuleMotherNeg,
643 dbManager->TILEnmodul());
644 pvITCMotherNeg->add(new GeoSerialIdentifier(1));
645 pvITCMotherNeg->add(stITCModuleMotherNeg);
646
647
648
649
650 if (not pvTileEnvelopePosEndcap){
651 (*m_log)<<MSG::ERROR<<"pvTileEnvelopePosEndcap is null in "<<__func__<<endmsg;
652 } else {
653 GeoTransform* tfITCMotherPos = new GeoTransform(GeoTrf::TranslateZ3D((dbManager->TILBzoffset()+dbManager->TILEzshift())*Gaudi::Units::cm));
654 GeoNameTag* ntITCMotherPos = new GeoNameTag("TileITCPos");
655 pvTileEnvelopePosEndcap->add(tfITCMotherPos);
656 pvTileEnvelopePosEndcap->add(ntITCMotherPos);
657 pvTileEnvelopePosEndcap->add(pvITCMotherPos);
658 }
659
660
661
662 if (not pvTileEnvelopeNegEndcap){
663 (*m_log)<<MSG::ERROR<<"pvTileEnvelopeNegEndcap is null in "<<__func__<<endmsg;
664 } else {
665 GeoTransform* tfITCMotherNeg = new GeoTransform(GeoTrf::TranslateZ3D((-dbManager->TILBzoffset()-dbManager->TILEzshift())*Gaudi::Units::cm));
666 GeoNameTag* ntITCMotherNeg = new GeoNameTag("TileITCNeg");
667 pvTileEnvelopeNegEndcap->add(tfITCMotherNeg);
668 pvTileEnvelopeNegEndcap->add(ntITCMotherNeg);
669 pvTileEnvelopeNegEndcap->add(pvITCMotherNeg);
670 }
671 }
672 //-------------------------- G A P ---------------------------------
673 // Tube - gap mother
674
676 GeoTube* gapMother = new GeoTube(dbManager->TILBrminimal()*Gaudi::Units::cm,
677 dbManager->TILBrmaximal()*Gaudi::Units::cm/cos(deltaPhi/2.*Gaudi::Units::deg),
678 dbManager->TILBdzmodul()/2.*Gaudi::Units::cm);
679
680 GeoLogVol* lvGapMother = new GeoLogVol("Gap",gapMother,matAir);
681 GeoFullPhysVol* pvGapMotherPos = new GeoFullPhysVol(lvGapMother);
682 GeoFullPhysVol* pvGapMotherNeg = new GeoFullPhysVol(lvGapMother);
683
684 // Trd - module mother
685 thicknessWedgeMother = dbManager->TILBdzmodul() * Gaudi::Units::cm;
686 heightWedgeMother = (dbManager->TILBrmaximal() - dbManager->TILBrminimal()) * Gaudi::Units::cm;
687 dy1WedgeMother = dbManager->TILBrminimal() * tan(deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
688 dy2WedgeMother = dbManager->TILBrmaximal() * tan(deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
689
690 dzGlue = 0.;
691
692 GeoTrd* gapModuleMother = new GeoTrd(thicknessWedgeMother/2.,
693 thicknessWedgeMother/2.,
694 dy1WedgeMother,
695 dy2WedgeMother,
696 heightWedgeMother/2.);
697
698 GeoLogVol* lvGapModuleMother = new GeoLogVol("GapModule",gapModuleMother,matAir);
699 PVLink pvGapModuleMother = new GeoPhysVol(lvGapModuleMother);
700
701 // Fill the section
702 sectionBuilder->fillSection(pvGapModuleMother,
703 5,
704 dbManager->TILBrmaximal(),
705 dbManager->TILBrminimal(),
706 dzGlue,
707 deltaPhi);
708
709 // --- Position N modules inside mother (positive/negative) -----
710 TRANSFUNCTION xfGapModuleMotherPos = 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);
711 TRANSFUNCTION xfGapModuleMotherNeg = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->TILBrmaximal()+dbManager->TILBrminimal())/2.*Gaudi::Units::cm)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
712
713 GeoSerialTransformer* stGapModuleMotherPos = new GeoSerialTransformer(pvGapModuleMother,
714 &xfGapModuleMotherPos,
715 dbManager->TILEnmodul());
716 pvGapMotherPos->add(new GeoSerialIdentifier(1));
717 pvGapMotherPos->add(stGapModuleMotherPos);
718
719 GeoSerialTransformer* stGapModuleMotherNeg = new GeoSerialTransformer(pvGapModuleMother,
720 &xfGapModuleMotherNeg,
721 dbManager->TILEnmodul());
722 pvGapMotherNeg->add(new GeoSerialIdentifier(1));
723 pvGapMotherNeg->add(stGapModuleMotherNeg);
724
725 if (not pvTileEnvelopePosEndcap){
726 (*m_log)<<MSG::ERROR<<"pvTileEnvelopePosEndcap is null in "<<__func__<<endmsg;
727 } else {
728 GeoTransform* tfGapMotherPos = new GeoTransform(GeoTrf::TranslateZ3D((dbManager->TILBzoffset()+dbManager->TILEzshift())*Gaudi::Units::cm));
729 GeoNameTag* ntGapMotherPos = new GeoNameTag("TileGapPos");
730 pvTileEnvelopePosEndcap->add(tfGapMotherPos);
731 pvTileEnvelopePosEndcap->add(ntGapMotherPos);
732 pvTileEnvelopePosEndcap->add(pvGapMotherPos);
733 }
734
735 if (not pvTileEnvelopeNegEndcap){
736 (*m_log)<<MSG::ERROR<<"pvTileEnvelopeNegEndcap is null in "<<__func__<<endmsg;
737 } else {
738 GeoTransform* tfGapMotherNeg = new GeoTransform(GeoTrf::TranslateZ3D((-dbManager->TILBzoffset()-dbManager->TILEzshift())*Gaudi::Units::cm));
739 GeoNameTag* ntGapMotherNeg = new GeoNameTag("TileGapNeg");
740 pvTileEnvelopeNegEndcap->add(tfGapMotherNeg);
741 pvTileEnvelopeNegEndcap->add(ntGapMotherNeg);
742 pvTileEnvelopeNegEndcap->add(pvGapMotherNeg);
743 }
744 }
745
746 if (globalsExist) {
747 dbManager->SetCurrentEnvByType(4);
748 nModulesNeg=dbManager->GetEnvNModules();
749 zShiftNeg=dbManager->GetEnvZShift()*Gaudi::Units::cm;
750 dbManager->SetCurrentEnvByType(5);
751 nModulesPos=dbManager->GetEnvNModules();
752 zShiftPos=dbManager->GetEnvZShift()*Gaudi::Units::cm;
753
754 sectionBuilder->computeCellDim(m_detectorManager,
756 m_switches.addPlatesToCell,
757 zShiftPos, // shift for positive eta
758 zShiftNeg); // shift for negative eta
759 } else {
760 nModulesPos=nModulesNeg=dbManager->TILEnmodul();
761 zShiftPos=zShiftNeg=dbManager->TILEzshift()*Gaudi::Units::cm;
762 // do not compute cell volumes for old setups (before DC3),
763 // because cell-size table might be missing in DB
764 }
765
766 // -- Readout
767 // Create two descriptor objects corresponding to positive and negative half of gap/crack
768 descriptor = new TileDetDescriptor();
769
770 sectionBuilder->fillDescriptor(descriptor,
772 negSide,
773 m_switches.testBeam,
774 m_switches.addPlatesToCell,
775 nModulesNeg,
776 zShiftNeg);
777
778 idRegion = tileID->region_id(nregion++);
779 descriptor->set(idRegion);
780
781 m_detectorManager->add(descriptor);
782 m_detectorManager->add(new TileDetDescrRegion(idRegion, descriptor));
783
784 descriptor = new TileDetDescriptor();
785
786 sectionBuilder->fillDescriptor(descriptor,
788 posSide,
789 m_switches.testBeam,
790 m_switches.addPlatesToCell,
791 nModulesPos,
792 zShiftPos);
793
794 idRegion = tileID->region_id(nregion++);
795 descriptor->set(idRegion);
796
797 m_detectorManager->add(descriptor);
798 m_detectorManager->add(new TileDetDescrRegion(idRegion, descriptor));
799
800 //-------------------------- C R A C K ---------------------------------
801 // Tube - crack mother
802
804 GeoTube* crackMother = new GeoTube(dbManager->TILBrminimal()*Gaudi::Units::cm,
805 dbManager->TILBrmaximal()*Gaudi::Units::cm/cos(deltaPhi/2.*Gaudi::Units::deg),
806 dbManager->TILBdzmodul()/2.*Gaudi::Units::cm);
807
808 GeoLogVol* lvCrackMother = new GeoLogVol("Crack",crackMother,matAir);
809 GeoFullPhysVol* pvCrackMotherPos = new GeoFullPhysVol(lvCrackMother);
810 GeoFullPhysVol* pvCrackMotherNeg = new GeoFullPhysVol(lvCrackMother);
811
812 // Trd - module mother
813 thicknessWedgeMother = dbManager->TILBdzmodul() * Gaudi::Units::cm;
814 heightWedgeMother = (dbManager->TILBrmaximal() - dbManager->TILBrminimal()) * Gaudi::Units::cm;
815 dy1WedgeMother = dbManager->TILBrminimal() * tan(deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
816 dy2WedgeMother = dbManager->TILBrmaximal() * tan(deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
817
818 dzGlue = 0.;
819
820 GeoTrd* crackModuleMother = new GeoTrd(thicknessWedgeMother/2.,
821 thicknessWedgeMother/2.,
822 dy1WedgeMother,
823 dy2WedgeMother,
824 heightWedgeMother/2.);
825
826 GeoLogVol* lvCrackModuleMother = new GeoLogVol("CrackModule",crackModuleMother,matAir);
827 PVLink pvCrackModuleMother = new GeoPhysVol(lvCrackModuleMother);
828
829 // Fill the section
830 sectionBuilder->fillSection(pvCrackModuleMother,
831 6,
832 dbManager->TILBrmaximal(),
833 dbManager->TILBrminimal(),
834 dzGlue,
835 deltaPhi);
836
837 // --- Position N modules inside mother (positive/negative) -----
838 TRANSFUNCTION xfCrackModuleMotherPos = 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);
839 TRANSFUNCTION xfCrackModuleMotherNeg = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->TILBrmaximal()+dbManager->TILBrminimal())/2.*Gaudi::Units::cm)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
840
841 GeoSerialTransformer* stCrackModuleMotherPos = new GeoSerialTransformer(pvCrackModuleMother,
842 &xfCrackModuleMotherPos,
843 dbManager->TILEnmodul());
844 pvCrackMotherPos->add(new GeoSerialIdentifier(1));
845 pvCrackMotherPos->add(stCrackModuleMotherPos);
846
847 GeoSerialTransformer* stCrackModuleMotherNeg = new GeoSerialTransformer(pvCrackModuleMother,
848 &xfCrackModuleMotherNeg,
849 dbManager->TILEnmodul());
850 pvCrackMotherNeg->add(new GeoSerialIdentifier(1));
851 pvCrackMotherNeg->add(stCrackModuleMotherNeg);
852
853
854 GeoTransform* tfCrackMotherPos = new GeoTransform(GeoTrf::TranslateZ3D((dbManager->TILBzoffset()+dbManager->TILEzshift())*Gaudi::Units::cm));
855 GeoNameTag* ntCrackMotherPos = new GeoNameTag("TileCrackPos");
856 pvTileEnvelopePosEndcap->add(tfCrackMotherPos);
857 pvTileEnvelopePosEndcap->add(ntCrackMotherPos);
858 pvTileEnvelopePosEndcap->add(pvCrackMotherPos);
859
860
861 GeoTransform* tfCrackMotherNeg = new GeoTransform(GeoTrf::TranslateZ3D((-dbManager->TILBzoffset()-dbManager->TILEzshift())*Gaudi::Units::cm));
862 GeoNameTag* ntCrackMotherNeg = new GeoNameTag("TileCrackNeg");
863 pvTileEnvelopeNegEndcap->add(tfCrackMotherNeg);
864 pvTileEnvelopeNegEndcap->add(ntCrackMotherNeg);
865 pvTileEnvelopeNegEndcap->add(pvCrackMotherNeg);
866 }
867
868 //-------------------------------- FINGERS --------------------------------
869
870 //------------------------- B A R R E L F I N G E R ----------------------------
871 // Tube - finger mother
872
874 dbManager->SetCurrentTifg(1)) {
875
876 zEndSection = dbManager->TILBzoffset() + dbManager->TILBdzmodul()/2.;
877
878 GeoTube* fingerMother = new GeoTube(dbManager->TILBrmax()*Gaudi::Units::cm,
879 dbManager->TILErmam()*Gaudi::Units::cm,
880 dbManager->TIFGdz()/2.*Gaudi::Units::cm);
881
882 GeoLogVol* lvFingerMother = new GeoLogVol("Finger",fingerMother,matAir);
883 GeoFullPhysVol* pvFingerMotherPos = new GeoFullPhysVol(lvFingerMother);
884 GeoFullPhysVol* pvFingerMotherNeg = new GeoFullPhysVol(lvFingerMother);
885
886 // Trd - one finger mother
887 // if (dbManager->SetCurrentSection(TileDddbManager::TILE_PLUG1))
888 // thicknessWedgeMother = (dbManager->TILBzoffset() - dbManager->TILBdzmodul()/2. + dbManager->TILEzshift() - zEndSection) * Gaudi::Units::cm;
889 // else
890 thicknessWedgeMother = dbManager->TIFGdz()*Gaudi::Units::cm;
891
893 heightWedgeMother = (dbManager->TILErmax() - dbManager->TILBrmax()) * Gaudi::Units::cm;
894 dy1WedgeMother = dbManager->TILBrmax() * tan(deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
895 dy2WedgeMother = dbManager->TILErmax() * tan(deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
896
897 GeoTrd* fingerModuleMother = new GeoTrd(thicknessWedgeMother/2.,
898 thicknessWedgeMother/2.,
899 dy1WedgeMother,
900 dy2WedgeMother,
901 heightWedgeMother/2.);
902
903 GeoLogVol* lvFingerModuleMother = new GeoLogVol("FingerModule",fingerModuleMother,matAir);
904 PVLink pvFingerModuleMother = new GeoPhysVol(lvFingerModuleMother);
905
906 // Fill the section
907 sectionBuilder->fillFinger(pvFingerModuleMother, 1,
908 dbManager->TILErmax(),
909 dbManager->TILBrmax(),
910 deltaPhi,
911 m_switches.testBeam,
912 ModuleNcp,
913 thicknessWedgeMother*(1./Gaudi::Units::cm));
914
915 // --- Position N modules inside mother (positive/negative) -----
916 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);
917 TRANSFUNCTION xfFingerModuleMotherNeg = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->TILErmax()+dbManager->TILBrmax())/2.*Gaudi::Units::cm)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
918
919 GeoSerialTransformer* stFingerModuleMotherPos = new GeoSerialTransformer(pvFingerModuleMother,
920 &xfFingerModuleMotherPos,
921 dbManager->TILEnmodul());
922
923 pvFingerMotherPos->add(new GeoSerialIdentifier(1));
924 pvFingerMotherPos->add(stFingerModuleMotherPos);
925
926 GeoSerialTransformer* stFingerModuleMotherNeg = new GeoSerialTransformer(pvFingerModuleMother,
927 &xfFingerModuleMotherNeg,
928 dbManager->TILEnmodul());
929 pvFingerMotherNeg->add(new GeoSerialIdentifier(1));
930 pvFingerMotherNeg->add(stFingerModuleMotherNeg);
931
932
933 GeoTransform* tfFingerMotherPos = new GeoTransform(GeoTrf::TranslateZ3D((zEndSection+dbManager->TIFGdz()/2.)*Gaudi::Units::cm));
934 GeoNameTag* ntFingerMotherPos = new GeoNameTag("TileFingerPos");
935 pvTileEnvelopeBarrel->add(tfFingerMotherPos);
936 pvTileEnvelopeBarrel->add(ntFingerMotherPos);
937 pvTileEnvelopeBarrel->add(pvFingerMotherPos);
938
939
940 GeoTransform* tfFingerMotherNeg = new GeoTransform(GeoTrf::TranslateZ3D((-zEndSection-dbManager->TIFGdz()/2.)*Gaudi::Units::cm));
941 GeoNameTag* ntFingerMotherNeg = new GeoNameTag("TileFingerNeg");
942 pvTileEnvelopeBarrel->add(tfFingerMotherNeg);
943 pvTileEnvelopeBarrel->add(ntFingerMotherNeg);
944 pvTileEnvelopeBarrel->add(pvFingerMotherNeg);
945 }
946
947 //------------------------- E X T E N D E D F I N G E R ----------------------------
948 // Tube - finger mother
949
951 dbManager->SetCurrentTifg(2)) {
952
953 zEndSection = dbManager->TILBzoffset() + dbManager->TILBdzmodul()/2. + dbManager->TILEzshift();
954
955 GeoTube* efingerMother = new GeoTube(dbManager->TILBrmax()*Gaudi::Units::cm,
956 dbManager->TILErmam()*Gaudi::Units::cm,
957 dbManager->TIFGdz()/2.*Gaudi::Units::cm);
958
959 GeoLogVol* lvEFingerMother = new GeoLogVol("EFinger",efingerMother,matAir);
960 GeoFullPhysVol* pvEFingerMotherPos = new GeoFullPhysVol(lvEFingerMother);
961 GeoFullPhysVol* pvEFingerMotherNeg = new GeoFullPhysVol(lvEFingerMother);
962
963 // Trd - one finger mother
964 thicknessWedgeMother = dbManager->TIFGdz() * Gaudi::Units::cm;
965 heightWedgeMother = (dbManager->TILErmax() - dbManager->TILBrmax()) * Gaudi::Units::cm;
966 dy1WedgeMother = dbManager->TILBrmax() * tan(deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
967 dy2WedgeMother = dbManager->TILErmax() * tan(deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
968
969 GeoTrd* efingerModuleMother = new GeoTrd(thicknessWedgeMother/2.,
970 thicknessWedgeMother/2.,
971 dy1WedgeMother,
972 dy2WedgeMother,
973 heightWedgeMother/2.);
974
975 GeoLogVol* lvEFingerModuleMother = new GeoLogVol("EFingerModule",efingerModuleMother,matAir);
976 PVLink pvEFingerModuleMother = new GeoPhysVol(lvEFingerModuleMother);
977
978 // Fill the section
979 sectionBuilder->fillFinger(pvEFingerModuleMother,
980 2,
981 dbManager->TILErmax(),
982 dbManager->TILBrmax(),
983 deltaPhi,
984 m_switches.testBeam);
985
986 // --- Position N modules inside mother (positive/negative) -----
987 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);
988 TRANSFUNCTION xfEFingerModuleMotherNeg = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->TILErmax()+dbManager->TILBrmax())/2.*Gaudi::Units::cm)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
989
990 GeoSerialTransformer* stEFingerModuleMotherPos = new GeoSerialTransformer(pvEFingerModuleMother,
991 &xfEFingerModuleMotherPos,
992 dbManager->TILEnmodul());
993 pvEFingerMotherPos->add(new GeoSerialIdentifier(1));
994 pvEFingerMotherPos->add(stEFingerModuleMotherPos);
995
996 GeoSerialTransformer* stEFingerModuleMotherNeg = new GeoSerialTransformer(pvEFingerModuleMother,
997 &xfEFingerModuleMotherNeg,
998 dbManager->TILEnmodul());
999 pvEFingerMotherNeg->add(new GeoSerialIdentifier(1));
1000 pvEFingerMotherNeg->add(stEFingerModuleMotherNeg);
1001
1002
1003 GeoTransform* tfEFingerMotherPos = new GeoTransform(GeoTrf::TranslateZ3D((zEndSection+dbManager->TIFGdz()/2.)*Gaudi::Units::cm));
1004 GeoNameTag* ntEFingerMotherPos = new GeoNameTag("TileEFingerPos");
1005 pvTileEnvelopePosEndcap->add(tfEFingerMotherPos);
1006 pvTileEnvelopePosEndcap->add(ntEFingerMotherPos);
1007 pvTileEnvelopePosEndcap->add(pvEFingerMotherPos);
1008
1009
1010 GeoTransform* tfEFingerMotherNeg = new GeoTransform(GeoTrf::TranslateZ3D((-zEndSection-dbManager->TIFGdz()/2.)*Gaudi::Units::cm));
1011 GeoNameTag* ntEFingerMotherNeg = new GeoNameTag("TileEFingerNeg");
1012 pvTileEnvelopeNegEndcap->add(tfEFingerMotherNeg);
1013 pvTileEnvelopeNegEndcap->add(ntEFingerMotherNeg);
1014 pvTileEnvelopeNegEndcap->add(pvEFingerMotherNeg);
1015 }
1016
1017 // --------- ----------- --------- -------- ------ --------- ------- ----------
1018 GeoNameTag *nTag = new GeoNameTag("Tile");
1019
1020 if (pvTileEnvelopeBarrel) {
1021 world->add(nTag);
1022
1023 if (globalsExist) {
1024 // Top transform for the central barrel
1025 dbManager->SetCurrentEnvByType(1);
1026 GeoTrf::Transform3D mz = GeoTrf::RotateZ3D(dbManager->GetEnvDPhi());
1027 GeoTrf::Transform3D my = GeoTrf::RotateY3D(dbManager->GetEnvDTheta());
1028 GeoTrf::Transform3D mx = GeoTrf::RotateZ3D(dbManager->GetEnvDPsi());
1029 GeoTrf::Transform3D vpos = GeoTrf::Translate3D(dbManager->GetEnvDX()*Gaudi::Units::cm,dbManager->GetEnvDY()*Gaudi::Units::cm,dbManager->GetEnvDZ()*Gaudi::Units::cm);
1030 GeoTransform* barrelTT = new GeoTransform(GeoTrf::Transform3D(vpos*(mx*(my*(mz)))));
1031 world->add(barrelTT);
1032 }
1033
1034 world->add(pvTileEnvelopeBarrel);
1035 m_detectorManager->addTreeTop(pvTileEnvelopeBarrel);
1036 }
1037
1038 if (pvTileEnvelopePosEndcap) {
1039 world->add(nTag);
1040
1041 if (globalsExist) {
1042 // Top transform for the positive endcap
1043 dbManager->SetCurrentEnvByType(3);
1044 GeoTrf::Transform3D mz = GeoTrf::RotateZ3D(dbManager->GetEnvDPhi());
1045 GeoTrf::Transform3D my = GeoTrf::RotateY3D(dbManager->GetEnvDTheta());
1046 GeoTrf::Transform3D mx = GeoTrf::RotateZ3D(dbManager->GetEnvDPsi());
1047 GeoTrf::Transform3D vpos = GeoTrf::Translate3D(dbManager->GetEnvDX()*Gaudi::Units::cm,dbManager->GetEnvDY()*Gaudi::Units::cm,dbManager->GetEnvDZ()*Gaudi::Units::cm);
1048 GeoTransform* posEcTT = new GeoTransform(GeoTrf::Transform3D(vpos*(mx*(my*(mz)))));
1049 world->add(posEcTT);
1050 }
1051
1052 world->add(pvTileEnvelopePosEndcap);
1053 m_detectorManager->addTreeTop(pvTileEnvelopePosEndcap);
1054 }
1055
1056 if (pvTileEnvelopeNegEndcap) {
1057 world->add(nTag);
1058
1059 if (globalsExist) {
1060 // Top transform for the positive endcap
1061 dbManager->SetCurrentEnvByType(2);
1062 GeoTrf::Transform3D mz = GeoTrf::RotateZ3D(dbManager->GetEnvDPhi());
1063 GeoTrf::Transform3D my = GeoTrf::RotateY3D(dbManager->GetEnvDTheta());
1064 GeoTrf::Transform3D mx = GeoTrf::RotateZ3D(dbManager->GetEnvDPsi());
1065 GeoTrf::Transform3D vpos = GeoTrf::Translate3D(dbManager->GetEnvDX()*Gaudi::Units::cm,dbManager->GetEnvDY()*Gaudi::Units::cm,dbManager->GetEnvDZ()*Gaudi::Units::cm);
1066 GeoTransform* negEcTT = new GeoTransform(GeoTrf::Transform3D(vpos*(mx*(my*(mz)))));
1067 world->add(negEcTT);
1068 }
1069
1070 world->add(pvTileEnvelopeNegEndcap);
1071 m_detectorManager->addTreeTop(pvTileEnvelopeNegEndcap);
1072 }
1073
1074 delete sectionBuilder;
1075}
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
#define endmsg
#define TILE_REGION_GAP
#define TILE_REGION_CENTRAL
#define TILE_REGION_EXTENDED
virtual const GeoMaterial * getMaterial(const std::string &name)=0
double TILBrminimal() const
double TILBdzend1() const
double GetEnvDY() const
int GetNumberOfEnv() const
double GetEnvDZ() const
int SetCurrentTifg(int section)
double GetEnvDX() const
double GetEnvDPhi() const
double TIFGdz() const
double TILBrmax() const
double TILErmax() const
double TILBzoffset() const
double GetEnvZShift() const
double TILBdzspac() const
double GetEnvDTheta() const
int GetEnvNModules() const
double TILBdzend2() const
double GetEnvDPsi() const
double TILEzshift() const
double TILErmam() const
int SetCurrentSection(unsigned int section, bool print=true)
int TILEnmodul() const
double TILBdzmast() const
double TILBrmin() const
double TILEzmam() const
double TILBdzmodul() const
int TILBnperiod() const
int SetCurrentEnvByType(unsigned int envelope)
double TILBrmaximal() const
void set(const Identifier &id)
void fillFinger(PVLink &mother, int sec_number, double tile_rmax, double tilb_rmax, double delta_phi_not_used, bool testbeam, int ModuleNcp=0, double corrected_dz=0.)
Finger parameters are the following:
void fillDescriptor(TileDetDescriptor *&descriptor, unsigned int detector, int side, bool testbeam, bool addPlates, unsigned int nphi, float zshift)
Readout Descriptor parameters are the following:
void computeCellDim(TileDetDescrManager *&manager, int detector, bool addPlates, float zShiftPos, float zShiftNeg)
Cell dimension parameters are the following:
void fillSection(PVLink &mother, int sec_number, double tile_rmax, double rminb, double dzglue, double delta_phi, int ModuleNcp=0, double zlen_itc2=0., bool neg=false)
Section parameters are the following:
Identifier region_id(int index) const
build single region, module, tower, cell, pmt, adc identifiers

◆ getDetectorManager()

virtual const TileDetDescrManager * TileDetectorFactory::getDetectorManager ( ) const
inlinevirtual

Access function to TileDetDescr geometry data.

Definition at line 39 of file TileDetectorFactory.h.

39{ return m_detectorManager; }

Member Data Documentation

◆ m_detectorManager

TileDetDescrManager* TileDetectorFactory::m_detectorManager
private

Detector pointer to TileDetDescrManager.

Definition at line 47 of file TileDetectorFactory.h.

◆ m_detectorStore

StoreGateSvc* TileDetectorFactory::m_detectorStore
private

Detector pointer to Store Gate service.

Definition at line 44 of file TileDetectorFactory.h.

◆ m_log

MsgStream* TileDetectorFactory::m_log
private

Get message SVC.

Definition at line 50 of file TileDetectorFactory.h.

◆ m_switches

TileSwitches TileDetectorFactory::m_switches
private

all switches

Definition at line 53 of file TileDetectorFactory.h.

◆ m_verbose

bool TileDetectorFactory::m_verbose
private

Flag for activation verbose level for debugging.

Definition at line 56 of file TileDetectorFactory.h.


The documentation for this class was generated from the following files: