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

#include <TileAtlasFactory.h>

Inheritance diagram for TileAtlasFactory:
Collaboration diagram for TileAtlasFactory:

Public Member Functions

 TileAtlasFactory (StoreGateSvc *pDetStore, TileDetDescrManager *manager, const TileSwitches &switches, MsgStream *log, bool fullGeo)
 Constructor.
 TileAtlasFactory (StoreGateSvc *pDetStore, TileDetDescrManager *manager, const TileSwitches &switches, const std::vector< std::string > &volumeNames, std::vector< GeoPhysVol * > &volumePtrs, const std::vector< double > &volumePositions, MsgStream *log, bool fullGeo)
 ~TileAtlasFactory ()
 Destructor.
virtual void create (GeoPhysVol *world)
 Creation of Tile geometry.
virtual const TileDetDescrManagergetDetectorManager () const
 Access function to TileDetDescr geometry data.
void checking (const std::string &VolumeName, bool print, int level, double X1, double X2, double Y1, double Y2, double Z)
 Function for checking empty volumes:

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
std::vector< std::string > m_volumeNames
 all additional variables which passed to constructor
std::vector< GeoPhysVol * > m_volumePtrs
std::vector< double > m_volumePositions
bool m_verbose
 Flag for activation verbose level for debugging.
bool m_fullGeo
 Geometry configuration: FULL, RECO.

Detailed Description

Definition at line 26 of file TileAtlasFactory.h.

Constructor & Destructor Documentation

◆ TileAtlasFactory() [1/2]

TileAtlasFactory::TileAtlasFactory ( StoreGateSvc * pDetStore,
TileDetDescrManager * manager,
const TileSwitches & switches,
MsgStream * log,
bool fullGeo )

Constructor.

Definition at line 57 of file TileAtlasFactory.cxx.

62 : m_detectorStore(pDetStore)
63 , m_detectorManager(manager)
64 , m_log(log)
65 , m_switches(switches)
66 , m_verbose(log->level()<=MSG::VERBOSE)
67 , m_fullGeo(fullGeo)
68{
69 m_switches.testBeam = false;
70}
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.
StoreGateSvc * m_detectorStore
Detector pointer to Store Gate service.
bool m_fullGeo
Geometry configuration: FULL, RECO.

◆ TileAtlasFactory() [2/2]

TileAtlasFactory::TileAtlasFactory ( StoreGateSvc * pDetStore,
TileDetDescrManager * manager,
const TileSwitches & switches,
const std::vector< std::string > & volumeNames,
std::vector< GeoPhysVol * > & volumePtrs,
const std::vector< double > & volumePositions,
MsgStream * log,
bool fullGeo )

Definition at line 73 of file TileAtlasFactory.cxx.

81 : m_detectorStore(pDetStore)
82 , m_detectorManager(manager)
83 , m_log(log)
84 , m_switches(switches)
85 , m_volumeNames(volumeNames)
86 , m_volumePtrs(volumePtrs)
87 , m_volumePositions(volumePositions)
88 , m_verbose(log->level()<=MSG::VERBOSE)
89 , m_fullGeo(fullGeo)
90{
91 m_switches.testBeam = false;
92}
std::vector< std::string > m_volumeNames
all additional variables which passed to constructor
std::vector< double > m_volumePositions
std::vector< GeoPhysVol * > m_volumePtrs

◆ ~TileAtlasFactory()

TileAtlasFactory::~TileAtlasFactory ( )

Destructor.

Definition at line 96 of file TileAtlasFactory.cxx.

96{}

Member Function Documentation

◆ checking()

void TileAtlasFactory::checking ( const std::string & VolumeName,
bool print,
int level,
double X1,
double X2,
double Y1,
double Y2,
double Z )

Function for checking empty volumes:

Parameters
VolumeNameThe volume name
printprintig ON/OFF
levelvolume level and printig level
X1,X2,Y1,Y2,DZ- checking variables

Definition at line 3389 of file TileAtlasFactory.cxx.

3391{
3392 double rless = .150; //150 [mkm]
3393 std::string Step[8] = {" "," "," "," "," "," "," "," "};
3394
3395 if (print) {
3396 if (m_log->level()<=MSG::DEBUG)
3397 (*m_log) << MSG::DEBUG <<Step[level]<<Name<<"-"<<level
3398 <<" dX1,dX2= "<<X1<<","<<X2<<" dY1,dY2= "<<Y1<<","<<Y2<<",dZ= "<<Z
3399 <<endmsg;
3400 }
3401 if (X1 < rless && X2 < rless) {
3402 (*m_log) << MSG::WARNING <<" volume "<<Name<<" is empty, X1 or X2<0 "<<endmsg;
3403 }
3404 if (Y1 < rless && Y2 < rless) {
3405 (*m_log) << MSG::WARNING <<" volume "<<Name<<" is empty, Y1 or Y2<0 "<<endmsg;
3406 }
3407 if (Z < rless) {
3408 (*m_log) << MSG::WARNING <<" volume "<<Name<<" is empty, Z<0 "<<endmsg;
3409 }
3410}
#define endmsg
JetDumper::Name Name
Definition JetDumper.cxx:19
void print(char *figname, TCanvas *c1)

◆ create()

void TileAtlasFactory::create ( GeoPhysVol * world)
virtual

Creation of Tile geometry.

Relative shift of EBpos is too big, This is expected behaviour for testbeam and commissioning configurations

Relative shift of EBpos is too big, This is expected behaviour for testbeam and commissioning configurations

setfinger length

Definition at line 100 of file TileAtlasFactory.cxx.

101{
102 // Global geometri definition for debugging
103 bool Filling = true;
104 bool EBC = true /* Negative */, BAR = true /* Barrel */, EBA = true /* Positive */;
105 int NcpFrom = 1, NcpPlus = 63; // Default is all [1-63]
106
107 //int NcpFrom = 34, NcpPlus = 29; // ext.barrel, special
108
109 double deltaPhi = 360./64; // we know apriory that 64 modules makes full cylinder
110 double AnglMin = (NcpFrom-1)*deltaPhi*Gaudi::Units::deg, AnglMax = (NcpPlus+1)*deltaPhi*Gaudi::Units::deg;
111
112 // phi range of modules with special C10
113 // double AnglMin1 = 38. * deltaPhi*Gaudi::Units::deg;
114 // double AnglMax1 = 42. * deltaPhi*Gaudi::Units::deg;
115 // double AnglMin2 = 54. * deltaPhi*Gaudi::Units::deg;
116 // double AnglMax2 = 58. * deltaPhi*Gaudi::Units::deg;
117
118 (*m_log) << MSG::INFO <<" Entering TileAtlasFactory::create()" << endmsg;
119
120 // -------- -------- MATERIAL MANAGER -------- ----------
121 StoredMaterialManager* theMaterialManager = nullptr;
122 if (StatusCode::SUCCESS != m_detectorStore->retrieve(theMaterialManager, "MATERIALS")) {
123 (*m_log) << MSG::ERROR << "Could not find Material Manager MATERIALS" << endmsg;
124 return;
125 }
126 const GeoMaterial* matAir = theMaterialManager->getMaterial("std::Air");
127 const GeoMaterial* matIron = theMaterialManager->getMaterial("std::Iron");
128 //const GeoMaterial* matAlu = theMaterialManager->getMaterial("std::Aluminium");
129
130 // -------- -------- SECTION BUILDER -------- ----------
131 TileDddbManager* dbManager = m_detectorManager->getDbManager();
132 TileGeoSectionBuilder* sectionBuilder = new TileGeoSectionBuilder(theMaterialManager,dbManager,m_switches,m_log);
133
134 double DzSaddleSupport = 0, RadiusSaddle = 0;
135 if (dbManager->BoolSaddle()) {
136 (*m_log) << MSG::INFO << " Tile Geometry with Saddle supports, starting from TileCal-CSC-02 xxx"<< endmsg;
137
138 dbManager->SetCurrentSaddle(0);
139
140 DzSaddleSupport = dbManager->DzSaddleSupport()*Gaudi::Units::cm;
141 RadiusSaddle = dbManager->RadiusSaddle()*Gaudi::Units::cm;
142 if (m_log->level()<=MSG::DEBUG)
143 (*m_log) << MSG::DEBUG << " DzSaddleSupport()= "<<DzSaddleSupport<<" RadiusSaddle= "<<RadiusSaddle
144 << endmsg;
145 }
146
147 if (m_log->level()<=MSG::DEBUG) {
148 (*m_log) <<MSG::DEBUG << "TileAtlasFactory. addPlates = " <<m_switches.addPlatesToCell<<endmsg;
149 (*m_log) <<MSG::DEBUG << "TileAtlasFactory. crackOption = " <<m_switches.crackOption<<endmsg;
150 }
151 int barrel_flag = m_switches.crackOption/10; // >0 - no barrel, >1 - no ext.bar, >2-no ITC, >3-no Gap, >4-no Crack
152 int crack_flag = m_switches.crackOption%10;
153 if (barrel_flag == 5) crack_flag = 9; // nothing will be created if barrel_flag is 5
154 if (crack_flag == 4 || crack_flag == 5) barrel_flag = 4; // only one crack is created, nothing else
155 bool eb_flag = (barrel_flag<4 || (barrel_flag==4 && crack_flag==0) ); // true if ext.barrel envelope is needed
156 if (m_log->level()<=MSG::DEBUG) {
157 (*m_log) << MSG::DEBUG << "barrel_flag " << barrel_flag << endmsg;
158 (*m_log) << MSG::DEBUG << "crack_flag " << crack_flag << endmsg;
159 }
160
161 // -------- -------- CUT BUILDER -------- ----------
162 //TileGeoCutBuilder* CutBuilder = new TileGeoCutBuilder(theMaterialManager,dbManager,m_log);
163
164 // --------------- TILE ------- TILE --------- TILE ---------- TILE ------------
165 // Envelope creation. Building three tree tops for standard setup and only one for commissioning
166 GeoIntrusivePtr<GeoLogVol> lvTileEnvelopeBarrel{nullptr}, lvTileEnvelopePosEndcap{nullptr}, lvTileEnvelopeNegEndcap{nullptr}, lvTileEnvelopePosCrack{nullptr}, lvTileEnvelopeNegCrack{nullptr};
167 PVLink pvTileEnvelopeBarrel{nullptr}, pvTileEnvelopePosEndcap{nullptr}, pvTileEnvelopeNegEndcap {nullptr}, pvTileEnvelopePosCrack{nullptr}, pvTileEnvelopeNegCrack{nullptr};
168
169 if (crack_flag==2) {
170 if ( m_volumeNames.size()<1 ) {
171 (*m_log) <<MSG::WARNING << "Top-level volume names for crack scintillators are missing"<<endmsg;
172 (*m_log) <<MSG::WARNING << "Crack scintillators will not be built"<<endmsg;
173 crack_flag = 9;
174 } else {
175 GeoVolumeVec_t vols = geoGetVolumes (&*world);
176 for (auto v : vols) {
177 if (v.first->getLogVol()->getName() == m_volumeNames[0] ) {
178 pvTileEnvelopePosCrack = const_pointer_cast(PVConstLink{v.first});
179 }
180 else if (m_volumeNames.size()>1 && v.first->getLogVol()->getName() == m_volumeNames[1] ) {
181 pvTileEnvelopeNegCrack = const_pointer_cast(PVConstLink{v.first});
182 }
183 }
184 }
185 } else if (crack_flag==3) {
186 if ( m_volumePtrs.size()<1 ) {
187 (*m_log) <<MSG::WARNING << "Top-level volume pointers for crack scintillators are missing"<<endmsg;
188 (*m_log) <<MSG::WARNING << "Crack scintillators will not be built"<<endmsg;
189 crack_flag = 9;
190 } else {
191 pvTileEnvelopePosCrack = m_volumePtrs[0];
192 if (m_volumePtrs.size()>1) pvTileEnvelopeNegCrack = m_volumePtrs[1];
193 }
194 } else if (crack_flag==4) {
195 pvTileEnvelopePosCrack = world;
196 } else if (crack_flag==5) {
197 pvTileEnvelopeNegCrack = world;
198 }
199
200 if (pvTileEnvelopePosCrack || pvTileEnvelopeNegCrack) {
201 (*m_log) <<MSG::DEBUG << "Top-level volume names for crack scintillators are "
202 << " positive: " << ( (pvTileEnvelopePosCrack) ? pvTileEnvelopePosCrack->getLogVol()->getName() : "none" )
203 << " negative: " << ( (pvTileEnvelopeNegCrack) ? pvTileEnvelopeNegCrack->getLogVol()->getName() : "none" )
204 << endmsg;
205 } else if (crack_flag==2) {
206 (*m_log) <<MSG::WARNING << "Top-level volume names for crack scintillators "
207 << ((m_volumeNames.size()>0) ? m_volumeNames[0] : "") << " "
208 << ((m_volumeNames.size()>1) ? m_volumeNames[1] : "") << " "
209 << " were not found" << endmsg;
210 (*m_log) <<MSG::WARNING << "Crack scintillators will not be built"<<endmsg;
211 (*m_log) <<MSG::WARNING << "Available top-level volumes are:";
212 GeoVolumeVec_t vols = geoGetVolumes (&*world);
213 for (auto v : vols) (*m_log) << " " << v.first->getLogVol()->getName();
214 (*m_log) <<endmsg;
215 crack_flag = 9;
216 }
217
218 // radius for minimization overlap volumes
219 double rless =0.15; // 150 [mkm]
220
221 double dzITC1 =0, rMinITC1 =0, rMaxITC1 =0;
222 double dzITC2 =0, rMinITC2 =0, rMaxITC2 =0;
223
224 double thicknessWedgeMother =0, heightWedgeMother =0, dy1WedgeMother =0, dy2WedgeMother =0;
225 double Glue =0, dzGlue =0; //Thickness of glue layer in the absorber
226 int NbPeriod =0;
227 double zEndSection =0;
228
229 // Positioning coordinates
230 double X =0, Z =0;
231 double zITCStandard =0;
232
233 double ZLength[] = {0.0,0.0,0.0,0.0,0.0,0.0};
234 double EnvDZPos[] = {0.0,0.0,0.0,0.0,0.0,0.0};
235 double PhiMax[] = {-360.0,-360.0,-360.0,-360.0,-360.0,-360.0};
236 double PhiMin[] = {+360.0,+360.0,+360.0,+360.0,+360.0,+360.0};
237 double RInMin[] = {99999.9,99999.9,99999.9,99999.9,99999.9,99999.9};
238 double ROutMax[] = {0.0,0.0,0.0,0.0,0.0,0.0};
239 double FingerRmax = 0;
240 //unsigned int ienv_size = 6;
241
242 // set default finger length
243 double BFingerLength =0;
244 double BFingerLengthNeg =0;
245 double BFingerLengthPos =0;
246
247 // Barrel finger
248 dbManager->SetCurrentTifg(1);
249 BFingerLength = BFingerLengthNeg = BFingerLengthPos = dbManager->TIFGdz()*Gaudi::Units::cm;
250
251 double EBFingerLength =0;
252 double EBFingerLengthNeg =0;
253 double EBFingerLengthPos =0;
254
255 // EBarrel finger
256 dbManager->SetCurrentTifg(2);
257 EBFingerLength = EBFingerLengthNeg = EBFingerLengthPos = dbManager->TIFGdz()*Gaudi::Units::cm;
258
259 int n_env = dbManager->GetNumberOfEnv();
260
261 //std::cerr <<std::cout.setf(std::ios::right)<<std::setiosflags(std::ios::fixed)<<std::setw(9)<<std::setprecision(2);
262
263 if (m_log->level()<=MSG::DEBUG)
264 (*m_log) << MSG::DEBUG << "n_env " << n_env << endmsg;
265
266 for (int i = 0; i < n_env ; ++i) {
267 dbManager->SetCurrentEnvByIndex(i);
268 int Type = dbManager->GetEnvType();
269
270 /*
271 if (Type == 1) BAR = true;
272 if (Type == 2) EBC = true;
273 if (Type == 3) EBA = true;
274 */
275
276 ZLength [Type] = dbManager->GetEnvZLength()*Gaudi::Units::cm;
277 EnvDZPos [Type] = dbManager->GetEnvDZ()*Gaudi::Units::cm;
278 PhiMin [Type] = std::min(PhiMin[Type], dbManager->GetEnvDPhi());
279 PhiMax [Type] = std::max(PhiMax[Type], dbManager->GetEnvNModules()*deltaPhi + dbManager->GetEnvDPhi());
280 RInMin [Type] = std::min(RInMin[Type], dbManager->GetEnvRin()*Gaudi::Units::cm);
281 ROutMax [Type] = std::max(ROutMax[Type],dbManager->GetEnvRout()*Gaudi::Units::cm);
282 FingerRmax = std::max(FingerRmax,dbManager->GetEnvRout()*Gaudi::Units::cm);
283
284 //std::cout << "# Type " <<Type<< " ZLength " <<ZLength [Type]<< " EnvDZPos "<<EnvDZPos [Type]<< "\n";
285 }
286
287 //
288 // recalculate length of positive barrel finger length if Ext.Barrel is present
289 //
290
291 double PosDelta =0;
292 PosDelta = EnvDZPos[3] - EnvDZPos[1];
293 if (m_log->level()<=MSG::DEBUG)
294 (*m_log) << MSG::DEBUG <<" BFingerLengthPos "<<BFingerLengthPos<<" PosDelta "<<PosDelta;
295 if (std::abs(PosDelta) < std::abs(EBFingerLength - BFingerLength) ) {
296 BFingerLengthPos += PosDelta;
297 if (m_log->level()<=MSG::DEBUG)
298 (*m_log) <<" => New BFingerLengthPos "<<BFingerLengthPos<<endmsg;
299 } else {
301 BFingerLengthPos = BFingerLength;
302 PosDelta =0;
303 if (m_log->level()<=MSG::DEBUG)
304 (*m_log) <<" => New PosDelta "<<PosDelta<<endmsg;
305 }
306
307 //
308 // recalculate length of negative barrel finger length if Ext.Barrel is present
309 //
310
311 double NegDelta =0;
312 NegDelta = (-EnvDZPos[2] + EnvDZPos[1]); // negative shift - bigger finger
313 if (m_log->level()<=MSG::DEBUG)
314 (*m_log) << MSG::DEBUG <<" BFingerLengthNeg "<<BFingerLengthNeg<<" NegDelta "<<NegDelta;
315 if (std::abs(NegDelta) < std::abs(EBFingerLength - BFingerLength) ) {
316 BFingerLengthNeg += NegDelta;
317 if (m_log->level()<=MSG::DEBUG)
318 (*m_log) <<" => New BFingerLengthNeg "<<BFingerLengthNeg<<endmsg;
319 } else {
321 BFingerLengthNeg = BFingerLength;
322 NegDelta =0;
323 if (m_log->level()<=MSG::DEBUG)
324 (*m_log) <<" => New NegDelta "<<NegDelta<<endmsg;
325 }
326
327 // extra flag sayubg that special C10 goes outside envelope for normal C10
328 bool spC10 = false;
330 double rMinC10 = dbManager->TILBrminimal();
331 if ( dbManager->SetCurrentSection(10+TileDddbManager::TILE_PLUG2, false) ) {
332 double rMinC10sp = dbManager->TILBrminimal();
333 spC10 = (rMinC10sp < rMinC10);
334 if (spC10) {
335 (*m_log) << MSG::DEBUG <<" Special C10, changing Rmin from "<<rMinC10<<" to "<< rMinC10sp << endmsg;
336 rMinC10 = rMinC10sp;
337 }
338 }
339
341 double rMinE2pos = dbManager->TILBrminimal();
342 double rMinE2neg = rMinE2pos;
343
344 // extra flag sayubg that E4' present on negative eta side
345 bool spE4 = false;
347 double rMinE4pos = dbManager->TILBrminimal();
348 double rMinE4neg = rMinE4pos;
349 double rMaxE3pos = dbManager->TILBrmaximal();
350 double rMaxE3neg = rMaxE3pos;
351 if ( dbManager->SetCurrentSection(10+TileDddbManager::TILE_PLUG4, false) ) {
352 double rMinE4sp = dbManager->TILBrminimal();
353 spE4 = (rMinE4sp < rMinE4neg);
354 if (spE4) {
355 (*m_log) << MSG::DEBUG <<" E4' present, changing Rmin for negative crack from "<<rMinE4neg<<" to "<< rMinE4sp << endmsg;
356 rMinE4neg = rMinE4sp;
357 }
358 }
359
361 double BFingerRmin=0, EFingerRmin=0;
363 BFingerRmin = dbManager->TILBrmax()*Gaudi::Units::cm;
365 EFingerRmin = dbManager->TILBrmax()*Gaudi::Units::cm;
366
367 // ??? Is this needed?
368 dbManager->SetCurrentEnvByType(2);
369
370
371 //
372 // Central Barrel
373 //
374
375 // Z planes
376 double endCentralBarrel = ZLength[1]/2 - BFingerLength; // nominal position of end plate
377 double endEnvelopeNeg = endCentralBarrel + BFingerLengthNeg;
378 double endEnvelopePos = endCentralBarrel + BFingerLengthPos;
379
380 // R minimal
381 double rminBarrel = RInMin[1];
382
383 // R maximal
384 double rmaxTotal = ROutMax[1];
385
386 if (barrel_flag<1) { // >0 - no central barrel
387
388 GeoPcon* tileEnvPconeBarrel = new GeoPcon(PhiMin[1]*Gaudi::Units::deg, PhiMax[1]*Gaudi::Units::deg);
389
390 tileEnvPconeBarrel->addPlane(-endEnvelopeNeg, BFingerRmin, rmaxTotal);
391 tileEnvPconeBarrel->addPlane(-endCentralBarrel-DzSaddleSupport, BFingerRmin, rmaxTotal);
392 if (dbManager->BoolSaddle()) {
393 tileEnvPconeBarrel->addPlane(-endCentralBarrel-DzSaddleSupport, BFingerRmin-RadiusSaddle,rmaxTotal);
394 tileEnvPconeBarrel->addPlane(-endCentralBarrel, BFingerRmin-RadiusSaddle,rmaxTotal);
395 }
396 tileEnvPconeBarrel->addPlane(-endCentralBarrel, rminBarrel, rmaxTotal);
397 tileEnvPconeBarrel->addPlane( endCentralBarrel, rminBarrel, rmaxTotal);
398 if (dbManager->BoolSaddle()) {
399 tileEnvPconeBarrel->addPlane( endCentralBarrel, BFingerRmin-RadiusSaddle,rmaxTotal);
400 tileEnvPconeBarrel->addPlane( endCentralBarrel+DzSaddleSupport, BFingerRmin-RadiusSaddle,rmaxTotal);
401 }
402 tileEnvPconeBarrel->addPlane( endCentralBarrel+DzSaddleSupport, BFingerRmin, rmaxTotal);
403 tileEnvPconeBarrel->addPlane( endEnvelopePos, BFingerRmin, rmaxTotal);
404
405 lvTileEnvelopeBarrel = new GeoLogVol("TileCentralBarrel",tileEnvPconeBarrel,matAir);
406 pvTileEnvelopeBarrel = new GeoPhysVol(lvTileEnvelopeBarrel);
407
408 }
409
410 //
411 // Pos Ext. Barrel
412 //
413
414 // Z planes
415 double PosEndBarrelFinger = ZLength[1]/2; // nominal end of barrel finger
416 double PosEndITC = PosEndBarrelFinger + ZLength[5];
417 double PosEndExBarrelFinger = PosEndITC + ZLength[3];
418 double PosEndExBarrel = PosEndExBarrelFinger - EBFingerLengthPos;
419
420 if (m_log->level()<=MSG::DEBUG) {
421 (*m_log) << MSG::DEBUG
422 << " EBPos EnvDZPos[3] " << EnvDZPos[3] << " ZLength[5] " <<ZLength[5]<<"+"<<ZLength[3]
423 << " = " << ZLength[3]+ZLength[5] << " EBFingerLengthPos = " <<EBFingerLengthPos
424 <<endmsg;
425
426 (*m_log) << MSG::DEBUG << " PosEndBarrelFinger = " << PosEndBarrelFinger
427 << " PosEndITC = " << PosEndITC
428 << " PosEndExBarrel = " << PosEndExBarrel
429 << " PosEndExtBarrelFinger = " << PosEndExBarrelFinger
430 << endmsg;
431 }
432
434 double PosEndITC1 = (dbManager->TILBzoffset() + dbManager->TILEzshift() + dbManager->TILBdzmodul()/2)*Gaudi::Units::cm;
435 double corr = PosEndITC - PosEndITC1;
436 if (std::abs(corr)>0.01) {
437 (*m_log) << MSG::WARNING
438 << "Discrepancy between TileGlobals and TILB tables in GeoModel DB "
439 << PosEndITC << " != " << PosEndITC1 << "; take this into account"
440 <<endmsg;
441 }
442
443 //double beginITC1 = corr + (dbManager->TILBzoffset() + dbManager->TILEzshift()-dbManager->TILBdzmodul()/2)*Gaudi::Units::cm;
445 double PosBeginITC2 = corr + (dbManager->TILBzoffset() + dbManager->TILEzshift()-dbManager->TILBdzmodul()/2)*Gaudi::Units::cm;
447 double PosBeginGap = corr + (dbManager->TILBzoffset() + dbManager->TILEzshift()-dbManager->TILBdzmodul()/2)*Gaudi::Units::cm;
448 double PosEndGap = corr + (dbManager->TILBzoffset() + dbManager->TILEzshift()+dbManager->TILBdzmodul()/2)*Gaudi::Units::cm;
450 double PosBeginCrack = corr + (dbManager->TILBzoffset() + dbManager->TILEzshift()-dbManager->TILBdzmodul()/2)*Gaudi::Units::cm;
451 double PosEndCrack = corr + (dbManager->TILBzoffset() + dbManager->TILEzshift()+dbManager->TILBdzmodul()/2)*Gaudi::Units::cm;
452
453 if (!spC10) { // recovering old (wrong) positioning of gap scintillators
454 double GapWidth = PosEndGap - PosBeginGap;
455 PosBeginGap = PosBeginCrack + 0.9 * Gaudi::Units::cm;
456 PosEndGap = PosBeginGap + GapWidth;
457 }
458
459 if (m_log->level()<=MSG::DEBUG)
460 (*m_log) << MSG::DEBUG << " PosBeginITC2 = " << PosBeginITC2
461 << " PosBeginGap = " << PosBeginGap
462 << " PosEndGap = " << PosEndGap
463 << " PosBeginCrack = " << PosBeginCrack
464 << " PosEndCrack = " << PosEndCrack
465 << endmsg;
466
467 // R minimals
469 double PosRminITC1 = dbManager->TILBrminimal()*Gaudi::Units::cm;
471 double PosRminITC = rMinC10 /* dbManager->TILBrminimal() */ *Gaudi::Units::cm;
473 double PosRminGap = rMinE2pos*Gaudi::Units::cm;
475 double PosRminCrack = rMinE4pos*Gaudi::Units::cm;
476 double PosRmaxCrack = rMaxE3pos*Gaudi::Units::cm;
477
478 double PosRminExt = RInMin[3];
479
480 // R maximal
481 double PosRmaxTotal = ROutMax[3];
482
483 if (m_log->level()<=MSG::DEBUG)
484 (*m_log) << MSG::DEBUG
485 << " PosRminITC1 = " << PosRminITC1
486 << " PosRminITC2 = " << PosRminITC
487 << " PosRminGap = " << PosRminGap
488 << " PosRmaxCrack = " << PosRmaxCrack
489 << " PosRminCrack = " << PosRminCrack
490 << " PosRminExt = " << PosRminExt
491 << " PosRmaxTotal = " << PosRmaxTotal
492 << endmsg;
493
494 if (eb_flag) {
495
496 GeoPcon* tileEnvPconePosEndcap = new GeoPcon(PhiMin[3]*Gaudi::Units::deg, PhiMax[3]*Gaudi::Units::deg);
497
498 // Positive Endcap
499 tileEnvPconePosEndcap->addPlane(PosEndBarrelFinger, PosRminITC1, PosRmaxTotal);
500 tileEnvPconePosEndcap->addPlane(PosBeginITC2, PosRminITC1, PosRmaxTotal);
501 tileEnvPconePosEndcap->addPlane(PosBeginITC2, PosRminITC, PosRmaxTotal);
502 if (crack_flag>0) {
503 // endcap volume without crack scintillators
504 tileEnvPconePosEndcap->addPlane(PosBeginGap, PosRminITC, PosRmaxTotal);
505 tileEnvPconePosEndcap->addPlane(PosBeginGap, PosRminGap, PosRmaxTotal);
506 tileEnvPconePosEndcap->addPlane(PosEndGap, PosRminGap, PosRmaxTotal);
507 tileEnvPconePosEndcap->addPlane(PosEndGap, PosRminExt, PosRmaxTotal);
508 } else {
509 // endcap volume with crack scintillators
510 tileEnvPconePosEndcap->addPlane(PosBeginCrack, PosRminITC, PosRmaxTotal);
511 tileEnvPconePosEndcap->addPlane(PosBeginCrack, PosRminCrack, PosRmaxTotal);
512 tileEnvPconePosEndcap->addPlane(PosEndCrack, PosRminCrack, PosRmaxTotal);
513 tileEnvPconePosEndcap->addPlane(PosEndCrack, PosRminExt, PosRmaxTotal);
514 }
515 tileEnvPconePosEndcap->addPlane(PosEndExBarrel, PosRminExt, PosRmaxTotal);
516 if (dbManager->BoolSaddle()) {
517 tileEnvPconePosEndcap->addPlane(PosEndExBarrel, EFingerRmin-RadiusSaddle, PosRmaxTotal);
518 tileEnvPconePosEndcap->addPlane(PosEndExBarrel+DzSaddleSupport, EFingerRmin-RadiusSaddle, PosRmaxTotal);
519 }
520 tileEnvPconePosEndcap->addPlane(PosEndExBarrel+DzSaddleSupport, EFingerRmin, PosRmaxTotal);
521 tileEnvPconePosEndcap->addPlane(PosEndExBarrelFinger, EFingerRmin, PosRmaxTotal);
522
523 lvTileEnvelopePosEndcap = new GeoLogVol("TileEndcapPos",tileEnvPconePosEndcap,matAir);
524 pvTileEnvelopePosEndcap = new GeoPhysVol(lvTileEnvelopePosEndcap);
525
526 }
527
528 if (crack_flag==1) {
529 // Positive Crack as separate volume
530 GeoPcon* tileEnvPconePosCrack = new GeoPcon(PhiMin[3]*Gaudi::Units::deg, PhiMax[3]*Gaudi::Units::deg);
531
532 tileEnvPconePosCrack->addPlane(PosBeginCrack, PosRminCrack, PosRmaxCrack);
533 tileEnvPconePosCrack->addPlane(PosEndCrack, PosRminCrack, PosRmaxCrack);
534
535 lvTileEnvelopePosCrack = new GeoLogVol("TileCrackPos",tileEnvPconePosCrack,matAir);
536 pvTileEnvelopePosCrack = new GeoPhysVol(lvTileEnvelopePosCrack);
537 }
538
539 //
540 // Neg Ex Barrel
541 //
542
543 // Z planes
544 double NegEndBarrelFinger = ZLength[1]/2; // nominal end of barrel finger
545 double NegEndITC = NegEndBarrelFinger + ZLength[4];
546 double NegEndExtBarrelFinger = NegEndITC + ZLength[2];
547 double NegEndExBarrel = NegEndExtBarrelFinger - EBFingerLengthNeg;
548
549 if (m_log->level()<=MSG::DEBUG) {
550 (*m_log) << MSG::DEBUG
551 << " EBNeg EnvDZPos[2] " << EnvDZPos[2] << " ZLength[4] " <<ZLength[4]<<"+"<<ZLength[2]
552 << " = " << ZLength[2]+ZLength[4] << " EBFingerLengthNeg = " <<EBFingerLengthNeg
553 <<endmsg;
554
555 (*m_log) << MSG::DEBUG << " NegEndBarrelFinger = " << NegEndBarrelFinger
556 << " NegEndITC = " << NegEndITC
557 << " NegEndExBarrel = " << NegEndExBarrel
558 << " NegEndExtBarrelFinger = " << NegEndExtBarrelFinger
559 << endmsg;
560 }
561
563 double NegEndITC1 = (dbManager->TILBzoffset() + dbManager->TILEzshift() + dbManager->TILBdzmodul()/2)*Gaudi::Units::cm;
564 corr = NegEndITC - NegEndITC1;
565
566 if (std::abs(corr)>0.01) {
567 (*m_log) << MSG::WARNING
568 << "Discrepancy between TileGlobals and TILB tables in GeoModel DB "
569 << NegEndITC << " != " << NegEndITC1 << "; take this into account"
570 << endmsg;
571 }
572 //double NegBeginITC1 = corr + (dbManager->TILBzoffset() + dbManager->TILEzshift()-dbManager->TILBdzmodul()/2)*Gaudi::Units::cm;
574 double NegBeginITC2 = corr + (dbManager->TILBzoffset() + dbManager->TILEzshift()-dbManager->TILBdzmodul()/2)*Gaudi::Units::cm;
576 double NegBeginGap = corr + (dbManager->TILBzoffset() + dbManager->TILEzshift()-dbManager->TILBdzmodul()/2)*Gaudi::Units::cm;
577 double NegEndGap = corr + (dbManager->TILBzoffset() + dbManager->TILEzshift()+dbManager->TILBdzmodul()/2)*Gaudi::Units::cm;
579 double NegBeginCrack = corr + (dbManager->TILBzoffset() + dbManager->TILEzshift()-dbManager->TILBdzmodul()/2)*Gaudi::Units::cm;
580 double NegEndCrack = corr + (dbManager->TILBzoffset() + dbManager->TILEzshift()+dbManager->TILBdzmodul()/2)*Gaudi::Units::cm;
581
582 if (!spC10) { // recovering old (wrong) positioning of gap scintillators
583 double GapWidth = NegEndGap - NegBeginGap;
584 NegBeginGap = NegBeginCrack + 0.9 * Gaudi::Units::cm;
585 NegEndGap = NegBeginGap + GapWidth;
586 }
587
588 if (m_log->level()<=MSG::DEBUG)
589 (*m_log) << MSG::DEBUG << " NegBeginITC2 = " << NegBeginITC2
590 << " NegBeginGap = " << NegBeginGap
591 << " NegEndGap = " << NegEndGap
592 << " NegBeginCrack = " << NegBeginCrack
593 << " NegEndCrack = " << NegEndCrack
594 << endmsg;
595
596 // R minimals
598 double NegRminITC1 = dbManager->TILBrminimal()*Gaudi::Units::cm;
600 double NegRminITC = rMinC10 /* dbManager->TILBrminimal() */ *Gaudi::Units::cm;
602 double NegRminGap = rMinE2neg*Gaudi::Units::cm;
604 double NegRminCrack = rMinE4neg*Gaudi::Units::cm;
605 double NegRmaxCrack = rMaxE3neg*Gaudi::Units::cm;
607
608 double NegRminExt = RInMin[2];
609
610 // R maximal
611 double NegRmaxTotal = ROutMax[2];
612
613 if (m_log->level()<=MSG::DEBUG)
614 (*m_log) << MSG::DEBUG
615 << " NegRminITC1 = " << NegRminITC1
616 << " NegRminITC2 = " << NegRminITC
617 << " NegRminGap = " << NegRminGap
618 << " NegRmaxCrack = " << NegRmaxCrack
619 << " NegRminCrack = " << NegRminCrack
620 << " NegRminExt = " << NegRminExt
621 << " NegRmaxTotal = " << NegRmaxTotal
622 << endmsg;
623
624 if (eb_flag) {
625
626 GeoPcon* tileEnvPconeNegEndcap = new GeoPcon(PhiMin[2]*Gaudi::Units::deg, PhiMax[2]*Gaudi::Units::deg);
627
628 // Negative Endcap
629 tileEnvPconeNegEndcap->addPlane(-NegEndExtBarrelFinger, EFingerRmin, NegRmaxTotal);
630 tileEnvPconeNegEndcap->addPlane(-NegEndExBarrel-DzSaddleSupport, EFingerRmin, NegRmaxTotal);
631 if (dbManager->BoolSaddle()) {
632 tileEnvPconeNegEndcap->addPlane(-NegEndExBarrel-DzSaddleSupport, EFingerRmin-RadiusSaddle, NegRmaxTotal);
633 tileEnvPconeNegEndcap->addPlane(-NegEndExBarrel, EFingerRmin-RadiusSaddle, NegRmaxTotal);
634 }
635 tileEnvPconeNegEndcap->addPlane(-NegEndExBarrel, NegRminExt, NegRmaxTotal);
636 if (crack_flag>0) {
637 // endcap volume without crack scintillators
638 tileEnvPconeNegEndcap->addPlane(-NegEndGap, NegRminExt, NegRmaxTotal);
639 tileEnvPconeNegEndcap->addPlane(-NegEndGap, NegRminGap, NegRmaxTotal);
640 tileEnvPconeNegEndcap->addPlane(-NegBeginGap, NegRminGap, NegRmaxTotal);
641 tileEnvPconeNegEndcap->addPlane(-NegBeginGap, NegRminITC, NegRmaxTotal);
642 } else {
643 // endcap volume with crack scintillators
644 tileEnvPconeNegEndcap->addPlane(-NegEndCrack, NegRminExt, NegRmaxTotal);
645 tileEnvPconeNegEndcap->addPlane(-NegEndCrack, NegRminCrack, NegRmaxTotal);
646 tileEnvPconeNegEndcap->addPlane(-NegBeginCrack, NegRminCrack, NegRmaxTotal);
647 tileEnvPconeNegEndcap->addPlane(-NegBeginCrack, NegRminITC, NegRmaxTotal);
648 }
649 tileEnvPconeNegEndcap->addPlane(-NegBeginITC2, NegRminITC, NegRmaxTotal);
650 tileEnvPconeNegEndcap->addPlane(-NegBeginITC2, NegRminITC1, NegRmaxTotal);
651 tileEnvPconeNegEndcap->addPlane(-NegEndBarrelFinger, NegRminITC1, NegRmaxTotal);
652
653 lvTileEnvelopeNegEndcap = new GeoLogVol("TileEndcapNeg",tileEnvPconeNegEndcap,matAir);
654 pvTileEnvelopeNegEndcap = new GeoPhysVol(lvTileEnvelopeNegEndcap);
655
656 }
657
658 if (crack_flag==1) {
659 // Negative Crack as separate volume
660 GeoPcon* tileEnvPconeNegCrack = new GeoPcon(PhiMin[3]*Gaudi::Units::deg, PhiMax[3]*Gaudi::Units::deg);
661
662 tileEnvPconeNegCrack->addPlane(-NegEndCrack, NegRminCrack, NegRmaxCrack);
663 tileEnvPconeNegCrack->addPlane(-NegBeginCrack, NegRminCrack, NegRmaxCrack);
664
665 lvTileEnvelopeNegCrack = new GeoLogVol("TileCrackNeg",tileEnvPconeNegCrack,matAir);
666 pvTileEnvelopeNegCrack = new GeoPhysVol(lvTileEnvelopeNegCrack);
667 }
668
669 // --------------- Configure Section Builder for the Reco geometry --------------------
670 if (!m_fullGeo || barrel_flag!=0) {
671 // Central barrel part
672 dbManager->SetCurrentSectionByNumber(1);
673
674 dzGlue = (dbManager->TILBdzmodul() - dbManager->TILBdzend1() - dbManager->TILBdzend2()
675 - (dbManager->TILBnperiod()*2.*(dbManager->TILBdzmast() + dbManager->TILBdzspac())
676 - dbManager->TILBdzmast()))/(2.*(2.*dbManager->TILBnperiod() - 1));
677
678 // TODO: apparently, the value set with the call below is not used: it seems m_barrelPeriodThickness is recomputed inside the GeoSectionBuilder's code; so, the call below is probably useless...
679 sectionBuilder->setBarrelPeriodThickness(2.*(dbManager->TILBdzmast() + dbManager->TILBdzspac() + 2.*dzGlue)*Gaudi::Units::cm);
680 sectionBuilder->setBarrelGlue(dzGlue*Gaudi::Units::cm); // TODO: it's probably the same, here...
681
682 // Ext barrel part
683 dbManager->SetCurrentSectionByNumber(2);
684
685 dzGlue = (dbManager->TILBdzmodul() - dbManager->TILBdzend1() - dbManager->TILBdzend2()
686 - dbManager->TILBnperiod()*2.*(dbManager->TILBdzmast() + dbManager->TILBdzspac()))/(4.*dbManager->TILBnperiod());
687
688 // TODO: apparently, the value set with the call below is not used: it seems m_extendedPeriodThickness is recomputed inside the GeoSectionBuilder's code; so, the call below is probably useless...
689 sectionBuilder->setExtendedPeriodThickness(2.*(dbManager->TILBdzmast() + dbManager->TILBdzspac() + 2.*dzGlue)*Gaudi::Units::cm);
690 }
691
692 PVLink pvBarrelMother{nullptr}, pvFingerMotherNeg{nullptr}, pvFingerMotherPos{nullptr}, pvSaddleMotherNeg{nullptr}, pvSaddleMotherPos{nullptr};
693 PVLink pvEBarrelMotherNeg{nullptr}, pvEBarrelMotherPos{nullptr};
694 PVLink pvEFingerMotherNeg{nullptr}, pvEFingerMotherPos{nullptr}, pvESaddleMotherNeg{nullptr}, pvESaddleMotherPos{nullptr};
695 PVLink pvITCMotherNeg{nullptr}, pvITCMotherPos{nullptr};
696 PVLink pvGapMotherNeg{nullptr}, pvGapMotherPos{nullptr};
697 PVLink pvCrackMotherNeg{nullptr}, pvCrackMotherPos{nullptr};
698
699 GeoLogVol *lvEBarrelModuleMotherPos{nullptr}, *lvEBarrelModuleMotherNeg{nullptr};
700 PVLink pvEBarrelModuleMotherPos{nullptr}, pvEBarrelModuleMotherNeg{nullptr};
701
702 /*
703 GeoPhysVol *pvTmp_EBarrelModuleMotherPos =0,*pvTmL_EBarrelModuleMotherPos =0,*pvTmR_EBarrelModuleMotherPos =0;
704 GeoPhysVol *pvTmp_EBarrelModuleMotherNeg =0,*pvTmL_EBarrelModuleMotherNeg =0,*pvTmR_EBarrelModuleMotherNeg =0;
705 */
706
707 //GeoCutVolAction *action1 =0, *action2 =0, *action3 =0;
708 // -----------------------------------------------------------------------------------------------------------------
709 //
710 // All volumes which absolute forme EnvCounter loop
711 //
712 // -----------------------------------------------------------------------------------------------------------------
713 double dX1 =0, dX2 =0, dY1 =0, dY2 =0, dZ1 =0, dZ2 =0;
714 double dxIron =0, dyIron =0, dxIr =0, dyIr =0;
715 std::string volname ="";
716
717 // Cuting positioning
718 double PosXcut =0, PosYcut =0, PosY =0;
719 double modl_length =0;
720
721 const GeoShapeUnion *CutA= 0;
722 GeoShape *CutB= 0;
723
724 GeoLogVol *lvIrUp =0, *lvIrDw =0, *lvIron3 =0, *lvIron2 =0, *lvIron1 =0, *lvIrBox =0;
725 GeoPhysVol *pvIrUp =0, *pvIrDw =0, *pvIron3 =0, *pvIron2 =0, *pvIron1 =0, *pvIrBox =0;
726
727 if (m_fullGeo) {
728
729 // ext. barrel Cuts description
730 if (dbManager->BoolCuts()) {
731 if (m_log->level()<=MSG::DEBUG)
732 (*m_log) << MSG::DEBUG << " Tile Geometry with Ext.Barrel CutOuts and Iron plates, starting form TileCal-CSC-01"
733 << endmsg;
734
735 volname = "CutB"; dbManager->SetCurrentCuts(volname);
736 PosXcut = dbManager->CutsXpos();
737 PosYcut = dbManager->CutsYpos();
738 modl_length = 4*dbManager->CutsDX1();
739
740 // Inert materials, CutB1
741 dX1 = dbManager->CutsDX1();
742 dX2 = dbManager->CutsDX2();
743 dY1 = dbManager->CutsDY1();
744 dY2 = dbManager->CutsDY2();
745 dZ1 = dbManager->CutsDZ1();
746
747 checking("CutB1", false, 1, dX1,dX2,dY1,dY2,dZ1);
748 GeoTrd* CutB1 = new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
749 //const GeoShape& CutB = *CutB1;
750 CutB = CutB1;
751
752 // Inert materials which are in cuts, special modules
753 // Materials are in cuting region, up Iron plate
754 volname = "IrUp"; dbManager->SetCurrentCuts(volname);
755 dX1 = dbManager->CutsDX1();
756 dX2 = dbManager->CutsDX2();
757 dY1 = dbManager->CutsDY1();
758 dY2 = dbManager->CutsDY2();
759 dZ1 = dbManager->CutsDZ1();
760
761 checking("IrUp", false, 1,dX1,dX2,dY1,dY2,dZ1);
762 GeoTrd* IrUp = new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
763 lvIrUp = new GeoLogVol("IrUp",IrUp,matIron);
764 pvIrUp = new GeoPhysVol(lvIrUp);
765
766 // Materials are in cuting region, down Iron plate
767 volname = "IrDw"; dbManager->SetCurrentCuts(volname);
768 dX1 = dbManager->CutsDX1();
769 dX2 = dbManager->CutsDX2();
770 dY1 = dbManager->CutsDY1();
771 dY2 = dbManager->CutsDY2();
772 dZ1 = dbManager->CutsDZ1();
773
774 checking("IrDw", false, 1, dX1,dX2,dY1,dY2,dZ1);
775 GeoTrd* IrDw = new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
776 lvIrDw = new GeoLogVol("IrDw",IrDw,matIron);
777 pvIrDw = new GeoPhysVol(lvIrDw);
778
779 // Materials are in cuting region, 1up Iron plate
780 volname = "Cut1up"; dbManager->SetCurrentCuts(volname); //>>
781 PosY = dbManager->CutsYpos();
782
783 dX1 = dbManager->CutsDX1();
784 dX2 = dbManager->CutsDX2();
785 dY1 = dbManager->CutsDY1();
786 dY2 = dbManager->CutsDY2();
787 dZ1 = dbManager->CutsDZ1();
788
789 checking("Cut1up", false, 1, dX1,dX2,dY1,dY2,dZ1);
790 GeoTrd* Cut1up = new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
791
792 volname = "Cut2down"; dbManager->SetCurrentCuts(volname); //>>
793 dX1 = dbManager->CutsDX1();
794 dX2 = dbManager->CutsDX2();
795 dY1 = dbManager->CutsDY1();
796 dY2 = dbManager->CutsDY2();
797 dZ2 = dbManager->CutsDZ1();
798
799 checking("Cut2down", false, 1, dX1,dX2,dY1,dY2,dZ2);
800 GeoTrd* Cut1down = new GeoTrd(dX1,dX2,dY1,dY2,dZ2);
801
802 GeoTrf::Translate3D yPosA(0.,0.,-dZ1-dZ2);
803
804 const GeoShapeUnion& CutA1 = Cut1up->add(*Cut1down<<yPosA);
805 CutA = &CutA1;
806
807 /*
808 |----------> X
809 |---------------------------------------| (Xdown, -Ydown)
810 | (3) |
811 |---------------------------------------| (2) (Xdown, -Ymiddle)
812 / CutA \
813 |-------------------------------------------| (1) (Xup, -Yup)
814
815 GeoSimplePolygonBrep *BREP = new GeoSimplePolygonBrep(length/2);
816 BREP->addVertex( Xup, -Yup );
817 BREP->addVertex( Xdown, -Ymiddle);
818 BREP->addVertex( Xdown, -Ydown );
819 BREP->addVertex(-Xdown, -Ydown );
820 BREP->addVertex(-Xdown, -Ymiddle);
821 BREP->addVertex(-Xup, -Yup );
822 const GeoShape& ShapeCut2 = *BREP;
823 */
824
825 // Inert materials which are in cuts, special modules
826 // Materials are in cuting region, down Iron plate (3)
827 volname = "Iron3"; dbManager->SetCurrentCuts(volname); //>>
828 dX1 = dbManager->CutsDX1();
829 dX2 = dbManager->CutsDX2();
830 dY1 = dbManager->CutsDY1();
831 dY2 = dbManager->CutsDY2();
832 dZ1 = dbManager->CutsDZ1();
833
834 checking("Iron3", false, 1, dX1,dX2,dY1,dY2,dZ1);
835 GeoTrd* Iron3 = new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
836 lvIron3 = new GeoLogVol("Iron3",Iron3,matIron);
837 pvIron3 = new GeoPhysVol(lvIron3);
838
839 // Materials are in cuting region, down Iron plate (2)
840 volname = "Iron2"; dbManager->SetCurrentCuts(volname); //>>
841 dX1 = dbManager->CutsDX1();
842 dX2 = dbManager->CutsDX2();
843 dY1 = dbManager->CutsDY1();
844 dY2 = dbManager->CutsDY2();
845 dZ1 = dbManager->CutsDZ1();
846
847 checking("Iron2", false, 1, dX1,dX2,dY1,dY2,dZ1);
848 GeoTrd* Iron2 = new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
849 lvIron2 = new GeoLogVol("Iron2",Iron2,matIron);
850 pvIron2 = new GeoPhysVol(lvIron2);
851
852 // Materials are in cuting region, down Iron plate (1)
853 volname = "Iron1"; dbManager->SetCurrentCuts(volname); //>>
854 dX1 = dbManager->CutsDX1();
855 dX2 = dbManager->CutsDX2();
856 dY1 = dbManager->CutsDY1();
857 dY2 = dbManager->CutsDY2();
858 dZ1 = dbManager->CutsDZ1();
859
860 checking("Iron1", false, 1, dX1,dX2,dY1,dY2,dZ1);
861 GeoTrd* Iron1 = new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
862 lvIron1 = new GeoLogVol("Iron1",Iron1,matIron);
863 pvIron1 = new GeoPhysVol(lvIron1);
864
865 // Materials are in cuting region, Heavy Iron Box
866 volname = "IrBox"; dbManager->SetCurrentCuts(volname); //>>
867 dX1 = dbManager->CutsDX1();
868 dX2 = dbManager->CutsDX2();
869 dY1 = dbManager->CutsDY1();
870 dY2 = dbManager->CutsDY2();
871 dZ1 = dbManager->CutsDZ1();
872
873 checking("IrBox", false, 1, dX1,dX2,dY1,dY2,dZ1);
874 GeoTrd* IrBox = new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
875 lvIrBox = new GeoLogVol("IrBox",IrBox,matIron);
876 pvIrBox = new GeoPhysVol(lvIrBox);
877
878 /*
879 |<-->|----- |Xdown - Xup|
880 (Xdown,-Ymiddle) /| ^
881 / | |
882 (Xup, / | | CutB
883 |----------> X | | |
884 (Xup,-Yup) | | |
885 \ | |
886 \ | |- |Ydown - Ymiddle|
887 (Xdown,-Ydown) \| ---
888 (Ydown+|Ydown-Ymiddle|/2)-Yup
889 Y position = Ydown+|Ydown-Ymiddle|/2
890
891 GeoSimplePolygonBrep *BREP = new GeoSimplePolygonBrep(length/4);
892 BREP->addVertex( Xup, -Yup );
893 BREP->addVertex( Xdown, -Ydown );
894 BREP->addVertex( Xdown, -Ymiddle);
895 BREP->addVertex(-Xdown, -Ymiddle);
896 BREP->addVertex(-Xdown, -Ydown );
897 BREP->addVertex(-Xup, -Yup );
898 const GeoShape& ShapeCut1 = *BREP;
899 */
900 } // end if, BoolCuts
901 }
902
903 int NumberOfEnv = dbManager->GetNumberOfEnv();
904 MLOG(DEBUG) << "NumberOfEnv: " << NumberOfEnv << endmsg;
905
906 for (int EnvCounter = 0; EnvCounter < NumberOfEnv ; ++EnvCounter) { // Loop over Envelopes
907
908 dbManager->SetCurrentEnvByIndex(EnvCounter);
909 int EnvType = dbManager->GetEnvType();
910 dbManager->SetCurrentEnvByType(EnvType);
911 int NumberOfMod = dbManager->GetEnvNModules();
912
913 // Break for debugging
914 //if (EnvType != 3) continue;
915
916 if (m_log->level()<=MSG::DEBUG)
917 (*m_log) << MSG::DEBUG << " EnvCounter " << EnvCounter << " EnvType " << EnvType
918 << " EnvNModules " << NumberOfMod << endmsg;
919
920 if (EnvType == 1 && barrel_flag < 1) {
921 // nominal position of end plate
922 zEndSection = ZLength[1]/2 - BFingerLength;
923
924 GeoTubs* GeneralMother = new GeoTubs(dbManager->GetEnvRin()*Gaudi::Units::cm,
925 dbManager->GetEnvRout()*Gaudi::Units::cm,
926 zEndSection,
927 AnglMin, AnglMax);
928
929 GeoTubs* barrelMother = GeneralMother;
930 GeoLogVol* lvBarrelMother = new GeoLogVol("Barrel",barrelMother,matAir);
931 pvBarrelMother = new GeoPhysVol(lvBarrelMother);
932
933 if (m_log->level()<=MSG::DEBUG)
934 (*m_log) << MSG::DEBUG << "Barrel envelope parameters: "
935 << " Length=" << zEndSection
936 << " Rmin=" << dbManager->GetEnvRin()*Gaudi::Units::cm
937 << " Rmax=" << dbManager->GetEnvRout()*Gaudi::Units::cm
938 << endmsg;
939
940 // Envelopes for two barrel fingers, positive finger
941 GeoTubs* fingerMotherPos = new GeoTubs(BFingerRmin,
942 dbManager->GetEnvRout()*Gaudi::Units::cm,
943 BFingerLengthPos/2,
944 AnglMin, AnglMax);
945
946 GeoLogVol* lvFingerMotherPos = new GeoLogVol("FingerPos",fingerMotherPos,matAir);
947 pvFingerMotherPos = new GeoPhysVol(lvFingerMotherPos);
948
949 if (dbManager->BoolSaddle()) { // Envelopes for barrel saddle supports, positive
950 GeoTubs* SaddleMotherPos = new GeoTubs(BFingerRmin-RadiusSaddle,
951 BFingerRmin,
952 DzSaddleSupport/2,
953 AnglMin, AnglMax);
954
955 GeoLogVol* lvSaddleMotherPos = new GeoLogVol("SaddlePos",SaddleMotherPos,matAir);
956 pvSaddleMotherPos = new GeoPhysVol(lvSaddleMotherPos);
957 }
958
959 // Negative finger
960 GeoTubs* fingerMotherNeg = new GeoTubs(BFingerRmin,
961 dbManager->GetEnvRout()*Gaudi::Units::cm,
962 BFingerLengthNeg/2,
963 AnglMin, AnglMax);
964
965 GeoLogVol* lvFingerMotherNeg = new GeoLogVol("FingerNeg",fingerMotherNeg,matAir);
966 pvFingerMotherNeg = new GeoPhysVol(lvFingerMotherNeg);
967
968 if (m_log->level()<=MSG::DEBUG)
969 (*m_log) << MSG::DEBUG << "Barrel finger envelope parameters: "
970 << " length Pos/Neg=" << BFingerLengthPos << "/" << BFingerLengthNeg
971 << " Rmin=" << BFingerRmin << " Rmax=" << dbManager->GetEnvRout()*Gaudi::Units::cm
972 << endmsg;
973
974 // Envelopes for two barrel saddle supports, positive
975 if (dbManager->BoolSaddle()) {
976 GeoTubs* SaddleMotherNeg = new GeoTubs(BFingerRmin-RadiusSaddle,
977 BFingerRmin,
978 DzSaddleSupport/2,
979 AnglMin, AnglMax);
980
981 GeoLogVol* lvSaddleMotherNeg = new GeoLogVol("SaddleNeg",SaddleMotherNeg,matAir);
982 pvSaddleMotherNeg = new GeoPhysVol(lvSaddleMotherNeg);
983 }
984 }
985
986 if (EnvType == 3 && eb_flag) {
987
988 if (m_log->level()<=MSG::DEBUG)
989 (*m_log) << MSG::DEBUG <<" EBarrelPos DZ "<<(dbManager->GetEnvZLength()*Gaudi::Units::cm- EBFingerLengthPos)/2<< endmsg;
990
991 checking("EBarrel (+)", false, 0,
992 dbManager->GetEnvRin()*Gaudi::Units::cm,dbManager->GetEnvRout()*Gaudi::Units::cm,
993 AnglMin,AnglMax,(dbManager->GetEnvZLength()*Gaudi::Units::cm- EBFingerLengthPos)/2);
994
995 GeoTubs* GeneralMother = new GeoTubs(dbManager->GetEnvRin()*Gaudi::Units::cm,
996 dbManager->GetEnvRout()*Gaudi::Units::cm,
997 (dbManager->GetEnvZLength()*Gaudi::Units::cm- EBFingerLengthPos)/2,
998 AnglMin, AnglMax);
999
1000 GeoTubs* ebarrelMotherPos = GeneralMother;
1001 GeoLogVol* lvEBarrelMotherPos = new GeoLogVol("EBarrel",ebarrelMotherPos,matAir);
1002 pvEBarrelMotherPos = new GeoPhysVol(lvEBarrelMotherPos);
1003
1004 if (m_log->level()<=MSG::DEBUG)
1005 (*m_log) << MSG::DEBUG << "Positive ext.barrel envelope parameters: "
1006 << " length=" << (dbManager->GetEnvZLength()*Gaudi::Units::cm- EBFingerLength)
1007 << " Rmin=" << dbManager->GetEnvRin()*Gaudi::Units::cm
1008 << " Rmax=" << dbManager->GetEnvRout()*Gaudi::Units::cm
1009 << endmsg;
1010
1011 if (barrel_flag < 2) {
1012 // Envelope for finger separately
1013 checking("EBarrel (+)", false, 0,
1014 EFingerRmin,dbManager->GetEnvRout()*Gaudi::Units::cm,
1015 AnglMin,AnglMax, EBFingerLength/2);
1016
1017 GeoTubs* fingerMother = new GeoTubs(EFingerRmin,
1018 dbManager->GetEnvRout()*Gaudi::Units::cm,
1019 EBFingerLength/2,
1020 AnglMin, AnglMax);
1021
1022 GeoLogVol* lvEFingerMother = new GeoLogVol("EFinger",fingerMother,matAir);
1023 pvEFingerMotherPos = new GeoPhysVol(lvEFingerMother);
1024
1025 if (m_log->level()<=MSG::DEBUG)
1026 (*m_log) << MSG::DEBUG << "Positive ext.barrel finger envelope parameters: "
1027 << " length=" << EBFingerLength
1028 << " Rmin=" << EFingerRmin
1029 << " Rmax=" << (dbManager->GetEnvRout())*Gaudi::Units::cm
1030 << endmsg;
1031
1032 if (dbManager->BoolSaddle()) { //Envelopes for two barrel saddle supports, positive
1033 checking("ESaddle (+)", false, 0,
1034 EFingerRmin-RadiusSaddle,EFingerRmin,AnglMin,AnglMax, DzSaddleSupport/2);
1035
1036 GeoTubs* ESaddleMother = new GeoTubs(EFingerRmin-RadiusSaddle,
1037 EFingerRmin,
1038 DzSaddleSupport/2,
1039 AnglMin, AnglMax);
1040
1041 GeoLogVol* lvESaddleMother = new GeoLogVol("ESaddlePos",ESaddleMother,matAir);
1042 pvESaddleMotherPos = new GeoPhysVol(lvESaddleMother);
1043 }
1044 }
1045 }
1046
1047 // Negative Ext.Barrel
1048 if (EnvType == 2 && eb_flag) {
1049 if (m_log->level()<=MSG::DEBUG)
1050 (*m_log) << MSG::DEBUG <<" EBarrelNeg DZ "<<(dbManager->GetEnvZLength()*Gaudi::Units::cm- EBFingerLengthNeg)/2<< endmsg;
1051
1052 GeoTubs* GeneralMother = new GeoTubs(dbManager->GetEnvRin()*Gaudi::Units::cm,
1053 dbManager->GetEnvRout()*Gaudi::Units::cm,
1054 (dbManager->GetEnvZLength()*Gaudi::Units::cm- EBFingerLengthNeg)/2,
1055 AnglMin, AnglMax);
1056
1057 GeoTubs* ebarrelMotherNeg = GeneralMother;
1058 GeoLogVol* lvEBarrelMotherNeg = new GeoLogVol("EBarrel",ebarrelMotherNeg,matAir);
1059 pvEBarrelMotherNeg = new GeoPhysVol(lvEBarrelMotherNeg);
1060
1061 if (m_log->level()<=MSG::DEBUG)
1062 (*m_log) << MSG::DEBUG << "Nevative ext.barrel envelope parameters: "
1063 << " length=" << (dbManager->GetEnvZLength()*Gaudi::Units::cm- EBFingerLength)
1064 << " Rmin=" << dbManager->GetEnvRin()*Gaudi::Units::cm
1065 << " Rmax=" << dbManager->GetEnvRout()*Gaudi::Units::cm
1066 << endmsg;
1067
1068 if (barrel_flag < 2) {
1069 // Envelope for finger separately
1070 GeoTubs* fingerMother = new GeoTubs(EFingerRmin,
1071 dbManager->GetEnvRout()*Gaudi::Units::cm,
1072 EBFingerLengthNeg/2,
1073 AnglMin, AnglMax);
1074
1075 GeoLogVol* lvEFingerMother = new GeoLogVol("EFinger",fingerMother,matAir);
1076 pvEFingerMotherNeg = new GeoPhysVol(lvEFingerMother);
1077
1078 if (m_log->level()<=MSG::DEBUG)
1079 (*m_log) << MSG::DEBUG <<"Negative ext.barrel finger envelope parameters: "
1080 << " length=" << EBFingerLengthNeg
1081 << " Rmin=" << EFingerRmin
1082 << " Rmax=" << dbManager->GetEnvRout()*Gaudi::Units::cm
1083 << endmsg;
1084
1085 if (dbManager->BoolSaddle()) { //Envelopes for Ext. barrel saddle supports, positive
1086 checking("ESaddle (-)", false, 0,
1087 EFingerRmin-RadiusSaddle,EFingerRmin,AnglMin,AnglMax, DzSaddleSupport/2);
1088
1089 GeoTubs* ESaddleMother = new GeoTubs(EFingerRmin-RadiusSaddle,
1090 EFingerRmin,
1091 DzSaddleSupport/2,
1092 AnglMin, AnglMax);
1093
1094 GeoLogVol* lvESaddleMother = new GeoLogVol("ESaddlePos",ESaddleMother,matAir);
1095 pvESaddleMotherNeg = new GeoPhysVol(lvESaddleMother);
1096 }
1097 }
1098 }
1099
1100 // ITC Positive
1101 if (EnvType == 5) {
1102
1103 if (barrel_flag < 3) { // allow ITC
1104
1106
1107 rMinITC2 = rMinC10; // dbManager->TILBrminimal();
1108 rMaxITC2 = dbManager->TILBrmaximal();
1109 dzITC2 = dbManager->TILBdzmodul();
1110
1112
1113 rMinITC1 = dbManager->TILBrminimal();
1114 rMaxITC1 = dbManager->TILErmam();
1115 dzITC1 = dbManager->TILBdzmodul();
1116
1117 (*m_log) << MSG::INFO << " Positive ITC envelope parameters: PLUG1 "
1118 <<" Rmin= "<<rMinITC1*Gaudi::Units::cm<<" Rmax= "<<rMaxITC1*Gaudi::Units::cm<<" dzITC1= "<<dzITC1/2*Gaudi::Units::cm<< endmsg;
1119 (*m_log) << MSG::INFO << " PLUG2 "
1120 <<" Rmin= "<<rMinITC2*Gaudi::Units::cm<<" Rmax= "<<rMaxITC2*Gaudi::Units::cm<<" dzITC2= "<<dzITC2/2*Gaudi::Units::cm<< endmsg;
1121
1122 checking("ITC itcWheel1 (+)", false, 0,
1123 rMinITC1*Gaudi::Units::cm,rMaxITC1*Gaudi::Units::cm, AnglMin,AnglMax, dzITC1/2*Gaudi::Units::cm);
1124
1125 GeoTubs* itcWheel1 = new GeoTubs(rMinITC1*Gaudi::Units::cm,
1126 rMaxITC1*Gaudi::Units::cm,
1127 dzITC1/2*Gaudi::Units::cm,
1128 AnglMin, AnglMax);
1129
1130 checking("ITC itcWheel2 (+)", false, 0,
1131 rMinITC2*Gaudi::Units::cm,rMaxITC2*Gaudi::Units::cm, AnglMin,AnglMax, dzITC2/2*Gaudi::Units::cm);
1132
1133 GeoTubs* itcWheel2 = new GeoTubs(rMinITC2*Gaudi::Units::cm,
1134 rMaxITC2*Gaudi::Units::cm,
1135 dzITC2/2*Gaudi::Units::cm,
1136 AnglMin, AnglMax);
1137
1138 Z = ( dzITC1 - dzITC2)/2*Gaudi::Units::cm;
1139 GeoTrf::Translate3D itcWheel2OffsetPos(0.,0., Z);
1140
1141 zITCStandard = Z;
1142
1143 const GeoShapeUnion& itcMotherPos = itcWheel1->add(*itcWheel2<<itcWheel2OffsetPos);
1144
1145 GeoLogVol* lvITCMotherPos = new GeoLogVol("ITC",&itcMotherPos,matAir);
1146 pvITCMotherPos = new GeoPhysVol(lvITCMotherPos);
1147
1148 }
1149
1150 // Gap Positive
1151 if (barrel_flag < 4) { // allow Gap
1152
1154
1155 checking("Gap (+)", false, 0,
1156 dbManager->TILBrminimal()*Gaudi::Units::cm,
1157 dbManager->TILBrmaximal()*Gaudi::Units::cm/cos(deltaPhi/2*Gaudi::Units::deg),
1158 AnglMin,AnglMax, dbManager->TILBdzmodul()/2*Gaudi::Units::cm);
1159
1160 GeoTubs* GapMotherPos = new GeoTubs(dbManager->TILBrminimal()*Gaudi::Units::cm,
1161 dbManager->TILBrmaximal()*Gaudi::Units::cm/cos(deltaPhi/2*Gaudi::Units::deg),
1162 dbManager->TILBdzmodul()/2*Gaudi::Units::cm,
1163 AnglMin, AnglMax);
1164
1165 GeoLogVol* lvGapMotherPos = new GeoLogVol("Gap",GapMotherPos,matAir);
1166 pvGapMotherPos = new GeoPhysVol(lvGapMotherPos);
1167
1168 }
1169
1170 // Crack Positive
1171 if (crack_flag<=0 || pvTileEnvelopePosCrack) { // allow Crack
1172
1174
1175 checking("Crack (+)", spE4, 0,
1176 rMinE4pos*Gaudi::Units::cm,
1177 dbManager->TILBrmaximal()*Gaudi::Units::cm/cos(deltaPhi/2*Gaudi::Units::deg),
1178 AnglMin,AnglMax, dbManager->TILBdzmodul()/2*Gaudi::Units::cm);
1179
1180 GeoTubs* crackMotherPos = new GeoTubs(rMinE4pos*Gaudi::Units::cm,
1181 dbManager->TILBrmaximal()*Gaudi::Units::cm/cos(deltaPhi/2*Gaudi::Units::deg),
1182 dbManager->TILBdzmodul()/2*Gaudi::Units::cm,
1183 AnglMin, AnglMax);
1184
1185 GeoLogVol* lvCrackMotherPos = new GeoLogVol("Crack",crackMotherPos,matAir);
1186 pvCrackMotherPos = new GeoPhysVol(lvCrackMotherPos);
1187 }
1188 }
1189
1190 // ITC Negative
1191 if (EnvType == 4) {
1192
1193 if (barrel_flag < 3) { // allow ITC
1194
1196
1197 rMinITC2 = rMinC10; // dbManager->TILBrminimal();
1198 rMaxITC2 = dbManager->TILBrmaximal();
1199 dzITC2 = dbManager->TILBdzmodul();
1200
1202
1203 rMinITC1 = dbManager->TILBrminimal();
1204 rMaxITC1 = dbManager->TILErmam();
1205 dzITC1 = dbManager->TILBdzmodul();
1206
1207 (*m_log) << MSG::INFO << " Negative ITC envelope parameters: PLUG1 "
1208 <<" Rmin= "<<rMinITC1*Gaudi::Units::cm<<" Rmax= "<<rMaxITC1*Gaudi::Units::cm<<" dzITC1= "<<dzITC1/2*Gaudi::Units::cm<<endmsg;
1209 (*m_log) << MSG::INFO << " PLUG2 "
1210 <<" Rmin= "<<rMinITC2*Gaudi::Units::cm<<" Rmax= "<<rMaxITC2*Gaudi::Units::cm<<" dzITC2= "<<dzITC2/2*Gaudi::Units::cm<<endmsg;
1211
1212 checking("ITC itcWheel1 (-)", false, 0,
1213 rMinITC1*Gaudi::Units::cm,rMaxITC1*Gaudi::Units::cm, AnglMin,AnglMax, dzITC1/2*Gaudi::Units::cm);
1214
1215 GeoTubs* itcWheel1 = new GeoTubs(rMinITC1*Gaudi::Units::cm,
1216 rMaxITC1*Gaudi::Units::cm,
1217 dzITC1/2*Gaudi::Units::cm,
1218 AnglMin, AnglMax);
1219
1220 checking("ITC itcWheel2 (-)", false, 0,
1221 rMinITC2*Gaudi::Units::cm,rMaxITC2*Gaudi::Units::cm, AnglMin,AnglMax, dzITC2/2*Gaudi::Units::cm);
1222
1223 GeoTubs* itcWheel2 = new GeoTubs(rMinITC2*Gaudi::Units::cm,
1224 rMaxITC2*Gaudi::Units::cm,
1225 dzITC2/2*Gaudi::Units::cm,
1226 AnglMin, AnglMax);
1227
1228 Z = (-dzITC1 + dzITC2)/2*Gaudi::Units::cm;
1229 GeoTrf::Translate3D itcWheel2OffsetNeg(0.,0., Z);
1230
1231 zITCStandard = Z;
1232
1233 const GeoShapeUnion& itcMotherNeg = itcWheel1->add(*itcWheel2<<itcWheel2OffsetNeg);
1234
1235 GeoLogVol* lvITCMotherNeg = new GeoLogVol("ITC",&itcMotherNeg,matAir);
1236 pvITCMotherNeg = new GeoPhysVol(lvITCMotherNeg);
1237
1238 }
1239
1240 // Gap Negative
1241 if (barrel_flag < 4) { // allow Gap
1242
1244
1245 checking("Gap (-)", false, 1,
1246 dbManager->TILBrminimal()*Gaudi::Units::cm,
1247 dbManager->TILBrmaximal()*Gaudi::Units::cm/cos(deltaPhi/2*Gaudi::Units::deg),
1248 AnglMin,AnglMax, dbManager->TILBdzmodul()/2*Gaudi::Units::cm);
1249
1250 GeoTubs* GapMotherNeg = new GeoTubs(dbManager->TILBrminimal()*Gaudi::Units::cm,
1251 dbManager->TILBrmaximal()*Gaudi::Units::cm/cos(deltaPhi/2*Gaudi::Units::deg),
1252 dbManager->TILBdzmodul()/2*Gaudi::Units::cm,
1253 AnglMin, AnglMax);
1254
1255 GeoLogVol* lvGapMotherNeg = new GeoLogVol("Gap",GapMotherNeg,matAir);
1256 pvGapMotherNeg = new GeoPhysVol(lvGapMotherNeg);
1257
1258 }
1259
1260 // Crack Negative
1261 if (crack_flag<=0 || pvTileEnvelopeNegCrack) { // allow Crack
1262
1264
1265 checking("Crack (-)", spE4, 0,
1266 rMinE4neg*Gaudi::Units::cm,
1267 dbManager->TILBrmaximal()*Gaudi::Units::cm/cos(deltaPhi/2*Gaudi::Units::deg),
1268 AnglMin,AnglMax, dbManager->TILBdzmodul()/2*Gaudi::Units::cm);
1269
1270 GeoTubs* crackMotherNeg = new GeoTubs(rMinE4neg*Gaudi::Units::cm,
1271 dbManager->TILBrmaximal()*Gaudi::Units::cm/cos(deltaPhi/2*Gaudi::Units::deg),
1272 dbManager->TILBdzmodul()/2*Gaudi::Units::cm,
1273 AnglMin, AnglMax);
1274
1275 GeoLogVol* lvCrackMotherNeg = new GeoLogVol("Crack",crackMotherNeg,matAir);
1276 pvCrackMotherNeg = new GeoPhysVol(lvCrackMotherNeg);
1277 }
1278 }
1279
1280 if (m_fullGeo && (
1281 ((EnvType&6) == 0 && barrel_flag < 1) ||
1282 ((EnvType&6) == 2 && barrel_flag < 2) ||
1283 ((EnvType&6) == 4 && barrel_flag < 5) )) {
1284
1285 // ModuleNumber[NumberOfMod] array for independent of positrion numeration
1286 int ModuleIndex[64];
1287 for (int i=0; i < NumberOfMod; i++) {
1288 ModuleIndex[i] = i+1;
1289 }
1290
1291 // the main loop around all phi modules position
1292 int ModuleNcp =0;
1293
1294 GeoIntrusivePtr<GeoTransform> yrotMod{new GeoTransform(GeoTrf::RotateY3D(90*Gaudi::Units::deg))};
1295 GeoIntrusivePtr<GeoTransform> XYrtMod{new GeoTransform(GeoTrf::RotateX3D(180*Gaudi::Units::deg) * GeoTrf::RotateY3D(90*Gaudi::Units::deg))};
1296
1297 for (int ModCounter = 0; ModCounter < NumberOfMod; ModCounter++) {
1298
1299 ModuleNcp = ModuleIndex[ModCounter];
1300
1301 // General rotation and transformations
1302 double phi = (double(ModuleNcp-1) + 0.5)*deltaPhi;
1303 double ph1 = (double(ModuleNcp-1))*deltaPhi;
1304
1305 GeoIntrusivePtr<GeoTransform> zrotMod{new GeoTransform(GeoTrf::RotateZ3D(phi*Gaudi::Units::deg))};
1306 GeoIntrusivePtr<GeoTransform> zrotSaddle{new GeoTransform(GeoTrf::RotateZ3D(ph1*Gaudi::Units::deg))};
1307
1308 dbManager->SetCurrentModuleByIndex(ModuleNcp-1);
1309 int ModType = dbManager->GetModType();
1310 int ModFingpattern = dbManager->TILBfingpattern();
1311
1312 // Debuging code for cuted modules
1313 if (!(ModuleNcp>=NcpFrom && ModuleNcp<=NcpFrom+NcpPlus)) continue;
1314
1315 // special Modules with Cuts
1316 //if (ModuleNcp<35 || ModuleNcp>62) continue; if (ModuleNcp>37 && ModuleNcp<60) continue;
1317
1318 // Saddle Supports
1319 //if (ModuleNcp<39 || ModuleNcp>58) continue; if (ModuleNcp>42 && ModuleNcp<55) continue;
1320
1321 if (m_log->level()<=MSG::DEBUG)
1322 (*m_log) << MSG::DEBUG <<" ModuleNcp= "<< ModuleNcp <<" ModType "<< ModType <<" Phi "<< phi << endmsg;
1323
1324 //
1325 // ------------------- BARREL BLOCKS ------------------------
1326 //
1327
1328 if ( EnvType == 1 && barrel_flag < 1) { // normal barrel module or module zero
1329
1330 dbManager->SetCurrentSectionByNumber(ModType);
1331
1332 thicknessWedgeMother = dbManager->TILBdzmodul() * Gaudi::Units::cm;
1333 heightWedgeMother = (dbManager->TILBrmaximal() - dbManager->TILBrminimal()) * Gaudi::Units::cm;
1334 dy1WedgeMother = dbManager->TILBrminimal() * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
1335 dy2WedgeMother = dbManager->TILBrmaximal() * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
1336
1337 dzGlue = (dbManager->TILBdzmodul() - dbManager->TILBdzend1() - dbManager->TILBdzend2()
1338 - (dbManager->TILBnperiod()*2.*(dbManager->TILBdzmast() + dbManager->TILBdzspac())
1339 - dbManager->TILBdzmast()))/(2.*(2.*dbManager->TILBnperiod() - 1));
1340
1341 GeoTrd* barrelModuleMother = new GeoTrd(thicknessWedgeMother/2,
1342 thicknessWedgeMother/2,
1343 dy1WedgeMother,
1344 dy2WedgeMother,
1345 heightWedgeMother/2);
1346
1347 GeoLogVol* lvBarrelModuleMother = new GeoLogVol("BarrelModule",barrelModuleMother,matAir);
1348 PVLink pvBarrelModuleMother = new GeoPhysVol(lvBarrelModuleMother);
1349
1350 // Fill the section
1351 if (Filling) {
1352 sectionBuilder->fillSection(pvBarrelModuleMother, 1,
1353 dbManager->TILBrmaximal(),
1354 dbManager->TILBrminimal(),
1355 dzGlue,
1356 deltaPhi);
1357 }
1358
1359 GeoTransform* xtraMod = new GeoTransform(GeoTrf::TranslateX3D(
1360 (dbManager->TILBrmaximal() + dbManager->TILBrminimal())/2 * Gaudi::Units::cm));
1361
1362 pvBarrelMother->add(zrotMod);
1363 pvBarrelMother->add(xtraMod);
1364 pvBarrelMother->add(XYrtMod);
1365
1366 pvBarrelMother->add(new GeoIdentifierTag(ModuleNcp));
1367 pvBarrelMother->add(pvBarrelModuleMother);
1368
1369 // --------------------------BARREL FINGERS MAKING----------------------------
1370
1371 dbManager->SetCurrentTifg(1); // Barrel finger
1372 zEndSection = dbManager->TILBzoffset() + dbManager->TILBdzmodul()/2;
1373
1374 heightWedgeMother = (dbManager->TILErmax() - dbManager->TILBrmax())*Gaudi::Units::cm;
1375 dy1WedgeMother = dbManager->TILBrmax() * tan(deltaPhi/2*Gaudi::Units::deg)*Gaudi::Units::cm;
1376 dy2WedgeMother = dbManager->TILErmax() * tan(deltaPhi/2*Gaudi::Units::deg)*Gaudi::Units::cm;
1377
1378 // Finger Positive, positioning (only Left ModFingpattern == 10)
1379 if ( ModFingpattern != 10 ) {
1380 GeoTrd* fingerModuleMotherPos = new GeoTrd(BFingerLengthPos/2,
1381 BFingerLengthPos/2,
1382 dy1WedgeMother,
1383 dy2WedgeMother,
1384 heightWedgeMother/2);
1385
1386 GeoLogVol* lvFingerModuleMotherPos = new GeoLogVol("FingerModule",fingerModuleMotherPos,matAir);
1387 PVLink pvFingerModuleMotherPos = new GeoPhysVol(lvFingerModuleMotherPos);
1388
1389 if (Filling)
1390 sectionBuilder->fillFinger(pvFingerModuleMotherPos, 1,
1391 dbManager->TILErmax(),
1392 dbManager->TILBrmax(),
1393 deltaPhi,
1394 m_switches.testBeam,
1395 ModuleNcp,
1396 BFingerLengthPos*(1./Gaudi::Units::cm));
1397
1398 GeoTransform* xtraModFingerPos = new GeoTransform(GeoTrf::TranslateX3D((dbManager->TILErmax() + dbManager->TILBrmax())/2*Gaudi::Units::cm));
1399
1400 //(*m_log) << MSG::DEBUG << "R Index " << ModuleNcp << " Fingpattern "<< ModFingpattern << endmsg;
1401
1402 pvFingerMotherPos->add(zrotMod);
1403 pvFingerMotherPos->add(xtraModFingerPos);
1404 pvFingerMotherPos->add(XYrtMod);
1405
1406 pvFingerMotherPos->add(new GeoIdentifierTag(ModuleNcp));
1407 pvFingerMotherPos->add(pvFingerModuleMotherPos);
1408 }
1409
1410 // Finger Negative, positioning (only Left ModFingpattern == 01)
1411 if ( ModFingpattern != 1 ) {
1412
1413 GeoTrd* fingerModuleMotherNeg = new GeoTrd(BFingerLengthNeg/2,
1414 BFingerLengthNeg/2,
1415 dy1WedgeMother,
1416 dy2WedgeMother,
1417 heightWedgeMother/2);
1418
1419 GeoLogVol* lvFingerModuleMotherNeg = new GeoLogVol("FingerModule",fingerModuleMotherNeg,matAir);
1420 PVLink pvFingerModuleMotherNeg = new GeoPhysVol(lvFingerModuleMotherNeg);
1421
1422 if (Filling)
1423 sectionBuilder->fillFinger(pvFingerModuleMotherNeg, 1,
1424 dbManager->TILErmax(),
1425 dbManager->TILBrmax(),
1426 deltaPhi,
1427 m_switches.testBeam,
1428 ModuleNcp*100,
1429 BFingerLengthNeg*(1./Gaudi::Units::cm));
1430
1431 GeoTransform* xtraModFingerNeg = new GeoTransform(GeoTrf::TranslateX3D((dbManager->TILErmax() + dbManager->TILBrmax())/2*Gaudi::Units::cm));
1432
1433 // (*m_log) << MSG::DEBUG << "L Index " << ModuleNcp << " Fingpattern "<< ModFingpattern << endmsg;
1434
1435 pvFingerMotherNeg->add(zrotMod);
1436 pvFingerMotherNeg->add(xtraModFingerNeg);
1437 pvFingerMotherNeg->add(yrotMod);
1438
1439 pvFingerMotherNeg->add(new GeoIdentifierTag(ModuleNcp));
1440 pvFingerMotherNeg->add(pvFingerModuleMotherNeg);
1441 }
1442
1443 // --------------------------BARREL SADDLE MAKING----------------------------
1444 if (dbManager->BoolSaddle()) {
1445 if ( (ModuleNcp >=40 && ModuleNcp <=41) || (ModuleNcp >=56 && ModuleNcp <=57) ) {
1446 GeoTubs* SaddleModule = new GeoTubs(BFingerRmin-RadiusSaddle,
1447 BFingerRmin,
1448 DzSaddleSupport/2,
1449 0.,deltaPhi*Gaudi::Units::deg);
1450
1451 GeoLogVol* lvSaddleModule = new GeoLogVol("SaddleModule",SaddleModule,matIron);
1452 PVLink pvSaddleModule = new GeoPhysVol(lvSaddleModule);
1453
1454 pvSaddleMotherPos->add(zrotSaddle);
1455 pvSaddleMotherPos->add(new GeoIdentifierTag(ModuleNcp));
1456 pvSaddleMotherPos->add(pvSaddleModule);
1457
1458 pvSaddleMotherNeg->add(zrotSaddle);
1459 pvSaddleMotherNeg->add(new GeoIdentifierTag(ModuleNcp));
1460 pvSaddleMotherNeg->add(pvSaddleModule);
1461 }
1462 }
1463 }
1464
1465 //------------------- Extended Barrel Module Positive ----------------------------------------------------------
1466
1467 if (EnvType == 3 && barrel_flag < 2) {
1468
1469 dbManager->SetCurrentSectionByNumber(ModType);
1470
1471 // Mother module
1472 thicknessWedgeMother = dbManager->TILBdzmodul() * Gaudi::Units::cm;
1473 heightWedgeMother = (dbManager->TILBrmaximal() - dbManager->TILBrminimal()) * Gaudi::Units::cm;
1474 dy1WedgeMother = dbManager->TILBrminimal() * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
1475 dy2WedgeMother = dbManager->TILBrmaximal() * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
1476
1477 dzGlue = (dbManager->TILBdzmodul() - dbManager->TILBdzend1() - dbManager->TILBdzend2()
1478 - dbManager->TILBnperiod()*2.*(dbManager->TILBdzmast() + dbManager->TILBdzspac()))
1479 / (4.* dbManager->TILBnperiod());
1480
1481 double Radius = (dbManager->TILBrmaximal() + dbManager->TILBrminimal())/2 * Gaudi::Units::cm;
1482
1483 checking("EBarrelModule (+)", false, 1,
1484 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
1485
1486 GeoTrd* ebarrelModuleMotherPos = new GeoTrd(thicknessWedgeMother/2,
1487 thicknessWedgeMother/2,
1488 dy1WedgeMother,
1489 dy2WedgeMother,
1490 heightWedgeMother/2);
1491
1492 if (!dbManager->BoolCuts()) {
1493 if (m_log->level()<=MSG::DEBUG)
1494 (*m_log) << MSG::DEBUG << " BoolCuts NO "<< dbManager->BoolCuts() << endmsg;
1495
1496 lvEBarrelModuleMotherPos = new GeoLogVol("EBarrelModule",ebarrelModuleMotherPos,matAir);
1497 pvEBarrelModuleMotherPos = new GeoPhysVol(lvEBarrelModuleMotherPos);
1498
1499 } else {
1500
1501 //gdb
1502 if (m_log->level()<=MSG::DEBUG)
1503 (*m_log) << MSG::DEBUG << " BoolCuts YES "<< dbManager->BoolCuts() << endmsg;
1504
1505 double PoZ2 =0, PoZ1 =0, thicknessEndPlate =dbManager->TILBdzend1()*Gaudi::Units::cm;
1506
1507 PoZ1 = thicknessEndPlate + modl_length/4 - (dbManager->GetEnvZLength()*Gaudi::Units::cm- EBFingerLengthPos)/2;
1508 PoZ2 = PoZ1 + modl_length/4;
1509
1510 if ((ModuleNcp>=35 && ModuleNcp<=37) || (ModuleNcp>=60 && ModuleNcp<=62)) {
1511 GeoTrf::Transform3D TransCut2 = GeoTrf::TranslateZ3D(-Radius) * GeoTrf::RotateX3D((90-phi)*Gaudi::Units::deg) * GeoTrf::RotateY3D(180*Gaudi::Units::deg)
1512 * GeoTrf::Translate3D(-PoZ2,0.,-PosY);
1513
1514 if (ModuleNcp>=60 && ModuleNcp<=62) {
1515 GeoTrf::Transform3D TransCutL = GeoTrf::TranslateZ3D(-Radius)
1516 * GeoTrf::RotateY3D(180*Gaudi::Units::deg) * GeoTrf::RotateX3D(phi*Gaudi::Units::deg)
1517 * GeoTrf::Translate3D(PoZ1,PosYcut,-PosXcut);
1518
1519 // Cuting of module (Left)
1520 const GeoShape& TmL_EBarrelModuleMotherPos = ebarrelModuleMotherPos->subtract((*CutA)<<TransCut2).
1521 subtract((*CutB)<<TransCutL);
1522
1523 lvEBarrelModuleMotherPos = new GeoLogVol("EBarrelModule",&TmL_EBarrelModuleMotherPos,matAir);
1524
1525 } else if (ModuleNcp>=35 && ModuleNcp<=37) {
1526 GeoTrf::Transform3D TransCutR = GeoTrf::TranslateZ3D(-Radius)
1527 * GeoTrf::RotateY3D(180*Gaudi::Units::deg) * GeoTrf::RotateX3D(phi*Gaudi::Units::deg)
1528 * GeoTrf::Translate3D(PoZ1,PosYcut,PosXcut) * GeoTrf::RotateY3D(180*Gaudi::Units::deg);
1529
1530 // Cuting of module (Right)
1531 const GeoShape& TmR_EBarrelModuleMotherPos = ebarrelModuleMotherPos->subtract((*CutA)<<TransCut2).
1532 subtract((*CutB)<<TransCutR);
1533
1534 lvEBarrelModuleMotherPos = new GeoLogVol("EBarrelModule",&TmR_EBarrelModuleMotherPos,matAir);
1535 }
1536
1537 pvEBarrelModuleMotherPos = new GeoPhysVol(lvEBarrelModuleMotherPos);
1538
1539 } else {
1540 lvEBarrelModuleMotherPos = new GeoLogVol("EBarrelModule",ebarrelModuleMotherPos,matAir);
1541 pvEBarrelModuleMotherPos = new GeoPhysVol(lvEBarrelModuleMotherPos);
1542 } // end special modules
1543 } // end if, BoolCuts()
1544
1545 // Fill the section
1546 if (Filling) {
1547 sectionBuilder->fillSection(pvEBarrelModuleMotherPos, 2,
1548 dbManager->TILBrmaximal(),
1549 dbManager->TILBrminimal(),
1550 dzGlue,
1551 deltaPhi,
1552 ModuleNcp);
1553 }
1554
1555 GeoTransform* xtraModPos = new GeoTransform(GeoTrf::TranslateX3D(Radius));
1556
1557 pvEBarrelMotherPos->add(zrotMod);
1558 pvEBarrelMotherPos->add(xtraModPos);
1559 pvEBarrelMotherPos->add(XYrtMod);
1560
1561 pvEBarrelMotherPos->add(new GeoIdentifierTag(ModuleNcp));
1562 pvEBarrelMotherPos->add(pvEBarrelModuleMotherPos);
1563
1564 /*
1565 if (!dbManager->BoolCuts()) {
1566 pvEBarrelMotherPos->add(pvEBarrelModuleMotherPos);
1567 (*m_log) << MSG::DEBUG << " BoolCuts NO "<< dbManager->BoolCuts() << endmsg;
1568
1569 } else {
1570
1571 (*m_log) << MSG::DEBUG << " BoolCuts YES "<< dbManager->BoolCuts() << endmsg;
1572
1573 double PoZ2 =0, PoZ1 =0;
1574 double thicknessEndPlate = dbManager->TILBdzend1()*Gaudi::Units::cm;
1575
1576 PoZ1 = thicknessEndPlate + modl_length/4 - (dbManager->GetEnvZLength()*Gaudi::Units::cm- EBFingerLengthPos)/2;
1577 PoZ2 = modl_length/4 + PoZ1;
1578
1579 if ((ModuleNcp>=35 && ModuleNcp<=37) || (ModuleNcp>=60 && ModuleNcp<=62)) {
1580 GeoTrf::Transform3D TransCut2 = GeoTrf::TranslateZ3D(-Radius) * GeoTrf::RotateX3D((90-phi)*Gaudi::Units::deg) * GeoTrf::RotateY3D(180*Gaudi::Units::deg)
1581 * GeoTrf::Translate3D(-PoZ2,0.,-PosY);
1582
1583 // Cuting of pvEBarrelModuleMotherPos (-)
1584 GeoCutVolAction action1(*CutA, TransCut2);
1585 pvEBarrelModuleMotherPos->apply(&action1);
1586 pvTmp_EBarrelModuleMotherPos = action1.getPV();
1587
1588 if (ModuleNcp>=60 && ModuleNcp<=62) {
1589 GeoTrf::Transform3D TransCutL = GeoTrf::TranslateZ3D(-Radius)
1590 * GeoTrf::RotateY3D(180*Gaudi::Units::deg) * GeoTrf::RotateX3D(phi*Gaudi::Units::deg)
1591 * GeoTrf::Translate3D(PoZ1,PosYcut,-PosXcut);
1592
1593 // Cuting of pvEBarrelModuleMotherPos (Left)
1594 GeoCutVolAction action2(*CutB, TransCutL);
1595 pvTmp_EBarrelModuleMotherPos->apply(&action2);
1596 pvTmL_EBarrelModuleMotherPos = action2.getPV();
1597
1598 pvEBarrelMotherPos->add(pvTmL_EBarrelModuleMotherPos);
1599
1600 } else if (ModuleNcp>=35 && ModuleNcp<=37) {
1601 GeoTrf::Transform3D TransCutR = GeoTrf::TranslateZ3D(-Radius)
1602 * GeoTrf::RotateY3D(180*Gaudi::Units::deg) * GeoTrf::RotateX3D(phi*Gaudi::Units::deg)
1603 * GeoTrf::Translate3D(PoZ1,PosYcut,PosXcut) * GeoTrf::RotateY3D(180*Gaudi::Units::deg);
1604
1605 // Cuting of pvEBarrelModuleMotherPos (Right)
1606 GeoCutVolAction action3(*CutB, TransCutR);
1607 pvTmp_EBarrelModuleMotherPos->apply(&action3);
1608 pvTmR_EBarrelModuleMotherPos = action3.getPV();
1609
1610 pvEBarrelMotherPos->add(pvTmR_EBarrelModuleMotherPos);
1611 }
1612 } else {
1613 pvEBarrelMotherPos->add(pvEBarrelModuleMotherPos);
1614 } // end special modules
1615 pvEBarrelMotherPos->add(pvEBarrelModuleMotherPos);
1616 } // end if, BoolCuts()
1617 */
1618
1619 //--------------------------EBARREL FINGERS MAKING------------------------------
1620
1621 dbManager->SetCurrentTifg(2); //barrel efinger (small)
1622
1623 // Trd - one finger mother
1624 thicknessWedgeMother = dbManager->TIFGdz() * Gaudi::Units::cm;
1625 heightWedgeMother = (dbManager->TILErmax() - dbManager->TILBrmax()) * Gaudi::Units::cm;
1626 dy1WedgeMother = dbManager->TILBrmax() * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
1627 dy2WedgeMother = dbManager->TILErmax() * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
1628
1629 checking("EFingerModule (+)", false, 1,
1630 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
1631
1632 GeoTrd* efingerModuleMother = new GeoTrd(thicknessWedgeMother/2,
1633 thicknessWedgeMother/2,
1634 dy1WedgeMother,
1635 dy2WedgeMother,
1636 heightWedgeMother/2);
1637
1638 GeoLogVol* lvEFingerModuleMother = new GeoLogVol("EFingerModule",efingerModuleMother,matAir);
1639 PVLink pvEFingerModuleMother = new GeoPhysVol(lvEFingerModuleMother);
1640
1641 // Fill the section
1642 if (Filling) {
1643 sectionBuilder->fillFinger(pvEFingerModuleMother, 2,
1644 dbManager->TILErmax(),
1645 dbManager->TILBrmax(),
1646 deltaPhi,
1647 m_switches.testBeam,
1648 ModuleNcp);
1649 }
1650 GeoTransform* xtraModFingerPos = new GeoTransform(GeoTrf::TranslateX3D(
1651 (dbManager->TILErmax() + dbManager->TILBrmax())/2*Gaudi::Units::cm));
1652 pvEFingerMotherPos->add(zrotMod);
1653 pvEFingerMotherPos->add(xtraModFingerPos);
1654 pvEFingerMotherPos->add(XYrtMod);
1655
1656 pvEFingerMotherPos->add(new GeoIdentifierTag(ModuleNcp));
1657 pvEFingerMotherPos->add(pvEFingerModuleMother);
1658
1659 // --------------------------BARREL SADDLE MAKING----------------------------
1660 if (dbManager->BoolSaddle()) {
1661 if ( (ModuleNcp >=39 && ModuleNcp <=42) || (ModuleNcp >=55 && ModuleNcp <=58) ) {
1662 GeoTubs* SaddleModule = new GeoTubs(BFingerRmin-RadiusSaddle,
1663 BFingerRmin,
1664 DzSaddleSupport/2,
1665 0.,deltaPhi*Gaudi::Units::deg);
1666
1667 GeoLogVol* lvSaddleModule = new GeoLogVol("SaddleModule",SaddleModule,matIron);
1668 PVLink pvSaddleModule = new GeoPhysVol(lvSaddleModule);
1669
1670 pvESaddleMotherPos->add(zrotSaddle);
1671 pvESaddleMotherPos->add(new GeoIdentifierTag(ModuleNcp));
1672 pvESaddleMotherPos->add(pvSaddleModule);
1673 }
1674 }
1675
1676 } // end if (EnvType == 3)
1677
1678 //------------------- Extended Barrel Module Negative ----------------------------------------------------------
1679
1680 if (EnvType == 2 && barrel_flag < 2) {
1681
1682 dbManager->SetCurrentSectionByNumber(ModType);
1683
1684 // Mother module
1685 thicknessWedgeMother = dbManager->TILBdzmodul() * Gaudi::Units::cm;
1686 heightWedgeMother = (dbManager->TILBrmaximal() - dbManager->TILBrminimal()) * Gaudi::Units::cm;
1687 dy1WedgeMother = dbManager->TILBrminimal() * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
1688 dy2WedgeMother = dbManager->TILBrmaximal() * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
1689
1690 dzGlue = (dbManager->TILBdzmodul() - dbManager->TILBdzend1() - dbManager->TILBdzend2()
1691 - dbManager->TILBnperiod()*2.*(dbManager->TILBdzmast()
1692 + dbManager->TILBdzspac()))/(4.*dbManager->TILBnperiod());
1693
1694 double Radius = (dbManager->TILBrmaximal() + dbManager->TILBrminimal())/2 * Gaudi::Units::cm;
1695
1696 checking("EBarrelModule (-)", false, 1,
1697 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
1698
1699 GeoTrd* ebarrelModuleMotherNeg = new GeoTrd(thicknessWedgeMother/2,
1700 thicknessWedgeMother/2,
1701 dy1WedgeMother,
1702 dy2WedgeMother,
1703 heightWedgeMother/2);
1704
1705 if (!dbManager->BoolCuts()) {
1706 if (m_log->level()<=MSG::DEBUG)
1707 (*m_log) << MSG::DEBUG << " BoolCuts NO "<< dbManager->BoolCuts() << endmsg;
1708
1709 lvEBarrelModuleMotherNeg = new GeoLogVol("EBarrelModule",ebarrelModuleMotherNeg,matAir);
1710 pvEBarrelModuleMotherNeg = new GeoPhysVol(lvEBarrelModuleMotherNeg);
1711
1712 } else {
1713
1714 //gdb
1715 if (m_log->level()<=MSG::DEBUG)
1716 (*m_log) << MSG::DEBUG << " BoolCuts YES "<< dbManager->BoolCuts() << endmsg;
1717
1718 double PoZ2 =0, PoZ1 =0, thicknessEndPlate = dbManager->TILBdzend1()*Gaudi::Units::cm;
1719
1720 PoZ1 = thicknessEndPlate + modl_length/4 - (dbManager->GetEnvZLength()*Gaudi::Units::cm- EBFingerLengthNeg)/2;
1721 PoZ2 = PoZ1 + modl_length/4;
1722
1723 if ((ModuleNcp>=35 && ModuleNcp<=37) || (ModuleNcp>=60 && ModuleNcp<=62)) {
1724 GeoTrf::Transform3D TransCut2 = GeoTrf::TranslateZ3D(-Radius)
1725 * GeoTrf::RotateX3D((phi-90)*Gaudi::Units::deg) * GeoTrf::RotateY3D(180*Gaudi::Units::deg)
1726 * GeoTrf::Translate3D(-PoZ2,0,-PosY);
1727
1728 if (ModuleNcp>=60 && ModuleNcp<=62) {
1729 GeoTrf::Transform3D TransCutL = GeoTrf::TranslateZ3D(-Radius)
1730 * GeoTrf::RotateY3D(180*Gaudi::Units::deg) * GeoTrf::RotateX3D(-phi*Gaudi::Units::deg)
1731 * GeoTrf::Translate3D(PoZ1,-PosYcut,-PosXcut);
1732
1733 // Cuting of module (Left)
1734 const GeoShape& TmL_EBarrelModuleMotherNeg = ebarrelModuleMotherNeg->subtract((*CutA)<<TransCut2).
1735 subtract((*CutB)<<TransCutL);
1736
1737 lvEBarrelModuleMotherNeg = new GeoLogVol("EBarrelModule",&TmL_EBarrelModuleMotherNeg,matAir);
1738
1739 } else if (ModuleNcp>=35 && ModuleNcp<=37) {
1740 GeoTrf::Transform3D TransCutR = GeoTrf::TranslateZ3D(-Radius)
1741 * GeoTrf::RotateY3D(180*Gaudi::Units::deg) * GeoTrf::RotateX3D(-phi*Gaudi::Units::deg)
1742 * GeoTrf::Translate3D(PoZ1,-PosYcut,PosXcut) * GeoTrf::RotateY3D(180*Gaudi::Units::deg);
1743
1744 // Cuting of module (Right)
1745 const GeoShape& TmR_EBarrelModuleMotherNeg = ebarrelModuleMotherNeg->subtract((*CutA)<<TransCut2).
1746 subtract((*CutB)<<TransCutR);
1747
1748 lvEBarrelModuleMotherNeg = new GeoLogVol("EBarrelModule",&TmR_EBarrelModuleMotherNeg,matAir);
1749 }
1750
1751 pvEBarrelModuleMotherNeg = new GeoPhysVol(lvEBarrelModuleMotherNeg);
1752
1753 } else {
1754 lvEBarrelModuleMotherNeg = new GeoLogVol("EBarrelModule",ebarrelModuleMotherNeg,matAir);
1755 pvEBarrelModuleMotherNeg = new GeoPhysVol(lvEBarrelModuleMotherNeg);
1756 } // end special modules
1757 } // end if, BoolCuts()
1758
1759 // Fill the section
1760 if (Filling) {
1761 sectionBuilder->fillSection(pvEBarrelModuleMotherNeg, 2,
1762 dbManager->TILBrmaximal(),
1763 dbManager->TILBrminimal(),
1764 dzGlue,
1765 deltaPhi,
1766 ModuleNcp,
1767 0.,true);
1768 }
1769
1770 GeoTransform* xtraModNeg = new GeoTransform(GeoTrf::TranslateX3D(Radius));
1771
1772 pvEBarrelMotherNeg->add(zrotMod);
1773 pvEBarrelMotherNeg->add(xtraModNeg);
1774 pvEBarrelMotherNeg->add(yrotMod);
1775
1776 pvEBarrelMotherNeg->add(new GeoIdentifierTag(ModuleNcp));
1777 pvEBarrelMotherNeg->add(pvEBarrelModuleMotherNeg);
1778
1779 /*
1780 if (!dbManager->BoolCuts()) {
1781 pvEBarrelMotherNeg->add(pvEBarrelModuleMotherNeg);
1782 (*m_log) << MSG::DEBUG << " BoolCuts NO "<< dbManager->BoolCuts() << endmsg;
1783
1784 } else {
1785 (*m_log) << MSG::DEBUG << " BoolCuts YES "<< dbManager->BoolCuts() << endmsg;
1786
1787 double PoZ2 =0, PoZ1 =0;
1788 double thicknessEndPlate = dbManager->TILBdzend1()*Gaudi::Units::cm;
1789
1790 PoZ1 = thicknessEndPlate + modl_length/4 - (dbManager->GetEnvZLength()*Gaudi::Units::cm- EBFingerLengthPos)/2;
1791 PoZ2 = modl_length/4 + PoZ1;
1792
1793 if ((ModuleNcp>=35 && ModuleNcp<=37) || (ModuleNcp>=60 && ModuleNcp<=62)) {
1794 GeoTrf::Transform3D TransCut2 = GeoTrf::TranslateZ3D(-Radius)
1795 * GeoTrf::RotateX3D((phi-90)*Gaudi::Units::deg) * GeoTrf::RotateY3D(180*Gaudi::Units::deg)
1796 * GeoTrf::Translate3D(-PoZ2,0.,-PosY);
1797
1798 // Cuting of pvEBarrelModuleMotherNeg (-)
1799 GeoCutVolAction action1(*CutA, TransCut2);
1800 pvEBarrelModuleMotherNeg->apply(&action1);
1801 pvTmp_EBarrelModuleMotherNeg = action1.getPV();
1802
1803 if (ModuleNcp>=60 && ModuleNcp<=62) {
1804 GeoTrf::Transform3D TransCutL = GeoTrf::TranslateZ3D(-Radius)
1805 * GeoTrf::RotateY3D(180*Gaudi::Units::deg) * GeoTrf::RotateX3D(-phi*Gaudi::Units::deg)
1806 * GeoTrf::Translate3D(PoZ1,-PosYcut,-PosXcut);
1807
1808 // Cuting of pvEBarrelModuleMotherNeg (Left)
1809 GeoCutVolAction action2(*CutB, TransCutL);
1810 pvTmp_EBarrelModuleMotherNeg->apply(&action2);
1811 pvTmL_EBarrelModuleMotherNeg = action2.getPV();
1812
1813 pvEBarrelMotherNeg->add(pvTmL_EBarrelModuleMotherNeg);
1814
1815 } else if (ModuleNcp>=35 && ModuleNcp<=37) {
1816 GeoTrf::Transform3D TransCutR = GeoTrf::TranslateZ3D(-Radius)
1817 * GeoTrf::RotateY3D(180*Gaudi::Units::deg) * GeoTrf::RotateX3D(-phi*Gaudi::Units::deg)
1818 * GeoTrf::Translate3D(PoZ1,-PosYcut,PosXcut) * GeoTrf::RotateY3D(180*Gaudi::Units::deg);
1819
1820 // Cuting of pvEBarrelModuleMotherNeg (Right)
1821 GeoCutVolAction action3(*CutB, TransCutR);
1822 pvTmp_EBarrelModuleMotherNeg->apply(&action3);
1823 pvTmR_EBarrelModuleMotherNeg = action3.getPV();
1824
1825 pvEBarrelMotherNeg->add(pvTmR_EBarrelModuleMotherNeg);
1826 }
1827 } else {
1828 pvEBarrelMotherNeg->add(pvEBarrelModuleMotherNeg);
1829 } // end special modules
1830 pvEBarrelMotherNeg->add(pvEBarrelModuleMotherNeg);
1831 } // end if, BoolCuts()
1832 */
1833
1834 //--------------------------EBARREL FINGERS MAKING------------------------------
1835
1836 dbManager->SetCurrentTifg(2); //barrel efinger (small)
1837
1838 //zEndSection = extOffset + dbManager->TILBdzmodul()/2 + dbManager->TILEzshift();
1839
1840 // Trd - one finger mother
1841 thicknessWedgeMother = dbManager->TIFGdz() * Gaudi::Units::cm;
1842 heightWedgeMother = (dbManager->TILErmax() - dbManager->TILBrmax()) * Gaudi::Units::cm;
1843 dy1WedgeMother = dbManager->TILBrmax() * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
1844 dy2WedgeMother = dbManager->TILErmax() * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
1845
1846 checking("EFingerModule (-)", false, 1,
1847 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
1848
1849 GeoTrd* efingerModuleMother = new GeoTrd(thicknessWedgeMother/2,
1850 thicknessWedgeMother/2,
1851 dy1WedgeMother,
1852 dy2WedgeMother,
1853 heightWedgeMother/2);
1854
1855 GeoLogVol* lvEFingerModuleMother = new GeoLogVol("EFingerModule",efingerModuleMother,matAir);
1856 PVLink pvEFingerModuleMother = new GeoPhysVol(lvEFingerModuleMother);
1857
1858 // Fill the section
1859 if (Filling) {
1860 sectionBuilder->fillFinger(pvEFingerModuleMother, 2,
1861 dbManager->TILErmax(),
1862 dbManager->TILBrmax(),
1863 deltaPhi,
1864 m_switches.testBeam,
1865 ModuleNcp*100);
1866 }
1867 GeoTransform* xtraModFingerNeg = new GeoTransform(GeoTrf::TranslateX3D(
1868 (dbManager->TILErmax() + dbManager->TILBrmax())/2*Gaudi::Units::cm));
1869 pvEFingerMotherNeg->add(zrotMod);
1870 pvEFingerMotherNeg->add(xtraModFingerNeg);
1871 pvEFingerMotherNeg->add(yrotMod);
1872
1873 pvEFingerMotherNeg->add(new GeoIdentifierTag(ModuleNcp));
1874 pvEFingerMotherNeg->add(pvEFingerModuleMother);
1875
1876 // --------------------------BARREL SADDLE MAKING----------------------------
1877 if (dbManager->BoolSaddle()) {
1878 if ( (ModuleNcp >=39 && ModuleNcp <=42) || (ModuleNcp >=55 && ModuleNcp <=58) ) {
1879 GeoTubs* SaddleModule = new GeoTubs(BFingerRmin-RadiusSaddle,
1880 BFingerRmin,
1881 DzSaddleSupport/2,
1882 0.,deltaPhi*Gaudi::Units::deg);
1883
1884 GeoLogVol* lvSaddleModule = new GeoLogVol("SaddleModule",SaddleModule,matIron);
1885 PVLink pvSaddleModule = new GeoPhysVol(lvSaddleModule);
1886
1887 pvESaddleMotherNeg->add(zrotSaddle);
1888 pvESaddleMotherNeg->add(new GeoIdentifierTag(ModuleNcp));
1889 pvESaddleMotherNeg->add(pvSaddleModule);
1890 }
1891 }
1892
1893 } // end if (EnvType == 2)
1894
1895 //------------------- D4/C10/Gap/Crack
1896
1897 if (((EnvType == 4) || (EnvType == 5)) && barrel_flag < 5) {
1898
1899 int Id4 = ModType%100;
1900 int Ic10 = (ModType/100)%100;
1901 int Igap = (ModType/10000)%100;
1902 int Icrack = (ModType/1000000)%100;
1903
1904 bool Ifd4 = ( Id4 != 0);
1905 bool Ifc10 = ( Ic10 != 0);
1906 bool Ifgap = ( Igap != 0);
1907 bool Ifcrack = ( Icrack != 0);
1908
1909 bool Ifspecialgirder = (Id4 == 7);
1910
1911 if (m_log->level()<=MSG::DEBUG)
1912 (*m_log) << MSG::DEBUG <<" ITC : EnvType "<<EnvType<<" Size = "<<dbManager->GetModTypeSize()
1913 <<" Ncp= "<<ModuleNcp<<" D4 "<<Id4<<" specialflag = "<<Ifspecialgirder<<" C10 "<<Ic10<<" Gap "<<Igap<<" Crack "<<Icrack
1914 << endmsg;
1915
1916 if (Ifc10) {
1917 dbManager->SetCurrentSectionByNumber(Ic10); // TILE_PLUG2
1918 rMinITC2 = dbManager->TILBrminimal();
1919 rMaxITC2 = dbManager->TILBrmaximal();
1920 dzITC2 = dbManager->TILBdzmodul();
1921 } else {
1922 if (m_log->level()<=MSG::DEBUG)
1923 (*m_log) << MSG::DEBUG <<" C10 unavailable "<<endmsg;
1924 }
1925
1926 if (Ifd4) {
1927 dbManager->SetCurrentSectionByNumber(Id4); // TILE_PLUG1
1928 rMinITC1 = dbManager->TILBrminimal();
1929 rMaxITC1 = dbManager->TILBrmaximal();
1930 dzITC1 = dbManager->TILBdzmodul();
1931 if (Ifspecialgirder) {
1932 if (m_log->level()<=MSG::DEBUG)
1933 (*m_log) << MSG::DEBUG <<" dzITC1 changed from "<<dzITC1<<" to "<<dbManager->TILBdzgir()<<endmsg;
1934 dzITC1 = dbManager->TILBdzgir();
1935 }
1936 } else {
1937 (*m_log) << MSG::INFO <<" D4 unavailable "<<endmsg;
1938 dzITC1 = 9.485; //sb [Gaudi::Units::cm]
1939 }
1940
1941 bool specialC10 = (Ifd4 && Ifc10 && rMaxITC2 < rMinITC1);
1942 if (specialC10) {
1943 rMaxITC2 = rMinITC1; // for special C10 make outer radius equal to inner radius of D4
1944 }
1945
1946 //------------------- ITC BLOCKS Negative --------------------------------
1947 if (EnvType == 4) {
1948
1949 // Common mother for ITC1/2 modules
1950 if ((Ifd4 || Ifc10) && pvITCMotherNeg) {
1951
1952 // The first sub shape
1953 thicknessWedgeMother = dzITC1 * Gaudi::Units::cm;
1954 heightWedgeMother = (rMaxITC1 - rMinITC1) * Gaudi::Units::cm;
1955 dy1WedgeMother = rMinITC1 * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
1956 dy2WedgeMother = rMaxITC1 * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
1957
1958 checking("ITCModule tcModuleSub1Neg (-) ", false, 1,
1959 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
1960
1961 GeoTrd* itcModuleSub1Neg = new GeoTrd(thicknessWedgeMother/2,
1962 thicknessWedgeMother/2,
1963 dy1WedgeMother,
1964 dy2WedgeMother,
1965 heightWedgeMother/2);
1966 // The second sub shape
1967 thicknessWedgeMother = dzITC2 * Gaudi::Units::cm;
1968 heightWedgeMother = (rMaxITC2 - rMinITC2) * Gaudi::Units::cm;
1969 dy1WedgeMother = rMinITC2 * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
1970 dy2WedgeMother = rMaxITC2 * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
1971
1972 checking("ITCModule itcModuleSub2Neg (-)", false, 1,
1973 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
1974
1975 GeoTrd* itcModuleSub2Neg = new GeoTrd(thicknessWedgeMother/2,
1976 thicknessWedgeMother/2,
1977 dy1WedgeMother,
1978 dy2WedgeMother,
1979 heightWedgeMother/2 );
1980
1981 X = (dzITC1 - dzITC2)/2*Gaudi::Units::cm;
1982 Z = ((rMinITC2+rMaxITC2)-(rMaxITC1 + rMinITC1))/2*Gaudi::Units::cm;
1983 if (m_log->level()<=MSG::DEBUG)
1984 (*m_log) << MSG::DEBUG <<" ITCModule Negative, position X= "<<X<<" Z= "<<Z<< endmsg;
1985
1986 GeoTrf::Translate3D itcModule_SubShiftNeg(X, 0., Z);
1987 const GeoShapeUnion& itcModuleMotherNeg = itcModuleSub1Neg->add(*itcModuleSub2Neg<<itcModule_SubShiftNeg);
1988
1989 GeoTrf::Translate3D itcModuleSubShiftNeg(X, 0., Z);
1990
1991 GeoLogVol* lvITCModuleMotherNeg = new GeoLogVol("ITCModule",&itcModuleMotherNeg,matAir);
1992 PVLink pvITCModuleMotherNeg = new GeoPhysVol(lvITCModuleMotherNeg);
1993
1994 //Mother volume for ITC1
1995 //In plug1 it's necessary to produce GeoShapeUnion for mother volume that is composed by two parts:
1996 // 1. Mother for absorber and girder
1997 // 2. Mother for frontplate (since it's short)
1998
1999 // The D4, PLUG1
2000 dbManager->SetCurrentSectionByNumber(Id4);
2001
2002 thicknessWedgeMother = dzITC1 * Gaudi::Units::cm;
2003 heightWedgeMother = (rMaxITC1 - dbManager->TILBrmin()) * Gaudi::Units::cm;
2004 dy1WedgeMother = dbManager->TILBrmin() * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2005 dy2WedgeMother = rMaxITC1 * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2006 // ps changes dzITC1 -> dzmodul
2007 Glue = dbManager->TILBdzmodul() - dbManager->TILBdzend1() - dbManager->TILBdzend2();
2008 NbPeriod = dbManager->TILBnperiod();
2009
2010 if (m_log->level()<=MSG::DEBUG)
2011 (*m_log) << MSG::DEBUG <<" Plug1Module : Glue= "<<Glue<<" dzITC1= "<<dzITC1
2012 <<" TILBdzend1= "<<dbManager->TILBdzend1()
2013 <<" TILBdzend2= "<<dbManager->TILBdzend2()
2014 <<endmsg;
2015
2016 if (NbPeriod > 6) {
2017 dzGlue = (Glue - 2*NbPeriod * (dbManager->TILBdzmast() + dbManager->TILBdzspac())) / (4.*NbPeriod);
2018 } else {
2019 dzGlue = (Glue - (2*(NbPeriod-1) * (dbManager->TILBdzmast() + dbManager->TILBdzspac()) + dbManager->TILBdzspac())) / (4.*(NbPeriod-1));
2020 }
2021
2022 if (m_log->level()<=MSG::DEBUG)
2023 (*m_log) << MSG::DEBUG <<" Plug1Module : Glue= "<<Glue<<" dzGlue= "<<dzGlue<<" NbPeriod= "<<NbPeriod
2024 <<" TILBdzmast= "<<dbManager->TILBdzmast()<<" TILBdzspac= "<<dbManager->TILBdzspac()
2025 <<endmsg;
2026
2027 if (dzGlue <= 0.) {
2028 (*m_log) << MSG::WARNING <<" Plug1Module warning: "<<" dzGlue= "<<dzGlue
2029 <<endmsg;
2030 }
2031
2032 checking("Plug1Module plug1SubMotherNeg (-)", false, 2,
2033 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2034
2035 GeoTrd* plug1SubMotherNeg = new GeoTrd(thicknessWedgeMother/2,
2036 thicknessWedgeMother/2,
2037 dy1WedgeMother,
2038 dy2WedgeMother,
2039 heightWedgeMother/2);
2040 //Second submother for frontplate
2041 double dzITC2Bis = (specialC10) ? 0.0 : dzITC2; // for special C10 D4 and C10 do not overlap
2042 thicknessWedgeMother = (dbManager->TILBdzmodul() - dzITC2Bis) * Gaudi::Units::cm;
2043 if (m_log->level()<=MSG::DEBUG)
2044 if (specialC10)
2045 (*m_log) << MSG::DEBUG <<" Separate C10 and D4 in module " << ModuleNcp << endmsg;
2046
2047 GeoLogVol *lvPlug1ModuleMotherNeg=0;
2048 if (thicknessWedgeMother > rless) {
2049 heightWedgeMother = (dbManager->TILBrmin() - dbManager->TILBrminimal()) * Gaudi::Units::cm;
2050 dy1WedgeMother = dbManager->TILBrminimal() * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2051 dy2WedgeMother = dbManager->TILBrmin() * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2052
2053 checking("Plug1Module plug2SubMotherNeg (-)", false, 2,
2054 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2055
2056 GeoTrd* plug2SubMotherNeg = new GeoTrd(thicknessWedgeMother/2,
2057 thicknessWedgeMother/2,
2058 dy1WedgeMother,
2059 dy2WedgeMother,
2060 heightWedgeMother/2);
2061
2062 GeoTrf::Translate3D plug1SubOffsetNeg(-dzITC2Bis*Gaudi::Units::cm/2, 0.,
2063 (dbManager->TILBrminimal()-dbManager->TILBrmaximal())*Gaudi::Units::cm/2);
2064
2065 const GeoShapeUnion& plug1ModuleMotherNeg =
2066 plug1SubMotherNeg->add(*plug2SubMotherNeg<<plug1SubOffsetNeg);
2067
2068 lvPlug1ModuleMotherNeg = new GeoLogVol("Plug1Module",&plug1ModuleMotherNeg,matAir);
2069 } else {
2070 lvPlug1ModuleMotherNeg = new GeoLogVol("Plug1Module",plug1SubMotherNeg,matAir);
2071 }
2072
2073 PVLink pvPlug1ModuleMotherNeg = new GeoPhysVol(lvPlug1ModuleMotherNeg);
2074
2075 // Fill the section
2076 if (Filling) {
2077 sectionBuilder->fillSection(pvPlug1ModuleMotherNeg, 3,
2078 dbManager->TILBrmaximal(),
2079 (thicknessWedgeMother > rless) ? dbManager->TILBrminimal() : dbManager->TILBrmin(),
2080 dzGlue,
2081 deltaPhi,
2082 ModuleNcp,
2083 dzITC2Bis);
2084 }
2085
2086 Z = (dbManager->TILBrmin()-dbManager->TILBrminimal())*Gaudi::Units::cm/2;
2087 GeoTransform* tfPlug1ModuleMotherNeg = new GeoTransform(GeoTrf::Translate3D(0.,0.,Z));
2088
2089 pvITCModuleMotherNeg->add(tfPlug1ModuleMotherNeg);
2090 pvITCModuleMotherNeg->add(pvPlug1ModuleMotherNeg);
2091
2092 //Mother volume for ITC2
2093 if (Ifc10) {
2094
2095 // TILE_PLUG2
2096 dbManager->SetCurrentSectionByNumber(Ic10);
2097
2098 thicknessWedgeMother = dbManager->TILBdzmodul() * Gaudi::Units::cm;
2099 heightWedgeMother = (dbManager->TILBrmaximal() - dbManager->TILBrminimal()) * Gaudi::Units::cm;
2100 dy1WedgeMother = dbManager->TILBrminimal() * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2101 dy2WedgeMother = dbManager->TILBrmaximal() * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2102
2103 if (dbManager->TILBnperiod() > 1) {
2104 dzGlue = (dbManager->TILBdzmodul() - dbManager->TILBdzend1() - dbManager->TILBdzend2()
2105 - ((dbManager->TILBnperiod()-1)*2*(dbManager->TILBdzmast() + dbManager->TILBdzspac())
2106 + dbManager->TILBdzspac()))/(4.*(dbManager->TILBnperiod() - 1));
2107 } else {
2108 dzGlue = 0; // add for special missing C10 modules
2109 }
2110
2111 checking("Plug2Module (-)", false, 2,
2112 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2113
2114 GeoTrd* plug2ModuleMotherNeg = new GeoTrd(thicknessWedgeMother/2,
2115 thicknessWedgeMother/2,
2116 dy1WedgeMother,
2117 dy2WedgeMother,
2118 heightWedgeMother/2);
2119
2120 GeoLogVol* lvPlug2ModuleMotherNeg = new GeoLogVol("Plug2Module",plug2ModuleMotherNeg,matAir);
2121 PVLink pvPlug2ModuleMotherNeg = new GeoPhysVol(lvPlug2ModuleMotherNeg);
2122
2123 // Fill the section
2124 if (Filling) {
2125 sectionBuilder->fillSection(pvPlug2ModuleMotherNeg, Ic10,
2126 dbManager->TILBrmaximal(),
2127 dbManager->TILBrminimal(),
2128 dzGlue,
2129 deltaPhi);
2130 }
2131
2132 // TILE_PLUG1, D4
2133 if (Ifd4) {
2134 dbManager->SetCurrentSectionByNumber(Id4);
2135
2136 GeoTransform* tfPlug2ModuleMotherNeg = new GeoTransform(itcModuleSubShiftNeg);
2137
2138 pvITCModuleMotherNeg->add(tfPlug2ModuleMotherNeg);
2139 pvITCModuleMotherNeg->add(pvPlug2ModuleMotherNeg);
2140 }
2141 }//if C10
2142
2143 double zShift = 0;
2144 NbPeriod = dbManager->TILBnperiod();
2145 // Z = (dbManager->TILBdzmodul()-dzITC2)/2*Gaudi::Units::cm;
2146 // ps Zshift calculated from length of volumes rather than modules (account for special modules)
2147 //
2148 Z = (dzITC1 - dzITC2)/2*Gaudi::Units::cm;
2149
2150 if (NbPeriod == 6 && !Ifspecialgirder && std::abs(Z) < std::abs(zITCStandard)) zShift = zITCStandard*(1./Gaudi::Units::cm);
2151
2152 if (m_log->level()<=MSG::DEBUG)
2153 (*m_log) << MSG::DEBUG <<" ITCModule Negative, position X= "<<X<<" Z= "<<Z
2154 <<" zStandard= "<<zITCStandard<< " zShift= " <<zShift
2155 <<endmsg;
2156
2157 GeoTransform* xtraITCNeg = new GeoTransform(GeoTrf::TranslateX3D(
2158 (dbManager->TILBrmaximal() + dbManager->TILBrminimal())/2*Gaudi::Units::cm));
2159 GeoTransform* ztraITCNeg = new GeoTransform(GeoTrf::TranslateZ3D(zShift*Gaudi::Units::cm));
2160
2161 pvITCMotherNeg->add(zrotMod);
2162 pvITCMotherNeg->add(xtraITCNeg);
2163 pvITCMotherNeg->add(ztraITCNeg);
2164 pvITCMotherNeg->add(yrotMod);
2165
2166 pvITCMotherNeg->add(new GeoIdentifierTag(ModuleNcp));
2167 pvITCMotherNeg->add(pvITCModuleMotherNeg);
2168
2169 }//if (Ifd4 || Ifc10)
2170
2171 //-------------------------- G A P Negative ---------------------------------
2172 if (Ifgap && pvGapMotherNeg) {
2173
2174 // TILE_PLUG3
2175 dbManager->SetCurrentSectionByNumber(Igap);
2176
2177 // Trd - module mother
2178 thicknessWedgeMother = dbManager->TILBdzmodul() * Gaudi::Units::cm;
2179 heightWedgeMother = (dbManager->TILBrmaximal() - dbManager->TILBrminimal()) * Gaudi::Units::cm;
2180 dy1WedgeMother = dbManager->TILBrminimal() * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2181 dy2WedgeMother = dbManager->TILBrmaximal() * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2182
2183 dzGlue = 0.;
2184
2185 checking("GapModule (-)", false, 2,
2186 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2187
2188 GeoTrd* gapModuleMotherNeg = new GeoTrd(thicknessWedgeMother/2,
2189 thicknessWedgeMother/2,
2190 dy1WedgeMother,
2191 dy2WedgeMother,
2192 heightWedgeMother/2);
2193
2194 GeoLogVol* lvGapModuleMotherNeg = new GeoLogVol("GapModule",gapModuleMotherNeg,matAir);
2195 PVLink pvGapModuleMotherNeg = new GeoPhysVol(lvGapModuleMotherNeg);
2196
2197 // Fill the section
2198 if (Filling) {
2199 sectionBuilder->fillSection(pvGapModuleMotherNeg, 5, // probably better to have Igap instead of 5
2200 dbManager->TILBrmaximal(),
2201 dbManager->TILBrminimal(),
2202 dzGlue,
2203 deltaPhi);
2204 }
2205
2206 // Module position inside mother
2207 GeoTransform* xtraGapNeg = new GeoTransform(GeoTrf::TranslateX3D(
2208 (dbManager->TILBrmaximal() + dbManager->TILBrminimal())/2*Gaudi::Units::cm));
2209 pvGapMotherNeg->add(zrotMod);
2210 pvGapMotherNeg->add(xtraGapNeg);
2211 pvGapMotherNeg->add(yrotMod);
2212
2213 pvGapMotherNeg->add(new GeoIdentifierTag(ModuleNcp));
2214 pvGapMotherNeg->add(pvGapModuleMotherNeg);
2215 }
2216
2217 //-------------------------- Crack Negative ---------------------------------
2218 if (Ifcrack && pvCrackMotherNeg) {
2219
2220 // TILE_PLUG4
2221 dbManager->SetCurrentSectionByNumber(Icrack);
2222
2223 // mother
2224 thicknessWedgeMother = dbManager->TILBdzmodul() * Gaudi::Units::cm;
2225 heightWedgeMother = (dbManager->TILBrmaximal() - dbManager->TILBrminimal()) * Gaudi::Units::cm;
2226 dy1WedgeMother = dbManager->TILBrminimal() * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2227 dy2WedgeMother = dbManager->TILBrmaximal() * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2228
2229 dzGlue = 0.;
2230
2231 checking("CrackModule (-)", spE4, 2,
2232 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2233
2234 GeoTrd* crackModuleMotherNeg = new GeoTrd(thicknessWedgeMother/2,
2235 thicknessWedgeMother/2,
2236 dy1WedgeMother,
2237 dy2WedgeMother,
2238 heightWedgeMother/2);
2239
2240 GeoLogVol* lvCrackModuleMotherNeg = new GeoLogVol("CrackModule",crackModuleMotherNeg,matAir);
2241 PVLink pvCrackModuleMotherNeg = new GeoPhysVol(lvCrackModuleMotherNeg);
2242
2243 // Fill the section
2244 if (Filling) {
2245 sectionBuilder->fillSection(pvCrackModuleMotherNeg, 6,
2246 dbManager->TILBrmaximal(),
2247 dbManager->TILBrminimal(),
2248 dzGlue,
2249 deltaPhi);
2250 }
2251 // Module position inside mother
2252 GeoTransform* xtraCrackNeg = new GeoTransform(GeoTrf::TranslateX3D(
2253 (dbManager->TILBrmaximal() + dbManager->TILBrminimal())/2*Gaudi::Units::cm));
2254 pvCrackMotherNeg->add(zrotMod);
2255 pvCrackMotherNeg->add(xtraCrackNeg);
2256 pvCrackMotherNeg->add(yrotMod);
2257
2258 pvCrackMotherNeg->add(new GeoIdentifierTag(ModuleNcp));
2259 pvCrackMotherNeg->add(pvCrackModuleMotherNeg);
2260
2261 }
2262 }
2263
2264 //-------------------------------------- ITC BLOCKS Positive --------------------------------------
2265 if (EnvType == 5) {
2266
2267 // Common mother for ITC1/2 modules
2268 if ((Ifd4 || Ifc10) && pvITCMotherPos) {
2269
2270 // The first sub shape
2271 thicknessWedgeMother = dzITC1 * Gaudi::Units::cm;
2272 heightWedgeMother = (rMaxITC1 - rMinITC1) * Gaudi::Units::cm;
2273 dy1WedgeMother = rMinITC1 * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2274 dy2WedgeMother = rMaxITC1 * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2275
2276 checking("ITCModule itcModuleSub2Pos (+)", false, 1,
2277 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2278
2279 GeoTrd* itcModuleSub1Pos = new GeoTrd(thicknessWedgeMother/2,
2280 thicknessWedgeMother/2,
2281 dy1WedgeMother ,
2282 dy2WedgeMother ,
2283 heightWedgeMother/2 );
2284 // The second sub shape
2285 thicknessWedgeMother = dzITC2 * Gaudi::Units::cm;
2286 heightWedgeMother = (rMaxITC2 - rMinITC2) * Gaudi::Units::cm;
2287 dy1WedgeMother = rMinITC2 * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2288 dy2WedgeMother = rMaxITC2 * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2289
2290 checking("ITCModule itcModuleSub2Pos (+)", false, 1,
2291 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2292
2293 GeoTrd* itcModuleSub2Pos = new GeoTrd(thicknessWedgeMother/2,
2294 thicknessWedgeMother/2,
2295 dy1WedgeMother ,
2296 dy2WedgeMother ,
2297 heightWedgeMother/2 );
2298
2299 X = (dzITC1 - dzITC2)/2*Gaudi::Units::cm;
2300 Z = ((rMinITC2+rMaxITC2)-(rMaxITC1 + rMinITC1))/2*Gaudi::Units::cm;
2301 if (m_log->level()<=MSG::DEBUG)
2302 (*m_log) << MSG::DEBUG <<" ITCModule Positive, position X= "<<X<<" Z= "<<Z<< endmsg;
2303
2304 GeoTrf::Translate3D itcModule_SubShiftPos(X, 0., Z);
2305 const GeoShapeUnion& itcModuleMotherPos = itcModuleSub1Pos->add(*itcModuleSub2Pos<<itcModule_SubShiftPos);
2306
2307 GeoTrf::Translate3D itcModuleSubShiftPos(X, 0., Z);
2308
2309 GeoLogVol* lvITCModuleMotherPos = new GeoLogVol("ITCModule",&itcModuleMotherPos,matAir);
2310 PVLink pvITCModuleMotherPos = new GeoPhysVol(lvITCModuleMotherPos);
2311
2312 // Mother volume for ITC1
2313 // In plug1 it's necessary to produce GeoShapeUnion for mother volume that is composed by two parts:
2314 // 1. Mother for absorber and girder
2315 // 2. Mother for frontplate (since it's short)
2316
2317 // The D4, PLUG1
2318 dbManager->SetCurrentSectionByNumber(Id4);
2319
2320 thicknessWedgeMother = dzITC1 * Gaudi::Units::cm;
2321 dy1WedgeMother = dbManager->TILBrmin() * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2322 dy2WedgeMother = rMaxITC1 * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2323 heightWedgeMother = (rMaxITC1 - dbManager->TILBrmin()) * Gaudi::Units::cm;
2324
2325 // ps changes dzITC1 -> dzmodul
2326 Glue = dbManager->TILBdzmodul() - dbManager->TILBdzend1() - dbManager->TILBdzend2();
2327 NbPeriod = dbManager->TILBnperiod();
2328
2329 if (m_log->level()<=MSG::DEBUG)
2330 (*m_log) << MSG::DEBUG <<" Plug1Module : Glue= "<<Glue<<" dzITC1= "<<dzITC1
2331 <<" TILBdzend1= "<<dbManager->TILBdzend1()
2332 <<" TILBdzend2= "<<dbManager->TILBdzend2()
2333 <<endmsg;
2334
2335 if (NbPeriod > 6) {
2336 dzGlue = (Glue - 2*NbPeriod * (dbManager->TILBdzmast() + dbManager->TILBdzspac())) / (4.*NbPeriod);
2337 } else {
2338 dzGlue = (Glue - (2*(NbPeriod-1) * (dbManager->TILBdzmast() + dbManager->TILBdzspac())
2339 + dbManager->TILBdzspac())) / (4.*(NbPeriod-1));
2340 }
2341
2342 if (m_log->level()<=MSG::DEBUG)
2343 (*m_log) << MSG::DEBUG <<" Plug1Module : Glue= "<<Glue<<" dzGlue= "<<dzGlue<<" NbPeriod= "<<NbPeriod
2344 <<" TILBdzmast= "<<dbManager->TILBdzmast()<<" TILBdzspac= "<<dbManager->TILBdzspac()
2345 <<endmsg;
2346
2347 if (dzGlue <= 0.) {
2348 (*m_log) << MSG::WARNING <<" Plug1Module warning: "<<" dzGlue= "<<dzGlue
2349 <<endmsg;
2350 }
2351
2352 checking("Plug1Module plug1SubMotherPos (+)", false, 2,
2353 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2354
2355 GeoTrd* plug1SubMotherPos = new GeoTrd(thicknessWedgeMother/2,
2356 thicknessWedgeMother/2,
2357 dy1WedgeMother ,
2358 dy2WedgeMother ,
2359 heightWedgeMother/2 );
2360
2361 //Second submother C10, PLUG2
2362 double dzITC2Bis = (specialC10) ? 0.0 : dzITC2; // for special C10 D4 and C10 do not overlap
2363 thicknessWedgeMother = (dbManager->TILBdzmodul() - dzITC2Bis) * Gaudi::Units::cm;
2364 if (m_log->level()<=MSG::DEBUG)
2365 if (specialC10)
2366 (*m_log) << MSG::DEBUG <<" Separate C10 and D4 in module " << ModuleNcp << endmsg;
2367
2368 GeoLogVol *lvPlug1ModuleMotherPos=0;
2369 if (thicknessWedgeMother > rless) {
2370 heightWedgeMother = (dbManager->TILBrmin() - dbManager->TILBrminimal()) * Gaudi::Units::cm;
2371 dy1WedgeMother = dbManager->TILBrminimal() * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2372 dy2WedgeMother = dbManager->TILBrmin() * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2373
2374 checking("Plug1Module plug2SubMotherPos (+)", false, 2,
2375 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2376
2377 GeoTrd* plug2SubMotherPos = new GeoTrd(thicknessWedgeMother/2,
2378 thicknessWedgeMother/2,
2379 dy1WedgeMother ,
2380 dy2WedgeMother ,
2381 heightWedgeMother/2 );
2382
2383 GeoTrf::Translate3D plug1SubOffsetPos(-dzITC2Bis/2*Gaudi::Units::cm, 0.,
2384 (dbManager->TILBrminimal()-dbManager->TILBrmaximal())/2*Gaudi::Units::cm);
2385
2386 const GeoShapeUnion& plug1ModuleMotherPos = plug1SubMotherPos->add(*plug2SubMotherPos<<plug1SubOffsetPos);
2387
2388 lvPlug1ModuleMotherPos = new GeoLogVol("Plug1Module",&plug1ModuleMotherPos,matAir);
2389 } else {
2390 lvPlug1ModuleMotherPos = new GeoLogVol("Plug1Module",plug1SubMotherPos,matAir);
2391 }
2392
2393 PVLink pvPlug1ModuleMotherPos = new GeoPhysVol(lvPlug1ModuleMotherPos);
2394
2395 // Fill the section
2396 if (Filling) {
2397 sectionBuilder->fillSection(pvPlug1ModuleMotherPos, 3,
2398 dbManager->TILBrmaximal(),
2399 (thicknessWedgeMother > rless) ? dbManager->TILBrminimal() : dbManager->TILBrmin(),
2400 dzGlue,
2401 deltaPhi,
2402 ModuleNcp,
2403 dzITC2Bis);
2404 }
2405
2406 Z = (dbManager->TILBrmin()-dbManager->TILBrminimal())*Gaudi::Units::cm/2;
2407 GeoTransform* tfPlug1ModuleMotherPos = new GeoTransform(GeoTrf::Translate3D(0.,0.,Z));
2408
2409 pvITCModuleMotherPos->add(tfPlug1ModuleMotherPos);
2410 pvITCModuleMotherPos->add(pvPlug1ModuleMotherPos);
2411
2412 //Mother volume for ITC2 Positive
2413 if (Ifc10) {
2414
2415 // TILE_PLUG2, C10
2416 dbManager->SetCurrentSectionByNumber(Ic10);
2417
2418 thicknessWedgeMother = dzITC2 * Gaudi::Units::cm;
2419 heightWedgeMother = (rMaxITC2 - rMinITC2) * Gaudi::Units::cm;
2420 dy1WedgeMother = rMinITC2 * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2421 dy2WedgeMother = rMaxITC2 * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2422
2423 if (dbManager->TILBnperiod() > 1) {
2424 dzGlue = (dzITC2 - dbManager->TILBdzend1() - dbManager->TILBdzend2()
2425 - ((dbManager->TILBnperiod()-1)*2*(dbManager->TILBdzmast()
2426 + dbManager->TILBdzspac()) + dbManager->TILBdzspac()))/(4*(dbManager->TILBnperiod()-1));
2427 } else {
2428 dzGlue = 0; // add for special missing C10 modules
2429 }
2430
2431 checking("Plug2Module (+)", false, 2,
2432 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2433
2434 GeoTrd* plug2ModuleMotherPos = new GeoTrd(thicknessWedgeMother/2,
2435 thicknessWedgeMother/2,
2436 dy1WedgeMother,
2437 dy2WedgeMother,
2438 heightWedgeMother/2);
2439
2440 GeoLogVol* lvPlug2ModuleMotherPos = new GeoLogVol("Plug2Module",plug2ModuleMotherPos,matAir);
2441 PVLink pvPlug2ModuleMotherPos = new GeoPhysVol(lvPlug2ModuleMotherPos);
2442
2443 // Fill the section
2444 if (Filling) {
2445 sectionBuilder->fillSection(pvPlug2ModuleMotherPos, Ic10,
2446 dbManager->TILBrmaximal(),
2447 dbManager->TILBrminimal(),
2448 dzGlue,
2449 deltaPhi);
2450 }
2451
2452 // TILE_PLUG1, D4
2453 if ((Ifd4)) {
2454 dbManager->SetCurrentSectionByNumber(Id4);
2455
2456 GeoTransform* tfPlug2ModuleMotherPos = new GeoTransform(itcModuleSubShiftPos);
2457
2458 pvITCModuleMotherPos->add(tfPlug2ModuleMotherPos);
2459 pvITCModuleMotherPos->add(pvPlug2ModuleMotherPos);
2460 }
2461 }//if C10
2462
2463 double zShift = 0;
2464 NbPeriod = dbManager->TILBnperiod();
2465 //ps Z = (dbManager->TILBdzmodul()-dzITC2)/2*Gaudi::Units::cm;
2466 Z = (dzITC1 - dzITC2)/2*Gaudi::Units::cm;
2467
2468 if (NbPeriod == 6 && !Ifspecialgirder && std::abs(Z) < std::abs(zITCStandard)) zShift = zITCStandard*(1./Gaudi::Units::cm);
2469
2470 if (m_log->level()<=MSG::DEBUG)
2471 (*m_log) << MSG::DEBUG <<" ITCModule Positive, position X= "<<X<<" Z= "<<Z
2472 <<" zStandard= "<<zITCStandard<< " zShift= " <<zShift
2473 <<endmsg;
2474
2475 GeoTransform* xtraITCPos = new GeoTransform(GeoTrf::TranslateX3D(
2476 (dbManager->TILBrmaximal() + dbManager->TILBrminimal())/2*Gaudi::Units::cm));
2477 GeoTransform* ztraITCPos = new GeoTransform(GeoTrf::TranslateZ3D(zShift*Gaudi::Units::cm));
2478
2479 pvITCMotherPos->add(zrotMod);
2480 pvITCMotherPos->add(xtraITCPos);
2481 pvITCMotherPos->add(ztraITCPos);
2482 pvITCMotherPos->add(XYrtMod);
2483
2484 pvITCMotherPos->add(new GeoIdentifierTag(ModuleNcp));
2485 pvITCMotherPos->add(pvITCModuleMotherPos);
2486
2487 }//if (Ifd4 || Ifc10)
2488
2489
2490 //-------------------------- G A P Positive ---------------------------------
2491 if (Ifgap && pvGapMotherPos) {
2492
2493 // TILE_PLUG3
2494 dbManager->SetCurrentSectionByNumber(Igap);
2495
2496 // Mother
2497 thicknessWedgeMother = dbManager->TILBdzmodul() * Gaudi::Units::cm;
2498 heightWedgeMother = (dbManager->TILBrmaximal() - dbManager->TILBrminimal()) * Gaudi::Units::cm;
2499 dy1WedgeMother = dbManager->TILBrminimal() * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2500 dy2WedgeMother = dbManager->TILBrmaximal() * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2501
2502 dzGlue = 0;
2503
2504 checking("Plug2Module (+)", false, 2,
2505 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2506
2507 GeoTrd* gapModuleMotherPos = new GeoTrd(thicknessWedgeMother/2,
2508 thicknessWedgeMother/2,
2509 dy1WedgeMother,
2510 dy2WedgeMother,
2511 heightWedgeMother/2);
2512
2513 GeoLogVol* lvGapModuleMotherPos = new GeoLogVol("GapModule",gapModuleMotherPos,matAir);
2514 PVLink pvGapModuleMotherPos = new GeoPhysVol(lvGapModuleMotherPos);
2515
2516 // Fill the section
2517 if (Filling) {
2518 sectionBuilder->fillSection(pvGapModuleMotherPos, 5,
2519 dbManager->TILBrmaximal(),
2520 dbManager->TILBrminimal(),
2521 dzGlue,
2522 deltaPhi);
2523 }
2524
2525 // Module position inside mother
2526 GeoTransform* xtraGapPos = new GeoTransform(GeoTrf::TranslateX3D(
2527 (dbManager->TILBrmaximal() + dbManager->TILBrminimal())/2*Gaudi::Units::cm));
2528 pvGapMotherPos->add(zrotMod);
2529 pvGapMotherPos->add(xtraGapPos);
2530 pvGapMotherPos->add(XYrtMod);
2531
2532 pvGapMotherPos->add(new GeoIdentifierTag(ModuleNcp));
2533 pvGapMotherPos->add(pvGapModuleMotherPos);
2534 }
2535
2536 //-------------------------- Crack Positive ---------------------------------
2537 if (Ifcrack && pvCrackMotherPos) {
2538
2539 // TILE_PLUG4
2540 dbManager->SetCurrentSectionByNumber(Icrack);
2541
2542 // Trd - module mother
2543 thicknessWedgeMother = dbManager->TILBdzmodul() * Gaudi::Units::cm;
2544 heightWedgeMother = (dbManager->TILBrmaximal() - dbManager->TILBrminimal()) * Gaudi::Units::cm;
2545 dy1WedgeMother = dbManager->TILBrminimal() * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2546 dy2WedgeMother = dbManager->TILBrmaximal() * tan(deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2547
2548 dzGlue = 0.;
2549
2550 checking("CrackModule (+)", spE4, 2,
2551 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2552
2553 GeoTrd* crackModuleMotherPos = new GeoTrd(thicknessWedgeMother/2,
2554 thicknessWedgeMother/2,
2555 dy1WedgeMother,
2556 dy2WedgeMother,
2557 heightWedgeMother/2);
2558
2559 GeoLogVol* lvCrackModuleMotherPos = new GeoLogVol("CrackModule",crackModuleMotherPos,matAir);
2560 PVLink pvCrackModuleMotherPos = new GeoPhysVol(lvCrackModuleMotherPos);
2561
2562 // Fill the section
2563 if (Filling) {
2564 sectionBuilder->fillSection(pvCrackModuleMotherPos, 6,
2565 dbManager->TILBrmaximal(),
2566 dbManager->TILBrminimal(),
2567 dzGlue,
2568 deltaPhi);
2569 }
2570
2571 // Module position inside mother
2572 GeoTransform* xtraCrackPos = new GeoTransform(GeoTrf::TranslateX3D(
2573 (dbManager->TILBrmaximal() + dbManager->TILBrminimal())/2*Gaudi::Units::cm));
2574 pvCrackMotherPos->add(zrotMod);
2575 pvCrackMotherPos->add(xtraCrackPos);
2576 pvCrackMotherPos->add(XYrtMod);
2577
2578 pvCrackMotherPos->add(new GeoIdentifierTag(ModuleNcp));
2579 pvCrackMotherPos->add(pvCrackModuleMotherPos);
2580
2581 }
2582 }
2583
2584 } // if (EnvType == 4 || EnvType == 5)
2585
2586 }// ModCounter, end
2587
2588
2589 }
2590
2591 //
2592 // Global Envelop positioning, BARREL Positive
2593 //
2594
2595 //
2596 // ---------------------------------------- BARREL Positive -----------------------------------------------------
2597 //
2598
2599 double ztrans =0;
2600 dbManager->SetCurrentEnvByType(EnvType);
2601
2602 if (EnvType == 1 && barrel_flag < 1) {
2603
2604 GeoTransform* tfBarrelMother;
2605
2606 // consider 3 options - with/without ext.barrels and take into account DZ correction
2607 ztrans = 0;
2608
2609 tfBarrelMother = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::RotateZ3D((dbManager->GetEnvDPhi())*Gaudi::Units::deg));
2610
2611 (*m_log) << MSG::INFO <<" Positioning barrel with translation "<<ztrans*Gaudi::Units::cm<< endmsg;
2612
2613 GeoNameTag* ntBarrelModuleMother = new GeoNameTag("Barrel");
2614
2615 pvTileEnvelopeBarrel->add(tfBarrelMother);
2616 pvTileEnvelopeBarrel->add(ntBarrelModuleMother);
2617 pvTileEnvelopeBarrel->add(pvBarrelMother);
2618
2619 GeoTransform* tfFingerMotherPos;
2620
2621 ztrans = (dbManager->GetEnvZLength()*Gaudi::Units::cm/2 - BFingerLengthPos/2 + PosDelta)*(1./Gaudi::Units::cm);
2622
2623 tfFingerMotherPos = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)*GeoTrf::RotateZ3D((dbManager->GetEnvDPhi())*Gaudi::Units::deg));
2624
2625 (*m_log) << MSG::INFO <<" Positioning positive barrel finger with translation "<<ztrans*Gaudi::Units::cm<< endmsg;
2626
2627 GeoNameTag* ntFingerMotherPos = new GeoNameTag("TileFingerPos");
2628
2629 pvTileEnvelopeBarrel->add(tfFingerMotherPos);
2630 pvTileEnvelopeBarrel->add(ntFingerMotherPos);
2631 pvTileEnvelopeBarrel->add(pvFingerMotherPos);
2632
2633 if (dbManager->BoolSaddle()) {
2634 GeoTransform* tfSaddleMotherPos;
2635
2636 ztrans = (dbManager->GetEnvZLength()*Gaudi::Units::cm/2 - BFingerLengthPos + DzSaddleSupport/2 + PosDelta)*(1./Gaudi::Units::cm);
2637
2638 tfSaddleMotherPos = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)*GeoTrf::RotateZ3D((dbManager->GetEnvDPhi())*Gaudi::Units::deg));
2639
2640 GeoNameTag* ntSaddleMotherPos = new GeoNameTag("TileSaddlePos");
2641
2642 pvTileEnvelopeBarrel->add(tfSaddleMotherPos);
2643 pvTileEnvelopeBarrel->add(ntSaddleMotherPos);
2644 pvTileEnvelopeBarrel->add(pvSaddleMotherPos);
2645 }
2646
2647 //*> negative barrel
2648
2649 GeoTransform* tfFingerMotherNeg;
2650
2651 ztrans = (-dbManager->GetEnvZLength()*Gaudi::Units::cm/2 + BFingerLengthNeg/2 - NegDelta)*(1./Gaudi::Units::cm);
2652
2653 tfFingerMotherNeg = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)*GeoTrf::RotateZ3D((dbManager->GetEnvDPhi())*Gaudi::Units::deg));
2654
2655 (*m_log) << MSG::INFO <<" Positioning negative barrel finger with translation "<<ztrans*Gaudi::Units::cm<< endmsg;
2656
2657 GeoNameTag* ntFingerMotherNeg = new GeoNameTag("TileFingerNeg");
2658 pvTileEnvelopeBarrel->add(tfFingerMotherNeg);
2659 pvTileEnvelopeBarrel->add(ntFingerMotherNeg);
2660 pvTileEnvelopeBarrel->add(pvFingerMotherNeg);
2661
2662 if (dbManager->BoolSaddle()) {
2663 GeoTransform* tfSaddleMotherNeg;
2664
2665 ztrans = (-dbManager->GetEnvZLength()*Gaudi::Units::cm/2 + BFingerLengthNeg - DzSaddleSupport/2 - NegDelta)*(1./Gaudi::Units::cm);
2666
2667 tfSaddleMotherNeg = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)*GeoTrf::RotateZ3D((dbManager->GetEnvDPhi())*Gaudi::Units::deg));
2668
2669 GeoNameTag* ntSaddleMotherNeg = new GeoNameTag("TileSaddleNeg");
2670
2671 pvTileEnvelopeBarrel->add(tfSaddleMotherNeg);
2672 pvTileEnvelopeBarrel->add(ntSaddleMotherNeg);
2673 pvTileEnvelopeBarrel->add(pvSaddleMotherNeg);
2674 }
2675 }
2676
2677 //
2678 //----------------------------------------- EBarrel Positive -----------------------------------------------------
2679
2680 if (EnvType == 3 && eb_flag) { // positive ext.barrel is always at positive boundary, after finger
2681
2683 double thicknessEndPlate = dbManager->TILBdzend1()*Gaudi::Units::cm;
2684
2685 double PoZ1 = thicknessEndPlate + modl_length/4 - (dbManager->GetEnvZLength()*Gaudi::Units::cm- EBFingerLengthPos)/2;
2686 double PoZ2 = modl_length/4 + PoZ1;
2687
2688 //--------------------------------------------------------------------------------------------------------------
2689 // CutA in Tile (Positive) (close center)
2690 if (m_fullGeo) {
2691 if (dbManager->BoolCuts() && barrel_flag < 2) {
2692
2693 // Iron1, down
2694 volname = "Iron1"; dbManager->SetCurrentCuts(volname); //>>
2695 dxIron = dbManager->CutsXpos();
2696 dyIron = dbManager->CutsYpos();
2697 if (m_log->level()<=MSG::DEBUG)
2698 (*m_log) << MSG::DEBUG << " Iron1: " << dxIron << " " << dyIron << endmsg;
2699
2700 GeoTransform* tfIron1 = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY-dyIron,PoZ2)
2701 * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg)); // Left
2702 pvEBarrelMotherPos->add(tfIron1);
2703 pvEBarrelMotherPos->add(new GeoIdentifierTag(1));
2704 pvEBarrelMotherPos->add(pvIron1);
2705
2706 tfIron1 = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::Translate3D(-dxIron,PosY-dyIron,PoZ2)
2707 * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg)); // Right
2708 pvEBarrelMotherPos->add(tfIron1);
2709 pvEBarrelMotherPos->add(pvIron1);
2710
2711 // Iron2, middle
2712 volname = "Iron2"; dbManager->SetCurrentCuts(volname); //>>
2713 dxIron = dbManager->CutsXpos();
2714 dyIron = dbManager->CutsYpos();
2715 if (m_log->level()<=MSG::DEBUG)
2716 (*m_log) << MSG::DEBUG << " Iron2: " << dxIron << " " << dyIron << endmsg;
2717
2718 GeoTransform* tfIron2 = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY+dyIron,PoZ2)
2719 * GeoTrf::RotateZ3D(-84.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg)); // Left
2720 pvEBarrelMotherPos->add(tfIron2);
2721 pvEBarrelMotherPos->add(new GeoIdentifierTag(2));
2722 pvEBarrelMotherPos->add(pvIron2);
2723
2724 tfIron2 = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::Translate3D(-dxIron,PosY+dyIron,PoZ2)
2725 * GeoTrf::RotateZ3D(84.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg)); // Left
2726 pvEBarrelMotherPos->add(tfIron2);
2727 pvEBarrelMotherPos->add(pvIron2);
2728
2729 // Iron3, middle
2730 volname = "Iron3"; dbManager->SetCurrentCuts(volname); //>>
2731 dxIron = dbManager->CutsXpos();
2732 dyIron = dbManager->CutsYpos();
2733 if (m_log->level()<=MSG::DEBUG)
2734 (*m_log) << MSG::DEBUG << " Iron3: " << dxIron << " " << dyIron << endmsg;
2735
2736 GeoTransform* tfIron3 = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY+dyIron,PoZ2)
2737 * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg)); // Left
2738 pvEBarrelMotherPos->add(tfIron3);
2739 pvEBarrelMotherPos->add(new GeoIdentifierTag(3));
2740 pvEBarrelMotherPos->add(pvIron3);
2741
2742 tfIron3 = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::Translate3D(-dxIron,PosY+dyIron,PoZ2)
2743 * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg)); // Right
2744 pvEBarrelMotherPos->add(tfIron3);
2745 pvEBarrelMotherPos->add(pvIron3);
2746
2747 // Heavy Iron Box
2748 volname = "IrBox"; dbManager->SetCurrentCuts(volname); //>>
2749 dxIron = dbManager->CutsXpos();
2750 dyIron = dbManager->CutsYpos();
2751
2752 GeoTransform* tfIrBoxL = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY-dyIron,PoZ2)
2753 * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg)); // Left
2754 pvEBarrelMotherPos->add(tfIrBoxL);
2755 pvEBarrelMotherPos->add(new GeoIdentifierTag(4));
2756 pvEBarrelMotherPos->add(pvIrBox);
2757
2758 GeoTransform* tfIrBoxR = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::Translate3D(-dxIron,PosY-dyIron,PoZ2)
2759 * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg)); // Right
2760 pvEBarrelMotherPos->add(tfIrBoxR);
2761 pvEBarrelMotherPos->add(pvIrBox);
2762
2763 // CutB in Tile (Positive) (outer center)
2764 volname = "IrUp"; dbManager->SetCurrentCuts(volname); //>>
2765 dxIr = dbManager->CutsXpos();
2766 dyIr = dbManager->CutsYpos();
2767 if (m_log->level()<=MSG::DEBUG)
2768 (*m_log) << MSG::DEBUG << " IrUp: " <<dxIr<< " " <<dyIr<< endmsg;
2769
2770 GeoTransform* tfIrUp = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)
2771 * GeoTrf::Translate3D(PosXcut+dxIr,-PosYcut+dyIr,-PoZ1)
2772 * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg)); // Left
2773 pvEBarrelMotherPos->add(tfIrUp);
2774 pvEBarrelMotherPos->add(new GeoIdentifierTag(5));
2775 pvEBarrelMotherPos->add(pvIrUp);
2776
2777 tfIrUp = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)
2778 * GeoTrf::Translate3D(-PosXcut-dxIr,-PosYcut+dyIr,-PoZ1)
2779 * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg)); // Right
2780 pvEBarrelMotherPos->add(tfIrUp);
2781 pvEBarrelMotherPos->add(pvIrUp);
2782
2783 // CutB in Tile (Positive) (outer center)
2784 volname = "IrDw"; dbManager->SetCurrentCuts(volname); //>>
2785 dxIr = dbManager->CutsXpos();
2786 dyIr = dbManager->CutsYpos();
2787 if (m_log->level()<=MSG::DEBUG)
2788 (*m_log) << MSG::DEBUG << " IrDw: " <<dxIr<< " " <<dyIr<< endmsg;
2789
2790 GeoTransform* tfIrDw = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)
2791 * GeoTrf::Translate3D(PosXcut+dxIr,-PosYcut+dyIr,-PoZ1)
2792 * GeoTrf::RotateZ3D(70.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg)); // Left
2793 pvEBarrelMotherPos->add(tfIrDw);
2794 pvEBarrelMotherPos->add(new GeoIdentifierTag(6));
2795 pvEBarrelMotherPos->add(pvIrDw);
2796
2797 tfIrDw = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)
2798 * GeoTrf::Translate3D(-PosXcut+dxIr,-PosYcut+dyIr,-PoZ1)
2799 * GeoTrf::RotateZ3D(-70.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg)); // Left
2800
2801 pvEBarrelMotherPos->add(tfIrDw);
2802 pvEBarrelMotherPos->add(pvIrDw);
2803 } // end if BoolCuts
2804 }
2805 //--------------------------------------------------------------------------------------------------------------
2806 // Ext.Barrel
2807 ztrans = (PosEndCrack + (dbManager->GetEnvZLength()*Gaudi::Units::cm - EBFingerLengthPos)/2 + 19.5)*(1./Gaudi::Units::cm);
2808
2809 GeoTransform* tfEBarrelMotherPos = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) *
2810 GeoTrf::RotateZ3D(dbManager->GetEnvDPhi()*Gaudi::Units::deg));
2811
2812 (*m_log) << MSG::INFO <<" Positioning positive ext.barrel with translation "<< ztrans*Gaudi::Units::cm << endmsg;
2813
2814 //
2815 GeoNameTag* ntEBarrelMotherPos = new GeoNameTag("EBarrelPos");
2816 pvTileEnvelopePosEndcap->add(tfEBarrelMotherPos);
2817 pvTileEnvelopePosEndcap->add(ntEBarrelMotherPos);
2818 pvTileEnvelopePosEndcap->add(new GeoIdentifierTag(3));
2819 pvTileEnvelopePosEndcap->add(pvEBarrelMotherPos);
2820 //
2821
2822 if (barrel_flag < 2) {
2823
2824 //--------------------------------------------------------------------------------------------------------------
2825 // Finger
2826 ztrans = (PosEndExBarrel + EBFingerLengthPos/2)*(1./Gaudi::Units::cm);
2827
2828 GeoTransform* tfEFingerMotherPos = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) *
2829 GeoTrf::RotateZ3D(dbManager->GetEnvDPhi() * Gaudi::Units::deg));
2830
2831 (*m_log) << MSG::INFO <<" Positioning positive ext.barrel finger with translation ztrans= "<<ztrans*Gaudi::Units::cm<<endmsg;
2832
2833 GeoNameTag* ntEFingerMotherPos = new GeoNameTag("TileEFingerPos");
2834
2835 pvTileEnvelopePosEndcap->add(tfEFingerMotherPos);
2836 pvTileEnvelopePosEndcap->add(ntEFingerMotherPos);
2837 pvTileEnvelopePosEndcap->add(pvEFingerMotherPos);
2838
2839 //--------------------------------------------------------------------------------------------------------------
2840 // Ext. Saddle Support
2841 if (dbManager->BoolSaddle()) {
2842 ztrans = (PosEndExBarrel + DzSaddleSupport/2)*(1./Gaudi::Units::cm);
2843
2844 GeoTransform* tfESaddleMotherPos = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) *
2845 GeoTrf::RotateZ3D(dbManager->GetEnvDPhi() * Gaudi::Units::deg));
2846
2847 (*m_log) << MSG::INFO <<" Positioning positive ext.barrel saddle with translation ztrans= "<<ztrans*Gaudi::Units::cm
2848 << endmsg;
2849
2850 GeoNameTag* ntESaddleMotherPos = new GeoNameTag("TileESaddlePos");
2851
2852 pvTileEnvelopePosEndcap->add(tfESaddleMotherPos);
2853 pvTileEnvelopePosEndcap->add(ntESaddleMotherPos);
2854 pvTileEnvelopePosEndcap->add(pvESaddleMotherPos);
2855 }
2856
2857 }
2858 }
2859
2860 //----------------------------------------- EBarrel Negative -----------------------------------------------------
2861 //
2862 if (EnvType == 2 && eb_flag) { // negative ext.barrel is always at negative boundary, after finger
2863
2865 double thicknessEndPlate = dbManager->TILBdzend1()*Gaudi::Units::cm;
2866
2867 double PoZ1 = thicknessEndPlate + modl_length/4 - (dbManager->GetEnvZLength()*Gaudi::Units::cm- EBFingerLengthNeg)/2;
2868 double PoZ2 = modl_length/4 + PoZ1;
2869
2870 //*>------------------------------------------------------------------------------------------------------
2871 // LArPart in Tile (Negative) (close center)
2872 if (m_fullGeo) {
2873 if (dbManager->BoolCuts() && barrel_flag < 2) {
2874 // Iron1, down
2875 volname = "Iron1"; dbManager->SetCurrentCuts(volname); //>>
2876 dxIron = dbManager->CutsXpos();
2877 dyIron = dbManager->CutsYpos();
2878
2879 GeoTransform* tfIron1 = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY-dyIron,-PoZ2)
2880 * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg)); // Left
2881 pvEBarrelMotherNeg->add(tfIron1);
2882 pvEBarrelMotherNeg->add(new GeoIdentifierTag(1));
2883 pvEBarrelMotherNeg->add(pvIron1);
2884
2885 tfIron1 = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::Translate3D(-dxIron,PosY-dyIron,-PoZ2)
2886 * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg)); // Right
2887 pvEBarrelMotherNeg->add(tfIron1);
2888 pvEBarrelMotherNeg->add(new GeoIdentifierTag(2));
2889 pvEBarrelMotherNeg->add(pvIron1);
2890
2891 // Iron2, middle
2892 volname = "Iron2"; dbManager->SetCurrentCuts(volname); //>>
2893 dxIron = dbManager->CutsXpos();
2894 dyIron = dbManager->CutsYpos();
2895
2896 GeoTransform* tfIron2 = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY+dyIron,-PoZ2)
2897 * GeoTrf::RotateZ3D(-84.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg)); // Left
2898 pvEBarrelMotherNeg->add(tfIron2);
2899 pvEBarrelMotherNeg->add(new GeoIdentifierTag(2));
2900 pvEBarrelMotherNeg->add(pvIron2);
2901
2902 tfIron2 = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::Translate3D(-dxIron,PosY+dyIron,-PoZ2)
2903 * GeoTrf::RotateZ3D(84.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg)); // Left
2904 pvEBarrelMotherNeg->add(tfIron2);
2905 pvEBarrelMotherNeg->add(pvIron2);
2906
2907 // Iron3, middle
2908 volname = "Iron3"; dbManager->SetCurrentCuts(volname); //>>
2909 dxIron = dbManager->CutsXpos();
2910 dyIron = dbManager->CutsYpos();
2911
2912 GeoTransform* tfIron3 = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY+dyIron,-PoZ2)
2913 * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg)); // Left
2914 pvEBarrelMotherNeg->add(tfIron3);
2915 pvEBarrelMotherNeg->add(new GeoIdentifierTag(3));
2916 pvEBarrelMotherNeg->add(pvIron3);
2917
2918 tfIron3 = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::Translate3D(-dxIron,PosY+dyIron,-PoZ2)
2919 * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg)); // Right
2920 pvEBarrelMotherNeg->add(tfIron3);
2921 pvEBarrelMotherNeg->add(pvIron3);
2922
2923 // Heavy Iron Box
2924 volname = "IrBox"; dbManager->SetCurrentCuts(volname); //>>
2925 dxIron = dbManager->CutsXpos();
2926 dyIron = dbManager->CutsYpos();
2927 GeoTransform* tfIrBoxL = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY-dyIron,-PoZ2)
2928 * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg)); // Left
2929 pvEBarrelMotherNeg->add(tfIrBoxL);
2930 pvEBarrelMotherNeg->add(new GeoIdentifierTag(4));
2931 pvEBarrelMotherNeg->add(pvIrBox);
2932
2933 GeoTransform* tfIrBoxR = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) *GeoTrf::Translate3D(-dxIron,PosY-dyIron,-PoZ2)
2934 * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg)); // Right
2935 pvEBarrelMotherNeg->add(tfIrBoxR);
2936 pvEBarrelMotherNeg->add(pvIrBox);
2937
2938 // LArPart in Tile (Positive) (outer center)
2939 volname = "IrUp"; dbManager->SetCurrentCuts(volname); //>>
2940 dxIr = dbManager->CutsXpos();
2941 dyIr = dbManager->CutsYpos();
2942
2943 GeoTransform* tfIrUp = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)
2944 * GeoTrf::Translate3D(PosXcut+dxIr,-PosYcut+dyIr,PoZ1)
2945 * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg)); // Left
2946 pvEBarrelMotherNeg->add(tfIrUp);
2947 pvEBarrelMotherNeg->add(new GeoIdentifierTag(5));
2948 pvEBarrelMotherNeg->add(pvIrUp);
2949
2950 tfIrUp = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)
2951 * GeoTrf::Translate3D(-PosXcut-dxIr,-PosYcut+dyIr,PoZ1)
2952 * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg)); // Right
2953 pvEBarrelMotherNeg->add(tfIrUp);
2954 pvEBarrelMotherNeg->add(pvIrUp);
2955
2956 // CutB in Tile (Positive) (outer center)
2957 volname = "IrDw"; dbManager->SetCurrentCuts(volname); //>>
2958 dxIr = dbManager->CutsXpos();
2959 dyIr = dbManager->CutsYpos();
2960
2961 GeoTransform* tfIrDw = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)
2962 * GeoTrf::Translate3D(PosXcut+dxIr,-PosYcut+dyIr,PoZ1)
2963 * GeoTrf::RotateZ3D(70.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg)); // Left
2964 pvEBarrelMotherNeg->add(tfIrDw);
2965 pvEBarrelMotherNeg->add(new GeoIdentifierTag(6));
2966 pvEBarrelMotherNeg->add(pvIrDw);
2967
2968 tfIrDw = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)
2969 * GeoTrf::Translate3D(-PosXcut+dxIr,-PosYcut+dyIr,PoZ1)
2970 * GeoTrf::RotateZ3D(-70.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg)); // Left
2971
2972 pvEBarrelMotherNeg->add(tfIrDw);
2973 pvEBarrelMotherNeg->add(pvIrDw);
2974 } // end if BoolCuts
2975 }
2976 //
2977 //*>------------------------------------------------------------------------------------------------------
2978 // Ext.Barrel
2979 ztrans = (-NegEndCrack - (dbManager->GetEnvZLength()*Gaudi::Units::cm - EBFingerLengthNeg)/2 - 19.5)*(1./Gaudi::Units::cm);
2980
2981 GeoTransform* tfEBarrelMotherNeg = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) *
2982 GeoTrf::RotateZ3D(dbManager->GetEnvDPhi()*Gaudi::Units::deg));
2983
2984 (*m_log) << MSG::INFO <<" Positioning negative ext.barrel with translation ztrans "<<ztrans*Gaudi::Units::cm<<endmsg;
2985
2986 GeoNameTag* ntEBarrelMotherNeg = new GeoNameTag("EBarrelNeg");
2987
2988 pvTileEnvelopeNegEndcap->add(tfEBarrelMotherNeg);
2989 pvTileEnvelopeNegEndcap->add(ntEBarrelMotherNeg);
2990 pvTileEnvelopeNegEndcap->add(new GeoIdentifierTag(2));
2991 pvTileEnvelopeNegEndcap->add(pvEBarrelMotherNeg);
2992
2993 if (barrel_flag < 2) {
2994
2995 //*>------------------------------------------------------------------------------------------------------
2996 // Finger
2997 ztrans = (-NegEndExBarrel - EBFingerLengthPos/2)*(1./Gaudi::Units::cm);
2998
2999 GeoTransform* tfEFingerMotherNeg = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) *
3000 GeoTrf::RotateZ3D(dbManager->GetEnvDPhi() * Gaudi::Units::deg));
3001
3002 (*m_log) << MSG::INFO <<" Positioning negative ext.barrel finger with translation ztrans= "<<ztrans*Gaudi::Units::cm<< endmsg;
3003
3004 GeoNameTag* ntEFingerMotherNeg = new GeoNameTag("TileEFingerNeg");
3005
3006 pvTileEnvelopeNegEndcap->add(tfEFingerMotherNeg);
3007 pvTileEnvelopeNegEndcap->add(ntEFingerMotherNeg);
3008 pvTileEnvelopeNegEndcap->add(pvEFingerMotherNeg);
3009
3010 //*>------------------------------------------------------------------------------------------------------
3011 // Ext. Saddle Support
3012 if (dbManager->BoolSaddle()) {
3013 ztrans = (-NegEndExBarrel - DzSaddleSupport/2)*(1./Gaudi::Units::cm);
3014
3015 GeoTransform* tfESaddleMotherNeg = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) *
3016 GeoTrf::RotateZ3D(dbManager->GetEnvDPhi() * Gaudi::Units::deg));
3017
3018 (*m_log) << MSG::INFO <<" Positioning negative ext.barrel saddle with translation ztrans= "<<ztrans*Gaudi::Units::cm
3019 << endmsg;
3020
3021 GeoNameTag* ntESaddleMotherNeg = new GeoNameTag("TileESaddleNeg");
3022
3023 pvTileEnvelopeNegEndcap->add(tfESaddleMotherNeg);
3024 pvTileEnvelopeNegEndcap->add(ntESaddleMotherNeg);
3025 pvTileEnvelopeNegEndcap->add(pvESaddleMotherNeg);
3026 }
3027
3028 }
3029 }
3030
3031 //
3032 // ---------------------------------------- ITC Positive -----------------------------------------------------
3033 //
3034
3035 if (EnvType == 5) { // positive ITC attached to positive ext.barrel
3036
3037 if (barrel_flag < 3) {
3038
3040
3041 ztrans = PosEndBarrelFinger*(1./Gaudi::Units::cm) + dbManager->TILBdzmodul()/2;
3042
3043 //std::cout <<" ztrans "<<ztrans<<" PosEndBarrelFinger/Gaudi::Units::cm "<<PosEndBarrelFinger/Gaudi::Units::cm
3044 // <<" dbManager->TILBdzmodul()/2*Gaudi::Units::cm"<<dbManager->TILBdzmodul()/2<<"\n";
3045
3046 (*m_log) << MSG::INFO <<" Positioning positive ITC with translation "<<ztrans*Gaudi::Units::cm<< endmsg;
3047
3048 GeoTransform* tfITCMotherPos = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) *
3049 GeoTrf::RotateZ3D(dbManager->GetEnvDPhi() * Gaudi::Units::deg));
3050
3051 GeoNameTag* ntITCMotherPos = new GeoNameTag("ITCPos");
3052
3053 pvTileEnvelopePosEndcap->add(tfITCMotherPos);
3054 pvTileEnvelopePosEndcap->add(ntITCMotherPos);
3055 pvTileEnvelopePosEndcap->add(pvITCMotherPos);
3056
3057 }
3058
3059 if (barrel_flag < 4) {
3060
3062 ztrans = PosBeginGap*(1./Gaudi::Units::cm) + dbManager->TILBdzmodul()/2;
3063
3064 (*m_log) << MSG::INFO <<" Positioning positive Gap with translation "<<ztrans*Gaudi::Units::cm<<endmsg;
3065
3066 GeoTransform* tfGapMotherPos = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)*
3067 GeoTrf::RotateZ3D(dbManager->GetEnvDPhi()*Gaudi::Units::deg));
3068
3069 GeoNameTag* ntGapMotherPos = new GeoNameTag("GapPos");
3070
3071 pvTileEnvelopePosEndcap->add(tfGapMotherPos);
3072 pvTileEnvelopePosEndcap->add(ntGapMotherPos);
3073 pvTileEnvelopePosEndcap->add(pvGapMotherPos);
3074
3075 }
3076
3077 // Crack
3078 if (crack_flag<=0 || pvTileEnvelopePosCrack) {
3079
3081 ztrans = PosBeginCrack*(1./Gaudi::Units::cm) + dbManager->TILBdzmodul()/2;
3082
3083 if (crack_flag<=0) {
3084 (*m_log) << MSG::INFO <<" Positioning positive Crack with translation "<<ztrans*Gaudi::Units::cm<<endmsg;
3085 } else if (crack_flag==1) {
3086 (*m_log) << MSG::INFO <<" Positioning positive Crack in separate mother volume with translation "<<ztrans*Gaudi::Units::cm<<endmsg;
3087 } else {
3088 ztrans = (m_volumePositions.size()>0) ? m_volumePositions[0] : 0.0;
3089 (*m_log) << MSG::INFO <<" Positioning positive Crack in " << pvTileEnvelopePosCrack->getLogVol()->getName() << " mother volume with translation "<<ztrans*Gaudi::Units::cm<<endmsg;
3090 }
3091
3092 GeoTransform* tfCrackMotherPos = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)*
3093 GeoTrf::RotateZ3D(dbManager->GetEnvDPhi()*Gaudi::Units::deg));
3094
3095 GeoNameTag* ntCrackMotherPos = new GeoNameTag("CrackPos");
3096
3097 if (crack_flag<=0) {
3098 pvTileEnvelopePosEndcap->add(tfCrackMotherPos);
3099 pvTileEnvelopePosEndcap->add(ntCrackMotherPos);
3100 pvTileEnvelopePosEndcap->add(pvCrackMotherPos);
3101 } else {
3102 pvTileEnvelopePosCrack->add(tfCrackMotherPos);
3103 pvTileEnvelopePosCrack->add(ntCrackMotherPos);
3104 pvTileEnvelopePosCrack->add(pvCrackMotherPos);
3105 }
3106 } else {
3107 (*m_log) << MSG::INFO <<" Do not create positive Crack"<<endmsg;
3108 }
3109
3110 }
3111
3112 //
3113 // ---------------------------------------- ITC Negative -----------------------------------------------------
3114 //
3115
3116 // negative ITC attached to negative ext.barrel
3117 if (EnvType == 4) {
3118
3119 if (barrel_flag < 3) {
3120
3122 ztrans = -NegEndBarrelFinger*(1./Gaudi::Units::cm) - dbManager->TILBdzmodul()/2;
3123
3124 (*m_log) << MSG::INFO <<" Positioning negative ITC with translation "<<ztrans*Gaudi::Units::cm<<endmsg;
3125
3126 GeoTransform* tfITCMotherNeg = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)*
3127 GeoTrf::RotateZ3D(dbManager->GetEnvDPhi()*Gaudi::Units::deg));
3128
3129 GeoNameTag* ntITCMotherNeg = new GeoNameTag("ITCNeg");
3130
3131 pvTileEnvelopeNegEndcap->add(tfITCMotherNeg);
3132 pvTileEnvelopeNegEndcap->add(ntITCMotherNeg);
3133 pvTileEnvelopeNegEndcap->add(pvITCMotherNeg);
3134
3135 }
3136
3137 if (barrel_flag < 4) {
3138
3140 ztrans = -NegBeginGap*(1./Gaudi::Units::cm) - dbManager->TILBdzmodul()/2;
3141
3142 (*m_log) << MSG::INFO <<" Positioning negative Gap with translation "<<ztrans*Gaudi::Units::cm<<endmsg;
3143
3144 GeoTransform* tfGapMotherNeg = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)*
3145 GeoTrf::RotateZ3D(dbManager->GetEnvDPhi()*Gaudi::Units::deg));
3146
3147 GeoNameTag* ntGapMotherNeg = new GeoNameTag("GapNeg");
3148
3149 pvTileEnvelopeNegEndcap->add(tfGapMotherNeg);
3150 pvTileEnvelopeNegEndcap->add(ntGapMotherNeg);
3151 pvTileEnvelopeNegEndcap->add(pvGapMotherNeg);
3152
3153 }
3154
3155 // Crack
3156 if (crack_flag<=0 || pvTileEnvelopeNegCrack) {
3157
3159 ztrans = -NegBeginCrack*(1./Gaudi::Units::cm) - dbManager->TILBdzmodul()/2;
3160
3161 if (crack_flag<=0) {
3162 (*m_log) << MSG::INFO <<" Positioning negative Crack with translation "<<ztrans*Gaudi::Units::cm<<endmsg;
3163 } else if (crack_flag==1) {
3164 (*m_log) << MSG::INFO <<" Positioning negative Crack in separate mother volume with translation "<<ztrans*Gaudi::Units::cm<<endmsg;
3165 } else {
3166 ztrans = (m_volumePositions.size()>1) ? m_volumePositions[1] : (m_volumePositions.size()>0) ? m_volumePositions[0] : 0.0;
3167 (*m_log) << MSG::INFO <<" Positioning positive Crack in " << pvTileEnvelopeNegCrack->getLogVol()->getName() << " mother volume with translation "<<ztrans*Gaudi::Units::cm<<endmsg;
3168 }
3169
3170 GeoTransform* tfCrackMotherNeg = new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)*
3171 GeoTrf::RotateZ3D(dbManager->GetEnvDPhi()*Gaudi::Units::deg));
3172
3173 GeoNameTag* ntCrackMotherNeg = new GeoNameTag("CrackNeg");
3174
3175 if (crack_flag<=0) {
3176 pvTileEnvelopeNegEndcap->add(tfCrackMotherNeg);
3177 pvTileEnvelopeNegEndcap->add(ntCrackMotherNeg);
3178 pvTileEnvelopeNegEndcap->add(pvCrackMotherNeg);
3179 } else {
3180 pvTileEnvelopeNegCrack->add(tfCrackMotherNeg);
3181 pvTileEnvelopeNegCrack->add(ntCrackMotherNeg);
3182 pvTileEnvelopeNegCrack->add(pvCrackMotherNeg);
3183 }
3184 } else {
3185 (*m_log) << MSG::INFO <<" Do not create negative Crack"<<endmsg;
3186 }
3187
3188 }
3189 } // EnvCounter, end
3190
3191 //
3192 // creating Descriptiors and CaloDetDescrElements
3193 //
3194
3195 if (barrel_flag<4 || (barrel_flag==4 && crack_flag<2) ) { // create descriptors only if top-level volumes were created
3196
3197 (*m_log) << MSG::DEBUG << "Creating descriptors for " << dbManager->GetNumberOfEnv() << " envelopes..." << endmsg;
3198
3199 int nModulesInSection[6] = {0,0,0,0,0,0};
3200 double zShiftInSection[6] = {0.0,0.0,0.0,0.0,0.0,0.0,};
3201
3202
3203 for (int EnvCounter = 0; EnvCounter < dbManager->GetNumberOfEnv(); ++EnvCounter) { //Loop over Envelopes
3204
3205 dbManager->SetCurrentEnvByIndex(EnvCounter);
3206 int EnvType = dbManager->GetEnvType();
3207 int NumberOfMod = dbManager->GetEnvNModules();
3208 double Zshift = dbManager->GetEnvZShift()*Gaudi::Units::cm;
3209
3210 if (m_log->level()<=MSG::DEBUG)
3211 (*m_log) << MSG::DEBUG
3212 << " EnvCounter is " << EnvCounter
3213 << " EnvType is " << EnvType
3214 << " Zshift is " << Zshift*(1./Gaudi::Units::cm) << " cm"
3215 << endmsg;
3216
3217 // Central barrel
3218 if (EnvType == 1 || EnvType == 0) {
3219 nModulesInSection[0] = nModulesInSection[1] = NumberOfMod;
3220 zShiftInSection[0] = zShiftInSection[1] = Zshift;
3221 } else if (EnvType < 6) {
3222 nModulesInSection[EnvType] = NumberOfMod;
3223 zShiftInSection[EnvType] = Zshift;
3224 }
3225 }
3226
3227 const TileID* tileID = m_detectorManager->get_id();
3228
3231 int side[6] = {0,1,0,1,0,1};
3232
3233
3234 (*m_log) << MSG::DEBUG << "Loop over Tile detector regions, and call computeCellDim() when needed..." << endmsg;
3235 for (int ii=0; ii<6; ++ii) {
3236
3237 (*m_log) << MSG::DEBUG << "ii: " << ii << ", region: " << dete[ii] << endmsg;
3238
3239 if (ii%2 == 0) {
3240 (*m_log) << MSG::DEBUG << "ii: " << ii << ", region: " << dete[ii] << " --> calling computeCellDim()..." << endmsg;
3241 sectionBuilder->computeCellDim(m_detectorManager, dete[ii],
3242 m_switches.addPlatesToCell,
3243 zShiftInSection[ii+1], // zShiftPos
3244 zShiftInSection[ii]); // zShiftNeg
3245 }
3246
3247 (*m_log) << MSG::DEBUG << "calling fillDescriptor()..." << endmsg;
3248 TileDetDescriptor* descriptor = new TileDetDescriptor();
3249 sectionBuilder->fillDescriptor(descriptor, dete[ii], side[ii],
3250 m_switches.testBeam, // set to false - ATLAS geometry
3251 m_switches.addPlatesToCell, // add front/end plates to cell volume
3252 nModulesInSection[ii], // 0-64 modules
3253 zShiftInSection[ii]); // Z-shift
3254
3255 (*m_log) << MSG::DEBUG << "Get an Identifier for the region and add it to the detectorManager..." << endmsg;
3256 Identifier idRegion = tileID->region_id(ii);
3257 descriptor->set(idRegion);
3258 m_detectorManager->add(descriptor);
3259 m_detectorManager->add(new TileDetDescrRegion(idRegion, descriptor));
3260 }
3261 }
3262
3263 // --------- ----------- --------- -------- ------ --------- ------- ----------
3264 GeoNameTag *nTag = new GeoNameTag("Tile");
3265
3266 if (BAR && barrel_flag<1) {
3267 world->add(nTag);
3268
3269 // Top transform for the Central barrel
3270 dbManager->SetCurrentEnvByType(1);
3271 GeoTrf::Transform3D mz = GeoTrf::RotateZ3D(dbManager->GetEnvDPhi());
3272 GeoTrf::Transform3D my = GeoTrf::RotateY3D(dbManager->GetEnvDTheta());
3273 GeoTrf::Transform3D mx = GeoTrf::RotateZ3D(dbManager->GetEnvDPsi());
3274 GeoTrf::Transform3D vpos = GeoTrf::Translate3D(dbManager->GetEnvDX()*Gaudi::Units::cm,dbManager->GetEnvDY()*Gaudi::Units::cm,dbManager->GetEnvDZ()*Gaudi::Units::cm);
3275 GeoTransform* barrelTT = new GeoTransform(GeoTrf::Transform3D(vpos*(mx*(my*(mz)))));
3276
3277 (*m_log) << MSG::INFO << " Global positioning of barrel with rotation ("
3278 << dbManager->GetEnvDPhi() << "," << dbManager->GetEnvDTheta() << "," << dbManager->GetEnvDPsi() << ")"
3279 << ") and translation (" << dbManager->GetEnvDX() << "," << dbManager->GetEnvDY() << "," << dbManager->GetEnvDZ()
3280 << ") Gaudi::Units::cm" << endmsg;
3281
3282 world->add(barrelTT);
3283 world->add(pvTileEnvelopeBarrel);
3284 m_detectorManager->addTreeTop(pvTileEnvelopeBarrel);
3285 }
3286
3287 if (EBA && eb_flag) {
3288 world->add(nTag);
3289
3290 // Top transform for the Positive endcap
3291 dbManager->SetCurrentEnvByType(3);
3292 GeoTrf::Transform3D mz = GeoTrf::RotateZ3D(dbManager->GetEnvDPhi());
3293 GeoTrf::Transform3D my = GeoTrf::RotateY3D(dbManager->GetEnvDTheta());
3294 GeoTrf::Transform3D mx = GeoTrf::RotateZ3D(dbManager->GetEnvDPsi());
3295 GeoTrf::Transform3D vpos = GeoTrf::Translate3D(dbManager->GetEnvDX()*Gaudi::Units::cm,dbManager->GetEnvDY()*Gaudi::Units::cm,dbManager->GetEnvDZ()*Gaudi::Units::cm);
3296 GeoTransform* posEcTT = new GeoTransform(GeoTrf::Transform3D(vpos*(mx*(my*(mz)))));
3297
3298 (*m_log) << MSG::INFO << " Global positioning of positive ext.barrel with rotation ("
3299 << dbManager->GetEnvDPhi() << "," << dbManager->GetEnvDTheta() << "," << dbManager->GetEnvDPsi() << ")"
3300 << ") and translation (" << dbManager->GetEnvDX() << "," << dbManager->GetEnvDY() << "," << dbManager->GetEnvDZ()
3301 << ") Gaudi::Units::cm" << endmsg;
3302
3303 world->add(posEcTT);
3304 world->add(pvTileEnvelopePosEndcap);
3305 m_detectorManager->addTreeTop(pvTileEnvelopePosEndcap);
3306 }
3307
3308 if (EBC && eb_flag) {
3309 world->add(nTag);
3310
3311 // Top transform for the Negative endcap
3312 dbManager->SetCurrentEnvByType(2);
3313 GeoTrf::Transform3D mz = GeoTrf::RotateZ3D(dbManager->GetEnvDPhi());
3314 GeoTrf::Transform3D my = GeoTrf::RotateY3D(dbManager->GetEnvDTheta());
3315 GeoTrf::Transform3D mx = GeoTrf::RotateZ3D(dbManager->GetEnvDPsi());
3316 GeoTrf::Transform3D vpos = GeoTrf::Translate3D(dbManager->GetEnvDX()*Gaudi::Units::cm,dbManager->GetEnvDY()*Gaudi::Units::cm,dbManager->GetEnvDZ()*Gaudi::Units::cm);
3317 GeoTransform* negEcTT = new GeoTransform(GeoTrf::Transform3D(vpos*(mx*(my*(mz)))));
3318
3319 (*m_log) << MSG::INFO << " Global positioning of negative ext.barrel with rotation ("
3320 << dbManager->GetEnvDPhi() << "," << dbManager->GetEnvDTheta() << "," << dbManager->GetEnvDPsi() << ")"
3321 << ") and translation (" << dbManager->GetEnvDX() << "," << dbManager->GetEnvDY() << "," << dbManager->GetEnvDZ()
3322 << ") Gaudi::Units::cm" << endmsg;
3323
3324 world->add(negEcTT);
3325 world->add(pvTileEnvelopeNegEndcap);
3326 m_detectorManager->addTreeTop(pvTileEnvelopeNegEndcap);
3327
3328 }
3329
3330 if (crack_flag==1) {
3331
3332 // repeating the same for crack in EBA
3333 if (EBA && pvTileEnvelopePosCrack) {
3334 //GeoNameTag *nTag = new GeoNameTag("TileCrackEBA");
3335 world->add(nTag);
3336
3337 // Top transform for the Positive crack
3338 dbManager->SetCurrentEnvByType(5);
3339 GeoTrf::Transform3D mz = GeoTrf::RotateZ3D(dbManager->GetEnvDPhi());
3340 GeoTrf::Transform3D my = GeoTrf::RotateY3D(dbManager->GetEnvDTheta());
3341 GeoTrf::Transform3D mx = GeoTrf::RotateZ3D(dbManager->GetEnvDPsi());
3342 GeoTrf::Transform3D vpos = GeoTrf::Translate3D(dbManager->GetEnvDX()*Gaudi::Units::cm,dbManager->GetEnvDY()*Gaudi::Units::cm,dbManager->GetEnvDZ()*Gaudi::Units::cm);
3343 GeoTransform* posCrackTT = new GeoTransform(GeoTrf::Transform3D(vpos*(mx*(my*(mz)))));
3344
3345 (*m_log) << MSG::INFO << " Global positioning of positive Crack with rotation ("
3346 << dbManager->GetEnvDPhi() << "," << dbManager->GetEnvDTheta() << "," << dbManager->GetEnvDPsi() << ")"
3347 << ") and translation (" << dbManager->GetEnvDX() << "," << dbManager->GetEnvDY() << "," << dbManager->GetEnvDZ()
3348 << ") Gaudi::Units::cm" << endmsg;
3349
3350 world->add(posCrackTT);
3351 world->add(pvTileEnvelopePosCrack);
3352 m_detectorManager->addTreeTop(pvTileEnvelopePosCrack);
3353
3354 }
3355
3356 // repeating the same for crack in EBC
3357 if (EBC && pvTileEnvelopeNegCrack) {
3358 //GeoNameTag *nTag = new GeoNameTag("TileCrackEBC");
3359 world->add(nTag);
3360
3361 // Top transform for the Negative endcap
3362 dbManager->SetCurrentEnvByType(4);
3363 GeoTrf::Transform3D mz = GeoTrf::RotateZ3D(dbManager->GetEnvDPhi());
3364 GeoTrf::Transform3D my = GeoTrf::RotateY3D(dbManager->GetEnvDTheta());
3365 GeoTrf::Transform3D mx = GeoTrf::RotateZ3D(dbManager->GetEnvDPsi());
3366 GeoTrf::Transform3D vpos = GeoTrf::Translate3D(dbManager->GetEnvDX()*Gaudi::Units::cm,dbManager->GetEnvDY()*Gaudi::Units::cm,dbManager->GetEnvDZ()*Gaudi::Units::cm);
3367 GeoTransform* negCrackTT = new GeoTransform(GeoTrf::Transform3D(vpos*(mx*(my*(mz)))));
3368
3369 (*m_log) << MSG::INFO << " Global positioning of negative Crack with rotation ("
3370 << dbManager->GetEnvDPhi() << "," << dbManager->GetEnvDTheta() << "," << dbManager->GetEnvDPsi() << ")"
3371 << ") and translation (" << dbManager->GetEnvDX() << "," << dbManager->GetEnvDY() << "," << dbManager->GetEnvDZ()
3372 << ") Gaudi::Units::cm" << endmsg;
3373
3374 world->add(negCrackTT);
3375 world->add(pvTileEnvelopeNegCrack);
3376 m_detectorManager->addTreeTop(pvTileEnvelopeNegCrack);
3377 }
3378
3379 }
3380
3381 delete sectionBuilder;
3382 //delete CutBuilder;
3383
3384}
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
Scalar phi() const
phi method
GeoVolumeVec_t geoGetVolumes(const GeoGraphNode *node, int depthLimit=1, int sizeHint=20)
Return the child volumes and associated transforms.
std::vector< std::pair< const GeoVPhysVol *, GeoTrf::Transform3D > > GeoVolumeVec_t
Return the child volumes and associated transforms.
#define MLOG(x)
#define TILE_REGION_GAP
#define TILE_REGION_CENTRAL
#define TILE_REGION_EXTENDED
RootType Type
virtual const GeoMaterial * getMaterial(const std::string &name)=0
void checking(const std::string &VolumeName, bool print, int level, double X1, double X2, double Y1, double Y2, double Z)
Function for checking empty volumes:
double TILBrminimal() const
double TILBdzend1() const
double GetEnvDY() const
double GetEnvRin() const
int GetNumberOfEnv() const
int SetCurrentModuleByIndex(unsigned int Id)
double DzSaddleSupport() const
double GetEnvDZ() const
double CutsYpos() const
int SetCurrentTifg(int section)
double GetEnvDX() const
double CutsXpos() const
double GetEnvDPhi() const
unsigned int GetModTypeSize() const
double TIFGdz() const
double TILBrmax() const
double TILErmax() const
double TILBzoffset() const
double CutsDZ1() const
int SetCurrentCuts(const std::string &input)
Fields of CUTS structure (see also Oracle comments):
int SetCurrentSaddle(unsigned int index)
Fields of SADDLE structure (see also Oracle comments):
double GetEnvZShift() const
double TILBdzspac() const
double TILBdzgir() const
double CutsDX1() const
double CutsDY2() const
double GetEnvDTheta() const
int GetEnvNModules() const
double TILBdzend2() const
double GetEnvDPsi() const
double TILEzshift() const
double TILErmam() const
int SetCurrentEnvByIndex(unsigned int envelope)
int SetCurrentSectionByNumber(unsigned int section)
double GetEnvZLength() const
int SetCurrentSection(unsigned int section, bool print=true)
double CutsDX2() const
double TILBdzmast() const
int TILBfingpattern() const
double TILBrmin() const
double CutsDY1() const
double RadiusSaddle() const
double TILBdzmodul() const
int TILBnperiod() const
int SetCurrentEnvByType(unsigned int envelope)
double GetEnvRout() const
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 setBarrelPeriodThickness(double val)
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 setExtendedPeriodThickness(double val)
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
#define DEBUG
Definition page_access.h:11

◆ getDetectorManager()

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

Access function to TileDetDescr geometry data.

Definition at line 49 of file TileAtlasFactory.h.

49{ return m_detectorManager; }

Member Data Documentation

◆ m_detectorManager

TileDetDescrManager* TileAtlasFactory::m_detectorManager
private

Detector pointer to TileDetDescrManager.

Definition at line 66 of file TileAtlasFactory.h.

◆ m_detectorStore

StoreGateSvc* TileAtlasFactory::m_detectorStore
private

Detector pointer to Store Gate service.

Definition at line 63 of file TileAtlasFactory.h.

◆ m_fullGeo

bool TileAtlasFactory::m_fullGeo
private

Geometry configuration: FULL, RECO.

Definition at line 83 of file TileAtlasFactory.h.

◆ m_log

MsgStream* TileAtlasFactory::m_log
private

Get message SVC.

Definition at line 69 of file TileAtlasFactory.h.

◆ m_switches

TileSwitches TileAtlasFactory::m_switches
private

all switches

Definition at line 72 of file TileAtlasFactory.h.

◆ m_verbose

bool TileAtlasFactory::m_verbose
private

Flag for activation verbose level for debugging.

Definition at line 80 of file TileAtlasFactory.h.

◆ m_volumeNames

std::vector<std::string> TileAtlasFactory::m_volumeNames
private

all additional variables which passed to constructor

Definition at line 75 of file TileAtlasFactory.h.

◆ m_volumePositions

std::vector<double> TileAtlasFactory::m_volumePositions
private

Definition at line 77 of file TileAtlasFactory.h.

◆ m_volumePtrs

std::vector<GeoPhysVol *> TileAtlasFactory::m_volumePtrs
private

Definition at line 76 of file TileAtlasFactory.h.


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