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