ATLAS Offline Software
TileGeoSectionBuilder.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
10 
11 #include "GeoModelKernel/GeoPcon.h"
12 #include "GeoModelKernel/GeoTubs.h"
13 #include "GeoModelKernel/GeoTube.h"
14 #include "GeoModelKernel/GeoTrd.h"
15 #include "GeoModelKernel/GeoTrap.h"
16 #include "GeoModelKernel/GeoBox.h"
17 #include "GeoModelKernel/GeoMaterial.h"
18 #include "GeoModelKernel/GeoLogVol.h"
19 #include "GeoModelKernel/GeoPhysVol.h"
20 #include "GeoModelKernel/GeoNameTag.h"
21 #include "GeoModelKernel/GeoTransform.h"
22 #include "GeoModelKernel/GeoSerialIdentifier.h"
23 #include "GeoModelKernel/GeoIdentifierTag.h"
24 #include "GeoModelKernel/GeoDefinitions.h"
25 #include "GeoModelKernel/Units.h"
26 
27 #include "GeoModelKernel/GeoShapeUnion.h"
28 #include "GeoModelKernel/GeoShapeShift.h"
29 #include "GeoModelKernel/GeoShapeSubtraction.h"
30 #include "GeoModelKernel/GeoCutVolAction.h"
31 
32 #include "GeoGenericFunctions/AbsFunction.h"
33 #include "GeoGenericFunctions/Variable.h"
34 #include "GeoModelKernel/GeoXF.h"
35 #include "GeoModelKernel/GeoSerialTransformer.h"
36 
37 #include "GaudiKernel/MsgStream.h"
38 #include "GaudiKernel/SystemOfUnits.h"
39 
40 #include <iostream>
41 
42 #include <assert.h>
43 
44 #define MLOG(x) if (m_log->level()<=MSG::x) *m_log << MSG::x
45 
46 using namespace GeoGenfun;
47 using namespace GeoXF;
48 
49 
51  TileDddbManager * pDbManager,
52  const TileSwitches & switches,
53  MsgStream * log)
54  : m_theMaterialManager(matManager)
55  , m_dbManager(pDbManager)
56  , m_log(log)
57  , m_switches(switches)
58  , m_barrelPeriodThickness(0.)
59  , m_barrelGlue(0.)
60  , m_extendedPeriodThickness(0.)
61  , m_verbose(log->level()<=MSG::VERBOSE)
62  , m_matLArServices(0)
63  , m_matIronHalfDens(0)
64  , m_additionalIronLayer(0.027)
65 {
66 }
67 
68 
70 {
71 }
72 
73 
74 void TileGeoSectionBuilder::fillSection(GeoPhysVol*& mother,
75  int sec_number,
76  double tile_rmax,
77  double rminb,
78  double dzglue,
79  double delta_phi,
80  int ModuleNcp,
81  double zlen_itc2,
82  bool neg)
83 {
84  (*m_log) << MSG::DEBUG <<" TileGeoSectionBuilder::fillSection ModuleNcp= "<<ModuleNcp<< endmsg;
85 
86  double tan_delta_phi_2 = std::tan(delta_phi/2*Gaudi::Units::deg);
87 
88  // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
89  // Obtain required materials - Air and Iron
90 
91  const GeoMaterial* matAir = m_theMaterialManager->getMaterial("std::Air");
92  const GeoMaterial* matIron = (m_switches.steel) ? m_theMaterialManager->getMaterial("tile::Steel")
93  : m_theMaterialManager->getMaterial("std::Iron");
94  const GeoMaterial* matAluminium = 0;
95 
96  // -----------------------------------------------------------------------------------------------------------------
97  // Cut-outs
98  //static bool First =true;
99  double dX1 =0., dX2 =0., dY1 =0., dY2 =0., dZ1 =0., dZ2 =0.;
100  std::string volname ="";
101 
102  // Cuting positioning
103  float PosXcut =0., PosYcut =0., PosY =0., Rmore =0.;
104  float Radius =0., YcorA =0., YcorB =0., lenPla =0., Blia =0.;
105 
106  // General rotation and transformations
107  float phi = (double(ModuleNcp-1) + 0.5)*delta_phi;
108 
109  // Special module flag
110  int SideFl = 1;
111  if (ModuleNcp>=35 && ModuleNcp<=37) SideFl = -1;
112 
113  GeoTrf::Transform3D TransCut2(GeoTrf::Transform3D::Identity());
114  GeoTrf::Transform3D TransCutL(GeoTrf::Transform3D::Identity());
115  GeoTrf::Transform3D TransCutR(GeoTrf::Transform3D::Identity());
116 
117  GeoIntrusivePtr<const GeoShapeUnion> CutA{nullptr};
118  GeoIntrusivePtr<GeoShape> CutB{nullptr};
119 
120  // ext. barrel Cuts description
121  if (sec_number==2 && m_dbManager->BoolCuts() && ((ModuleNcp>=35 && ModuleNcp<=37) || (ModuleNcp>=60 && ModuleNcp<=62))) {
122  volname = "CutB"; m_dbManager->SetCurrentCuts(volname);
123  PosXcut = m_dbManager->CutsXpos();
124  PosYcut = m_dbManager->CutsYpos();
125  Rmore = 0.8*Gaudi::Units::cm;
126 
127  // Inert materials, CutB1
128  dX1 = m_dbManager->CutsDX1()+Rmore;
129  dX2 = m_dbManager->CutsDX2()+Rmore;
130  dY1 = m_dbManager->CutsDY1()+Rmore;
131  dY2 = m_dbManager->CutsDY2()+Rmore;
132  dZ1 = m_dbManager->CutsDZ1();
133 
134  checking("CutB1", false, 1, dX1,dX2,dY1,dY2,dZ1);
135  GeoTrd* CutB1 = new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
136  //const GeoShape& CutB = *CutB1;
137  CutB = CutB1;
138 
139  // Materials are in cuting region, 1up Iron plate
140  volname = "Cut1up"; m_dbManager->SetCurrentCuts(volname); //>>
141  PosY = m_dbManager->CutsYpos();
142 
143  dX1 = m_dbManager->CutsDX1()+Rmore;
144  dX2 = m_dbManager->CutsDX2()+Rmore;
145  dY1 = m_dbManager->CutsDY1();
146  dY2 = m_dbManager->CutsDY2();
147  dZ1 = m_dbManager->CutsDZ1();
148 
149  checking("Cut1up", false, 1, dX1,dX2,dY1,dY2,dZ1);
150  GeoTrd* Cut1up = new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
151 
152  volname = "Cut2down"; m_dbManager->SetCurrentCuts(volname); //>>
153  dX1 = m_dbManager->CutsDX1()+Rmore;
154  dX2 = m_dbManager->CutsDX2()+Rmore;
155  dY1 = m_dbManager->CutsDY1();
156  dY2 = m_dbManager->CutsDY2();
157  dZ2 = m_dbManager->CutsDZ1();
158 
159  checking("Cut2down", false, 1, dX1,dX2,dY1,dY2,dZ2);
160  GeoTrd* Cut1down = new GeoTrd(dX1,dX2,dY1,dY2,dZ2);
161 
162  GeoTrf::Translate3D yPosA(0.,0.,-dZ1-dZ2);
163 
164  const GeoShapeUnion& CutA1 = Cut1up->add(*Cut1down<<yPosA);
165  CutA = &CutA1;
166 
168 
169  if (ModuleNcp==35||ModuleNcp==62) { YcorA = 5*Gaudi::Units::cm; YcorB = 5*Gaudi::Units::cm; lenPla =0.8*Gaudi::Units::cm, Blia = 17.4*Gaudi::Units::cm;}
170  if (ModuleNcp==36||ModuleNcp==61) { YcorA = 6.5*Gaudi::Units::cm; YcorB = 6*Gaudi::Units::cm; lenPla =1.7*Gaudi::Units::cm; Blia = 16.9*Gaudi::Units::cm;}
171  if (ModuleNcp==37||ModuleNcp==60) { YcorA = 8*Gaudi::Units::cm; YcorB = 9*Gaudi::Units::cm; lenPla =2.8*Gaudi::Units::cm; Blia = 16.4*Gaudi::Units::cm;}
172 
173  TransCut2 = GeoTrf::TranslateZ3D(-Radius)
174  * GeoTrf::RotateX3D((90-phi)*Gaudi::Units::deg) * GeoTrf::RotateY3D(180*Gaudi::Units::deg)
175  * GeoTrf::Translate3D(0.1*Gaudi::Units::cm,SideFl*17.5*Gaudi::Units::cm,-PosY+YcorA);
176 
177  // For modules on the side C apply extra transformation
178  // which implements ReflectZ(0)
179  if (neg) {
180  GeoTrf::Vector3D ptTmp = TransCut2*GeoTrf::Vector3D(0.,0.,0.);
181  TransCut2 = GeoTrf::TranslateX3D(2*ptTmp.x())*GeoTrf::RotateZ3D(180*Gaudi::Units::deg)*TransCut2;
182  }
183 
184  if (ModuleNcp>=60 && ModuleNcp<=62) {
185  TransCutL = GeoTrf::TranslateZ3D(-Radius)
186  * GeoTrf::RotateY3D(180*Gaudi::Units::deg) * GeoTrf::RotateX3D(phi*Gaudi::Units::deg)
187  * GeoTrf::Translate3D(-1.4*Gaudi::Units::cm,PosYcut+YcorB,-PosXcut-Blia);
188 
189  // ReflectZ for C side
190  if (neg) {
191  GeoTrf::Vector3D ptTmp = TransCutL*GeoTrf::Vector3D(0.,0.,0.);
192  TransCutL = GeoTrf::TranslateX3D(2*ptTmp.x())*GeoTrf::RotateZ3D(180*Gaudi::Units::deg)*TransCutL;
193  }
194 
195  } else if (ModuleNcp>=35 && ModuleNcp<=37) {
196  TransCutR = GeoTrf::TranslateZ3D(-Radius)
197  * GeoTrf::RotateY3D(180*Gaudi::Units::deg) * GeoTrf::RotateX3D(phi*Gaudi::Units::deg)
198  * GeoTrf::Translate3D(-1.4*Gaudi::Units::cm,PosYcut+YcorB,PosXcut+Blia)
199  * GeoTrf::RotateY3D(180*Gaudi::Units::deg);
200  // ReflectZ for C side
201  if (neg) {
202  GeoTrf::Vector3D ptTmp = TransCutR*GeoTrf::Vector3D(0.,0.,0.);
203  TransCutR = GeoTrf::TranslateX3D(2*ptTmp.x())*GeoTrf::RotateZ3D(180*Gaudi::Units::deg)*TransCutR;
204  }
205  }
206 
207  if (m_log->level()<=MSG::DEBUG)
208  (*m_log) << MSG::DEBUG <<" _fillSection: CutA and CutB Ok"<< endmsg;
209  } // end if, BoolCuts
210 
211  //---------------------Girder-----------------------------------------
212 
213  int Id4 = m_dbManager->GetModType()%100;
214  double thicknessGirderMother = 0.0;
215  double specialModuleZShift = 0.0;
216 
217  if (m_dbManager->TILBngirder() > 0) {
218  // Mother volume for girder
219  thicknessGirderMother = (m_dbManager->TILBdzmodul() - m_dbManager->TILBdzend() - m_dbManager->TILBdzend2())*Gaudi::Units::cm;
220  // special module with special girder
221  if ((Id4 == 7) && (sec_number == 3))
222  thicknessGirderMother = (m_dbManager->TILBdzgir() - m_dbManager->TILBdzend() - m_dbManager->TILBdzend2())*Gaudi::Units::cm;
223 
224  double heightGirderMother = (tile_rmax - m_dbManager->TILBrmax())*Gaudi::Units::cm;
225  double dy1GirderMother = m_dbManager->TILBrmax() * tan_delta_phi_2 * Gaudi::Units::cm;
226  double dy2GirderMother = tile_rmax * tan_delta_phi_2 * Gaudi::Units::cm;
227  // ps test the TILB DZGIR
228  // std::cout <<"\t\t PS Girder Module = "<<ModuleNcp<< std::endl;
229  // std::cout <<"\t\t PS thicknessGirderMother = "<<thicknessGirderMother<< std::endl;
230  //ps account for special ITC modules 14,15,18,19
231  if ((Id4 == 7) && (sec_number == 3)) {
232  specialModuleZShift = 0.5*Gaudi::Units::cm*(m_dbManager->TILBdzgir() - m_dbManager->TILBdzmodul());
233  }
234  //
235  checking("GirderMother", false, 3,
236  thicknessGirderMother/2,thicknessGirderMother/2,dy1GirderMother,dy2GirderMother,heightGirderMother/2);
237 
238  GeoTrd* girderMother = new GeoTrd(thicknessGirderMother/2,
239  thicknessGirderMother/2,
240  dy1GirderMother,
241  dy2GirderMother,
242  heightGirderMother/2);
243 
244  GeoLogVol* lvGirderMother = new GeoLogVol("GirderMother",girderMother,matAir);
245  GeoPhysVol* pvGirderMother = new GeoPhysVol(lvGirderMother);
246 
247  fillGirder(pvGirderMother,
248  tile_rmax,
250  tan_delta_phi_2,
251  thicknessGirderMother*(1./Gaudi::Units::cm));
252 
253  GeoTransform* tfGirderMother = 0;
254 
255  if (sec_number==3)
256  tfGirderMother = new GeoTransform(GeoTrf::Translate3D((m_dbManager->TILBdzend()-m_dbManager->TILBdzend2())*Gaudi::Units::cm/2, 0.,
258  else
259  tfGirderMother = new GeoTransform(GeoTrf::Translate3D((m_dbManager->TILBdzend()-m_dbManager->TILBdzend2())*Gaudi::Units::cm/2, 0.,
260  (m_dbManager->TILBrmax()-rminb)*Gaudi::Units::cm/2));
261 
262  mother->add(tfGirderMother);
263  mother->add(pvGirderMother);
264 
265  if (m_log->level()<=MSG::DEBUG)
266  (*m_log) << MSG::DEBUG <<" _fillSection: GirderMother Ok "<< endmsg;
267 
268  } // End Girder
269 
270  //--------------------Front Plate-------------------------------------
271  double thicknessFrontPlate, heightFrontPlate, dy1FrontPlate, dy2FrontPlate;
272  double rless =.150; // 150 [mkm]
273  int NbPeriod =0;
274 
275  if (m_dbManager->TILBdrfront() > 0) {
276  if (sec_number==3) {
277  //ITC coverplate
278  thicknessFrontPlate = (m_dbManager->TILBdzmodul() - zlen_itc2)*Gaudi::Units::cm;
279 
280  if (thicknessFrontPlate > rless) {
281  heightFrontPlate = m_dbManager->TILBdrfront()*Gaudi::Units::cm;
282  dy1FrontPlate = (rminb*tan_delta_phi_2 - m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
283  dy2FrontPlate = (m_dbManager->TILBrmin()*tan_delta_phi_2 - m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
284 
285  if (m_log->level()<=MSG::DEBUG)
286  (*m_log) << MSG::DEBUG <<" FrontPlateSh dX1,dX2= "<<thicknessFrontPlate/2<<", "<<thicknessFrontPlate/2
287  <<" dY1,dY2= "<<dy1FrontPlate<<" "<<dy2FrontPlate<<" dZ= "<<heightFrontPlate/2
288  << endmsg;
289 
290  GeoTrd* frontPlateSh = new GeoTrd(thicknessFrontPlate/2,
291  thicknessFrontPlate/2,
292  dy1FrontPlate,
293  dy2FrontPlate,
294  heightFrontPlate/2);
295 
296  GeoLogVol* lvFrontPlateSh = new GeoLogVol("FrontPlateSh",frontPlateSh,matIron);
297  GeoPhysVol* pvFrontPlateSh = new GeoPhysVol(lvFrontPlateSh);
298  GeoTransform* tfFrontPlateSh = new GeoTransform(GeoTrf::Translate3D(
299  -m_dbManager->TILBdzmodul()/2*Gaudi::Units::cm+thicknessFrontPlate/2, 0.,
300  (rminb - tile_rmax)/2*Gaudi::Units::cm));
301 
302  mother->add(tfFrontPlateSh);
303  mother->add(pvFrontPlateSh);
304 
305  } else {
306  if (m_log->level()<=MSG::DEBUG)
307  (*m_log) << MSG::DEBUG <<" FrontPlateSh was lost "<< endmsg;
308  }
309 
310  } else if (sec_number==2 && (m_dbManager->BoolCuts() &&
311  ((ModuleNcp>=35 && ModuleNcp<=37)||(ModuleNcp>=60 && ModuleNcp<=62)) )) {
312 
313  std::string volname ="";
314  double dXCutA = 0, dXCutB = 0;
315 
316  volname = "Cut1up"; m_dbManager->SetCurrentCuts(volname);
317  dXCutA = m_dbManager->CutsDX1();
318 
319  volname = "CutB"; m_dbManager->SetCurrentCuts(volname);
320  dXCutB = m_dbManager->CutsDX1();
321 
323  heightFrontPlate = m_dbManager->TILBdrfront()*Gaudi::Units::cm;
324  dy1FrontPlate = (rminb*tan_delta_phi_2 - m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
325  dy2FrontPlate = (m_dbManager->TILBrmin()*tan_delta_phi_2 - m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
326 
327  GeoTrd* frontPlate = new GeoTrd(thicknessFrontPlate/2 -(dXCutA+dXCutB),
328  thicknessFrontPlate/2 -(dXCutA+dXCutB),
329  dy1FrontPlate,
330  dy2FrontPlate,
331  heightFrontPlate/2);
332 
333  // Cuting of Plate
334  /*
335  GeoTrf::Transform3D TCu2 = GeoTrf::RotateX3D((90-phi)*Gaudi::Units::deg) * GeoTrf::RotateY3D(180*Gaudi::Units::deg)
336  * GeoTrf::Translate3D(thicknessFrontPlate/2-dXCutA,0,0);
337  GeoTransform* TCu = new GeoTransform(TCu2);
338 
339  const GeoShape &tmp_frontPlate = frontPlate->subtract((*CutA)<<TCu2);
340  .subtract((*CutB)<<TransCutL);
341  */
342 
343  GeoLogVol* lvFrontPlate = new GeoLogVol("FrontPlate",frontPlate,matIron);
344  GeoPhysVol* pvFrontPlate = new GeoPhysVol(lvFrontPlate);
345  GeoTransform* tfFrontPlate = new GeoTransform(GeoTrf::Translate3D(
347  (m_dbManager->TILBrmin()-m_dbManager->TILBdrfront()/2-(tile_rmax + rminb)/2)*Gaudi::Units::cm));
348 
349  mother->add(tfFrontPlate);
350  mother->add(pvFrontPlate);
351 
352  if (m_log->level()<=MSG::DEBUG)
353  (*m_log) << MSG::DEBUG<<" _fillSection: FrontPlate Cut Ok "<< endmsg;
354 
355  } else {
356  //Ordinary frontplate
358  heightFrontPlate = m_dbManager->TILBdrfront()*Gaudi::Units::cm;
359  dy1FrontPlate = (rminb*tan_delta_phi_2 - m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
360  dy2FrontPlate = (m_dbManager->TILBrmin()*tan_delta_phi_2 - m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
361 
362  GeoTrd* frontPlate = new GeoTrd(thicknessFrontPlate/2,
363  thicknessFrontPlate/2,
364  dy1FrontPlate,
365  dy2FrontPlate,
366  heightFrontPlate/2);
367 
368  GeoLogVol* lvFrontPlate = new GeoLogVol("FrontPlate",frontPlate,matIron);
369  GeoPhysVol* pvFrontPlate = new GeoPhysVol(lvFrontPlate);
370  GeoTransform* tfFrontPlate = new GeoTransform(GeoTrf::Translate3D(
372  (m_dbManager->TILBrmin()-m_dbManager->TILBdrfront()/2-(tile_rmax + rminb)/2)*Gaudi::Units::cm));
373 
374  mother->add(tfFrontPlate);
375  mother->add(pvFrontPlate);
376  }
377  } // End Front Plate
378 
379  //--------------------End Plates--------------------------------------
380  double dy1EndPlate, dy2EndPlate, thicknessEndPlate, heightEndPlate;
381 
382  //VARIABLES FOR END PLATE HOLE
383  double heightEPHole = m_dbManager->TILBflangex()*Gaudi::Units::cm;
384  double dyEPHole = m_dbManager->TILBflangex()*Gaudi::Units::cm/2;
385 
386  // ps . shifts for end plates in cutout regions
387  GeoTrf::Transform3D cutOutTransformation(GeoTrf::Transform3D::Identity());
388  //first endplate
389  GeoIntrusivePtr<GeoTransform> tfEndPlateSh{nullptr};
390 
391  if (m_dbManager->TILBdzend1() > 0) {
393 
394  //Short endplate
395  dy1EndPlate = rminb * tan_delta_phi_2 * Gaudi::Units::cm;
396  dy2EndPlate = m_dbManager->TILBrmax() * tan_delta_phi_2 * Gaudi::Units::cm;
397  thicknessEndPlate = m_dbManager->TILBdzend1() * Gaudi::Units::cm;
398  heightEndPlate = (m_dbManager->TILBrmax() - rminb) * Gaudi::Units::cm;
399  //
400  // creating standart endplate. It is the same for
401  // both standard mosules and modules with cuts
402  //
403  GeoTrd* endPlateSh = new GeoTrd(thicknessEndPlate/2,
404  thicknessEndPlate/2,
405  dy1EndPlate,
406  dy2EndPlate,
407  heightEndPlate/2);
408  GeoLogVol* lvEndPlateSh = 0;
409 
410  // if ( sec_number==2 && ( (ModuleNcp==37)||( ModuleNcp==60) ) )
411  if (sec_number==2 && ((ModuleNcp>=35 && ModuleNcp<=37)||(ModuleNcp>=60 && ModuleNcp<=62)) ) { // Short endplate Cut-outs
412 
413  //
414  // shape for the cutted part
415  //
416  GeoTrd* endPlateShCut = new GeoTrd(thicknessEndPlate,
417  thicknessEndPlate,
418  heightEndPlate/2.,
419  heightEndPlate/2.,
420  dy2EndPlate);
421 
422 
423  double rotationAngle ;
424  double shiftCutPlate ;
425  int rotationSign = 1;
426  if (ModuleNcp > 50) rotationSign *= -1;
427  if ( neg ) rotationSign *= -1;
428 
429 
430  if ( ( ModuleNcp == 37 ) || ( ModuleNcp == 60 ) ) {
431  rotationAngle = (180.0 - 25.3125 )* Gaudi::Units::deg ; // ATLLEMS_0003 0004
432  shiftCutPlate = 38.7 * Gaudi::Units::mm;
433 
434  cutOutTransformation =
435  GeoTrf::Translate3D(0,0, -heightEndPlate/2.) *
436  GeoTrf::RotateX3D( 90 * Gaudi::Units::deg ) *
437  GeoTrf::Translate3D(0.,0., -rotationSign * (dy2EndPlate + shiftCutPlate ) ) *
438  GeoTrf::RotateX3D( rotationSign * rotationAngle ) ;
439 
440  const GeoShape & endPlateShCutted3760 = (endPlateSh->subtract( (*endPlateShCut)<< cutOutTransformation ) ) ;
441  lvEndPlateSh = new GeoLogVol("EndPlateSh", &(endPlateShCutted3760) , matIron);
442 
443  } else if ( ( ModuleNcp == 36 ) || ( ModuleNcp == 61 ) ) {
444  rotationAngle = - ( 116.4832 - 90. )* Gaudi::Units::deg ; // ATLLEMS_0005 0006
445  shiftCutPlate = ( ( m_dbManager->TILBrmax() - rminb )*Gaudi::Units::cm - 1448.4 * Gaudi::Units::mm);
446 
447  cutOutTransformation =
448  GeoTrf::Translate3D( 0, 0, -heightEndPlate/2. ) *
449  GeoTrf::Translate3D( 0, 0, - (dy2EndPlate - shiftCutPlate + 0.5*dy2EndPlate*(1.- std::cos(rotationAngle*Gaudi::Units::rad))) ) *
450  GeoTrf::RotateX3D( rotationSign * rotationAngle ) ;
451 
452  const GeoShape & endPlateShCutted3661 = (endPlateSh->subtract( (*endPlateShCut)<< cutOutTransformation ) ) ;
453  lvEndPlateSh = new GeoLogVol("EndPlateSh", &(endPlateShCutted3661) , matIron);
454 
455  } else if ( ( ModuleNcp == 35 ) || ( ModuleNcp == 62 ) ) {
456  rotationAngle = - ( 104.0625 - 90.0 )* Gaudi::Units::deg ; // ATLLEMS_0007 0008
457  shiftCutPlate = ( ( m_dbManager->TILBrmax() - rminb )*Gaudi::Units::cm - 1534.6 * Gaudi::Units::mm);
458 
459  cutOutTransformation =
460  GeoTrf::Translate3D( 0, 0, -heightEndPlate/2. ) *
461  GeoTrf::Translate3D( 0, 0, - (dy2EndPlate - shiftCutPlate) ) *
462  GeoTrf::RotateX3D( rotationSign * rotationAngle ) ;
463 
464  const GeoShape & endPlateShCutted3562 = (endPlateSh->subtract( (*endPlateShCut)<< cutOutTransformation ) ) ;
465  lvEndPlateSh = new GeoLogVol("EndPlateSh", &(endPlateShCutted3562) , matIron);
466 
467  } else {
468  (*m_log) << MSG::ERROR <<" TileGeoSectionBuilder::fillSection . Wrong Module in cut-out region. ModuleNcp= "<<ModuleNcp<< endmsg;
469  lvEndPlateSh = new GeoLogVol("EndPlateSh", endPlateSh , matIron);
470  }
471 
472  } else {
473  lvEndPlateSh = new GeoLogVol("EndPlateSh", endPlateSh , matIron);
474  }
475 
476 
477 
478 
479  // const GeoShape & endPlateShFinal = (endPlateSh->subtract( (*CutB)<<TransCutL ) );
480  //subtract((*CutB)<<TransCutL);
481 
482  GeoPhysVol* pvEndPlateSh = new GeoPhysVol(lvEndPlateSh);
483 
484  tfEndPlateSh = new GeoTransform(GeoTrf::Translate3D(
485  specialModuleZShift +
487  (m_dbManager->TILBrmax() - tile_rmax)*Gaudi::Units::cm/2));
488 
489  mother->add(tfEndPlateSh);
490  mother->add(pvEndPlateSh);
491 
492  if (m_log->level()<=MSG::DEBUG)
493  (*m_log) << MSG::DEBUG <<" _fillSection: ext.barrel EndPlateSh Ok "<< endmsg;
494 
495  } else {
496  //Ordinary endplate
497  dy1EndPlate = rminb * tan_delta_phi_2 * Gaudi::Units::cm;
498  dy2EndPlate = tile_rmax * tan_delta_phi_2 * Gaudi::Units::cm;
499  thicknessEndPlate = m_dbManager->TILBdzend1() * Gaudi::Units::cm;
500  heightEndPlate = (tile_rmax-rminb)*Gaudi::Units::cm;
501 
502  GeoTrd* endPlate1 = new GeoTrd(thicknessEndPlate/2,
503  thicknessEndPlate/2,
504  dy1EndPlate,
505  dy2EndPlate,
506  heightEndPlate/2);
507 
508  GeoLogVol* lvEndPlate1 = new GeoLogVol("EndPlate1",endPlate1,matIron);
509  GeoPhysVol* pvEndPlate1 = new GeoPhysVol(lvEndPlate1);
510 
511  //Position air hole
512  if (m_dbManager->TILBflangex() > 0.) {
513  GeoTrd* epHole1 = new GeoTrd (thicknessEndPlate/2,
514  thicknessEndPlate/2,
515  dyEPHole,
516  dyEPHole,
517  heightEPHole/2);
518 
519  GeoLogVol* lvEPHole1 = new GeoLogVol("EPHole1",epHole1,matAir);
520  GeoPhysVol* pvEPHole1 = new GeoPhysVol(lvEPHole1);
521  GeoTransform* tfEPHole1 = new GeoTransform(GeoTrf::Translate3D(0.,0.,
522  (m_dbManager->TILBflangey()-(tile_rmax + rminb)/2)*Gaudi::Units::cm));
523  pvEndPlate1->add(tfEPHole1);
524  pvEndPlate1->add(pvEPHole1);
525  }
526 
527  GeoTransform* tfEndPlate1 = new GeoTransform(GeoTrf::Translate3D(
529  mother->add(tfEndPlate1);
530  mother->add(pvEndPlate1);
531 
532  if (m_log->level()<=MSG::DEBUG)
533  (*m_log) << MSG::DEBUG <<" _fillSection: Ordinary EndPlateSh Ok "<< endmsg;
534  }
535  }
536 
537  //second endplate
538  GeoIntrusivePtr<GeoTransform> tfEndPlate2{nullptr};
539 
540  if (m_dbManager->TILBdzend2() > 0) {
541  //Short endplate Cut-outs
542  double radShift =lenPla;
543  double rminbT=rminb + radShift;
544 
545  dy1EndPlate = rminb * tan_delta_phi_2 * Gaudi::Units::cm;
546  dy2EndPlate = tile_rmax * tan_delta_phi_2 * Gaudi::Units::cm;
547  thicknessEndPlate = m_dbManager->TILBdzend2() * Gaudi::Units::cm;
548  heightEndPlate = (tile_rmax-rminb) * Gaudi::Units::cm;
549 
550 
551  GeoLogVol* lvEndPlate2 = 0;
552  GeoTrd* endPlate2 = new GeoTrd(thicknessEndPlate/2,
553  thicknessEndPlate/2,
554  dy1EndPlate,
555  dy2EndPlate,
556  heightEndPlate/2);
557 
558  tfEndPlate2 = new GeoTransform(GeoTrf::Translate3D(
560 
561  if (sec_number==2 && ((ModuleNcp>=35 && ModuleNcp<=37)||(ModuleNcp>=60 && ModuleNcp<=62)) ) { // Short endplate Cut-outs
562 
563  GeoTrd* endPlate2Cut = new GeoTrd(thicknessEndPlate,
564  thicknessEndPlate,
565  heightEndPlate/2.,
566  heightEndPlate/2.,
567  dy2EndPlate);
568  double rotationAngle ;
569  double shiftCutPlate ;
570  int rotationSign = 1;
571  if (ModuleNcp > 50) rotationSign *= -1;
572  if ( neg ) rotationSign *= -1;
573 
574  if ( ( ModuleNcp == 37 ) || ( ModuleNcp == 60 ) ) {
575  rotationAngle = - ( 115.3125 - 90.0 )* Gaudi::Units::deg ; // ATLLEMS_0011 0012
576  shiftCutPlate = ( ( m_dbManager->TILBrmax() - rminb )*Gaudi::Units::cm - 1364.0 * Gaudi::Units::mm);
577 
578  cutOutTransformation =
579  GeoTrf::Translate3D( 0, 0, -heightEndPlate/2. ) *
580  GeoTrf::Translate3D( 0, 0, - (dy2EndPlate - shiftCutPlate) ) *
581  GeoTrf::RotateX3D( rotationSign * rotationAngle ) ;
582 
583  const GeoShape & endPlate2Cutted3760 = (endPlate2->subtract( (*endPlate2Cut)<< cutOutTransformation ) ) ;
584  lvEndPlate2 = new GeoLogVol("EndPlate2", &(endPlate2Cutted3760) , matIron);
585 
586  } else if ( ( ModuleNcp == 36 ) || ( ModuleNcp == 61 ) ) {
587  rotationAngle = - ( 109.6875 - 90.0 )* Gaudi::Units::deg ; // ATLLEMS_0009 0010
588  shiftCutPlate = ( ( m_dbManager->TILBrmax() - rminb )*Gaudi::Units::cm - 1464.0 * Gaudi::Units::mm);
589 
590  cutOutTransformation =
591  GeoTrf::Translate3D( 0, 0, -heightEndPlate/2. ) *
592  GeoTrf::Translate3D( 0, 0, - (dy2EndPlate - shiftCutPlate) ) *
593  GeoTrf::RotateX3D( rotationSign * rotationAngle ) ;
594 
595  const GeoShape & endPlate2Cutted3661 = (endPlate2->subtract( (*endPlate2Cut)<< cutOutTransformation ) ) ;
596  lvEndPlate2 = new GeoLogVol("EndPlate2", &(endPlate2Cutted3661) , matIron);
597 
598  } else if ( ( ModuleNcp == 35 ) || ( ModuleNcp == 62 ) ) {
599  rotationAngle = - ( 104.0625 - 90.0 )* Gaudi::Units::deg ; // ATLLEMS_0009 0010
600  shiftCutPlate = ( ( m_dbManager->TILBrmax() - rminb )*Gaudi::Units::cm - ( 1915.0 -385.0 )* Gaudi::Units::mm); // girder is subtracted (no drawing)
601 
602  cutOutTransformation =
603  GeoTrf::Translate3D( 0, 0, -heightEndPlate/2. ) *
604  GeoTrf::Translate3D( 0, 0, - (dy2EndPlate - shiftCutPlate) ) *
605  GeoTrf::RotateX3D( rotationSign * rotationAngle ) ;
606 
607  const GeoShape & endPlate2Cutted3562 = (endPlate2->subtract( (*endPlate2Cut)<< cutOutTransformation ) ) ;
608  lvEndPlate2 = new GeoLogVol("EndPlate2", &(endPlate2Cutted3562) , matIron);
609  }
610 
611  // dy1EndPlate = rminbT * tan_delta_phi_2 * Gaudi::Units::cm;
612  // dy2EndPlate = tile_rmax * tan_delta_phi_2 * Gaudi::Units::cm;
613  // thicknessEndPlate = m_dbManager->TILBdzend2() * Gaudi::Units::cm;
614  // heightEndPlate = (tile_rmax - rminbT) * Gaudi::Units::cm;
615 
616  // tfEndPlate2 = new GeoTransform(GeoTrf::Translate3D(
617  // (-m_dbManager->TILBdzend2() + m_dbManager->TILBdzmodul())*Gaudi::Units::cm/2, 0, radShift/2*Gaudi::Units::cm));
618 
619  } else {
620  lvEndPlate2 = new GeoLogVol("EndPlate2",endPlate2,matIron);
621  }
622 
623  GeoPhysVol* pvEndPlate2 = new GeoPhysVol(lvEndPlate2);
624 
625  //Position air hole
626  if (m_dbManager->TILBflangex() > 0) {
627  dyEPHole = m_dbManager->TILBflangex()*Gaudi::Units::cm/2;
628 
629  GeoTrd* epHole2 = new GeoTrd (thicknessEndPlate/2,
630  thicknessEndPlate/2,
631  dyEPHole,
632  dyEPHole,
633  heightEPHole/2);
634 
635  GeoLogVol* lvEPHole2 = new GeoLogVol("EPHole2",epHole2,matAir);
636  GeoPhysVol* pvEPHole2 = new GeoPhysVol(lvEPHole2);
637  GeoTransform* tfEPHole2 = new GeoTransform(GeoTrf::Translate3D(0.,0.,
638  (m_dbManager->TILBflangey()-(tile_rmax + rminbT)/2)*Gaudi::Units::cm));
639  pvEndPlate2->add(tfEPHole2);
640  pvEndPlate2->add(pvEPHole2);
641  }
642 
643  mother->add(tfEndPlate2);
644  mother->add(pvEndPlate2);
645 
646  if (m_log->level()<=MSG::DEBUG)
647  (*m_log) << MSG::DEBUG <<" _fillSection: EndPlate2 Ok "<< endmsg;
648 
649  } // End Plates
650 
651  //---------------------------------------------------Absorber--------------------------------------------------------
652  double heightAbsorber = (m_dbManager->TILBrmax() - m_dbManager->TILBrmin())*Gaudi::Units::cm;
653  double thicknessAbsorber = (m_dbManager->TILBdzmodul() - m_dbManager->TILBdzend1() - m_dbManager->TILBdzend2())*Gaudi::Units::cm;
654  double dy1Absorber = (m_dbManager->TILBrmin()*tan_delta_phi_2 - m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
655  double dy2Absorber = (m_dbManager->TILBrmax()*tan_delta_phi_2 - m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
656 
657  checking("Absorber", true, 3,
658  thicknessAbsorber/2,thicknessAbsorber/2,dy1Absorber,dy2Absorber,heightAbsorber/2);
659 
660  //----------------------------- Absorber -------------------------------------------------------------------
661  double thicknessPeriod =0, thicknessAbsorber1 =0, thicknessAbsorber2 =0, thicknessAbsorber3 =0;
662  double PosAbsor1 =0, PosAbsor2 =0, PosAbsor3 =0;
663  int nA1 =32, nA2 = 0, nA3 =16;
664 
665  GeoTrd *absorber{nullptr}, *absorber1{nullptr}, *absorber3{nullptr};
666  GeoLogVol *lvAbsorber{nullptr}, *lvAbsorber1{nullptr}, *lvAbsorber3{nullptr};
667  GeoIntrusivePtr<GeoPhysVol> pvAbsorber{nullptr}, pvAbsorber1{nullptr}, pvAbsorber3{nullptr};
668  GeoPhysVol *pvTmp_Absorber1{nullptr}, *pvTmp_Absorber3{nullptr};
669 
670  // Perform different actions depending on sections
671  switch (sec_number) {
672  case 2:
673  {
674  //Extended barrel - consists of ordinary periods of type 1 only
675  thicknessPeriod = 2.*(m_dbManager->TILBdzmast() + m_dbManager->TILBdzspac() + 2.*dzglue)*Gaudi::Units::cm;
676 
677  // The period number for middle absorber
678  nA2 = m_dbManager->TILBnperiod() - (nA1+nA3);
679 
680  thicknessAbsorber1 = nA1*thicknessPeriod;
681  PosAbsor1 = thicknessAbsorber/2 - thicknessAbsorber1/2;
682 
683  thicknessAbsorber2 = nA2*thicknessPeriod;
684  PosAbsor2 = thicknessAbsorber/2 - thicknessAbsorber1 - thicknessAbsorber2/2;
685 
686  thicknessAbsorber3 = nA3*thicknessPeriod;
687  PosAbsor3 = thicknessAbsorber/2 - thicknessAbsorber1 - thicknessAbsorber2 - thicknessAbsorber3/2;
688 
689  if (m_log->level()<=MSG::DEBUG)
690  (*m_log) << MSG::DEBUG <<" Number of periods per Module: N= "<<nA1+nA2+nA3
691  << " Middle absorber, numbers of periods = "<<nA2
692  << endmsg;
693 
694  // First Cut-out part
695  absorber1 = new GeoTrd(thicknessAbsorber1/2, thicknessAbsorber1/2,
696  dy1Absorber, dy2Absorber,
697  heightAbsorber/2);
698 
699  lvAbsorber1 = new GeoLogVol("Absorber",absorber1,matIron);
700  pvAbsorber1 = new GeoPhysVol(lvAbsorber1);
701 
702  // absorber without Cut-out, middle part
703  absorber = new GeoTrd(thicknessAbsorber2/2, thicknessAbsorber2/2,
704  dy1Absorber, dy2Absorber,
705  heightAbsorber/2);
706 
707  lvAbsorber = new GeoLogVol("Absorber",absorber,matIron);
708  pvAbsorber = new GeoPhysVol(lvAbsorber);
709 
710  //
711  // Second Cut-out part
712  absorber3 = new GeoTrd(thicknessAbsorber3/2, thicknessAbsorber3/2,
713  dy1Absorber, dy2Absorber,
714  heightAbsorber/2);
715 
716  lvAbsorber3 = new GeoLogVol("Absorber",absorber3,matIron);
717  pvAbsorber3 = new GeoPhysVol(lvAbsorber3);
718  //
719 
720  if (m_log->level()<=MSG::DEBUG)
721  (*m_log) << MSG::DEBUG <<" _fillSection: Ex.Barrel pvAbsorber 1,3 Ok "<< endmsg;
722 
723  break;
724  }
725  default:
726  {
727  absorber = new GeoTrd(thicknessAbsorber/2, thicknessAbsorber/2,
728  dy1Absorber, dy2Absorber,
729  heightAbsorber/2);
730 
731  if (m_dbManager->TILBnperiod() > 1) {
732  lvAbsorber = new GeoLogVol("Absorber",absorber,matIron);
733  } else {
734  // make C10special/Gap/Crack absorber volume from Air, Aluminium will be in period
735  lvAbsorber = new GeoLogVol("Absorber",absorber,matAir);
736  }
737  pvAbsorber = new GeoPhysVol(lvAbsorber);
738 
739  if (m_log->level()<=MSG::DEBUG) {
740  if (m_dbManager->TILBnperiod() > 1) {
741  (*m_log) << MSG::DEBUG <<" _fillSection: default pvAbsorber Ok "<< endmsg;
742  } else {
743  (*m_log) << MSG::DEBUG <<" _fillSection: special pvAbsorber made from Air Ok "<< endmsg;
744  }
745  }
746 
747  break;
748  }
749  }
750  //----- ------ ------- PERIODS ------ ------ ------ PERIODS ----- ------- -------
751  double thicknessAbsorberChild;
752  Variable periodInd;
753 
754  GeoTrd* period = 0;
755  GeoLogVol* lvPeriod = 0;
756  GeoPhysVol* pvPeriod = 0;
757  GeoTransform* tfPeriod = 0;
758  GeoSerialTransformer* stPeriod = 0;
759 
760  GeoTrd* absorberChild = 0;
761  GeoLogVol* lvAbsorberChild = 0;
762  GeoPhysVol* pvAbsorberChild = 0;
763  GeoTransform* tfAbsorberChild = 0;
764 
765  // Perform different actions depending on sections
766  switch (sec_number) {
767  case 1:
768  {
769  //Barrel section
770  //Divide absorber volume on two parts: first filled with
771  //nrOfPeriods-1 ordinary period and second with one special period of type 2
772 
773  //First division
774  thicknessPeriod = 2.*(m_dbManager->TILBdzmast() + m_dbManager->TILBdzspac() + 2.*dzglue)*Gaudi::Units::cm;
775  MLOG(DEBUG) << "BARREL Section -- m_dbManager->TILBdzmast(): " << m_dbManager->TILBdzmast() << ", m_dbManager->TILBdzspac(): " << m_dbManager->TILBdzspac()
776  << ", dzglue: " << dzglue << " ==> thicknessPeriod: " << thicknessPeriod << endmsg;
777 
778  m_barrelPeriodThickness = thicknessPeriod;
780 
781  checking("Period 0", false, 4,
782  thicknessPeriod/2,thicknessPeriod/2,dy1Absorber,dy2Absorber,heightAbsorber/2);
783 
784  period = new GeoTrd(thicknessPeriod/2,
785  thicknessPeriod/2,
786  dy1Absorber,
787  dy2Absorber,
788  heightAbsorber/2);
789 
790  lvPeriod = new GeoLogVol("Period",period,matIron);
791  pvPeriod = new GeoPhysVol(lvPeriod);
792 
793  fillPeriod(pvPeriod,
794  thicknessPeriod*(1./Gaudi::Units::cm),
795  dzglue,
796  tan_delta_phi_2,
797  1); // 1-period type
798 
799 
800  thicknessAbsorberChild = thicknessPeriod*(m_dbManager->TILBnperiod()-1);
801  absorberChild = new GeoTrd(thicknessAbsorberChild/2,
802  thicknessAbsorberChild/2,
803  dy1Absorber,
804  dy2Absorber,
805  heightAbsorber/2);
806  lvAbsorberChild = new GeoLogVol("AbsorberChild",absorberChild,matAir);
807  pvAbsorberChild = new GeoPhysVol(lvAbsorberChild);
808 
809  // Place periods into Absorber Child like G4 replica
810  GENFUNCTION periodPos1 = (thicknessPeriod*(2*periodInd+1)-thicknessAbsorberChild)/2;
811  TRANSFUNCTION xfReplica1 = Pow(GeoTrf::TranslateX3D(1.),periodPos1);
812  if (m_verbose) checktransfunc(thicknessAbsorberChild,thicknessPeriod,m_dbManager->TILBnperiod()-1,
813  (thicknessAbsorberChild - thicknessAbsorber)/2);
814 
815  stPeriod = new GeoSerialTransformer(pvPeriod,
816  &xfReplica1,
817  m_dbManager->TILBnperiod()-1);
818 
819  pvAbsorberChild->add(new GeoSerialIdentifier(0));
820  pvAbsorberChild->add(stPeriod);
821 
822  // Place absorber child
823  tfAbsorberChild = new GeoTransform(GeoTrf::Translate3D((thicknessAbsorberChild - thicknessAbsorber)/2,0.,0.));
824  pvAbsorber->add(tfAbsorberChild);
825  pvAbsorber->add(pvAbsorberChild);
826 
827  //Second division
828  thicknessPeriod = (m_dbManager->TILBdzmast() + 2.*m_dbManager->TILBdzspac() + 2.*dzglue)*Gaudi::Units::cm;
829 
830  checking("Period 1", false, 4,
831  thicknessPeriod/2,thicknessPeriod/2,dy1Absorber,dy2Absorber,heightAbsorber/2);
832 
833  period = new GeoTrd(thicknessPeriod/2,
834  thicknessPeriod/2,
835  dy1Absorber,
836  dy2Absorber,
837  heightAbsorber/2);
838  lvPeriod = new GeoLogVol("Period",period,matIron);
839  pvPeriod = new GeoPhysVol(lvPeriod);
840 
841  fillPeriod(pvPeriod,
842  thicknessPeriod*(1./Gaudi::Units::cm),
843  dzglue,
844  tan_delta_phi_2,
845  2); // 2-period type
846 
847 
848  thicknessAbsorberChild = thicknessPeriod;
849  absorberChild = new GeoTrd(thicknessAbsorberChild/2,
850  thicknessAbsorberChild/2,
851  dy1Absorber,
852  dy2Absorber,
853  heightAbsorber/2);
854  lvAbsorberChild = new GeoLogVol("AbsorberChild",absorberChild,matAir);
855  pvAbsorberChild = new GeoPhysVol(lvAbsorberChild);
856 
857  if (m_verbose) checktransfunc(thicknessAbsorberChild,thicknessPeriod,1,
858  (-thicknessAbsorberChild + thicknessAbsorber)/2);
859 
860  // Place period in the absorber child
861  tfPeriod = new GeoTransform(GeoTrf::Translate3D(0.,0.,0.));
862 
863  pvAbsorberChild->add(new GeoIdentifierTag(m_dbManager->TILBnperiod()-1));
864  pvAbsorberChild->add(tfPeriod);
865  pvAbsorberChild->add(pvPeriod);
866 
867  // Place absorber child
868  tfAbsorberChild = new GeoTransform(GeoTrf::Translate3D((-thicknessAbsorberChild + thicknessAbsorber)/2,0.,0.));
869  pvAbsorber->add(tfAbsorberChild);
870  pvAbsorber->add(pvAbsorberChild);
871 
872  break;
873  }
874  case 2:
875  {
876  //Extended barrel - consists of ordinary periods of type 1 only
877  thicknessPeriod = 2. * (m_dbManager->TILBdzmast() + m_dbManager->TILBdzspac() + 2.*dzglue) * Gaudi::Units::cm;
878  MLOG(DEBUG) << "EXTENDED BARREL Section -- m_dbManager->TILBdzmast(): " << m_dbManager->TILBdzmast() << ", m_dbManager->TILBdzspac(): " << m_dbManager->TILBdzspac()
879  << ", dzglue: " << dzglue << " ==> thicknessPeriod: " << thicknessPeriod << endmsg;
880 
881  checking("Period 2", false, 4,
882  thicknessPeriod/2,thicknessPeriod/2,dy1Absorber,dy2Absorber,heightAbsorber/2);
883 
884  period = new GeoTrd(thicknessPeriod/2,
885  thicknessPeriod/2,
886  dy1Absorber,
887  dy2Absorber,
888  heightAbsorber/2);
889  lvPeriod = new GeoLogVol("Period",period,matIron);
890  pvPeriod = new GeoPhysVol(lvPeriod);
891 
892  m_extendedPeriodThickness = thicknessPeriod;
893 
894  fillPeriod(pvPeriod,
895  thicknessPeriod*(1./Gaudi::Units::cm),
896  dzglue,
897  tan_delta_phi_2,
898  1); // 1-period type
899 
900  // Place periods into Absorber like G4 replica
901  // - first partr of absorber
902  //
903  GENFUNCTION periodPos1 = (thicknessPeriod*(2*periodInd+1)-thicknessAbsorber1)/2;
904  TRANSFUNCTION xfReplica1 = Pow(GeoTrf::TranslateX3D(1.),periodPos1);
905  if (m_verbose) checktransfunc(thicknessAbsorber1,thicknessPeriod,nA1,
906  (-thicknessAbsorber+thicknessAbsorber1)/2.);
907 
908  stPeriod = new GeoSerialTransformer(pvPeriod,&xfReplica1,nA1); //m_dbManager->TILBnperiod());
909 
910  pvAbsorber1->add(new GeoSerialIdentifier(0));
911  pvAbsorber1->add(stPeriod);
912  //
913 
914  if (m_dbManager->BoolCuts()) {
915  if ((ModuleNcp>=35 && ModuleNcp<=37) || (ModuleNcp>=60 && ModuleNcp<=62)) {
916  // Cuting of (-)
917  GeoCutVolAction action1(*CutA, TransCut2);
918  pvAbsorber1->apply(&action1);
919  pvTmp_Absorber1 = action1.getPV();
920  //
921  if (m_log->level()<=MSG::DEBUG)
922  (*m_log) << MSG::DEBUG <<" _fillSection: CutA Ok "<< endmsg;
923  } // end special modules
924  } // end if, BoolCuts()
925  if (m_log->level()<=MSG::DEBUG)
926  (*m_log) << MSG::DEBUG <<" _fillSection: Absorber1 Ok "<< endmsg;
927 
928  // middle partr of absorber
929  GENFUNCTION periodPos2 = (thicknessPeriod*(2*periodInd+1)-thicknessAbsorber2)/2;
930  TRANSFUNCTION xfReplica2 = Pow(GeoTrf::TranslateX3D(1.),periodPos2);
931  if (m_verbose) checktransfunc(thicknessAbsorber2,thicknessPeriod,nA2,
932  (-thicknessAbsorber+thicknessAbsorber2)/2.+thicknessAbsorber1);
933 
934  stPeriod = new GeoSerialTransformer(pvPeriod,&xfReplica2,nA2); //m_dbManager->TILBnperiod());
935 
936  pvAbsorber->add(new GeoSerialIdentifier(nA1));
937  pvAbsorber->add(stPeriod);
938 
939  if (m_log->level()<=MSG::DEBUG)
940  (*m_log) << MSG::DEBUG <<" _fillSection: pvAbsorber Ok "<< endmsg;
941 
942  // second partr of absorber
943  //
944  GENFUNCTION periodPos3 = (thicknessPeriod*(2*periodInd+1)-thicknessAbsorber3)/2;
945  TRANSFUNCTION xfReplica3 = Pow(GeoTrf::TranslateX3D(1.),periodPos3);
946  if (m_verbose) checktransfunc(thicknessAbsorber3,thicknessPeriod,nA3,
947  (-thicknessAbsorber+thicknessAbsorber3)/2.+thicknessAbsorber2+thicknessAbsorber1);
948 
949  stPeriod = new GeoSerialTransformer(pvPeriod,&xfReplica3,nA3); //m_dbManager->TILBnperiod());
950 
951  pvAbsorber3->add(new GeoSerialIdentifier(nA1+nA2));
952  pvAbsorber3->add(stPeriod);
953 
954  if (m_dbManager->BoolCuts()) {
955  if (ModuleNcp>=60 && ModuleNcp<=62) {
956  // Cuting of pvEBarrelModuleMotherPos (Left)
957  //
958  GeoCutVolAction action2(*CutB, TransCutL);
959  pvAbsorber3->apply(&action2);
960  pvTmp_Absorber3 = action2.getPV();
961  if (m_log->level()<=MSG::DEBUG)
962  (*m_log) << MSG::DEBUG <<" _fillSection: CutB L Ok "<< endmsg;
963 
964  } else if (ModuleNcp>=35 && ModuleNcp<=37) {
965  // Cuting of pvEBarrelModuleMotherPos (Right)
966  //
967  GeoCutVolAction action3(*CutB, TransCutR);
968  pvAbsorber3->apply(&action3);
969  pvTmp_Absorber3 = action3.getPV();
970  if (m_log->level()<=MSG::DEBUG)
971  (*m_log) << MSG::DEBUG <<" _fillSection: CutB R Ok "<< endmsg;
972  }
973  } // end if, BoolCuts()
974  if (m_log->level()<=MSG::DEBUG) {
975  (*m_log) << MSG::DEBUG <<" _fillSection: Absorber3 Ok "<< endmsg;
976  }
977 
978  break;
979  }
980  case 3:
981  {
982  //Plug Section 1 - consists of ordinary periods of type 3
983  // ps plug1 special module
984  if ((m_dbManager->TILBsection() == 7)||(m_dbManager->TILBsection() == 8)) {
985  //Divide absorber volume on two parts: first filled with
986  //nrOfPeriods-1 ordinary period of type 1 and second with one special period of type 4
987 
988  //First division
989  thicknessPeriod = 2.*(m_dbManager->TILBdzmast() + m_dbManager->TILBdzspac() + 2.*dzglue)*Gaudi::Units::cm;
990  MLOG(DEBUG) << "PLUG Section 1 -- m_dbManager->TILBdzmast(): " << m_dbManager->TILBdzmast() << ", m_dbManager->TILBdzspac(): " << m_dbManager->TILBdzspac()
991  << ", dzglue: " << dzglue << " ==> thicknessPeriod: " << thicknessPeriod << endmsg;
992 
993  checking("Period 3 (ITC1 special)", true, 4,
994  thicknessPeriod/2,thicknessPeriod/2,dy1Absorber,dy2Absorber,heightAbsorber/2);
995 
996  period = new GeoTrd(thicknessPeriod/2,
997  thicknessPeriod/2,
998  dy1Absorber,
999  dy2Absorber,
1000  heightAbsorber/2);
1001  lvPeriod = new GeoLogVol("Period",period,matIron);
1002  pvPeriod = new GeoPhysVol(lvPeriod);
1003 
1004  fillPeriod(pvPeriod,
1005  thicknessPeriod*(1./Gaudi::Units::cm),
1006  dzglue,
1007  tan_delta_phi_2,
1008  1); // 1-period type
1009 
1010  thicknessAbsorberChild = thicknessPeriod*(m_dbManager->TILBnperiod()-1);
1011 
1012  absorberChild = new GeoTrd(thicknessAbsorberChild/2,
1013  thicknessAbsorberChild/2,
1014  dy1Absorber,
1015  dy2Absorber,
1016  heightAbsorber/2);
1017  lvAbsorberChild = new GeoLogVol("AbsorberChild",absorberChild,matAir);
1018  pvAbsorberChild = new GeoPhysVol(lvAbsorberChild);
1019 
1020  // Place periods into Absorber Child like G4 replica
1021  GENFUNCTION periodPosITC1sp = (thicknessPeriod*(2*periodInd+1)-thicknessAbsorberChild)/2;
1022  TRANSFUNCTION xfReplicaITC1sp = Pow(GeoTrf::TranslateX3D(1.),periodPosITC1sp);
1023  if (m_verbose) checktransfunc(thicknessAbsorberChild,thicknessPeriod,m_dbManager->TILBnperiod()-1,
1024  (thicknessAbsorberChild - thicknessAbsorber)/2);
1025 
1026  stPeriod = new GeoSerialTransformer(pvPeriod,
1027  &xfReplicaITC1sp,
1028  m_dbManager->TILBnperiod()-1);
1029 
1030  pvAbsorberChild->add(new GeoSerialIdentifier(0));
1031  pvAbsorberChild->add(stPeriod);
1032 
1033  // Place absorber child
1034  tfAbsorberChild = new GeoTransform(GeoTrf::Translate3D((thicknessAbsorberChild - thicknessAbsorber)/2,0.,0.));
1035  pvAbsorber->add(tfAbsorberChild);
1036  pvAbsorber->add(pvAbsorberChild);
1037  //
1038  //Second division
1039  //
1040  thicknessPeriod = m_dbManager->TILBdzspac()*Gaudi::Units::cm;
1041 
1042  checking("Period 5 (ITC1 special)", true, 4,
1043  thicknessPeriod/2,thicknessPeriod/2,dy1Absorber,dy2Absorber,heightAbsorber/2);
1044 
1045  period = new GeoTrd(thicknessPeriod/2,
1046  thicknessPeriod/2,
1047  dy1Absorber,
1048  dy2Absorber,
1049  heightAbsorber/2);
1050  lvPeriod = new GeoLogVol("Period",period,matIron);
1051  pvPeriod = new GeoPhysVol(lvPeriod);
1052 
1053  fillPeriod(pvPeriod,
1054  thicknessPeriod*(1./Gaudi::Units::cm),
1055  dzglue,
1056  tan_delta_phi_2,
1057  4); // 4-period type
1058 
1059  thicknessAbsorberChild = thicknessPeriod;
1060  absorberChild = new GeoTrd(thicknessAbsorberChild/2,
1061  thicknessAbsorberChild/2,
1062  dy1Absorber,
1063  dy2Absorber,
1064  heightAbsorber/2);
1065  lvAbsorberChild = new GeoLogVol("AbsorberChild",absorberChild,matAir);
1066  pvAbsorberChild = new GeoPhysVol(lvAbsorberChild);
1067 
1068  if (m_verbose) checktransfunc(thicknessAbsorberChild,thicknessPeriod,1,
1069  (-thicknessAbsorberChild + thicknessAbsorber)/2);
1070 
1071  // Place period in the absorber child
1072  tfPeriod = new GeoTransform(GeoTrf::Translate3D(0.,0.,0.));
1073  pvAbsorberChild->add(new GeoIdentifierTag(m_dbManager->TILBnperiod()-1));
1074  pvAbsorberChild->add(tfPeriod);
1075  pvAbsorberChild->add(pvPeriod);
1076 
1077  // Place absorber child
1078  tfAbsorberChild = new GeoTransform(GeoTrf::Translate3D((-thicknessAbsorberChild + thicknessAbsorber)/2,0.,0.));
1079  pvAbsorber->add(tfAbsorberChild);
1080  pvAbsorber->add(pvAbsorberChild);
1081 
1082  if (m_log->level()<=MSG::DEBUG)
1083  (*m_log) << MSG::DEBUG <<" _fillSection: Absorber (ITC plug special) Ok "<< endmsg;
1084 
1085  } else {
1086  thicknessPeriod = 2.*(m_dbManager->TILBdzmast() + m_dbManager->TILBdzspac() + 2.*dzglue)*Gaudi::Units::cm;
1087 
1088  checking("Period 3", true, 4,
1089  thicknessPeriod/2,thicknessPeriod/2,dy1Absorber,dy2Absorber,heightAbsorber/2);
1090 
1091  period = new GeoTrd(thicknessPeriod/2,
1092  thicknessPeriod/2,
1093  dy1Absorber,
1094  dy2Absorber,
1095  heightAbsorber/2);
1096  lvPeriod = new GeoLogVol("Period",period,matIron);
1097  pvPeriod = new GeoPhysVol(lvPeriod);
1098 
1099  fillPeriod(pvPeriod,
1100  thicknessPeriod*(1./Gaudi::Units::cm),
1101  dzglue,
1102  tan_delta_phi_2,
1103  3); // 3-period type
1104 
1105  // Place periods into Absorber like G4 replica
1106  GENFUNCTION periodPos3 = (thicknessPeriod*(2*periodInd+1)-thicknessAbsorber)/2;
1107  TRANSFUNCTION xfReplica3 = Pow(GeoTrf::TranslateX3D(1.),periodPos3);
1108  if (m_verbose) checktransfunc(thicknessAbsorber,thicknessPeriod,m_dbManager->TILBnperiod(),0.0);
1109 
1110  //ps if ( (m_dbManager->TILBsection()==7 || m_dbManager->TILBsection()==8) && m_dbManager->SCNTitem()==302)
1111  // if ( m_dbManager->TILBsection()==7 && m_dbManager->SCNTitem() == 302)
1112  // NbPeriod = m_dbManager->TILBnperiod() - 1;
1113  // else
1114  NbPeriod = m_dbManager->TILBnperiod();
1115 
1116  if (m_log->level()<=MSG::DEBUG)
1117  (*m_log) << MSG::DEBUG <<" SCNTitem= "<<m_dbManager->SCNTitem()<<" NbPeriod= "<<NbPeriod<< endmsg;
1118  stPeriod = new GeoSerialTransformer(pvPeriod,
1119  &xfReplica3,
1120  NbPeriod);//sbb
1121 
1122  pvAbsorber->add(new GeoSerialIdentifier(0));
1123  pvAbsorber->add(stPeriod);
1124  if (m_log->level()<=MSG::DEBUG)
1125  (*m_log) << MSG::DEBUG <<" _fillSection: Absorber (case 3) Ok "<< endmsg;
1126  }
1127  break;
1128  }
1129  case 4:
1130  {
1131  //Plug Section 2
1132  //Divide absorber volume on two parts: first filled with
1133  //nrOfPeriods-1 ordinary period of type 1 and second with one special period of type 4
1134 
1135  //First division
1136  thicknessPeriod = 2.*(m_dbManager->TILBdzmast() + m_dbManager->TILBdzspac() + 2.*dzglue)*Gaudi::Units::cm;
1137  MLOG(DEBUG) << "PLUG Section 2 -- m_dbManager->TILBdzmast(): " << m_dbManager->TILBdzmast() << ", m_dbManager->TILBdzspac(): " << m_dbManager->TILBdzspac()
1138  << ", dzglue: " << dzglue << " ==> thicknessPeriod: " << thicknessPeriod << endmsg;
1139 
1140  checking("Period 4", true, 4,
1141  thicknessPeriod/2,thicknessPeriod/2,dy1Absorber,dy2Absorber,heightAbsorber/2);
1142 
1143  period = new GeoTrd(thicknessPeriod/2,
1144  thicknessPeriod/2,
1145  dy1Absorber,
1146  dy2Absorber,
1147  heightAbsorber/2);
1148  lvPeriod = new GeoLogVol("Period",period,matIron);
1149  pvPeriod = new GeoPhysVol(lvPeriod);
1150 
1151  fillPeriod(pvPeriod,
1152  thicknessPeriod*(1./Gaudi::Units::cm),
1153  dzglue,
1154  tan_delta_phi_2,
1155  1); // 1-period type
1156 
1157 
1158  thicknessAbsorberChild = thicknessPeriod*(m_dbManager->TILBnperiod()-1);
1159  absorberChild = new GeoTrd(thicknessAbsorberChild/2,
1160  thicknessAbsorberChild/2,
1161  dy1Absorber,
1162  dy2Absorber,
1163  heightAbsorber/2);
1164  lvAbsorberChild = new GeoLogVol("AbsorberChild",absorberChild,matAir);
1165  pvAbsorberChild = new GeoPhysVol(lvAbsorberChild);
1166 
1167  // Place periods into Absorber Child like G4 replica
1168  GENFUNCTION periodPos1 = (thicknessPeriod*(2*periodInd+1)-thicknessAbsorberChild)/2;
1169  TRANSFUNCTION xfReplica1 = Pow(GeoTrf::TranslateX3D(1.),periodPos1);
1170  if (m_verbose) checktransfunc(thicknessAbsorberChild,thicknessPeriod,m_dbManager->TILBnperiod()-1,
1171  (thicknessAbsorberChild - thicknessAbsorber)/2);
1172 
1173  stPeriod = new GeoSerialTransformer(pvPeriod,
1174  &xfReplica1,
1175  m_dbManager->TILBnperiod()-1);
1176 
1177  pvAbsorberChild->add(new GeoSerialIdentifier(0));
1178  pvAbsorberChild->add(stPeriod);
1179 
1180  // Place absorber child
1181  tfAbsorberChild = new GeoTransform(GeoTrf::Translate3D((thicknessAbsorberChild - thicknessAbsorber)/2,0.,0.));
1182  pvAbsorber->add(tfAbsorberChild);
1183  pvAbsorber->add(pvAbsorberChild);
1184 
1185  //Second division
1186  thicknessPeriod = m_dbManager->TILBdzspac()*Gaudi::Units::cm;
1187 
1188  checking("Period 5", true, 4,
1189  thicknessPeriod/2,thicknessPeriod/2,dy1Absorber,dy2Absorber,heightAbsorber/2);
1190 
1191  period = new GeoTrd(thicknessPeriod/2,
1192  thicknessPeriod/2,
1193  dy1Absorber,
1194  dy2Absorber,
1195  heightAbsorber/2);
1196  lvPeriod = new GeoLogVol("Period",period,matIron);
1197  pvPeriod = new GeoPhysVol(lvPeriod);
1198 
1199  fillPeriod(pvPeriod,
1200  thicknessPeriod*(1./Gaudi::Units::cm),
1201  dzglue,
1202  tan_delta_phi_2,
1203  4); // 4-period type
1204 
1205  thicknessAbsorberChild = thicknessPeriod;
1206  absorberChild = new GeoTrd(thicknessAbsorberChild/2,
1207  thicknessAbsorberChild/2,
1208  dy1Absorber,
1209  dy2Absorber,
1210  heightAbsorber/2);
1211  lvAbsorberChild = new GeoLogVol("AbsorberChild",absorberChild,matAir);
1212  pvAbsorberChild = new GeoPhysVol(lvAbsorberChild);
1213 
1214  if (m_verbose) checktransfunc(thicknessAbsorberChild,thicknessPeriod,1,
1215  (-thicknessAbsorberChild + thicknessAbsorber)/2);
1216 
1217  // Place period in the absorber child
1218  tfPeriod = new GeoTransform(GeoTrf::Translate3D(0.,0.,0.));
1219  pvAbsorberChild->add(new GeoIdentifierTag(m_dbManager->TILBnperiod()-1));
1220  pvAbsorberChild->add(tfPeriod);
1221  pvAbsorberChild->add(pvPeriod);
1222 
1223  // Place absorber child
1224  tfAbsorberChild = new GeoTransform(GeoTrf::Translate3D((-thicknessAbsorberChild + thicknessAbsorber)/2,0.,0.));
1225  pvAbsorber->add(tfAbsorberChild);
1226  pvAbsorber->add(pvAbsorberChild);
1227 
1228  if (m_log->level()<=MSG::DEBUG)
1229  (*m_log) << MSG::DEBUG <<" _fillSection: Absorber (case 4) Ok "<< endmsg;
1230  break;
1231  }
1232  default:
1233  {
1234  // C10_missing/Gap/Crack 5,6,14,15,16
1235 
1236  if ((m_dbManager->TILBsection()==5)||(m_dbManager->TILBsection()==6)) { // Gap/Crack
1238 
1239  } else if ((m_dbManager->TILBsection()==14) || (m_dbManager->TILBsection()==15) || (m_dbManager->TILBsection()==16)) {
1241 
1242  } else {
1243  (*m_log) << MSG::ERROR << "TileGeoSectionBuilder::fillSection: Unexpected section = "
1244  << m_dbManager->TILBsection() << " for Gap/Crack" << endmsg;
1245  return;
1246  }
1247 
1248  thicknessPeriod = thicknessAbsorber; // the same as absorber, but made from Aluminium
1249  MLOG(DEBUG) << "DEFAULT Section -- thicknessAbsorber: " << thicknessAbsorber << " ==> thicknessPeriod: " << thicknessPeriod << endmsg;
1250 
1251  checking("Period 6", true, 4,
1252  thicknessPeriod/2,thicknessPeriod/2,dy1Absorber,dy2Absorber,heightAbsorber/2);
1253 
1254  double dy1Period = m_dbManager->TILBflangex()/2.*Gaudi::Units::cm; // correct size from the drawings
1255  double dy2Period = m_dbManager->TILBflangey()/2.*Gaudi::Units::cm; // correct size from the drawings
1256  if (dy1Period <= 0.0 || dy2Period <= 0.0 || dy1Period > dy1Absorber || dy2Period > dy2Absorber || dy1Period >= dy2Period ) {
1257  dy1Period = dy1Absorber;
1258  dy2Period = dy2Absorber;
1259  }
1260 
1261  period = new GeoTrd(thicknessPeriod/2,
1262  thicknessPeriod/2,
1263  dy1Period,
1264  dy2Period,
1265  heightAbsorber/2);
1266  if (!matAluminium) matAluminium = m_theMaterialManager->getMaterial("std::Aluminium");
1267  lvPeriod = new GeoLogVol("Period",period,matAluminium); // note - aluminium period inside air absorber here
1268  pvPeriod = new GeoPhysVol(lvPeriod);
1269 
1270  fillPeriod(pvPeriod,
1271  thicknessPeriod*(1./Gaudi::Units::cm),
1272  dzglue,
1273  tan_delta_phi_2,
1274  5, period);
1275 
1276  if (m_verbose) checktransfunc(thicknessAbsorber,thicknessPeriod,1,0.0);
1277 
1278  // Place period in the absorber
1279  tfPeriod = new GeoTransform(GeoTrf::Translate3D(0.,0.,0.));
1280  pvAbsorber->add(new GeoIdentifierTag(0));
1281  pvAbsorber->add(tfPeriod);
1282  pvAbsorber->add(pvPeriod);
1283 
1284  if (m_log->level()<=MSG::DEBUG)
1285  (*m_log) << MSG::DEBUG <<" _fillSection: Absorber (case default) Ok "<< endmsg;
1286  break;
1287  }
1288  }
1289 
1290  // Place absorber in the module mother
1291  GeoTransform *tfAbsorber{nullptr}, *tfAbsorber1{nullptr}, *tfAbsorber3{nullptr};
1292 
1293  double dXAbsorber = (m_dbManager->TILBdzend1() - m_dbManager->TILBdzend2());
1294  double dZAbsorber = (m_dbManager->TILBrmax() - tile_rmax);
1295 
1296  if (sec_number==3) {
1297  // ps specialModuleZShift
1298  tfAbsorber = new GeoTransform(GeoTrf::Translate3D( specialModuleZShift + dXAbsorber*Gaudi::Units::cm/2, 0., dZAbsorber*Gaudi::Units::cm/2));
1299  mother->add(tfAbsorber);
1300  mother->add(pvAbsorber);
1301 
1302  } else if (sec_number==2) {
1303  if (m_log->level()<=MSG::DEBUG)
1304  (*m_log) << MSG::DEBUG << " _fillsection Ex.barrel in "<< endmsg;
1305 
1306  tfAbsorber1 = new GeoTransform(GeoTrf::Translate3D(dXAbsorber*Gaudi::Units::cm/2 - PosAbsor1, 0.,
1307  (dZAbsorber + m_dbManager->TILBrmin() - rminb)*Gaudi::Units::cm/2));
1308  mother->add(tfAbsorber1);
1309  if (m_dbManager->BoolCuts() && ((ModuleNcp>=35 && ModuleNcp<=37) || (ModuleNcp>=60 && ModuleNcp<=62)) ) {
1310  mother->add(pvTmp_Absorber1);
1311  } else {
1312  mother->add(pvAbsorber1);
1313  }
1314 
1315  if (m_log->level()<=MSG::DEBUG)
1316  (*m_log) << MSG::DEBUG << " _fillsection ext.barrel pvAbsorber1 Ok"<< endmsg;
1317 
1318  tfAbsorber = new GeoTransform(GeoTrf::Translate3D(dXAbsorber*Gaudi::Units::cm/2 - PosAbsor2, 0.,
1319  (dZAbsorber + m_dbManager->TILBrmin() - rminb)*Gaudi::Units::cm/2));
1320  mother->add(tfAbsorber);
1321  mother->add(pvAbsorber);
1322 
1323  if (m_log->level()<=MSG::DEBUG)
1324  (*m_log) << MSG::DEBUG << " _fillsection ext.barrel pvAbsorber Ok"<< endmsg;
1325 
1326  tfAbsorber3 = new GeoTransform(GeoTrf::Translate3D(dXAbsorber*Gaudi::Units::cm/2 - PosAbsor3, 0.,
1327  (dZAbsorber + m_dbManager->TILBrmin() - rminb)*Gaudi::Units::cm/2));
1328  mother->add(tfAbsorber3);
1329  if (m_dbManager->BoolCuts() && ((ModuleNcp>=35 && ModuleNcp<=37) || (ModuleNcp>=60 && ModuleNcp<=62)) ) {
1330  mother->add(pvTmp_Absorber3);
1331  } else {
1332  mother->add(pvAbsorber3);
1333  }
1334 
1335  if (m_log->level()<=MSG::DEBUG)
1336  (*m_log) << MSG::DEBUG << " _fillsection ext.barrel pvAbsorber3 Ok"<< endmsg;
1337 
1338  } else {
1339  tfAbsorber = new GeoTransform(GeoTrf::Translate3D(dXAbsorber*Gaudi::Units::cm/2, 0.,
1340  (dZAbsorber + m_dbManager->TILBrmin() - rminb)*Gaudi::Units::cm/2));
1341  mother->add(tfAbsorber);
1342  mother->add(pvAbsorber);
1343  if (m_log->level()<=MSG::DEBUG)
1344  (*m_log) << MSG::DEBUG << " _fillsection other pvAbsorber Ok"<< endmsg;
1345  }
1346 
1347 
1348 }
1349 
1350 
1351 void TileGeoSectionBuilder::fillGirder(GeoPhysVol*& mother,
1352  double tile_rmax,
1353  double tilb_rmax,
1354  double tan_delta_phi_2,
1355  double thickness)
1356 {
1357  // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
1358  // Obtain required materials - Iron, Aluminium and electronic boards
1359 
1360  const GeoMaterial* matIron = (m_switches.steel) ? m_theMaterialManager->getMaterial("tile::Steel")
1361  : m_theMaterialManager->getMaterial("std::Iron");
1362  const GeoMaterial* matAluminium = m_theMaterialManager->getMaterial("std::Aluminium");
1363  const GeoMaterial* matElBoard = m_theMaterialManager->getMaterial("tile::SiO2CondEpox");
1364 
1365  // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
1366 
1367  GeoTrd* girderElement = 0;
1368  GeoLogVol* lvGirderElement = 0;
1369  GeoPhysVol* pvGirderElement = 0;
1370  GeoTransform* tfGirderElement = 0;
1371 
1372  int CurrentGird = 1;
1373  int j;
1374 
1375  //if (m_dbManager->TILBsection()==8)
1376  // CurrentGird = 801; //Prototype module
1377  // ps commented out old geometry
1378 
1379  for (j = CurrentGird; j < (CurrentGird + m_dbManager->TILBngirder()); j++) {
1381  double elementRC = m_dbManager->TIGRrc();
1382  double elementSizeInR = m_dbManager->TIGRdr();
1383  double elementSizeInY = m_dbManager->TIGRdw();
1384  double elementOffsetInY = m_dbManager->TIGRoff();
1385 
1386  double dy1GirderElement, dy2GirderElement;
1387  if (elementSizeInY >0) {
1388  dy1GirderElement = elementSizeInY/2;
1389  dy2GirderElement = elementSizeInY/2;
1390  } else {
1391  dy1GirderElement = (elementRC - elementSizeInR/2) * tan_delta_phi_2;
1392  dy2GirderElement = (elementRC + elementSizeInR/2) * tan_delta_phi_2;
1393  }
1394 
1395  girderElement = new GeoTrd(thickness/2*Gaudi::Units::cm,
1396  thickness/2*Gaudi::Units::cm,
1397  dy1GirderElement*Gaudi::Units::cm,
1398  dy2GirderElement*Gaudi::Units::cm,
1399  elementSizeInR/2*Gaudi::Units::cm);
1400 
1401  switch(m_dbManager->TIGRmaterial()) {
1402  case 1: //Iron
1403  {
1404  lvGirderElement = new GeoLogVol("GirderIron",girderElement,matIron);
1405  break;
1406  }
1407  case 2: //Aluminium
1408  {
1409  lvGirderElement = new GeoLogVol("GirderAluminium",girderElement,matAluminium);
1410  break;
1411  }
1412  case 3: //Electronics
1413  {
1414  lvGirderElement = new GeoLogVol("GirderElectronics",girderElement,matElBoard);
1415  break;
1416  }
1417  default:
1418  {
1419  (*m_log) << MSG::ERROR << "TileGeoSectionBuilder::FillGirder: unknown material = "
1420  << m_dbManager->TIGRmaterial() << endmsg;
1421  return;
1422  }
1423  }
1424 
1425  pvGirderElement = new GeoPhysVol(lvGirderElement);
1426  tfGirderElement = new GeoTransform(GeoTrf::Translate3D(0.,
1427  elementOffsetInY*Gaudi::Units::cm,
1428  (elementRC-(tilb_rmax + tile_rmax)/2)*Gaudi::Units::cm));
1429  mother->add(tfGirderElement);
1430  mother->add(pvGirderElement);
1431  }
1432 }
1433 
1434 
1435 void TileGeoSectionBuilder::fillFinger(GeoPhysVol*& mother,
1436  int sec_number,
1437  double tile_rmax,
1438  double tilb_rmax,
1439  double /* delta_phi */,
1440  bool testbeam,
1441  int ModuleNcp,
1442  double corrected_dz)
1443 {
1444  bool boolNeg = false;
1445 
1446  if (ModuleNcp > 99) {
1447  ModuleNcp = ModuleNcp/100;
1448  boolNeg = true;
1449  }
1450 
1451  // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
1452  // Obtain required materials - Iron, Aluminium and electronic boards
1453 
1454  const GeoMaterial* matIron = (m_switches.steel) ? m_theMaterialManager->getMaterial("tile::Steel")
1455  : m_theMaterialManager->getMaterial("std::Iron");
1456  const GeoMaterial* matAluminium = m_theMaterialManager->getMaterial("std::Aluminium");
1457  const GeoMaterial* matElBoard = m_theMaterialManager->getMaterial("tile::SiO2CondEpox");
1458 
1459  // Get required elements
1460  //const GeoElement* oxygen = m_theMaterialManager->getElement("Oxygen");
1461  //const GeoElement* hydrogen = m_theMaterialManager->getElement("Hydrogen");
1462  const GeoElement* copper = m_theMaterialManager->getElement("Copper");
1463 
1464  // Get some standard materials
1465  const GeoMaterial *air = m_theMaterialManager->getMaterial("std::Air");
1466  const GeoMaterial *iron = m_theMaterialManager->getMaterial("std::Iron");
1467  const GeoMaterial *shieldSteel = m_theMaterialManager->getMaterial("shield::ShieldSteel");
1468  const GeoMaterial *matRubber = m_theMaterialManager->getMaterial("std::Rubber")!=nullptr
1469  ? m_theMaterialManager->getMaterial("std::Rubber")
1470  : m_theMaterialManager->getMaterial("sct::Rubber");
1471 
1472  // m_matLArServices
1473  if (!m_matLArServices) {
1474  m_matLArServices = new GeoMaterial("LArServices", 2.5*GeoModelKernelUnits::gram/Gaudi::Units::cm3);
1475  m_matLArServices->add(shieldSteel, 0.20);
1476  m_matLArServices->add(copper, 0.60);
1477  m_matLArServices->add(matRubber, 0.10);
1478  m_matLArServices->add(air, 0.10);
1479  m_matLArServices->lock();
1480  }
1481 
1482  // m_matIronHalfDens
1483  if (!m_matIronHalfDens) {
1484  m_matIronHalfDens = new GeoMaterial("LArIronBox", 4.5*GeoModelKernelUnits::gram/Gaudi::Units::cm3);
1485  m_matIronHalfDens->add(shieldSteel, 0.80);
1486  m_matIronHalfDens->add(matRubber, 0.10);
1487  m_matIronHalfDens->add(copper, 0.10);
1488  m_matIronHalfDens->lock();
1489  }
1490 
1491  // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
1492 
1493  GeoTrd* fingerElementTrd = 0;
1494  GeoTrap* fingerElementTrap = 0;
1495 
1496  GeoBox *fingerCablesL{nullptr}, *fingerCablesR{nullptr};
1497  GeoPhysVol *pvFingerElement = 0, *pvFingerCablesL{nullptr}, *pvFingerCablesR{nullptr};
1498  GeoLogVol *lvFingerElement = 0, *lvFingerCablesL{nullptr}, *lvFingerCablesR{nullptr};
1499  GeoTransform* tfFingerElement = 0, *tfFingerCables{nullptr};
1500 
1501  GeoTransform* ZrotateMod = 0;
1502  GeoTransform* yrotateMod = 0;
1503  GeoTransform* zrotateMod = 0;
1504 
1505  const GeoMaterial *currentMaterial{nullptr}, *leftMaterial{nullptr}, *rightMaterial{nullptr};
1506  std::string currentName, leftName, rightName;
1507 
1508  int CurrentTicg = 100*sec_number + 1;
1509  int j;
1510  double AirVolumeShift = 0.0;
1511  double AirVolumeSize = corrected_dz;
1512 
1513  for (j = CurrentTicg; j < (CurrentTicg + m_dbManager->TIFGnelem()); j++) {
1515  double elementRC = m_dbManager->TICGrc();
1516  double elementHeight = m_dbManager->TICGdr();
1517  double elementDy1 = m_dbManager->TICGdx1();
1518  double elementDy2 = m_dbManager->TICGdx2();
1519  double elementOffset = m_dbManager->TICGoff();
1520  double elementDz = m_dbManager->TICGdz();
1521  double elementZPozition = m_dbManager->TICGzc();
1522 
1523  if (corrected_dz > 0.) {
1524  if (j-CurrentTicg==0) { // take air volume size from first element
1525  AirVolumeShift = (elementDz-corrected_dz)/2 - elementZPozition;
1526  AirVolumeSize = elementDz;
1527  if (m_log->level()<=MSG::DEBUG) {
1528  (*m_log) << MSG::DEBUG << "TileFinger: OldAirVolumeCenter ="<<elementZPozition << endmsg;
1529  (*m_log) << MSG::DEBUG << "TileFinger: NewAirVolumeCenter ="<<elementZPozition+AirVolumeShift << endmsg;
1530  (*m_log) << MSG::DEBUG << "TileFinger: AirVolumeShift ="<< AirVolumeShift << endmsg;
1531  (*m_log) << MSG::DEBUG << "TileFinger: AirVolumeSize ="<< AirVolumeSize << endmsg;
1532  }
1533  }
1534 
1535  if (elementZPozition*2-AirVolumeSize<-0.01) { // compare with zero with 0.1 Gaudi::Units::mm precision
1536  elementZPozition += AirVolumeShift; // shift all volumes keeping size
1537 
1538  } else { // resize finger cover with shims attached to it
1539  if (m_log->level()<=MSG::DEBUG)
1540  (*m_log) << MSG::DEBUG << "TileFinger: OldCoverThickness ="<<elementDz << endmsg;
1541  elementDz = corrected_dz - AirVolumeSize;
1542  if (m_log->level()<=MSG::DEBUG) {
1543  (*m_log) << MSG::DEBUG << "TileFinger: NewCoverThickness ="<<elementDz << endmsg;
1544  (*m_log) << MSG::DEBUG << "TileFinger: OldCoverCenter ="<<elementZPozition << endmsg;
1545  }
1546  elementZPozition = (corrected_dz-elementDz)/2;
1547  if (m_log->level()<=MSG::DEBUG)
1548  (*m_log) << MSG::DEBUG << "TileFinger: NewCoverCenter ="<<elementZPozition << endmsg;
1549  }
1550  }
1551 
1552  switch(m_dbManager->TICGmaterial()) {
1553  case 1:
1554  {
1555  currentMaterial = matIron;
1556  currentName = "FingerIron";
1557  break;
1558  }
1559  case 2:
1560  {
1561  currentMaterial = matAluminium;
1562  currentName = "FingerAluminum";
1563  break;
1564  }
1565  case 3:
1566  {
1567  currentMaterial = matElBoard;
1568  currentName = "FingerElectronics";
1569  break;
1570  }
1571  default:
1572  {
1573  (*m_log) << MSG::ERROR << "TileGeoSectionBuilder::fillFinger: unexpected material = "
1574  << m_dbManager->TICGmaterial() << " for finger element" << endmsg;
1575  return;
1576  }
1577  }
1578 
1579  if (m_dbManager->TICGshape()==1) {
1580  fingerElementTrd = new GeoTrd(elementDz/2*Gaudi::Units::cm,
1581  elementDz/2*Gaudi::Units::cm,
1582  elementDy1/2*Gaudi::Units::cm,
1583  elementDy2/2*Gaudi::Units::cm,
1584  elementHeight/2*Gaudi::Units::cm);
1585  lvFingerElement = new GeoLogVol(currentName,fingerElementTrd,currentMaterial);
1586 
1587  } else if (m_dbManager->TICGshape()==2) {
1588 
1589  fingerElementTrap = new GeoTrap(elementDz/2*Gaudi::Units::cm,
1590  0.,
1591  0.,
1592  elementHeight/2*Gaudi::Units::cm,
1593  elementDy2/2*Gaudi::Units::cm,
1594  elementDy1/2*Gaudi::Units::cm,
1595  std::atan((elementDy1-elementDy2)/(2.*elementHeight)),
1596  elementHeight/2*Gaudi::Units::cm,
1597  elementDy2/2*Gaudi::Units::cm,
1598  elementDy1/2*Gaudi::Units::cm,
1599  std::atan((elementDy1-elementDy2)/(2.*elementHeight)));
1600 
1601  lvFingerElement = new GeoLogVol(currentName,fingerElementTrap,currentMaterial);
1602 
1603  } else {
1604  (*m_log) << MSG::ERROR << "TileGeoSectionBuilder::fillFinger: unexpected shape = "
1605  << m_dbManager->TICGshape() << " for finger element" << endmsg;
1606  return;
1607  }
1608 
1609 
1610  pvFingerElement = new GeoPhysVol(lvFingerElement);
1611  tfFingerElement = new GeoTransform(GeoTrf::Translate3D(elementZPozition*Gaudi::Units::cm,
1612  elementOffset*Gaudi::Units::cm,
1613  (elementRC-(tilb_rmax + tile_rmax)/2)*Gaudi::Units::cm));
1614 
1615  mother->add(tfFingerElement);
1616  if (m_dbManager->TICGshape()==2) {
1617  if (elementOffset<0) {
1618  ZrotateMod = new GeoTransform(GeoTrf::RotateZ3D(180*Gaudi::Units::deg));
1619  mother->add(ZrotateMod);
1620  }
1621 
1622  zrotateMod = new GeoTransform(GeoTrf::RotateZ3D(90*Gaudi::Units::deg));
1623  yrotateMod = new GeoTransform(GeoTrf::RotateY3D(-90*Gaudi::Units::deg));
1624  mother->add(yrotateMod);
1625  mother->add(zrotateMod);
1626  }
1627 
1628  mother->add(new GeoIdentifierTag(ModuleNcp));
1629  mother->add(pvFingerElement);
1630  }
1631 
1632  if (testbeam) return; // no cables between fingers at the testbeam
1633 
1634  // Cables space
1635 
1636  int Isector =0, LRflag =0;
1637 
1638  if ((ModuleNcp/4 - (float)ModuleNcp/4) != 0) {
1639  Isector = (int)ModuleNcp/4;
1640  } else {
1641  Isector = (int)ModuleNcp/4-1;
1642  }
1643  LRflag = ModuleNcp-4*Isector;
1644 
1645  m_dbManager->SetCurrentTicg(CurrentTicg);
1646 
1647  double elementRC = m_dbManager->TICGrc();
1648  double elementOffset = m_dbManager->TICGoff();
1649  double elementDz = m_dbManager->TICGdz();
1650  double elementZPozition = m_dbManager->TICGzc();
1651 
1652  double dXleft =35., dXright = 35.;
1653  double dZleft = elementDz/2, dZright = dZleft;
1654  double dZsaddleL = elementDz/4, dZsaddleR = dZsaddleL;
1655  double dY = 7.5;
1656 
1657  rightMaterial = leftMaterial = m_matLArServices;
1658  rightName = leftName = "LArCables";
1659 
1660  if (LRflag == 1) {
1661  dZright = elementDz, dXright = 35;
1662  dZsaddleR = 0;
1663  rightMaterial = m_matIronHalfDens;
1664  rightName = "LArService";
1665 
1666  } else if (LRflag == 4) {
1667  dZleft = elementDz, dXleft = 35;
1668  dZsaddleL = 0;
1669  leftMaterial = m_matIronHalfDens;
1670  leftName = "LArService";
1671  }
1672 
1673  if (sec_number == 1) {
1674  if ( (ModuleNcp >=40 && ModuleNcp <=41) || (ModuleNcp >=56 && ModuleNcp <=57) ) {
1675  dZright = dZleft = 8.5;
1676  dZsaddleL = dZsaddleR = 13.7;
1677  rightMaterial = leftMaterial = iron;
1678  rightName = leftName = "BarrelSaddleSupport";
1679  }
1680 
1681  } else {
1682  if ( (ModuleNcp >=39 && ModuleNcp <=42) || (ModuleNcp >=55 && ModuleNcp <=58) ) {
1683  dZright = dZleft = 8.5;
1684  dZsaddleR = dZsaddleL = 13.7;
1685  rightMaterial = leftMaterial = iron;
1686  rightName = leftName = "ExtBarrelSaddleSupport";
1687  }
1688  }
1689 
1690  if (m_log->level()<=MSG::DEBUG)
1691  (*m_log) << MSG::DEBUG << " Finger : number= "<<sec_number<<" ModuleNcp = " <<ModuleNcp<< " Sector= "<< Isector
1692  << " LRflag= " << LRflag <<" Neg "<< boolNeg
1693  << endmsg;
1694 
1695  GeoTransform *rotateY = new GeoTransform(GeoTrf::RotateY3D(90*Gaudi::Units::deg));
1696  GeoTransform *rotateZ = new GeoTransform(GeoTrf::RotateZ3D(3*Gaudi::Units::deg));
1697  GeoTransform *rotateZm = new GeoTransform(GeoTrf::RotateZ3D(-3*Gaudi::Units::deg));
1698 
1699  // Left (+phi)
1700  fingerCablesL = new GeoBox(dXleft/2*Gaudi::Units::cm, dY/2*Gaudi::Units::cm, dZleft/2*Gaudi::Units::cm);
1701  lvFingerCablesL = new GeoLogVol(leftName,fingerCablesL,leftMaterial);
1702  pvFingerCablesL = new GeoPhysVol(lvFingerCablesL);
1703 
1704  // Right (-phi)
1705  fingerCablesR = new GeoBox(dXright/2*Gaudi::Units::cm, dY/2*Gaudi::Units::cm, dZright/2*Gaudi::Units::cm);
1706  lvFingerCablesR = new GeoLogVol(rightName,fingerCablesR,rightMaterial);
1707  pvFingerCablesR = new GeoPhysVol(lvFingerCablesR);
1708 
1709  double YpoFinger =0;
1710 
1711  if (boolNeg) {
1712  YpoFinger = -elementOffset+5.4;
1713  } else {
1714  YpoFinger = elementOffset-5.4;
1715  }
1716 
1717  tfFingerCables = new GeoTransform(GeoTrf::Translate3D(elementZPozition*Gaudi::Units::cm +0.5*Gaudi::Units::cm -dZsaddleL*Gaudi::Units::cm,
1718  YpoFinger*Gaudi::Units::cm,
1719  (elementRC-(tilb_rmax + tile_rmax)/2)*Gaudi::Units::cm));
1720  mother->add(tfFingerCables);
1721 
1722  // inversion for negativ fingers, Left
1723  if (boolNeg) {
1724  mother->add(rotateY);
1725  mother->add(rotateZm);
1726  } else {
1727  mother->add(rotateY);
1728  mother->add(rotateZ);
1729  }
1730 
1731  mother->add(new GeoIdentifierTag(ModuleNcp));
1732  mother->add(pvFingerCablesL);
1733 
1734  if (boolNeg) {
1735  YpoFinger = elementOffset-5.4;
1736  } else {
1737  YpoFinger = -elementOffset+5.4;
1738  }
1739 
1740  tfFingerCables = new GeoTransform(GeoTrf::Translate3D(elementZPozition*Gaudi::Units::cm +0.5*Gaudi::Units::cm -dZsaddleR*Gaudi::Units::cm,
1741  YpoFinger*Gaudi::Units::cm,
1742  (elementRC-(tilb_rmax + tile_rmax)/2)*Gaudi::Units::cm));
1743  mother->add(tfFingerCables);
1744 
1745  // inversion for negativ fingers, Right
1746  if (boolNeg) {
1747  mother->add(rotateY);
1748  mother->add(rotateZ);
1749  } else {
1750  mother->add(rotateY);
1751  mother->add(rotateZm);
1752  }
1753 
1754  mother->add(new GeoIdentifierTag(ModuleNcp));
1755  mother->add(pvFingerCablesR);
1756 }
1757 
1758 
1759 void TileGeoSectionBuilder::fillPeriod(GeoPhysVol*& mother,
1760  double thickness,
1761  double dzglue,
1762  double tan_delta_phi_2,
1763  int period_type,
1764  GeoTrd * period)
1765 {
1766  int j;
1767  int CurrentScin = 0;
1768  const GeoShape* glue = 0;
1769  GeoLogVol* lvGlue = 0;
1770  GeoPhysVol* pvGlue = 0;
1771  GeoTransform* tfGlue = 0;
1772 
1773  double scintiWrapInZ, scintiWrapInR, scintiThickness, scintiDeltaInPhi;
1774  double scintiHeight, scintiRC, scintiZPos, dy1Scintillator, dy2Scintillator;
1775  const GeoShape* scintillator = 0;
1776  GeoLogVol* lvScintillator = 0;
1777  GeoPhysVol* pvScintillator = 0;
1778  GeoTransform* tfScintillator = 0;
1779 
1780  double thicknessWrapper, heightWrapper, dy1Wrapper, dy2Wrapper;
1781  const GeoShape* wrapper = 0;
1782  GeoLogVol* lvWrapper = 0;
1783  GeoPhysVol* pvWrapper = 0;
1784  GeoTransform* tfWrapper = 0;
1785 
1786  GeoIdentifierTag* idTag = 0;
1787 
1788  (*m_log) << MSG::VERBOSE <<" TileGeoSectionBuilder::fillPeriod"<< endmsg;
1789 
1790  // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
1791 
1792  // Determine the number of first scintillator depending on the section type
1793  if (m_dbManager->TILBsection() >= 7 && m_dbManager->TILBcurscint() == 0) {
1794  CurrentScin = 101; //special modules for testbeam identical to normal barrel module
1795  } else {
1796  if (m_dbManager->TILBcurscint()>0) {
1797  CurrentScin = m_dbManager->TILBcurscint();
1798  } else {
1799  CurrentScin = 100*m_dbManager->TILBsection()+1;
1800  }
1801  }
1802 
1803  // special EB modules with cut-outs
1804  if (m_dbManager->TILBsection()>=26 && m_dbManager->TILBsection()<=38 && m_dbManager->TILBcurscint() == 0) {
1805  //ps shortcut. Should be read from DB later on.
1806  CurrentScin = 100*2 + 1;
1807  }
1808 
1809  int zpShift = 1;
1810  // special EB modules with small D4 cell
1811  if (m_dbManager->TILBsection()>=7 && m_dbManager->TILBsection()<=8 && m_dbManager->TILBcurscint() == 301) {
1812  //ps fix. Should put curscint = 1301 in DB and zpShift will not be needed
1813  zpShift = -1;
1814  }
1815 
1816  (*m_log) << MSG::VERBOSE <<" TILBsection= "<<m_dbManager->TILBsection()<<endmsg;
1817  (*m_log) << MSG::VERBOSE <<" CurrentScin= "<<CurrentScin<<" TILBcurscint= "<<m_dbManager->TILBcurscint()
1818  << " - " << m_dbManager->TILBcurscint()+m_dbManager->TILBnscin()-1 <<endmsg;
1819  (*m_log) << MSG::VERBOSE <<" period_type= "<<period_type <<endmsg;
1820 
1821  // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
1822  // Obtain required materials - Air, Glue, Scintillator
1823 
1824  const GeoMaterial* matAir = m_theMaterialManager->getMaterial("std::Air");
1825  const GeoMaterial* matScin = nullptr;
1826  if (m_switches.pvt) {
1827  if (m_switches.testBeam || // choose PVT for all scintillators in testbeam setup
1828  ( period_type>4 && // choose PVT for crack scintillators (defined starting from RUN3)
1829  (m_dbManager->TILBsection() == 6 || m_dbManager->TILBsection() == 16) ) ) {
1830  // different material for crack scintillators
1831  matScin = m_theMaterialManager->getMaterial("tile::Polyvinyltoluene");
1832  if (matScin != nullptr) {
1833  (*m_log) << MSG::VERBOSE << "Using Polyvinyltoluene for section = " << m_dbManager->TILBsection() << endmsg;
1834  } else {
1835  (*m_log) << MSG::VERBOSE << "Using Polystyrene for section = " << m_dbManager->TILBsection() << endmsg;
1836  }
1837  }
1838  }
1839  if (matScin == nullptr) matScin = m_theMaterialManager->getMaterial("tile::Scintillator");
1840 
1841  //Cs hole parameters
1842  double csHoleR = 0.45 * Gaudi::Units::cm;
1843  double csTubeOuterR = 0.4 * Gaudi::Units::cm;
1844  double csTubeInnerR = 0.3 * Gaudi::Units::cm;
1845  double csTubeOffCorr = 1.35 * Gaudi::Units::cm;
1846 
1847  double thicknessMother2 = thickness/2.*Gaudi::Units::cm;
1848  double heightMother2 = (m_dbManager->TILBrmax() - m_dbManager->TILBrmin())*Gaudi::Units::cm/2.;
1849 
1850  const bool removeGlue = (m_switches.glue == 0 || m_switches.glue == 2);
1851 
1852  //Glue layer
1853  if (dzglue>0.0 && period_type<4 && !removeGlue) {
1854  const GeoMaterial* matGlue = m_theMaterialManager->getMaterial("tile::Glue");
1855 
1856  double dzglue2 = dzglue/2*Gaudi::Units::cm;
1857  dzglue2 = floor(dzglue2*1.0e+10)*1.0e-10;
1858 
1859  if (m_verbose) {
1860  printdouble(" period thickness/2 = ",thickness/2*Gaudi::Units::cm);
1861  printdouble(" glue thickness/2 = ",dzglue/2*Gaudi::Units::cm);
1862  printdouble("rounded thickness/2 = ",dzglue2);
1863  }
1864 
1865  double dy1Glue = (m_dbManager->TILBrmin() * tan_delta_phi_2 - m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
1866  double dy2Glue = (m_dbManager->TILBrmax() * tan_delta_phi_2 - m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
1867  double heightGlue2 = (m_dbManager->TILBrmax() - m_dbManager->TILBrmin())*Gaudi::Units::cm/2.;
1868 
1869  checking("Glue 0", false, 4,
1870  dzglue2,dzglue2,dy1Glue,dy2Glue,heightGlue2);
1871 
1872  glue = new GeoTrd(dzglue2,dzglue2,dy1Glue,dy2Glue,heightGlue2);
1873 
1874  //Cs tubes in mother volume and holes in glue
1875  if (m_switches.csTube) {
1876  for (j = CurrentScin; j < (CurrentScin + m_dbManager->TILBnscin()); j++) {
1877  idTag = new GeoIdentifierTag(j-CurrentScin);
1879 
1880  double off0 = m_dbManager->SCNTrc()*Gaudi::Units::cm - heightMother2;
1881  double off = m_dbManager->SCNTdr()/2.*Gaudi::Units::cm - csTubeOffCorr;
1882 
1883  GeoTrf::Transform3D tfHole1 = GeoTrf::Translate3D(0.,0.,(off0-off)) * GeoTrf::RotateY3D(-90*Gaudi::Units::deg);
1884  GeoTrf::Transform3D tfHole2 = GeoTrf::Translate3D(0.,0.,(off0+off)) * GeoTrf::RotateY3D(-90*Gaudi::Units::deg);
1885 
1886  // air around iron rod, around Cs tube and inside Cs tube
1887  GeoShape *air1 = new GeoTubs(csTubeOuterR, csHoleR, thicknessMother2, 0.,360.0 * Gaudi::Units::deg);
1888  GeoShape *air2 = new GeoTubs(csTubeOuterR, csHoleR, thicknessMother2, 0.,360.0 * Gaudi::Units::deg);
1889  GeoShape *air3 = new GeoTubs(0., csTubeInnerR, thicknessMother2, 0.,360.0 * Gaudi::Units::deg);
1890 
1891  GeoLogVol * lvAir1 = new GeoLogVol("CsTubeAir1",air1,matAir);
1892  GeoLogVol * lvAir2 = new GeoLogVol("CsTubeAir2",air2,matAir);
1893  GeoLogVol * lvAir3 = new GeoLogVol("CsTubeAir3",air3,matAir);
1894  GeoPhysVol * pvAir1 = new GeoPhysVol(lvAir1);
1895  GeoPhysVol * pvAir2 = new GeoPhysVol(lvAir2);
1896  GeoPhysVol * pvAir3 = new GeoPhysVol(lvAir3);
1897 
1898  GeoTransform* tftube1 = new GeoTransform(tfHole1);
1899  GeoTransform* tftube2 = new GeoTransform(tfHole2);
1900  GeoTransform* tftube3 = new GeoTransform(tfHole2);
1901 
1902  mother->add(tftube1);
1903  mother->add(pvAir1);
1904  mother->add(tftube2);
1905  mother->add(pvAir2);
1906  mother->add(tftube3);
1907  mother->add(pvAir3);
1908 
1909  //Holes in Glue
1910  if (glue) {
1911  glue = makeHoles(glue, csHoleR, dzglue2, off, off0);
1912  }
1913  }
1914  }
1915  lvGlue = new GeoLogVol("Glue",glue,matGlue);
1916  pvGlue = new GeoPhysVol(lvGlue);
1917  }
1918 
1919  switch(period_type) {
1920  case 1:
1921  {
1922  //Ordinary period in Barrel and Extended barrel - /spacer/glue/master/glue/spacer/glue/master/glue
1923 
1924  //Glue layer
1925  if (glue) {
1926  if (m_verbose)
1927  printdouble(" glue position = ",(-3.*dzglue/2-m_dbManager->TILBdzmast())*Gaudi::Units::cm);
1928  tfGlue = new GeoTransform(GeoTrf::Translate3D((-3.*dzglue/2-m_dbManager->TILBdzmast())*Gaudi::Units::cm,0.,0.));
1929  mother->add(tfGlue);
1930  mother->add(pvGlue);
1931 
1932  if (m_verbose)
1933  printdouble(" glue position = ",-dzglue/2*Gaudi::Units::cm);
1934  tfGlue = new GeoTransform(GeoTrf::Translate3D(-dzglue/2*Gaudi::Units::cm,0.,0.));
1935  mother->add(tfGlue);
1936  mother->add(pvGlue);
1937 
1938  if (m_verbose)
1939  printdouble(" glue position = ",(dzglue/2+m_dbManager->TILBdzspac())*Gaudi::Units::cm);
1940  tfGlue = new GeoTransform(GeoTrf::Translate3D((dzglue/2+m_dbManager->TILBdzspac())*Gaudi::Units::cm,0.,0.));
1941  mother->add(tfGlue);
1942  mother->add(pvGlue);
1943 
1944  if (m_verbose)
1945  printdouble(" glue position = ",(thickness-dzglue)/2*Gaudi::Units::cm);
1946  tfGlue = new GeoTransform(GeoTrf::Translate3D((thickness-dzglue)/2*Gaudi::Units::cm,0.,0.));
1947  mother->add(tfGlue);
1948  mother->add(pvGlue);
1949  }
1950 
1951  for (j = CurrentScin; j < (CurrentScin + m_dbManager->TILBnscin()); j++) {
1952  idTag = new GeoIdentifierTag(j-CurrentScin);
1954 
1955  scintiHeight = m_dbManager->SCNTdr();
1956  scintiRC = m_dbManager->SCNTrc();
1957  scintiZPos = zpShift * m_dbManager->SCNTzp(); // ps special module inversion
1958  scintiThickness = m_dbManager->SCNTdt();
1959  scintiWrapInZ = m_dbManager->SCNTdtw();
1960  scintiWrapInR = m_dbManager->SCNTdrw();
1961  scintiDeltaInPhi = (m_switches.uShape > 0) ? 0.0 : m_dbManager->SCNTdphi();
1962 
1963  thicknessWrapper = (m_dbManager->TILBdzspac() <= (scintiThickness + 2*scintiWrapInZ)) ?
1964  (scintiThickness + 2*scintiWrapInZ)*Gaudi::Units::cm: m_dbManager->TILBdzspac()*Gaudi::Units::cm;
1965  if (m_switches.glue == 2) thicknessWrapper = std::max(thicknessWrapper - m_additionalIronLayer, scintiThickness);
1966 
1967  // create wrapper
1968  heightWrapper = (scintiHeight + 2*scintiWrapInR)*Gaudi::Units::cm;
1969  dy1Wrapper = ((scintiRC - scintiHeight/2 - scintiWrapInR + m_dbManager->TILBrmin()) *
1970  tan_delta_phi_2 - m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
1971  dy2Wrapper = ((scintiRC + scintiHeight/2 + scintiWrapInR + m_dbManager->TILBrmin()) *
1972  tan_delta_phi_2 - m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
1973 
1974  checking("Wrapper 0", true, 5,
1975  thicknessWrapper/2,thicknessWrapper/2,dy1Wrapper,dy2Wrapper,heightWrapper/2);
1976 
1977  wrapper = new GeoTrd(thicknessWrapper/2,
1978  thicknessWrapper/2,
1979  dy1Wrapper,
1980  dy2Wrapper,
1981  heightWrapper/2);
1982 
1983  if (m_switches.csTube) {
1984  wrapper = makeHoles(wrapper, csHoleR, thicknessWrapper/2, scintiHeight/2.*Gaudi::Units::cm - csTubeOffCorr);
1985  }
1986  lvWrapper = new GeoLogVol("Wrapper",wrapper,matAir);
1987  pvWrapper = new GeoPhysVol(lvWrapper);
1988 
1989  // create scintillator
1990  dy1Scintillator = ((scintiRC - scintiHeight/2 + m_dbManager->TILBrmin()) *
1991  tan_delta_phi_2 - m_dbManager->TILBphigap()/2 - scintiDeltaInPhi)*Gaudi::Units::cm;
1992  dy2Scintillator = ((scintiRC + scintiHeight/2 + m_dbManager->TILBrmin()) *
1993  tan_delta_phi_2 - m_dbManager->TILBphigap()/2 - scintiDeltaInPhi)*Gaudi::Units::cm;
1994 
1995  checking("Scintillator 0", true, 6,
1996  scintiThickness/2*Gaudi::Units::cm,scintiThickness/2*Gaudi::Units::cm,dy1Scintillator,dy2Scintillator,scintiHeight/2*Gaudi::Units::cm);
1997 
1998  scintillator = new GeoTrd(scintiThickness/2*Gaudi::Units::cm,
1999  scintiThickness/2*Gaudi::Units::cm,
2000  dy1Scintillator,
2001  dy2Scintillator,
2002  scintiHeight/2*Gaudi::Units::cm);
2003 
2004  if (m_switches.csTube) {
2005  scintillator = makeHolesScint(scintillator, csHoleR, scintiThickness/2 * Gaudi::Units::cm, scintiHeight/2.*Gaudi::Units::cm - csTubeOffCorr);
2006  }
2007  lvScintillator = new GeoLogVol("Scintillator",scintillator,matScin);
2008  pvScintillator = new GeoPhysVol(lvScintillator);
2009 
2010  // place scintillator in wrapper
2011  tfScintillator = new GeoTransform(GeoTrf::Translate3D(0.,0.,0.));
2012  pvWrapper->add(idTag);
2013  pvWrapper->add(tfScintillator);
2014  pvWrapper->add(pvScintillator);
2015 
2016  //place wrapper in period
2017  if (m_verbose) {
2018  (*m_log) << MSG::VERBOSE <<" X scintiZPos= "<<scintiZPos;
2019  printdouble(" ==> ",(scintiZPos*thickness+m_dbManager->TILBdzspac()/2)*Gaudi::Units::cm);
2020  (*m_log) << MSG::VERBOSE <<" Y scintiRC= "<<scintiRC <<endmsg;
2021  }
2022 
2023  tfWrapper = new GeoTransform(GeoTrf::Translate3D((scintiZPos*thickness+m_dbManager->TILBdzspac()/2)*Gaudi::Units::cm,
2024  0.,
2025  (scintiRC-(m_dbManager->TILBrmax()-m_dbManager->TILBrmin())/2)*Gaudi::Units::cm));
2026  mother->add(idTag);
2027  mother->add(tfWrapper);
2028  mother->add(pvWrapper);
2029  }
2030  break;
2031  }
2032  case 2:
2033  {
2034  //Special period in the barrel - /spacer/glue/master/glue/spacer
2035 
2036  //Glue layer
2037  if (glue) {
2038  if (m_verbose)
2039  printdouble(" glue position = ",(dzglue + m_dbManager->TILBdzmast())*Gaudi::Units::cm/2);
2040  tfGlue = new GeoTransform(GeoTrf::Translate3D((dzglue + m_dbManager->TILBdzmast())*Gaudi::Units::cm/2,0.,0.));
2041  mother->add(tfGlue);
2042  mother->add(pvGlue);
2043 
2044  if (m_verbose)
2045  printdouble(" glue position = ",-(dzglue + m_dbManager->TILBdzmast())*Gaudi::Units::cm/2);
2046  tfGlue = new GeoTransform(GeoTrf::Translate3D(-(dzglue + m_dbManager->TILBdzmast())*Gaudi::Units::cm/2,0.,0.));
2047  mother->add(tfGlue);
2048  mother->add(pvGlue);
2049  }
2050 
2051  for (j = CurrentScin; j < (CurrentScin + m_dbManager->TILBnscin()); j++) {
2052  idTag = new GeoIdentifierTag(j-CurrentScin);
2054 
2055  scintiHeight = m_dbManager->SCNTdr();
2056  scintiRC = m_dbManager->SCNTrc();
2057  scintiZPos = m_dbManager->SCNTzp();
2058  scintiThickness = m_dbManager->SCNTdt();
2059  scintiWrapInZ = m_dbManager->SCNTdtw();
2060  scintiWrapInR = m_dbManager->SCNTdrw();
2061  scintiDeltaInPhi = (m_switches.uShape > 0) ? 0.0 : m_dbManager->SCNTdphi();
2062 
2063  thicknessWrapper = (m_dbManager->TILBdzspac() <= (scintiThickness + 2*scintiWrapInZ)) ?
2064  (scintiThickness + 2*scintiWrapInZ)*Gaudi::Units::cm: m_dbManager->TILBdzspac()*Gaudi::Units::cm;
2065  if (m_switches.glue == 2) thicknessWrapper = std::max(thicknessWrapper - m_additionalIronLayer, scintiThickness);
2066 
2067  // create wrapper
2068  heightWrapper = (scintiHeight + 2*scintiWrapInR)*Gaudi::Units::cm;
2069  dy1Wrapper = ((scintiRC - scintiHeight/2 - scintiWrapInR + m_dbManager->TILBrmin()) *
2070  tan_delta_phi_2 - m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
2071  dy2Wrapper = ((scintiRC + scintiHeight/2 + scintiWrapInR + m_dbManager->TILBrmin()) *
2072  tan_delta_phi_2 - m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
2073 
2074  checking("Wrapper 1", true, 5,
2075  thicknessWrapper/2,thicknessWrapper/2,dy1Wrapper,dy2Wrapper,heightWrapper/2);
2076 
2077  wrapper = new GeoTrd(thicknessWrapper/2,
2078  thicknessWrapper/2,
2079  dy1Wrapper,
2080  dy2Wrapper,
2081  heightWrapper/2);
2082 
2083  if (m_switches.csTube) {
2084  wrapper = makeHoles(wrapper, csHoleR, thicknessWrapper/2, scintiHeight/2.*Gaudi::Units::cm - csTubeOffCorr);
2085  }
2086  lvWrapper = new GeoLogVol("Wrapper",wrapper,matAir);
2087  pvWrapper = new GeoPhysVol(lvWrapper);
2088 
2089  // create scintillator
2090  dy1Scintillator = ((scintiRC - scintiHeight/2 + m_dbManager->TILBrmin()) *
2091  tan_delta_phi_2 - m_dbManager->TILBphigap()/2 - scintiDeltaInPhi)*Gaudi::Units::cm;
2092  dy2Scintillator = ((scintiRC + scintiHeight/2 + m_dbManager->TILBrmin()) *
2093  tan_delta_phi_2 - m_dbManager->TILBphigap()/2 - scintiDeltaInPhi)*Gaudi::Units::cm;
2094 
2095  checking("Scintillator 1", true, 6,
2096  scintiThickness/2*Gaudi::Units::cm,scintiThickness/2*Gaudi::Units::cm,dy1Scintillator,dy2Scintillator,scintiHeight/2*Gaudi::Units::cm);
2097 
2098  scintillator = new GeoTrd(scintiThickness/2*Gaudi::Units::cm,
2099  scintiThickness/2*Gaudi::Units::cm,
2100  dy1Scintillator,
2101  dy2Scintillator,
2102  scintiHeight/2*Gaudi::Units::cm);
2103 
2104  if (m_switches.csTube) {
2105  scintillator = makeHolesScint(scintillator, csHoleR, scintiThickness/2 * Gaudi::Units::cm, scintiHeight/2.*Gaudi::Units::cm - csTubeOffCorr);
2106  }
2107  lvScintillator = new GeoLogVol("Scintillator",scintillator,matScin);
2108  pvScintillator = new GeoPhysVol(lvScintillator);
2109 
2110  // place scintillator in wrapper
2111  tfScintillator = new GeoTransform(GeoTrf::Translate3D(0.,0.,0.));
2112  pvWrapper->add(idTag);
2113  pvWrapper->add(tfScintillator);
2114  pvWrapper->add(pvScintillator);
2115 
2116  //place wrapper in period
2117  if (m_verbose) {
2118  (*m_log) << MSG::VERBOSE <<" X scintiZPos= "<<scintiZPos;
2119  printdouble(" ==> ",(2*scintiZPos+0.5)*(thickness-m_dbManager->TILBdzspac())*Gaudi::Units::cm);
2120  (*m_log) << MSG::VERBOSE <<" Y scintiRC= "<<scintiRC <<endmsg;
2121  }
2122 
2123  tfWrapper = new GeoTransform(GeoTrf::Translate3D((2*scintiZPos+0.5)*(thickness-m_dbManager->TILBdzspac())*Gaudi::Units::cm,
2124  0.,
2125  (scintiRC-(m_dbManager->TILBrmax()-m_dbManager->TILBrmin())/2)*Gaudi::Units::cm));
2126  mother->add(idTag);
2127  mother->add(tfWrapper);
2128  mother->add(pvWrapper);
2129  }
2130  break;
2131  }
2132  case 3:
2133  {
2134  //Ordinary period in Plug Section 1 - /glue/master/glue/spacer/glue/master/glue/spacer
2135 
2136  //Glue layer
2137  if (glue) {
2138  if (m_verbose)
2139  printdouble(" glue position = ",(-thickness + dzglue)*Gaudi::Units::cm/2);
2140  tfGlue = new GeoTransform(GeoTrf::Translate3D((-thickness + dzglue)*Gaudi::Units::cm/2,0.,0.));
2141  mother->add(tfGlue);
2142  mother->add(pvGlue);
2143 
2144  if (m_verbose)
2145  printdouble(" glue position = ",((-thickness + 3*dzglue)+m_dbManager->TILBdzmast())/2*Gaudi::Units::cm);
2146  tfGlue = new GeoTransform(GeoTrf::Translate3D(((-thickness + 3*dzglue)+m_dbManager->TILBdzmast())/2*Gaudi::Units::cm,0.,0.));
2147  mother->add(tfGlue);
2148  mother->add(pvGlue);
2149 
2150  if (m_verbose)
2151  printdouble(" glue position = ",dzglue/2*Gaudi::Units::cm);
2152  tfGlue = new GeoTransform(GeoTrf::Translate3D(dzglue/2*Gaudi::Units::cm,0.,0.));
2153  mother->add(tfGlue);
2154  mother->add(pvGlue);
2155 
2156  if (m_verbose)
2157  printdouble(" glue position = ",(3.*dzglue/2 + m_dbManager->TILBdzmast())*Gaudi::Units::cm);
2158  tfGlue = new GeoTransform(GeoTrf::Translate3D((3.*dzglue/2 + m_dbManager->TILBdzmast())*Gaudi::Units::cm,0.,0.));
2159  mother->add(tfGlue);
2160  mother->add(pvGlue);
2161  }
2162 
2163  for (j = CurrentScin; j < (CurrentScin + m_dbManager->TILBnscin()); j++) {
2164  idTag = new GeoIdentifierTag(j-CurrentScin);
2166 
2167  scintiHeight = m_dbManager->SCNTdr();
2168  scintiRC = m_dbManager->SCNTrc();
2169  scintiZPos = m_dbManager->SCNTzp();
2170  scintiThickness = m_dbManager->SCNTdt();
2171  scintiWrapInZ = m_dbManager->SCNTdtw();
2172  scintiWrapInR = m_dbManager->SCNTdrw();
2173  scintiDeltaInPhi = (m_switches.uShape > 0) ? 0. : m_dbManager->SCNTdphi();
2174 
2175  thicknessWrapper = (m_dbManager->TILBdzspac() <= (scintiThickness + 2*scintiWrapInZ)) ?
2176  (scintiThickness + 2*scintiWrapInZ)*Gaudi::Units::cm: m_dbManager->TILBdzspac()*Gaudi::Units::cm;
2177  if (m_switches.glue == 2) thicknessWrapper = std::max(thicknessWrapper - m_additionalIronLayer, scintiThickness);
2178 
2179  // create wrapper
2180  heightWrapper = (scintiHeight + 2*scintiWrapInR)*Gaudi::Units::cm;
2181 
2182  dy1Wrapper = ((scintiRC - scintiHeight/2 - scintiWrapInR + m_dbManager->TILBrmin()) *
2183  tan_delta_phi_2 - m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
2184  dy2Wrapper = ((scintiRC + scintiHeight/2 + scintiWrapInR + m_dbManager->TILBrmin()) *
2185  tan_delta_phi_2 - m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
2186 
2187  checking("Wrapper 2", true, 5,
2188  thicknessWrapper/2,thicknessWrapper/2,dy1Wrapper,dy2Wrapper,heightWrapper/2);
2189 
2190  wrapper = new GeoTrd(thicknessWrapper/2,
2191  thicknessWrapper/2,
2192  dy1Wrapper,
2193  dy2Wrapper,
2194  heightWrapper/2);
2195 
2196  if (m_switches.csTube) {
2197  wrapper = makeHoles(wrapper, csHoleR, thicknessWrapper/2, scintiHeight/2.*Gaudi::Units::cm - csTubeOffCorr);
2198  }
2199  lvWrapper = new GeoLogVol("Wrapper",wrapper,matAir);
2200  pvWrapper = new GeoPhysVol(lvWrapper);
2201 
2202  // create scintillator
2203  dy1Scintillator = ((scintiRC - scintiHeight/2 + m_dbManager->TILBrmin()) *
2204  tan_delta_phi_2 - m_dbManager->TILBphigap()/2 - scintiDeltaInPhi)*Gaudi::Units::cm;
2205  dy2Scintillator = ((scintiRC + scintiHeight/2 + m_dbManager->TILBrmin()) *
2206  tan_delta_phi_2 - m_dbManager->TILBphigap()/2 - scintiDeltaInPhi)*Gaudi::Units::cm;
2207 
2208  checking("Scintillator 2", true, 6,
2209  scintiThickness/2*Gaudi::Units::cm,scintiThickness/2*Gaudi::Units::cm,dy1Scintillator,dy2Scintillator,scintiHeight/2*Gaudi::Units::cm);
2210 
2211  scintillator = new GeoTrd(scintiThickness/2*Gaudi::Units::cm,
2212  scintiThickness/2*Gaudi::Units::cm,
2213  dy1Scintillator,
2214  dy2Scintillator,
2215  scintiHeight/2*Gaudi::Units::cm);
2216 
2217  if (m_switches.csTube) {
2218  scintillator = makeHolesScint(scintillator, csHoleR, scintiThickness/2 * Gaudi::Units::cm, scintiHeight/2.*Gaudi::Units::cm - csTubeOffCorr);
2219  }
2220  lvScintillator = new GeoLogVol("Scintillator",scintillator,matScin);
2221  pvScintillator = new GeoPhysVol(lvScintillator);
2222 
2223  // place scintillator in wrapper
2224  tfScintillator = new GeoTransform(GeoTrf::Translate3D(0.,0.,0.));
2225  pvWrapper->add(idTag);
2226  pvWrapper->add(tfScintillator);
2227  pvWrapper->add(pvScintillator);
2228 
2229  //place wrapper in period
2230  if (m_verbose) {
2231  (*m_log) << MSG::VERBOSE <<" X scintiZPos= "<<scintiZPos;
2232  printdouble(" ==> ",(scintiZPos*thickness-m_dbManager->TILBdzspac()/2)*Gaudi::Units::cm);
2233  (*m_log) << MSG::VERBOSE <<" Y scintiRC= "<<scintiRC <<endmsg;
2234  }
2235 
2236  tfWrapper = new GeoTransform(GeoTrf::Translate3D((scintiZPos*thickness-m_dbManager->TILBdzspac()/2)*Gaudi::Units::cm,
2237  0.,
2238  (scintiRC-(m_dbManager->TILBrmax()-m_dbManager->TILBrmin())/2)*Gaudi::Units::cm));
2239  mother->add(idTag);
2240  mother->add(tfWrapper);
2241  mother->add(pvWrapper);
2242  }
2243  break;
2244  }
2245  case 4:
2246  {
2247  //Special period in Plug Section - /spacer
2248 
2249  for (j = CurrentScin; j < (CurrentScin + m_dbManager->TILBnscin()); j++) {
2251 
2252  scintiHeight = m_dbManager->SCNTdr();
2253  scintiRC = m_dbManager->SCNTrc();
2254  scintiZPos = zpShift * m_dbManager->SCNTzp(); // ps special module inversion
2255  scintiThickness = m_dbManager->SCNTdt();
2256  scintiWrapInZ = m_dbManager->SCNTdtw();
2257  scintiWrapInR = m_dbManager->SCNTdrw();
2258  scintiDeltaInPhi = (m_switches.uShape > 0) ? 0.0 : m_dbManager->SCNTdphi();
2259 
2260  thicknessWrapper = (m_dbManager->TILBdzspac() <= (scintiThickness + 2*scintiWrapInZ)) ?
2261  (scintiThickness + 2*scintiWrapInZ)*Gaudi::Units::cm: m_dbManager->TILBdzspac()*Gaudi::Units::cm;
2262  if (m_switches.glue == 2) thicknessWrapper = std::max(thicknessWrapper - m_additionalIronLayer, scintiThickness);
2263 
2264  if (scintiZPos<0) {
2265  idTag = new GeoIdentifierTag(j-CurrentScin);
2266  // create wrapper
2267  heightWrapper = (scintiHeight + 2*scintiWrapInR)*Gaudi::Units::cm;
2268  dy1Wrapper = ((scintiRC - scintiHeight/2 - scintiWrapInR + m_dbManager->TILBrmin()) *
2269  tan_delta_phi_2 - m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
2270  dy2Wrapper = ((scintiRC + scintiHeight/2 + scintiWrapInR + m_dbManager->TILBrmin()) *
2271  tan_delta_phi_2 - m_dbManager->TILBphigap()/2)*Gaudi::Units::cm;
2272 
2273  checking("Wrapper 3", true, 5,
2274  thicknessWrapper/2,thicknessWrapper/2,dy1Wrapper,dy2Wrapper,heightWrapper/2);
2275 
2276  wrapper = new GeoTrd(thicknessWrapper/2,
2277  thicknessWrapper/2,
2278  dy1Wrapper,
2279  dy2Wrapper,
2280  heightWrapper/2);
2281 
2282  if (m_switches.csTube) {
2283  wrapper = makeHoles(wrapper, csHoleR, thicknessWrapper/2, scintiHeight/2.*Gaudi::Units::cm - csTubeOffCorr);
2284  }
2285  lvWrapper = new GeoLogVol("Wrapper",wrapper,matAir);
2286  pvWrapper = new GeoPhysVol(lvWrapper);
2287 
2288  // create scintillator
2289  dy1Scintillator = ((scintiRC - scintiHeight/2 + m_dbManager->TILBrmin()) *
2290  tan_delta_phi_2 - m_dbManager->TILBphigap()/2 - scintiDeltaInPhi)*Gaudi::Units::cm;
2291  dy2Scintillator = ((scintiRC + scintiHeight/2 + m_dbManager->TILBrmin()) *
2292  tan_delta_phi_2 - m_dbManager->TILBphigap()/2 - scintiDeltaInPhi)*Gaudi::Units::cm;
2293 
2294  checking("Scintillator 3", true, 6,
2295  scintiThickness/2*Gaudi::Units::cm,scintiThickness/2*Gaudi::Units::cm,dy1Scintillator,dy2Scintillator,scintiHeight/2*Gaudi::Units::cm);
2296 
2297  scintillator = new GeoTrd(scintiThickness/2*Gaudi::Units::cm,
2298  scintiThickness/2*Gaudi::Units::cm,
2299  dy1Scintillator,
2300  dy2Scintillator,
2301  scintiHeight/2*Gaudi::Units::cm);
2302 
2303  if (m_switches.csTube) {
2304  scintillator = makeHolesScint(scintillator, csHoleR, scintiThickness/2 * Gaudi::Units::cm, scintiHeight/2.*Gaudi::Units::cm - csTubeOffCorr);
2305  }
2306  lvScintillator = new GeoLogVol("Scintillator",scintillator,matScin);
2307  pvScintillator = new GeoPhysVol(lvScintillator);
2308 
2309  // place scintillator in wrapper
2310  tfScintillator = new GeoTransform(GeoTrf::Translate3D(0.,0.,0.));
2311  pvWrapper->add(idTag);
2312  pvWrapper->add(tfScintillator);
2313  pvWrapper->add(pvScintillator);
2314 
2315  //place wrapper in period
2316  if (m_verbose) {
2317  (*m_log) << MSG::VERBOSE <<" X scintiZPos= "<<0.0 <<endmsg;
2318  (*m_log) << MSG::VERBOSE <<" Y scintiRC= "<<scintiRC <<endmsg;
2319  }
2320 
2321  tfWrapper = new GeoTransform(GeoTrf::Translate3D(0.,
2322  0.,
2323  (scintiRC-(m_dbManager->TILBrmax()-m_dbManager->TILBrmin())/2)*Gaudi::Units::cm));
2324  mother->add(idTag);
2325  mother->add(tfWrapper);
2326  mother->add(pvWrapper);
2327  }
2328  }
2329  break;
2330  }
2331  default:
2332  {
2333  //Scintillator layers in Plug Sections 3 and 4
2334 
2335  // checking shape of mother volume.
2336  double dy1Period = period->getYHalfLength1();
2337  double tanphi = (period->getYHalfLength2()-dy1Period)/period->getZHalfLength()/2.;
2338  if (m_log->level()<=MSG::DEBUG)
2339  if (std::abs(tanphi-tan_delta_phi_2) > 1.e-5)
2340  (*m_log) << MSG::DEBUG <<"Different tan_delta_phi_2 " << tanphi << " " << tan_delta_phi_2 <<endmsg;
2341 
2342  for (j = CurrentScin; j < (CurrentScin + m_dbManager->TILBnscin()); j++) {
2343  idTag = new GeoIdentifierTag(j-CurrentScin);
2345 
2346  scintiHeight = m_dbManager->SCNTdr();
2347  scintiRC = m_dbManager->SCNTrc();
2348  scintiZPos = m_dbManager->SCNTzp();
2349  scintiThickness = m_dbManager->SCNTdt();
2350  scintiWrapInZ = m_dbManager->SCNTdtw();
2351  scintiWrapInR = m_dbManager->SCNTdrw();
2352  scintiDeltaInPhi = m_dbManager->SCNTdphi(); // don't need to check m_uShape for single scintillator
2353 
2354  // create wrapper
2355  heightWrapper = (scintiHeight + 2*scintiWrapInR)*Gaudi::Units::cm;
2356  thicknessWrapper = (scintiThickness + 2*scintiWrapInZ)*Gaudi::Units::cm;
2357  if (m_switches.glue == 2) thicknessWrapper = std::max(thicknessWrapper - m_additionalIronLayer, scintiThickness);
2358 
2359  double thicknessEnvelope = (m_dbManager->TILBdzmodul()*Gaudi::Units::cm - thicknessWrapper); // along phi thickness is twice bigger than along Z
2360  dy1Wrapper = dy1Period - thicknessEnvelope + ((scintiRC - scintiHeight/2. - scintiWrapInR)*tanphi)*Gaudi::Units::cm;
2361  dy2Wrapper = dy1Period - thicknessEnvelope + ((scintiRC + scintiHeight/2. + scintiWrapInR)*tanphi)*Gaudi::Units::cm;
2362 
2363  if (m_log->level()<=MSG::DEBUG)
2364  (*m_log) << MSG::DEBUG <<"Envelope thickness is " << thicknessEnvelope <<endmsg;
2365  checking("Wrapper 4", true, 5,
2366  thicknessWrapper/2,thicknessWrapper/2,dy1Wrapper,dy2Wrapper,heightWrapper/2);
2367 
2368  wrapper = new GeoTrd(thicknessWrapper/2,
2369  thicknessWrapper/2,
2370  dy1Wrapper,
2371  dy2Wrapper,
2372  heightWrapper/2);
2373  lvWrapper = new GeoLogVol("Wrapper",wrapper,matAir);
2374  pvWrapper = new GeoPhysVol(lvWrapper);
2375 
2376  // create scintillator
2377  dy1Scintillator = dy1Period - thicknessEnvelope + ((scintiRC - scintiHeight/2.)*tanphi - scintiDeltaInPhi)*Gaudi::Units::cm;
2378  dy2Scintillator = dy1Period - thicknessEnvelope + ((scintiRC + scintiHeight/2.)*tanphi - scintiDeltaInPhi)*Gaudi::Units::cm;
2379 
2380  checking("Scintillator 4", true, 6,
2381  scintiThickness/2*Gaudi::Units::cm,scintiThickness/2*Gaudi::Units::cm,dy1Scintillator,dy2Scintillator,scintiHeight/2*Gaudi::Units::cm);
2382 
2383  scintillator = new GeoTrd(scintiThickness/2*Gaudi::Units::cm,
2384  scintiThickness/2*Gaudi::Units::cm,
2385  dy1Scintillator,
2386  dy2Scintillator,
2387  scintiHeight/2*Gaudi::Units::cm);
2388  lvScintillator = new GeoLogVol("Scintillator",scintillator,matScin);
2389  pvScintillator = new GeoPhysVol(lvScintillator);
2390 
2391  // place scintillator in wrapper
2392  tfScintillator = new GeoTransform(GeoTrf::Translate3D(0.,0.,0.));
2393  pvWrapper->add(idTag);
2394  pvWrapper->add(tfScintillator);
2395  pvWrapper->add(pvScintillator);
2396 
2397  //place wrapper in period
2398  if (m_verbose) {
2399  (*m_log) << MSG::VERBOSE <<" X scintiZPos= "<<0.0 <<endmsg;
2400  (*m_log) << MSG::VERBOSE <<" Y scintiRC= "<<scintiRC <<endmsg;
2401  }
2402 
2403  tfWrapper = new GeoTransform(GeoTrf::Translate3D(0.,
2404  0.,
2405  (scintiRC-(m_dbManager->TILBrmax()-m_dbManager->TILBrmin())/2)*Gaudi::Units::cm));
2406  mother->add(idTag);
2407  mother->add(tfWrapper);
2408  mother->add(pvWrapper);
2409  }
2410  break;
2411  }
2412  }
2413 }
2414 
2415 
2416 // Checking geometry dimensions for all directions
2417 
2418 void TileGeoSectionBuilder::checking(const std::string& Name, bool print, int level,
2419  double X1, double X2, double Y1, double Y2, double Z)
2420 {
2421  double rless = .005; //5 [mkm]
2422  std::string Step[8] = {" ",
2423  " ",
2424  " ",
2425  " ",
2426  " ",
2427  " ",
2428  " ",
2429  " "};
2430  if (print) {
2431  if (m_log->level()<=MSG::DEBUG)
2432  (*m_log) << MSG::DEBUG <<Step[level]<<Name<<" -"<<level
2433  << std::setiosflags(std::ios::fixed) << std::setw(9) << std::setprecision(4)
2434  <<" dX1,dX2= "<<X1<<" "<<X2
2435  <<" dY1,dY2= "<<Y1<<" "<<Y2
2436  <<" dZ= "<<Z
2437  << std::resetiosflags(std::ios::fixed)
2438  <<endmsg;
2439  }
2440  if (X1 < rless && X2 < rless) {
2441  (*m_log) << MSG::WARNING <<" volume "<<Name<<" is empty, X1 or X2<0 "<<endmsg;
2442  }
2443  if (Y1 < rless && Y2 < rless) {
2444  (*m_log) << MSG::WARNING <<" volume "<<Name<<" is empty, Y1 or Y2<0 "<<endmsg;
2445  }
2446  if (Z < rless) {
2447  (*m_log) << MSG::WARNING <<" volume "<<Name<<" is empty, Z<0 "<<endmsg;
2448  }
2449 }
2450 
2451 
2452 // -- Readout
2453 
2455  unsigned int detector,
2456  int side,
2457  bool testbeam,
2458  bool addPlates,
2459  unsigned int nphi,
2460  float zshift)
2461 {
2462  // auxillary variables
2463  unsigned int index;
2464  int currentSample, etaIndex, nsamp;
2465  std::vector<int> samples; // samples of a given region
2466  std::vector<int> firstScin; // first scintillator for samples of a given region
2467  std::vector<int> lastScin; // last scintillator for samples of a given region
2468 
2469  // -- default values for all regions
2470  // they are overwritten later in calculateR() by actual values taken from DB
2471  float phi_min, phi_max;
2472  float dphi = 2.0f*M_PI/64;
2473 
2474  if (testbeam) { // put modules symmetricaly
2475  phi_max = nphi*dphi/2;
2476  phi_min = -phi_max;
2477  } else { // put edge of very first module on horizontal plane
2478  phi_min = 0.;
2479  phi_max = nphi * dphi;
2480  }
2481 
2482  // Hardcoded values for R/dR
2483  float rBarrel[] = {2450., 3020., 3630.};
2484  float drBarrel[] = {300., 840., 380.};
2485 
2486  float rExtended[] = {2450., 2870., 3480.};
2487  float drExtended[] = {300., 540., 680.};
2488 
2489  float rGap[] = {3215., 3630., 2802.5, 2475.5, 2066., 1646.};
2490  float drGap[] = {450., 380., 313., 341., 478., 362.};
2491 
2492  if (addPlates) {
2493  rBarrel[0] -= 10*Gaudi::Units::mm/2;
2494  rBarrel[2] += 40*Gaudi::Units::mm/2;
2495  drBarrel[0] += 10*Gaudi::Units::mm;
2496  drBarrel[2] += 40*Gaudi::Units::mm;
2497  rExtended[0] -= 10*Gaudi::Units::mm/2;
2498  rExtended[2] += 40*Gaudi::Units::mm/2;
2499  drExtended[0] += 10*Gaudi::Units::mm;
2500  drExtended[2] += 40*Gaudi::Units::mm;
2501  rGap[1] += 40*Gaudi::Units::mm/2;
2502  drGap[1] += 40*Gaudi::Units::mm;
2503  }
2504 
2505  int indHardcoded = 0;
2506 
2507  // --------------------------------
2508 
2509  // -- initialize all necessary arrays with 0.
2510  std::vector<float> eta_min (MAX_N_SAMP_TILEDD, 0.);
2511  std::vector<float> eta_max (MAX_N_SAMP_TILEDD, 0.);
2512  std::vector<float> deta (MAX_N_SAMP_TILEDD, 0.);
2513  std::vector<unsigned int> neta (size_t(MAX_N_SAMP_TILEDD), 0U);
2514  std::vector<float> rcenter (MAX_N_SAMP_TILEDD, 0.);
2515  std::vector<float> dr (MAX_N_SAMP_TILEDD, 0.);
2516  std::vector<float> zcenter (MAX_N_SAMP_TILEDD, 0.);
2517  std::vector<float> dz (MAX_N_SAMP_TILEDD, 0.);
2518 
2519  // ---------------------------------
2520 
2521  // Set side
2522  int sign_eta = (side>0) ? 1 : -1;
2523 
2524 
2525  // iterate over all samples of the region and fill corresponding eta values.
2526  // this works for Central and Extended Barrel regions only!
2528  // -- Calculate number of samples for the region
2529  // find first TICL for the given detector
2531  // for the central barrel region take care of the side
2532  if (detector == TILE_REGION_CENTRAL) {
2533  while (sign_eta * m_dbManager->TICLncell() < 0) {
2534  if (!(m_dbManager->SetNextTiclInDet())) {
2535  (*m_log) << MSG::ERROR << "TileGeoSectionBuilder::fillDescriptor: No TICL structures for detector: "
2536  << detector << " and side: " << sign_eta << endmsg;
2537  return;
2538  }
2539  }
2540  }
2541 
2542  samples.push_back((int)m_dbManager->TICLsample());
2543  firstScin.push_back((int)m_dbManager->TICLfirstrow());
2544  lastScin.push_back((int)m_dbManager->TICLlastrow());
2545 
2546  // iterate over all other TICLs in the detector
2547  while (m_dbManager->SetNextTiclInDet()) {
2548  if (!((detector == TILE_REGION_CENTRAL)&&(sign_eta * m_dbManager->TICLncell() < 0))) {
2549  // find if the sample of the cell is already in the samples vector
2550  // and if not then add it
2551  currentSample = (int)m_dbManager->TICLsample();
2552  for (index=0; index<samples.size(); index++)
2553  if (currentSample==samples[index]) break;
2554  if (index==samples.size()) {
2555  samples.push_back(currentSample);
2556  firstScin.push_back((int)m_dbManager->TICLfirstrow());
2557  lastScin.push_back((int)m_dbManager->TICLlastrow());
2558  }
2559  }
2560  }
2561 
2562  } else {
2563  (*m_log) << MSG::ERROR << "TileGeoSectionBuilder::fillDescriptor: No TICL structures for the detector: "
2564  << detector << endmsg;
2565  return;
2566  }
2567 
2568  nsamp = 0;
2569  for (index=0; index<samples.size(); index++, indHardcoded++) {
2570  etaIndex = samples[index];
2571  if (etaIndex > nsamp) nsamp = etaIndex;
2573  side,
2574  etaIndex,
2575  eta_min[etaIndex-1], // In TICL structures samples are numbered from 1
2576  eta_max[etaIndex-1],
2577  deta[etaIndex-1],
2578  neta[etaIndex-1]);
2580  side,
2581  etaIndex,
2582  zshift,
2583  zcenter[etaIndex-1],
2584  dz[etaIndex-1]);
2585 
2586  // Fill in the hardcoded values
2587  if (detector == TILE_REGION_CENTRAL) {
2588  rcenter[etaIndex-1] = rBarrel[indHardcoded];
2589  dr[etaIndex-1] = drBarrel[indHardcoded];
2590  } else {
2591  rcenter[etaIndex-1] = rExtended[indHardcoded];
2592  dr[etaIndex-1] = drExtended[indHardcoded];
2593  }
2595  etaIndex,
2596  addPlates,
2597  firstScin[index],
2598  lastScin[index],
2599  rcenter[etaIndex-1],
2600  dr[etaIndex-1]);
2601  }
2602 
2603  } else if (detector == TILE_REGION_GAP) {
2604  // We are in GAP detectors (detector = 3 & 4)
2605  // Loop over all TICL structures of these detectors
2606  // Determine eta_min, eta_max, deta
2607  // neta = 1 for all
2608  //
2609  // !!! For DETECTOR=4 INDEX is set by TOWER and NOT SAMPLE !!!
2610  //
2611 
2612  nsamp = 0;
2613  for (unsigned int det = detector; det < detector+2; det++)
2615  if ((int)m_dbManager->TICLtower()>16) continue;
2616  if (det==detector)
2617  etaIndex = (int)m_dbManager->TICLsample();
2618  else
2619  etaIndex = (int)m_dbManager->TICLtower();
2620  if (etaIndex > nsamp) nsamp = etaIndex;
2621  // simple calculations of eta for one cell
2622  neta[etaIndex-1] = 1;
2623  deta[etaIndex-1] = m_dbManager->TICLdeta();
2624  eta_min[etaIndex-1] = m_dbManager->TICLeta() - m_dbManager->TICLdeta()/2;
2625  eta_max[etaIndex-1] = m_dbManager->TICLeta() + m_dbManager->TICLdeta()/2;
2627  side,
2628  etaIndex,
2629  zshift,
2630  zcenter[etaIndex-1],
2631  dz[etaIndex-1]);
2632 
2633  // Fill in the hardcoded values
2634  rcenter[etaIndex-1] = rGap[indHardcoded];
2635  dr[etaIndex-1] = drGap[indHardcoded];
2636  indHardcoded++;
2638  etaIndex,
2639  addPlates,
2642  rcenter[etaIndex-1],
2643  dr[etaIndex-1]);
2644  }
2645 
2646  } else {
2647  // MBSCIN case
2648  // - should not arrive to this place !!!
2649  // TileDetDescrManager do not expect MBSCIN at all
2650  // it is kept here just in case we'll want to describe
2651  // them as a separate region
2652  //
2653  assert (detector <= TILE_REGION_GAP);
2654 
2655  // diameter: 276 - 740 - 1964
2656  // radius: 138 - 370 - 982
2657  float rMB[] = { 676., 254. };
2658  float drMB[] = { 306., 116. };
2659  float zMB = 3500;
2660  float dzMB = 30;
2661 
2662  for (int ind=0; ind<2; ++ind) {
2663  neta[ind] = 1;
2664  deta[ind] = 1.;
2665  eta_min[ind] = 2. + ind;
2666  eta_max[ind] = 3. + ind;
2667  zcenter[ind] = zMB;
2668  dz[ind] = dzMB;
2669  rcenter[ind] = rMB[ind];
2670  dr[ind] = drMB[ind];
2671  }
2672  nsamp = 2;
2673  nphi = 8;
2674  dphi = M_PI_4;
2675  phi_min = -dphi/2;
2676  phi_max = nphi * dphi + phi_min;
2677  }
2678 
2679  descriptor->set(&*eta_min.begin(),
2680  &*eta_max.begin(),
2681  &*deta.begin(),
2682  phi_min,
2683  phi_max,
2684  dphi,
2685  zshift,
2686  &*rcenter.begin(),
2687  &*dr.begin(),
2688  &*zcenter.begin(),
2689  &*dz.begin(),
2690  nsamp,
2691  &*neta.begin(),
2692  nphi,
2693  sign_eta);
2694 
2695 
2696  // debug print
2697  if (m_verbose)
2698  descriptor->print();
2699 
2700 }
2701 
2702 
2710  int detector,
2711  bool addPlates,
2712  float zShiftPos,
2713  float zShiftNeg)
2714 {
2715  MLOG(DEBUG) << "TileGeoSectionBuilder::computeCellDim for detector="
2716  << detector << endmsg;
2717 
2719  std::vector<double> rmins;
2720  std::vector<double> rmaxs;
2721  std::vector<double> zmins;
2722  std::vector<double> zmaxs;
2723 
2725  int currentSample;
2726  std::vector<int> samples;
2727 
2729  unsigned int index;
2730  unsigned int CurrentScin;
2731 
2732  int nSide, nTower, nSample=0;
2733  unsigned int nFirstRow, nLastRow, nRows;
2734 
2735  double dzCell, dzPeriod;
2736  double rMin, rMax;
2737  double zEnd1 =0,zEnd2 =0,zEnd1Lim =0,zEnd2Lim =0;
2738 
2739  bool isSquare;
2740  float minTilesInRow;
2741  TileCellDim *cellDim =0, *cellDimNeg =0;
2742  // -------- Auxiliary variables ----------
2743 
2744  MLOG(DEBUG) << "Auxiliary variables..." << endmsg;
2745 
2746  // Barrel/Extended barrel regions
2747  if (detector != TILE_REGION_GAP ) {
2748  MLOG(DEBUG) << "Barrel/ExtendedBarrel regions..." << endmsg;
2749 
2750  if (detector == TILE_REGION_CENTRAL) {
2752  dzPeriod = m_barrelPeriodThickness;
2753  } else {
2755  dzPeriod = m_extendedPeriodThickness;
2756  }
2757  MLOG(DEBUG) << "dzPeriod: " << dzPeriod << "\n" << endmsg;
2758 
2759 
2761  if (addPlates) rMin -= m_dbManager->TILBdrfront() *Gaudi::Units::cm;
2762  CurrentScin = 100*m_dbManager->TILBsection() + 1;
2763  //dzMaster = m_dbManager->TILBdzmast()*Gaudi::Units::cm;
2764 
2769  for (unsigned int j = CurrentScin; j < (CurrentScin + m_dbManager->TILBnscin()); j++) {
2771 
2772  if ( (j == CurrentScin + m_dbManager->TILBnscin() - 1) && addPlates ) {
2773  // use end of the master as end of last cell
2775 
2776  } else {
2777  double tileSize=m_dbManager->SCNTdr();
2778  if (m_dbManager->SCNTdrw() > 0)
2779  // round to integer for all tiles except gap scin
2780  tileSize=round(tileSize);
2781  rMax = (m_dbManager->TILBrmin() + m_dbManager->SCNTrc() + tileSize/2)*Gaudi::Units::cm;
2782  }
2783 
2784  rmins.push_back(rMin);
2785  rmaxs.push_back(rMax);
2786  rMin = rMax;
2787 
2788  if (detector == TILE_REGION_CENTRAL) {
2789  zmins.push_back((-m_dbManager->TILBdzmast()/2 - m_barrelGlue*(1./Gaudi::Units::cm)
2793  zEnd1 = (-m_dbManager->TILBdzmodul()/2)*Gaudi::Units::cm;
2794  zEnd2 = ( m_dbManager->TILBdzmodul()/2)*Gaudi::Units::cm;
2795 
2796  } else {
2802  }
2803 
2804  // init all zmaxs to 0.
2805  zmaxs.push_back(0.);
2806  }
2807 
2808  // Iterate through region cells and fill in the Samples vector
2810  samples.push_back((int)m_dbManager->TICLsample());
2811 
2812  // iterate over all other TICLs in the detector
2813  while (m_dbManager->SetNextTiclInDet()) {
2815  currentSample = (int)m_dbManager->TICLsample();
2816  for (index=0; index<samples.size(); index++)
2817  if (currentSample==samples[index]) break;
2818  if (index==samples.size()) samples.push_back(currentSample);
2819  }
2820 
2821  } else {
2822  (*m_log) << MSG::ERROR << "TileGeoSectionBuilder::computeCellDim: No TICL structures for the detector: "
2823  << detector << endmsg;
2824  return;
2825  }
2826 
2828  for (index=0; index<samples.size(); index++) {
2829  currentSample = samples[index];
2830 
2831  if (m_dbManager->SetFirstTiclInDetSamp(detector, currentSample)) {
2832  nFirstRow = (int)m_dbManager->TICLfirstrow();
2833  // BC sample
2835  nLastRow = nFirstRow + 2;
2836  else
2837  nLastRow = (int)m_dbManager->TICLlastrow();
2838 
2839  nRows = nLastRow - nFirstRow + 1;
2840 
2841  do {
2842  isSquare = true;
2843  minTilesInRow = m_dbManager->TICLntilesrow(0);
2844  for (unsigned int jj=1; jj<nRows; jj++) {
2845  if (m_dbManager->TICLntilesrow(jj)!=minTilesInRow)
2846  isSquare = false;
2847  if (m_dbManager->TICLntilesrow(jj)<minTilesInRow)
2848  minTilesInRow = m_dbManager->TICLntilesrow(jj);
2849  }
2850 
2851  if (isSquare)
2852  dzCell = minTilesInRow * dzPeriod;
2853  else
2854  dzCell = (minTilesInRow + 0.5) * dzPeriod;
2855 
2856  MLOG(DEBUG) << "dzCell: " << dzCell << " minTilesInRow: " << minTilesInRow << " isSquare: " << isSquare << " dzPeriod: " << dzPeriod << endmsg;
2857 
2858  for (unsigned int jj=nFirstRow; jj<=nLastRow; jj++)
2859  zmaxs[jj-1] = zmins[jj-1] + dzCell;
2860 
2861 
2863  bool BCcell = (m_dbManager->TICLsample()==2 && detector == TILE_REGION_CENTRAL);
2864  if (BCcell) {
2865  isSquare = true;
2866  int firstC = nLastRow + 1;
2867  nLastRow +=3;
2868 
2869  minTilesInRow = m_dbManager->TICLntilesrow(firstC-nFirstRow);
2870 
2871  for (unsigned int jj=firstC-nFirstRow+1; jj<=nLastRow-nFirstRow; jj++) {
2872  if (m_dbManager->TICLntilesrow(jj)!=minTilesInRow)
2873  isSquare = false;
2874  if (m_dbManager->TICLntilesrow(jj)<minTilesInRow)
2875  minTilesInRow = m_dbManager->TICLntilesrow(jj);
2876  }
2877 
2878  if (isSquare)
2879  dzCell = minTilesInRow*dzPeriod;
2880  else
2881  dzCell = (minTilesInRow + 0.5)*dzPeriod;
2882 
2883 
2884  MLOG(DEBUG) << "BC - dzCell: " << dzCell << " minTilesInRow: " << minTilesInRow << " isSquare: " << isSquare << endmsg;
2885 
2886  for (unsigned int jj=firstC; jj<=nLastRow; jj++)
2887  zmaxs[jj-1] = zmins[jj-1] + dzCell;
2888  }
2889 
2892  cellDim = new TileCellDim(2*nRows);
2893  else
2894  cellDim = new TileCellDim(nRows);
2895 
2897  cellDimNeg = new TileCellDim(nRows);
2898 
2899  for (unsigned int jj=nFirstRow; jj<=nLastRow; jj++) {
2900  double Zmin=zmins[jj-1];
2901  double Zmax=zmaxs[jj-1];
2902  if (addPlates) {
2903  if (Zmin<zEnd1Lim) Zmin=zEnd1;
2904  else if (Zmin>zEnd2Lim) Zmin=zEnd2;
2905  if (Zmax<zEnd1Lim) Zmax=zEnd1;
2906  else if (Zmax>zEnd2Lim) Zmax=zEnd2;
2907  }
2908 
2909  cellDim->addRMin(rmins[jj-1]);
2910  cellDim->addRMax(rmaxs[jj-1]);
2911  cellDim->addZMin(Zmin+zShiftPos);
2912  cellDim->addZMax(Zmax+zShiftPos);
2913 
2914  if (detector != TILE_REGION_CENTRAL) {
2915  cellDimNeg->addRMin(rmins[jj-1]);
2916  cellDimNeg->addRMax(rmaxs[jj-1]);
2917  cellDimNeg->addZMin(-Zmax-zShiftNeg);
2918  cellDimNeg->addZMax(-Zmin-zShiftNeg);
2919  if (jj==nFirstRow || (BCcell && jj==nLastRow))
2920  MLOG(DEBUG) << "Zmin: " << Zmin << " Zmax: " << Zmax << " zShiftPos: " << zShiftPos << " zShiftNeg: " << zShiftNeg << endmsg;
2921 
2922  } else {
2923  if (jj==nFirstRow || (BCcell && jj==nLastRow))
2924  MLOG(DEBUG) << "Zmin: " << Zmin << " Zmax: " << Zmax << " zShift: " << zShiftPos << endmsg;
2925  }
2926  }
2927 
2928  for (unsigned int jj=nFirstRow; jj<=nLastRow; jj++)
2929  zmins[jj-1] = zmaxs[jj-1];
2930 
2931  if (m_dbManager->TICLncell()<0)
2932  nSide = -1;
2933  else
2934  nSide = 1;
2935 
2936  nTower = abs((int)m_dbManager->TICLtower())-1;
2937  nSample = currentSample - 1;
2938 
2939  if (detector == TILE_REGION_CENTRAL) {
2940  cellDim->computeVolume();
2941  manager->add_cellDim(detector, nSide, nTower, nSample, cellDim);
2942 
2943  } else {
2944  cellDim->computeVolume();
2945  cellDimNeg->computeVolume();
2946  manager->add_cellDim(detector, 1, nTower, nSample, cellDim);
2947  manager->add_cellDim(detector, -1, nTower, nSample, cellDimNeg);
2948  }
2949 
2950  if (m_dbManager->TICLsample()==2 && detector == TILE_REGION_CENTRAL) nLastRow -=3;
2951 
2952  /* -------- DEBUG printouts -------------- */
2953 
2954  if (m_verbose) {
2955  std::cout << std::setiosflags(std::ios::fixed)
2956  << std::setw(9) << std::setprecision(2);
2957  std::cout << "\n **** Cell dimensions computed for : ";
2958  std::cout << "(" << detector << ", "
2959  << nSide << ", "
2960  << nTower << ", "
2961  << nSample << ")\n";
2962  std::cout << " >> CellDim contains " << cellDim->getNRows() << " rows\n";
2963  for (unsigned int jj=0; jj<cellDim->getNRows(); jj++)
2964  std::cout << cellDim->getRMin(jj) << " "
2965  << cellDim->getRMax(jj) << " "
2966  << cellDim->getZMin(jj) << " "
2967  << cellDim->getZMax(jj) << "\n";
2968  std::cout << " >> Cell Volume is " << cellDim->getVolume()*(1./Gaudi::Units::cm3) << " cm^3\n";
2969 
2970  if (detector != TILE_REGION_CENTRAL) {
2971  std::cout << " >> CellDimNeg contains " << cellDimNeg->getNRows() << " rows\n";
2972  for (unsigned int jj=0; jj<cellDimNeg->getNRows(); jj++)
2973  std::cout << cellDimNeg->getRMin(jj) << " "
2974  << cellDimNeg->getRMax(jj) << " "
2975  << cellDimNeg->getZMin(jj) << " "
2976  << cellDimNeg->getZMax(jj) << "\n";
2977  std::cout << " >> CellNeg Volume is " << cellDimNeg->getVolume()*(1./Gaudi::Units::cm3) << " cm^3\n";
2978  }
2979  std::cout << "\n" << std::resetiosflags(std::ios::fixed);
2980  }
2981  /* ------------------------------------------------------------------------------------------------ */
2982  }
2983  while (m_dbManager->SetNextTiclInDetSamp());
2984 
2985  } else {
2986  (*m_log) << MSG::ERROR << "TileGeoSectionBuilder::computeCellDim: No TICL structures in detector: "
2987  << detector << " for sample: " << nSample << endmsg;
2988  return;
2989  }
2990  }
2991 
2992  } else { // ITC/GAP/CRACK
2993  MLOG(DEBUG) << "ITC/GAP/CRACK regions...\n" << endmsg;
2994  nSide = 1;
2995  // Deal with ITC
2996  for (unsigned int sec=0; sec<2; sec++) { // PLUG1 & PLUG2
2997  rmins.clear();
2998  rmaxs.clear();
2999  zmins.clear();
3000  zmaxs.clear();
3001 
3003 
3004  if (sec) {
3006  } else {
3009  }
3010 
3012  if (addPlates) rMin -= m_dbManager->TILBdrfront() *Gaudi::Units::cm;
3013  CurrentScin = 100*m_dbManager->TILBsection() + 1;
3014 
3015  for (unsigned int j = CurrentScin; j < (CurrentScin + m_dbManager->TILBnscin()); j++) {
3017 
3018  if ( (j == CurrentScin + m_dbManager->TILBnscin() - 1) && addPlates ) {
3022  if (addPlates && sec)
3024 
3025  } else {
3026  double tileSize=m_dbManager->SCNTdr();
3027  if (m_dbManager->SCNTdrw() > 0)
3029  tileSize=round(tileSize);
3030  rMax = (m_dbManager->TILBrmin() + m_dbManager->SCNTrc() + tileSize/2)*Gaudi::Units::cm;
3031  }
3032 
3033  rmins.push_back(rMin);
3034  rmaxs.push_back(rMax);
3035  rMin = rMax;
3036 
3041 
3042  if ( addPlates ) {
3043  zmins.push_back((m_dbManager->TILBzoffset() - m_dbManager->TILBdzmodul()/2)*Gaudi::Units::cm);
3044  zmaxs.push_back((m_dbManager->TILBzoffset() + m_dbManager->TILBdzmodul()/2)*Gaudi::Units::cm);
3045  } else {
3048  }
3049  }
3050 
3051  // Create TileCellDim objects
3052  if (m_dbManager->TILBnscin() < 0) {
3053  (*m_log) << MSG::ERROR << "TileGeoSectionBuilder::computeCellDim: Bad return from TILBnscin" << endmsg;
3054  return;
3055  }
3056  unsigned int nscin = static_cast<unsigned int>(m_dbManager->TILBnscin());
3057  cellDim = new TileCellDim(nscin);
3058  cellDimNeg = new TileCellDim(nscin);
3059 
3060  for (unsigned int jj=0; jj<nscin; jj++) {
3061  cellDim->addRMin(rmins[jj]);
3062  cellDim->addRMax(rmaxs[jj]);
3063  cellDim->addZMin(zmins[jj]+zShiftPos);
3064  cellDim->addZMax(zmaxs[jj]+zShiftPos);
3065 
3066  cellDimNeg->addRMin(rmins[jj]);
3067  cellDimNeg->addRMax(rmaxs[jj]);
3068  cellDimNeg->addZMin(-zmaxs[jj]-zShiftNeg);
3069  cellDimNeg->addZMax(-zmins[jj]-zShiftNeg);
3070  }
3071  MLOG(DEBUG) << "Zmin: " << zmins[0] << " Zmax: " << zmaxs[0] << " zShiftPos: " << zShiftPos << " zShiftNeg: " << zShiftNeg << endmsg;
3072 
3073  nTower = (int)m_dbManager->TICLtower()-1;
3074  nSample = (int)m_dbManager->TICLsample()-1;
3075 
3076  cellDim->computeVolume();
3077  cellDimNeg->computeVolume();
3078  manager->add_cellDim(detector, 1, nTower, nSample, cellDim);
3079  manager->add_cellDim(detector, -1, nTower, nSample, cellDimNeg);
3080 
3081 /* -------- DEBUG printouts -------------- */
3082  if (m_verbose) {
3083  std::cout << std::setiosflags(std::ios::fixed)
3084  << std::setw(9) << std::setprecision(2);
3085  std::cout << "\n **** Cell dimension computed for : ";
3086  std::cout << "(" << detector << ", "
3087  << nSide << ", "
3088  << nTower << ", "
3089  << nSample << ")\n";
3090  std::cout << " >> CellDim contains " << cellDim->getNRows() << " rows\n";
3091  for (unsigned int jj=0; jj<cellDim->getNRows(); jj++)
3092  std::cout << cellDim->getRMin(jj) << " "
3093  << cellDim->getRMax(jj) << " "
3094  << cellDim->getZMin(jj) << " "
3095  << cellDim->getZMax(jj) << "\n";
3096  std::cout<< " >> Cell Volume is " << cellDim->getVolume()*(1./Gaudi::Units::cm3) << " cm^3\n";
3097 
3098  std::cout << " >> CellDimNeg contains " << cellDimNeg->getNRows() << " rows\n";
3099  for (unsigned int jj=0; jj<cellDimNeg->getNRows(); jj++)
3100  std::cout << cellDimNeg->getRMin(jj) << " "
3101  << cellDimNeg->getRMax(jj) << " "
3102  << cellDimNeg->getZMin(jj) << " "
3103  << cellDimNeg->getZMax(jj) << "\n";
3104  std::cout << " >> CellNeg Volume is " << cellDimNeg->getVolume()*(1./Gaudi::Units::cm3) << " cm^3\n";
3105  std::cout << "\n" << std::resetiosflags(std::ios::fixed);
3106  }
3107 /* -------------------------------------------- */
3108  }
3109 
3110  for (unsigned int sec=0; sec<2; sec++) { // GAP & CRACK
3111  rmins.clear();
3112  rmaxs.clear();
3113  zmins.clear();
3114  zmaxs.clear();
3115 
3116  if (sec) {
3118  CurrentScin = 100*m_dbManager->TILBsection()+1;
3119  } else {
3121  CurrentScin = 100*m_dbManager->TILBsection()+1;
3122  }
3123 
3124  double rMIN = m_dbManager->TILBrmin()*Gaudi::Units::cm;
3125  double rMAX = m_dbManager->TILBrmax()*Gaudi::Units::cm;
3126 
3127  // Initialize rMin, rMax, zMin, zMax vectors
3128  for (unsigned int j = CurrentScin; j < (CurrentScin + m_dbManager->TILBnscin()); j++) {
3130 
3131  double rCenter = rMIN + m_dbManager->SCNTrc()*Gaudi::Units::cm;
3132  double dR2 = (0.5 * m_dbManager->SCNTdr() + m_dbManager->SCNTdrw()) *Gaudi::Units::cm;
3133  if (addPlates) {
3134  if (j==CurrentScin) { // cells E2, E4 - use rMin of mother volume, calculate rMax
3135  rMin = rMIN;
3136  rMax = rCenter + dR2;
3137  } else { // cells E1, E3 - use rMax of mother volume, calculate rMin
3138  rMin = rCenter - dR2;
3139  rMax = rMAX;
3140  }
3141  } else {
3142  rMin = rCenter - dR2;
3143  rMax = rCenter + dR2;
3144  }
3145 
3146  rmins.push_back(rMin);
3147  rmaxs.push_back(rMax);
3148 
3149  zmins.push_back((m_dbManager->TILBzoffset() - m_dbManager->TILBdzmodul()/2)*Gaudi::Units::cm);
3150  zmaxs.push_back((m_dbManager->TILBzoffset() + m_dbManager->TILBdzmodul()/2)*Gaudi::Units::cm);
3151  }
3152 
3153  // Iterate through scintillators and create corresponding TileCellDim objects (+/-)
3154  for (unsigned int jj = 0; jj < (unsigned int)m_dbManager->TILBnscin(); jj++) {
3155  if (sec==0 && jj==0)
3157  else
3159  if ((int)m_dbManager->TICLtower()>16) continue;
3160 
3161  cellDim = new TileCellDim(1);
3162  cellDimNeg = new TileCellDim(1);
3163 
3164  cellDim->addRMin(rmins[m_dbManager->TILBnscin() - jj - 1]);
3165  cellDim->addRMax(rmaxs[m_dbManager->TILBnscin() - jj - 1]);
3166  cellDim->addZMin(zmins[m_dbManager->TILBnscin() - jj - 1]+zShiftPos);
3167  cellDim->addZMax(zmaxs[m_dbManager->TILBnscin() - jj - 1]+zShiftPos);
3168 
3169  cellDimNeg->addRMin(rmins[m_dbManager->TILBnscin() - jj - 1]);
3170  cellDimNeg->addRMax(rmaxs[m_dbManager->TILBnscin() - jj - 1]);
3171  cellDimNeg->addZMin(-zmaxs[m_dbManager->TILBnscin() - jj - 1]-zShiftNeg);
3172  cellDimNeg->addZMax(-zmins[m_dbManager->TILBnscin() - jj - 1]-zShiftNeg);
3173 
3174  MLOG(DEBUG) << "Zmin: " << zmins[m_dbManager->TILBnscin() - jj - 1] << " Zmax: " << zmaxs[m_dbManager->TILBnscin() - jj - 1] << " zShiftPos: " << zShiftPos << " zShiftNeg: " << zShiftNeg << endmsg;
3175 
3176  nTower = (int)m_dbManager->TICLtower()-1;
3177  nSample = (int)m_dbManager->TICLsample()-1;
3178 
3179  cellDim->computeVolume();
3180  cellDimNeg->computeVolume();
3181  manager->add_cellDim(detector, 1, nTower, nSample, cellDim);
3182  manager->add_cellDim(detector, -1, nTower, nSample, cellDimNeg);
3183 
3184 /* -------- DEBUG printouts -------------- */
3185  if (m_verbose) {
3186  std::cout << std::setiosflags(std::ios::fixed)
3187  << std::setw(9) << std::setprecision(2);
3188  std::cout << "\n **** Cell dimension computed for : ";
3189  std::cout << "(" << detector << ", "
3190  << nSide << ", "
3191  << nTower << ", "
3192  << nSample << ")\n";
3193  std::cout << " >> CellDim contains " << cellDim->getNRows() << " rows\n";
3194  for (unsigned int jj=0; jj<cellDim->getNRows(); jj++)
3195  std::cout << cellDim->getRMin(jj) << " "
3196  << cellDim->getRMax(jj) << " "
3197  << cellDim->getZMin(jj) << " "
3198  << cellDim->getZMax(jj) << "\n";
3199  std::cout << " >> Cell Volume is " << cellDim->getVolume()*(1./Gaudi::Units::cm3) << " cm^3\n";
3200 
3201  std::cout << " >> CellDimNeg contains " << cellDimNeg->getNRows() << " rows\n";
3202  for (unsigned int jj=0; jj<cellDimNeg->getNRows(); jj++)
3203  std::cout << cellDimNeg->getRMin(jj) << " "
3204  << cellDimNeg->getRMax(jj) << " "
3205  << cellDimNeg->getZMin(jj) << " "
3206  << cellDimNeg->getZMax(jj) << "\n";
3207  std::cout << " >> CellNeg Volume is " << cellDimNeg->getVolume()*(1./Gaudi::Units::cm3) << " cm^3\n";
3208  std::cout << "\n" << std::resetiosflags(std::ios::fixed);
3209  }
3210 /* -------------------------------------------- */
3211  }
3212  }
3213  }
3214 }
3215 
3216 
3218  int side,
3219  int sample,
3220  float zshift,
3221  float& zcenter,
3222  float& dz)
3223 {
3224  switch(detector) {
3225  case TILE_REGION_CENTRAL:
3227  break;
3228  case TILE_REGION_EXTENDED:
3230  break;
3231  case TILE_REGION_GAP:
3232  if (sample==3) { // D4
3234  } else if (sample==2) { // C10
3236  } else if (sample<13) { // E1-E2
3238  } else { // E3-E4
3240  }
3241  break;
3242  default:
3243  (*m_log) << MSG::ERROR << "TileGeoSectionBuilder::calculateZ: Unexpected detector: "
3244  << detector << endmsg;
3245  return;
3246  }
3247 
3248  // first - find position in ideal world before Z-shift and misalignment
3249  if (detector == TILE_REGION_CENTRAL) {
3250  // need to split one cylinder in pos/neg halves
3253  if (sample==3) { // fix for D0 cell
3254  float D0size = 560.58/307*40 * Gaudi::Units::cm; // size of D0 along Z in Gaudi::Units::cm
3255  // FIXME:: should be taken from DB
3256  if (side>0) // positive
3257  zmin = - D0size/2;
3258  else
3259  zmin = D0size/2;
3260  }
3261  zcenter = (zmin+zmax)/2;
3262  dz = (zmax-zmin);
3263 
3264  } else if (detector == TILE_REGION_GAP && (sample > 9) ) {
3268 
3269  } else {
3272  }
3273 
3274  // apply zshift from ideal pseudo-projective eta (which includes alignment also!)
3275  zcenter += zshift;
3276  // inversion for negative side
3277  if (side<1) zcenter *= -1;
3278 
3279  return;
3280 }
3281 
3282 
3284  int sample,
3285  bool addPlates,
3286  int firstScin,
3287  int lastScin,
3288  float& rcenter,
3289  float& dr)
3290 {
3291  int cell = 0;
3292  switch(detector) {
3293  case TILE_REGION_CENTRAL:
3295  break;
3296  case TILE_REGION_EXTENDED:
3298  break;
3299  case TILE_REGION_GAP:
3300  if (sample==3) { // D4
3301  cell = -2;
3303  } else if (sample==2) { // C10
3304  cell = -1;
3306  } else if (sample<13) { // E1-E2
3308  cell = firstScin - 2; // E2 has index 1, E1 has index 2
3309  } else { // E3-E4
3311  cell = firstScin; // E4 has index 1, E3 has index 2
3312  }
3313  break;
3314  default:
3315  (*m_log) << MSG::ERROR << "TileGeoSectionBuilder::calculateR: Unexpected detector: "
3316  << detector << endmsg;
3317  return;
3318  }
3319 
3320  float oldrc = rcenter;
3321  float olddr = dr;
3322 
3323  float rMin = m_dbManager->TILBrmin();
3324  float rMax = m_dbManager->TILBrmax();
3325 
3326  if (cell>0) { // single gap/crack scintillator
3328  rcenter = (rMin + m_dbManager->SCNTrc());
3329  dr = m_dbManager->SCNTdr() + 2. * m_dbManager->SCNTdrw();
3330  if (addPlates) {
3331  if (cell==1) { // cells E4, E2 - use rMin of mother volume, recalculate rMax
3332  rMax = rcenter + dr * 0.5;
3333  } else { // cells E3, E1 - use rMax of mother volume, recalculate rMin
3334  rMin = rcenter - dr * 0.5;
3335  }
3336  rcenter = (rMax+rMin) * 0.5;
3337  dr = (rMax-rMin);
3338  }
3339 
3340  } else {
3341  int first = 100*m_dbManager->TILBsection()+firstScin;
3342  int last = 100*m_dbManager->TILBsection()+lastScin;
3343  if (m_dbManager->TILBcurscint() != 0) { // for cells C10 and D4 first/last should be different
3345  last = first + m_dbManager->TILBnscin()-1;
3346  }
3347  if (addPlates) {
3348  if (cell == -1) { // adjust size for cell C10
3349  rMin -= m_dbManager->TILBdrfront(); // add front plate at inner radius
3350  rMax -= m_dbManager->TILBdrfront(); // decrease outer radius by thickness of front plate of cell D4
3351  } else if (cell == -2) { // adjust size for cell D4, use rMax of mother volume
3352  rMin -= m_dbManager->TILBdrfront(); // add front plate at inner radius
3353  } else if (firstScin == 1) { // decrease rMin by thickness of front plate, calculate rMax for layer A
3354  m_dbManager->SetCurrentScin(last);
3355  rMax = rMin + m_dbManager->SCNTrc() + round(m_dbManager->SCNTdr())*0.5;
3356  rMin -= m_dbManager->TILBdrfront();
3357  } else if (lastScin == m_dbManager->TILBnscin()) { // use rMax of mother volume, calculate rMin for layer D
3359  rMin += m_dbManager->SCNTrc() - round(m_dbManager->SCNTdr())*0.5;
3360  } else { // calculate both rMin and rMax for layer BC and B
3361  m_dbManager->SetCurrentScin(last);
3362  rMax = rMin + m_dbManager->SCNTrc() + round(m_dbManager->SCNTdr())*0.5;
3364  rMin += m_dbManager->SCNTrc() - round(m_dbManager->SCNTdr())*0.5;
3365  }
3366 
3367  } else { // keep only sensitive part of the cell without front/back planes
3368  m_dbManager->SetCurrentScin(last);
3369  rMax = rMin + m_dbManager->SCNTrc() + round(m_dbManager->SCNTdr())*0.5;
3371  rMin += m_dbManager->SCNTrc() - round(m_dbManager->SCNTdr())*0.5;
3372  }
3373 
3374  rcenter = (rMax+rMin)*0.5;
3375  dr = (rMax-rMin);
3376  }
3377 
3378  rcenter *= Gaudi::Units::cm;
3379  dr *= Gaudi::Units::cm;
3380 
3381 /* -------- DEBUG printouts -------------- */
3382  if (m_verbose) {
3383  std::cout << std::setiosflags(std::ios::fixed) << std::setw(9) << std::setprecision(2);
3384  std::cout << "Detector " << detector << " sample " << sample << " old r/dr " << oldrc << " " << olddr << std::endl;
3385  std::cout << "Detector " << detector << " sample " << sample << " new r/dr " << rcenter << " " << dr << " delta r/dr " << rcenter-oldrc << " " << dr-olddr << std::endl;
3386  std::cout << std::resetiosflags(std::ios::fixed);
3387  }
3388 
3389  return;
3390 }
3391 
3392 
3394  int side,
3395  int sample,
3396  float& etamin,
3397  float& etamax,
3398  float& deta,
3399  unsigned int& neta)
3400 {
3410  int sign_eta = 1;
3411  if ((detector == TILE_REGION_CENTRAL) && (side<1)) sign_eta = -1;
3412 
3413  switch(detector) {
3414  case TILE_REGION_CENTRAL: // Central Barrel
3415  case TILE_REGION_EXTENDED: // Extended Barrel
3416  {
3418  // --- A ---
3419  while (sign_eta * m_dbManager->TICLncell() < 0)
3420  if (!(m_dbManager->SetNextTiclInDetSamp())) {
3421  (*m_log) << MSG::ERROR << "TileGeoSectionBuilder::calculateEta: No TICL structures of positive side "
3422  << "in Central Barrel for sample: " << sample << endmsg;
3423  return;
3424  }
3425 
3426  // --- B ---
3427  neta = 1;
3428  deta = m_dbManager->TICLdeta();
3429  etamin = m_dbManager->TICLeta()*sign_eta - m_dbManager->TICLdeta()/2;
3430  etamax = m_dbManager->TICLeta()*sign_eta + m_dbManager->TICLdeta()/2;
3431 
3432  // --- C ---
3433  while (m_dbManager->SetNextTiclInDetSamp()) {
3434  if (!((detector == TILE_REGION_CENTRAL)&&(sign_eta * m_dbManager->TICLncell() <= 0))) {
3435  neta++;
3436  if (etamax < m_dbManager->TICLeta()*sign_eta + m_dbManager->TICLdeta()/2)
3437  etamax = m_dbManager->TICLeta()*sign_eta + m_dbManager->TICLdeta()/2;
3438  if (etamin > m_dbManager->TICLeta()*sign_eta - m_dbManager->TICLdeta()/2)
3439  etamin = m_dbManager->TICLeta()*sign_eta - m_dbManager->TICLdeta()/2;
3440  }
3441  }
3442 
3443  } else {
3444  (*m_log) << MSG::ERROR << "TileGeoSectionBuilder::calculateEta: No TICL structures in detector: "
3445  << detector << " for sample: " << sample << endmsg;
3446  return;
3447  }
3448  break;
3449  }
3450  default:
3451  {
3452  (*m_log) << MSG::ERROR << "TileGeoSectionBuilder::calculateEta: Unexpected detector: "
3453  << detector << endmsg;
3454  return;
3455  }
3456  }
3457 }
3458 
3459 
3461 {
3463 }
3464 
3465 
3467 {
3468  m_barrelGlue = val;
3469 }
3470 
3471 
3473 {
3475 }
3476 
3477 
3478 void TileGeoSectionBuilder::checktransfunc(double absorber, double period, int np, double center)
3479 {
3480  (*m_log) << MSG::VERBOSE
3481  << std::setprecision (std::numeric_limits<double>::digits10 + 1)
3482  << " Absorber center = " << center
3483  << " length = " << absorber
3484  << " period = " << period
3485  << " nperiods = " << np
3486  << endmsg;
3487  double zC,dZ,z1,z2=-absorber/2.+center;
3488  for (int i=0; i<np; ++i) {
3489  zC = (period*(2*i+1)-absorber)/2. + center;
3490  z1 = zC - period/2.;
3491  dZ = z1 - z2;
3492  z2 = zC + period/2.;
3493  (*m_log) << MSG::VERBOSE << std::setw(4)
3494  << i << " z1= " << z1 << " z2= " << z2
3495  << " dist from previous= " << dZ << endmsg;
3496  }
3497 }
3498 
3499 
3500 void TileGeoSectionBuilder::printdouble(const char * name, double val)
3501 {
3502  (*m_log) << MSG::VERBOSE << std::setprecision (std::numeric_limits<double>::digits10 + 1)
3503  << name << val << endmsg;
3504 }
3505 
3506 
3507 const GeoShape * TileGeoSectionBuilder::makeHolesScint(const GeoShape * mother, double R, double H2, double off, double off0) {
3508  GeoShape *hole = new GeoTubs(0., R, H2, 0., 360.0 * Gaudi::Units::deg);
3509  const GeoShapeUnion& scintUnion = hole->add( *hole << GeoTrf::Translate3D((off0-off*2.0),0.,0.));
3510  GeoTrf::Transform3D tfHole = GeoTrf::Translate3D(0.,0.,(off0-off)) * GeoTrf::RotateY3D(90*Gaudi::Units::deg);
3511  const GeoShape & motherWithHoles = (mother->subtract(scintUnion<<tfHole));
3512  return &motherWithHoles;
3513 }
3514 
3515 
3516 const GeoShape * TileGeoSectionBuilder::makeHoles(const GeoShape * mother, double R, double H2, double off, double off0) {
3517  GeoShape *hole1 = new GeoTubs(0., R, H2, 0., 360.0 * Gaudi::Units::deg);
3518  GeoShape *hole2 = new GeoTubs(0., R, H2, 0., 360.0 * Gaudi::Units::deg);
3519  GeoTrf::Transform3D tfHole1 = GeoTrf::Translate3D(0.,0.,(off0-off)) * GeoTrf::RotateY3D(-90*Gaudi::Units::deg);
3520  GeoTrf::Transform3D tfHole2 = GeoTrf::Translate3D(0.,0.,(off0+off)) * GeoTrf::RotateY3D(-90*Gaudi::Units::deg);
3521  const GeoShape & motherWithHoles = (mother->subtract((*hole1)<<tfHole1).subtract((*hole2)<<tfHole2));
3522  return &motherWithHoles;
3523 }
TileDddbManager::TICLtower
double TICLtower() const
Definition: TileDddbManager.cxx:1621
TileDddbManager::TILE_PLUG3
@ TILE_PLUG3
Definition: TileDddbManager.h:46
TileGeoSectionBuilder::m_matIronHalfDens
GeoIntrusivePtr< GeoMaterial > m_matIronHalfDens
Definition: TileGeoSectionBuilder.h:214
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
python.AtlRunQueryAMI.period
period
Definition: AtlRunQueryAMI.py:225
TileDddbManager::TICGdx2
double TICGdx2() const
Definition: TileDddbManager.cxx:1398
TileCellDim::addRMax
void addRMax(double rMax)
Definition: TileCellDim.cxx:71
TileDddbManager::TILBsection
int TILBsection() const
Definition: TileDddbManager.cxx:601
TileDddbManager::SetCurrentCuts
int SetCurrentCuts(const std::string &input)
Fields of CUTS structure (see also Oracle comments):
Definition: TileDddbManager.cxx:1014
VertexShift::Zmax
const float Zmax
Definition: VertexShift.h:26
TileDddbManager::TIGRmaterial
int TIGRmaterial() const
Definition: TileDddbManager.cxx:1202
TileDddbManager::SCNTitem
int SCNTitem() const
Fields of SCNT structure (see also Oracle comments):
Definition: TileDddbManager.cxx:923
TileGeoSectionBuilder::m_switches
TileSwitches m_switches
Definition: TileGeoSectionBuilder.h:205
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
TileDddbManager::TILE_BARREL
@ TILE_BARREL
Definition: TileDddbManager.h:42
TileGeoSectionBuilder::calculateR
void calculateR(int detector, int sample, bool addPlates, int firstScin, int lastScin, float &rcenter, float &dr)
Calculator of R position given sample in region (detector):
Definition: TileGeoSectionBuilder.cxx:3283
TileGeoSectionBuilder.h
Definition of TileGeoSectionBuilder class.
TileDddbManager::SetCurrentSection
int SetCurrentSection(unsigned int section, bool print=true)
Definition: TileDddbManager.cxx:582
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
TileDddbManager::TILE_PLUG1
@ TILE_PLUG1
Definition: TileDddbManager.h:44
TileDddbManager::TILBngirder
int TILBngirder() const
Definition: TileDddbManager.cxx:821
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
TileDddbManager::TICLntilesrow
double TICLntilesrow(unsigned int ind) const
Definition: TileDddbManager.cxx:1687
TRTCalib_Extractor.det
det
Definition: TRTCalib_Extractor.py:36
TileDddbManager::TILBrmax
double TILBrmax() const
Definition: TileDddbManager.cxx:645
PixelAthClusterMonAlgCfg.zmin
zmin
Definition: PixelAthClusterMonAlgCfg.py:169
index
Definition: index.py:1
TRTCalib_cfilter.detector
detector
Definition: TRTCalib_cfilter.py:241
TileDddbManager::TILE_PLUG4
@ TILE_PLUG4
Definition: TileDddbManager.h:47
Monitored::Z
@ Z
Definition: HistogramFillerUtils.h:24
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
TileDddbManager::TICGzc
double TICGzc() const
Definition: TileDddbManager.cxx:1431
TileDddbManager::TILBflangex
double TILBflangex() const
Definition: TileDddbManager.cxx:711
TileCellDim::computeVolume
void computeVolume()
Definition: TileCellDim.cxx:95
TileGeoSectionBuilder::m_log
MsgStream * m_log
Definition: TileGeoSectionBuilder.h:203
TileDddbManager::TICGoff
double TICGoff() const
Definition: TileDddbManager.cxx:1409
MuonGM::round
float round(const float toRound, const unsigned int decimals)
Definition: Mdt.cxx:27
Zmin
double Zmin
Definition: LArDetectorConstructionTBEC.cxx:58
TileCellDim::getVolume
double getVolume() const
Definition: TileCellDim.h:26
StoredMaterialManager::getElement
virtual const GeoElement * getElement(const std::string &name)=0
cm3
#define cm3
M_PI
#define M_PI
Definition: ActiveFraction.h:11
TileDddbManager::SetCurrentTicg
int SetCurrentTicg(int item)
Definition: TileDddbManager.cxx:1312
deg
#define deg
Definition: SbPolyhedron.cxx:17
TileGeoSectionBuilder::m_matLArServices
GeoIntrusivePtr< GeoMaterial > m_matLArServices
Definition: TileGeoSectionBuilder.h:213
TileDddbManager::TICLsample
double TICLsample() const
Definition: TileDddbManager.cxx:1632
TileDddbManager::GetModType
int GetModType() const
Definition: TileDddbManager.cxx:437
TileDddbManager::TILBnscin
int TILBnscin() const
Definition: TileDddbManager.cxx:832
TileGeoSectionBuilder::makeHolesScint
const GeoShape * makeHolesScint(const GeoShape *mother, double R, double H2, double off, double off0=0.)
Definition: TileGeoSectionBuilder.cxx:3507
TileSwitches::testBeam
bool testBeam
setting up testbeam geometry or ATLAS geometry
Definition: TileSwitches.h:31
TileDddbManager::TILBdzmodul
double TILBdzmodul() const
Definition: TileDddbManager.cxx:766
TILE_REGION_EXTENDED
#define TILE_REGION_EXTENDED
Definition: TileGeoSectionBuilder.h:23
python.SystemOfUnits.gram
int gram
Definition: SystemOfUnits.py:165
python.TurnDataReader.dr
dr
Definition: TurnDataReader.py:112
TileDddbManager::SetNextTiclInDet
int SetNextTiclInDet()
Definition: TileDddbManager.cxx:1564
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
MLOG
#define MLOG(x)
Definition: TileGeoSectionBuilder.cxx:44
TileGeoSectionBuilder::TileGeoSectionBuilder
TileGeoSectionBuilder(StoredMaterialManager *matManager, TileDddbManager *pDbManager, const TileSwitches &switches, MsgStream *log)
Constructor.
Definition: TileGeoSectionBuilder.cxx:50
TileGeoSectionBuilder::setBarrelGlue
void setBarrelGlue(double val)
Definition: TileGeoSectionBuilder.cxx:3466
PlotPulseshapeFromCool.np
np
Definition: PlotPulseshapeFromCool.py:64
TileDetDescriptor::print
void print() const
Definition: TileDetDescriptor.cxx:125
TileDddbManager::TICLfirstrow
double TICLfirstrow() const
Definition: TileDddbManager.cxx:1665
TileDddbManager::TILBdrfront
double TILBdrfront() const
Definition: TileDddbManager.cxx:689
TileDddbManager::TIGRdr
double TIGRdr() const
Definition: TileDddbManager.cxx:1224
TileDddbManager::TICLncell
double TICLncell() const
Definition: TileDddbManager.cxx:1610
H2
#define H2(x, y, z)
Definition: MD5.cxx:115
TileDddbManager::TICGmaterial
int TICGmaterial() const
Definition: TileDddbManager.cxx:1343
TileDddbManager::TILE_PLUG2
@ TILE_PLUG2
Definition: TileDddbManager.h:45
TileSwitches::steel
int steel
0: Absorber is pure Iron 1: Absorber is tile::Steel defined in DB
Definition: TileSwitches.h:51
TileDddbManager::TILBrmin
double TILBrmin() const
Definition: TileDddbManager.cxx:634
TileDddbManager::TILBphigap
double TILBphigap() const
Definition: TileDddbManager.cxx:744
TileDddbManager::TILBzoffset
double TILBzoffset() const
Definition: TileDddbManager.cxx:733
TileGeoSectionBuilder::fillGirder
void fillGirder(GeoPhysVol *&mother, double tile_rmax, double tilb_rmax, double tan_delta_phi_2, double thickness)
Girder parameters are the following:
Definition: TileGeoSectionBuilder.cxx:1351
MAX_N_SAMP_TILEDD
#define MAX_N_SAMP_TILEDD
Definition: TileDetDescriptor.h:17
TileDddbManager::SetCurrentScin
int SetCurrentScin(int item)
Definition: TileDddbManager.cxx:903
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
TileDetDescrManager.h
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
TileDddbManager::TILBcurscint
int TILBcurscint() const
Definition: TileDddbManager.cxx:877
TRT::Hit::side
@ side
Definition: HitInfo.h:83
TileCellDim
Definition: TileCellDim.h:19
TileDddbManager::SCNTdr
double SCNTdr() const
Definition: TileDddbManager.cxx:934
TileDddbManager::TIGRrc
double TIGRrc() const
Definition: TileDddbManager.cxx:1213
TileDddbManager::TIGRdw
double TIGRdw() const
Definition: TileDddbManager.cxx:1235
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
TileGeoSectionBuilder::fillDescriptor
void fillDescriptor(TileDetDescriptor *&descriptor, unsigned int detector, int side, bool testbeam, bool addPlates, unsigned int nphi, float zshift)
Readout Descriptor parameters are the following:
Definition: TileGeoSectionBuilder.cxx:2454
TileDetDescriptor::set
void set(const Identifier &id)
Definition: TileDetDescriptor.h:244
TileCellDim::getRMax
double getRMax(unsigned int index) const
Definition: TileCellDim.cxx:39
TileDddbManager::SCNTdphi
double SCNTdphi() const
Definition: TileDddbManager.cxx:1000
TileSwitches::uShape
int uShape
0: simulation without U-shape 1: simulation with U-shape
Definition: TileSwitches.h:38
TileCellDim::addZMin
void addZMin(double zMin)
Definition: TileCellDim.cxx:79
TileDddbManager::CutsXpos
double CutsXpos() const
Definition: TileDddbManager.cxx:1104
TileSwitches::glue
int glue
0: glue layer is removed and replaced by iron, 1: simulation with glue, 2: glue is replaced by iron +...
Definition: TileSwitches.h:43
TileCellDim::getNRows
unsigned int getNRows() const
Definition: TileCellDim.h:25
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:113
TileDddbManager::TICLeta
double TICLeta() const
Definition: TileDddbManager.cxx:1643
TileDddbManager::TIFGnelem
int TIFGnelem() const
Definition: TileDddbManager.cxx:1289
TileGeoSectionBuilder::checktransfunc
void checktransfunc(double absorber, double period, int np, double center)
Definition: TileGeoSectionBuilder.cxx:3478
lumiFormat.i
int i
Definition: lumiFormat.py:85
TileDddbManager::TICLlastrow
double TICLlastrow() const
Definition: TileDddbManager.cxx:1676
TileGeoSectionBuilder::m_barrelPeriodThickness
double m_barrelPeriodThickness
Definition: TileGeoSectionBuilder.h:206
TileGeoSectionBuilder::checking
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:
Definition: TileGeoSectionBuilder.cxx:2418
TileDetDescrManager
Definition: TileDetDescrManager.h:33
MSG
Definition: MsgLevel.h:28
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TileDddbManager::TILBdzgir
double TILBdzgir() const
Definition: TileDddbManager.cxx:891
TileDetDescriptor
Definition: TileDetDescriptor.h:46
TileDddbManager::TILBdzend1
double TILBdzend1() const
Definition: TileDddbManager.cxx:799
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
TileGeoSectionBuilder::m_dbManager
TileDddbManager * m_dbManager
Definition: TileGeoSectionBuilder.h:202
TileGeoSectionBuilder::fillFinger
void fillFinger(GeoPhysVol *&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:
Definition: TileGeoSectionBuilder.cxx:1435
TileDddbManager::TILBrmaximal
double TILBrmaximal() const
Definition: TileDddbManager.cxx:667
TileCellDim::addRMin
void addRMin(double rMin)
Definition: TileCellDim.cxx:63
TileSwitches
Definition: TileSwitches.h:15
PixelAthClusterMonAlgCfg.zmax
zmax
Definition: PixelAthClusterMonAlgCfg.py:169
TileDddbManager::TICGrc
double TICGrc() const
Definition: TileDddbManager.cxx:1365
TileGeoSectionBuilder::fillPeriod
void fillPeriod(GeoPhysVol *&mother, double thickness, double dzglue, double tan_delta_phi_2, int period_type, GeoTrd *period=0)
Period parameters are the following:
Definition: TileGeoSectionBuilder.cxx:1759
TileGeoSectionBuilder::calculateEta
void calculateEta(int detector, int side, int sample, float &etamin, float &etamax, float &deta, unsigned int &neta)
calculateEta function calculates are the following parameters given sample in region (detector)
Definition: TileGeoSectionBuilder.cxx:3393
TileDddbManager::TILBdzend
double TILBdzend() const
Definition: TileDddbManager.cxx:700
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
AnalysisUtils::Delta::R
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
Definition: AnalysisMisc.h:49
TileDddbManager::SetFirstTiclInDetSamp
int SetFirstTiclInDetSamp(int detector, double sample)
Definition: TileDddbManager.cxx:1535
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
TileCellDim::getRMin
double getRMin(unsigned int index) const
Definition: TileCellDim.cxx:31
TileSwitches::csTube
int csTube
0: without Cesium tubes 1: with cesium tubes
Definition: TileSwitches.h:55
TileGeoSectionBuilder::calculateZ
void calculateZ(int detector, int side, int sample, float zshift, float &zcenter, float &dz)
Calculator of Z position given sample in region (detector):
Definition: TileGeoSectionBuilder.cxx:3217
TileGeoSectionBuilder::makeHoles
const GeoShape * makeHoles(const GeoShape *mother, double R, double H2, double off, double off0=0.)
Definition: TileGeoSectionBuilder.cxx:3516
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
TILE_REGION_CENTRAL
#define TILE_REGION_CENTRAL
Definition: TileGeoSectionBuilder.h:22
TileDddbManager::BoolCuts
bool BoolCuts()
Definition: TileDddbManager.cxx:1037
TileDddbManager::TIGRoff
double TIGRoff() const
Definition: TileDddbManager.cxx:1246
TILE_REGION_GAP
#define TILE_REGION_GAP
Definition: TileGeoSectionBuilder.h:24
TileGeoSectionBuilder::~TileGeoSectionBuilder
~TileGeoSectionBuilder()
Destructor.
Definition: TileGeoSectionBuilder.cxx:69
TileDddbManager::SCNTzp
double SCNTzp() const
Definition: TileDddbManager.cxx:956
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TileDddbManager::SetCurrentGird
int SetCurrentGird(int item)
Definition: TileDddbManager.cxx:1171
TileDddbManager::CutsDY2
double CutsDY2() const
Definition: TileDddbManager.cxx:1084
TileDddbManager::TILBdzspac
double TILBdzspac() const
Definition: TileDddbManager.cxx:788
TileGeoSectionBuilder::m_verbose
bool m_verbose
Flag for activation verbose level for debugging.
Definition: TileGeoSectionBuilder.h:211
TileDddbManager::TILE_EBARREL
@ TILE_EBARREL
Definition: TileDddbManager.h:43
TileGeoSectionBuilder::setBarrelPeriodThickness
void setBarrelPeriodThickness(double val)
Definition: TileGeoSectionBuilder.cxx:3460
TileCellDim::getZMax
double getZMax(unsigned int index) const
Definition: TileCellDim.cxx:55
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
TileDddbManager::CutsDX1
double CutsDX1() const
Definition: TileDddbManager.cxx:1054
Variable
Wrapper around a histogram which allows for some additional filling patterns and data manipulation.
Definition: Trigger/TrigCost/TrigCostAnalysis/src/Variable.h:39
TileCellDim.h
TileDddbManager.h
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
TileDddbManager::TILBrminimal
double TILBrminimal() const
Definition: TileDddbManager.cxx:656
TileDddbManager::CutsYpos
double CutsYpos() const
Definition: TileDddbManager.cxx:1114
TileDddbManager::SetNextTiclInDetSamp
int SetNextTiclInDetSamp()
Definition: TileDddbManager.cxx:1580
DeMoScan.index
string index
Definition: DeMoScan.py:364
TileDddbManager::SCNTdtw
double SCNTdtw() const
Definition: TileDddbManager.cxx:989
Name
JetDumper::Name Name
Definition: JetDumper.cxx:19
TileDddbManager::TICGshape
int TICGshape() const
Definition: TileDddbManager.cxx:1354
TileGeoSectionBuilder::m_theMaterialManager
StoredMaterialManager * m_theMaterialManager
Definition: TileGeoSectionBuilder.h:201
TileDddbManager::SCNTdt
double SCNTdt() const
Definition: TileDddbManager.cxx:978
TileDddbManager::SCNTrc
double SCNTrc() const
Definition: TileDddbManager.cxx:945
GeoGenfun
Definition: ArrayFunction.cxx:7
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
eFEXNTuple.delta_phi
def delta_phi(phi1, phi2)
Definition: eFEXNTuple.py:15
TileDddbManager::CutsDZ1
double CutsDZ1() const
Definition: TileDddbManager.cxx:1094
DeMoScan.first
bool first
Definition: DeMoScan.py:536
TileDddbManager::SetFirstTiclInDet
int SetFirstTiclInDet(int detector)
Definition: TileDddbManager.cxx:1517
TileSwitches::pvt
int pvt
0: all scintillators are polystyrene 1: crack scrintillators are PVT, others - polystyrene
Definition: TileSwitches.h:47
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
TileDddbManager::TICGdr
double TICGdr() const
Definition: TileDddbManager.cxx:1376
StoredMaterialManager::getMaterial
virtual const GeoMaterial * getMaterial(const std::string &name)=0
TileDetDescriptor.h
TileDddbManager::TILBdzend2
double TILBdzend2() const
Definition: TileDddbManager.cxx:810
StoredMaterialManager
This class holds one or more material managers and makes them storeable, under StoreGate.
Definition: StoredMaterialManager.h:28
TileGeoSectionBuilder::setExtendedPeriodThickness
void setExtendedPeriodThickness(double val)
Definition: TileGeoSectionBuilder.cxx:3472
TileDddbManager::TICGdz
double TICGdz() const
Definition: TileDddbManager.cxx:1420
TileDddbManager::TILBflangey
double TILBflangey() const
Definition: TileDddbManager.cxx:722
TileDddbManager::TILBdzmast
double TILBdzmast() const
Definition: TileDddbManager.cxx:777
Trk::hole
@ hole
Definition: MeasurementType.h:36
python.Logging.manager
manager
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/Logging.py:92
merge.status
status
Definition: merge.py:17
TileGeoSectionBuilder::m_extendedPeriodThickness
double m_extendedPeriodThickness
Definition: TileGeoSectionBuilder.h:208
TileGeoSectionBuilder::printdouble
void printdouble(const char *name, double val)
Definition: TileGeoSectionBuilder.cxx:3500
RPDUtils::nRows
unsigned constexpr int nRows
Definition: RPDUtils.h:24
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
TileGeoSectionBuilder::computeCellDim
void computeCellDim(TileDetDescrManager *&manager, int detector, bool addPlates, float zShiftPos, float zShiftNeg)
Cell dimension parameters are the following:
Definition: TileGeoSectionBuilder.cxx:2709
TileDddbManager::CutsDY1
double CutsDY1() const
Definition: TileDddbManager.cxx:1074
TileDddbManager::TILBnperiod
int TILBnperiod() const
Definition: TileDddbManager.cxx:612
TileCellDim::addZMax
void addZMax(double zMax)
Definition: TileCellDim.cxx:87
TileGeoSectionBuilder::fillSection
void fillSection(GeoPhysVol *&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:
Definition: TileGeoSectionBuilder.cxx:74
LArCellBinning.etamin
etamin
Definition: LArCellBinning.py:137
TileDddbManager
This class provides access to constants in the Geometry DB.
Definition: TileDddbManager.h:38
TileDddbManager::CutsDX2
double CutsDX2() const
Definition: TileDddbManager.cxx:1064
TileGeoSectionBuilder::m_barrelGlue
double m_barrelGlue
Definition: TileGeoSectionBuilder.h:207
TileCellDim::getZMin
double getZMin(unsigned int index) const
Definition: TileCellDim.cxx:47
TileGeoSectionBuilder::m_additionalIronLayer
double m_additionalIronLayer
Makes iron layer a little bit wider to obtain the same sampling fraction for simulation without a glu...
Definition: TileGeoSectionBuilder.h:217
TileDddbManager::SCNTdrw
double SCNTdrw() const
Definition: TileDddbManager.cxx:967
checkFileSG.ind
list ind
Definition: checkFileSG.py:118
python.SystemOfUnits.rad
int rad
Definition: SystemOfUnits.py:111
TileDddbManager::TICLdeta
double TICLdeta() const
Definition: TileDddbManager.cxx:1654
TileDddbManager::TICGdx1
double TICGdx1() const
Definition: TileDddbManager.cxx:1387