CMS 3D CMS Logo

DDHCalEndcapAlgo.cc
Go to the documentation of this file.
1 // File: DDHCalEndcapAlgo.cc
3 // adapted from CCal(G4)HcalEndcap.cc
4 // Description: Geometry factory class for Hcal Endcap
6 
7 #include <cmath>
8 #include <algorithm>
9 
19 
20 //#define EDM_ML_DEBUG
21 using namespace geant_units::operators;
22 
24  modMat(0),modType(0),sectionModule(0),layerN(0),layerN0(0),layerN1(0),
25  layerN2(0),layerN3(0),layerN4(0),layerN5(0),thick(0),trimLeft(0),
26  trimRight(0),zminBlock(0),zmaxBlock(0),rinBlock1(0),routBlock1(0),
27  rinBlock2(0),routBlock2(0),layerType(0),layerT(0),scintT(0) {
28 
29 #ifdef EDM_ML_DEBUG
30  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapAlgo: Creating an instance";
31 #endif
32 }
33 
35 
36 int DDHCalEndcapAlgo::getLayer(unsigned int i, unsigned int j) const {
37 
38  switch (i) {
39  case 0:
40  return layerN0[j];
41  break;
42 
43  case 1:
44  return layerN1[j];
45  break;
46 
47  case 2:
48  return layerN2[j];
49  break;
50 
51  case 3:
52  return layerN3[j];
53  break;
54 
55  case 4:
56  return layerN4[j];
57  break;
58 
59  case 5:
60  return layerN5[j];
61  break;
62 
63  default:
64  return 0;
65  }
66 }
67 
68 double DDHCalEndcapAlgo::getTrim(unsigned int i, unsigned int j) const {
69 
70  if (j == 0)
71  return trimLeft[i];
72  else
73  return trimRight[j];
74 }
75 
77  const DDVectorArguments & vArgs,
78  const DDMapArguments & ,
79  const DDStringArguments & sArgs,
80  const DDStringVectorArguments & vsArgs) {
81 
82  genMaterial = sArgs["MaterialName"];
83  rotation = sArgs["Rotation"];
84  nsectors = int (nArgs["Sector"]);
85  nsectortot = int (nArgs["SectorTot"]);
86  nEndcap = int (nArgs["Endcap"]);
87  rotHalf = sArgs["RotHalf"];
88  rotns = sArgs["RotNameSpace"];
89  zShift = nArgs["ZShift"];
90 
91  zFront = nArgs["ZFront"];
92  zEnd = nArgs["ZEnd"];
93  ziNose = nArgs["ZiNose"];
94  ziL0Nose = nArgs["ZiL0Nose"];
95  ziBody = nArgs["ZiBody"];
96  ziL0Body = nArgs["ZiL0Body"];
97  z0Beam = nArgs["Z0Beam"];
98  ziDip = nArgs["ZiDip"];
99  dzStep = nArgs["DzStep"];
100  zShiftHac2 = nArgs["ZShiftHac2"];
101  double gap = nArgs["Gap"];
102  double z1 = nArgs["Z1"];
103  double r1 = nArgs["R1"];
104  rout = nArgs["Rout"];
105  heboxDepth = nArgs["HEboxDepth"];
106  drEnd = nArgs["DrEnd"];
107  double etamin = nArgs["Etamin"];
108  angBot = nArgs["AngBot"];
109  angGap = nArgs["AngGap"];
110 
111 #ifdef EDM_ML_DEBUG
112  edm::LogVerbatim("HCalGeom")
113  << "DDHCalEndcapAlgo: General material " << genMaterial << "\tSectors "
114  << nsectors << ", " << nsectortot << "\tEndcaps " << nEndcap
115  << "\tRotation matrix for half " << rotns << ":" << rotHalf << "\n\tzFront "
116  << zFront << " zEnd " << zEnd << " ziNose " << ziNose << " ziL0Nose "
117  << ziL0Nose << " ziBody " << ziBody << " ziL0Body " << ziL0Body << " z0Beam "
118  << z0Beam << " ziDip " << ziDip << " dzStep " << dzStep << " Gap " << gap
119  << " z1 " << z1 << "\n\tr1 " << r1 << " rout " << rout << " HeboxDepth "
120  << heboxDepth << " drEnd " << drEnd << "\tetamin " << etamin
121  << " Bottom angle " << angBot << " Gap angle " << angGap << " Z-Shift "
122  << zShift << " " << zShiftHac2;
123 #endif
124 
125  //Derived quantities
126  angTop = 2.0 * atan (exp(-etamin));
127  slope = tan(angGap);
128  z1Beam = z1 - r1/slope;
129  ziKink = z1Beam + rout/slope;
130  riKink = ziKink*tan(angBot);
131  riDip = ziDip*tan(angBot);
132  roDip = rout - heboxDepth;
133  dzShift = (z1Beam - z0Beam) - gap/sin(angGap);
134 
135 #ifdef EDM_ML_DEBUG
136  edm::LogVerbatim("HCalGeom")
137  << "DDHCalEndcapAlgo: angTop " << convertRadToDeg(angTop) <<"\tSlope "
138  << slope << "\tDzShift " << dzShift << "\n\tz1Beam " << z1Beam
139  << "\tziKink" << ziKink << "\triKink " << riKink << "\triDip " << riDip
140  << "\n\troDip " << roDip << "\tRotation " << rotation;
141 #endif
142 
144  //Modules
145  absMat = sArgs["AbsMat"];
146  modules = int(nArgs["Modules"]);
147 
148 #ifdef EDM_ML_DEBUG
149  edm::LogVerbatim("HCalGeom")
150  << "DDHCalEndcapAlgo: Number of modules " << modules
151  << " and absorber material " << absMat;
152 #endif
153 
154  modName = vsArgs["ModuleName"];
155  modMat = vsArgs["ModuleMat"];
156  modType = dbl_to_int(vArgs["ModuleType"]);
157  sectionModule = dbl_to_int(vArgs["SectionModule"]);
158  thick = vArgs["ModuleThick"];
159  trimLeft = vArgs["TrimLeft"];
160  trimRight = vArgs["TrimRight"];
161  eModule = dbl_to_int(vArgs["EquipModule"]);
162  layerN = dbl_to_int(vArgs["LayerN"]);
163  layerN0 = dbl_to_int(vArgs["LayerN0"]);
164  layerN1 = dbl_to_int(vArgs["LayerN1"]);
165  layerN2 = dbl_to_int(vArgs["LayerN2"]);
166  layerN3 = dbl_to_int(vArgs["LayerN3"]);
167  layerN4 = dbl_to_int(vArgs["LayerN4"]);
168  layerN5 = dbl_to_int(vArgs["LayerN5"]);
169 
170 #ifdef EDM_ML_DEBUG
171  for (int i = 0; i < modules; i++) {
172  edm::LogVerbatim("HCalGeom")
173  << "DDHCalEndcapAlgo: " << modName[i] << " type " << modType[i]
174  << " Sections " << sectionModule[i] <<" thickness of absorber/air "
175  << thick[i] << " trim " << trimLeft[i] << ", " << trimRight[i]
176  << " equip module " << eModule[i] << " with " << layerN[i] << " layers";
177  if (i == 0) {
178  for (int j = 0; j < layerN[i]; j++) {
179  edm::LogVerbatim("HCalGeom")
180  << "\t " << layerN0[j] << "/" << layerN0[j+1];
181  }
182  } else if (i == 1) {
183  for (int j = 0; j < layerN[i]; j++) {
184  edm::LogVerbatim("HCalGeom")
185  << "\t " << layerN1[j] << "/" << layerN1[j+1];
186  }
187  } else if (i == 2) {
188  for (int j = 0; j < layerN[i]; j++) {
189  edm::LogVerbatim("HCalGeom") << "\t " << layerN2[j];
190  }
191  } else if (i == 3) {
192  for (int j = 0; j < layerN[i]; j++) {
193  edm::LogVerbatim("HCalGeom") << "\t " << layerN3[j];
194  }
195  } else if (i == 4) {
196  for (int j = 0; j < layerN[i]; j++) {
197  edm::LogVerbatim("HCalGeom") << "\t " << layerN4[j];
198  }
199  } else if (i == 5) {
200  for (int j = 0; j < layerN[i]; j++) {
201  edm::LogVerbatim("HCalGeom") << "\t " << layerN5[j];
202  }
203  }
204  }
205 #endif
206 
208  //Layers
209  phiSections = int(nArgs["PhiSections"]);
210  phiName = vsArgs["PhiName"];
211  layers = int(nArgs["Layers"]);
212  layerName = vsArgs["LayerName"];
213  layerType = dbl_to_int(vArgs["LayerType"]);
214  layerT = vArgs["LayerT"];
215  scintT = vArgs["ScintT"];
216  scintMat = sArgs["ScintMat"];
217  plastMat = sArgs["PlastMat"];
218  rotmat = sArgs["RotMat"];
219 
220 #ifdef EDM_ML_DEBUG
221  edm::LogVerbatim("HCalGeom")
222  << "DDHCalEndcapAlgo: Phi Sections " << phiSections;
223  for (int i = 0; i < phiSections; i++)
224  edm::LogVerbatim("HCalGeom") << "\tName[" << i << "] : " << phiName[i];
225  edm::LogVerbatim("HCalGeom")
226  << "\tPlastic: " << plastMat << "\tScintillator: " << scintMat
227  << "\tRotation matrix " << rotns << ":" << rotmat << "\n\tNumber of layers "
228  << layers;
229  for (int i = 0; i < layers; i++) {
230  edm::LogVerbatim("HCalGeom")
231  << "\t" << layerName[i] << "\tType " << layerType[i] << "\tThickness "
232  << layerT[i] << "\tScint.Thick " << scintT[i];
233  }
234 #endif
235 
237  // Derive bounding of the modules
238  int module = 0;
239  // Layer 0 (Nose)
240  if (modules > 0) {
241  zminBlock.emplace_back(ziL0Nose);
242  zmaxBlock.emplace_back(zminBlock[module] + layerT[0] + 0.5*dzStep);
243  rinBlock1.emplace_back(zminBlock[module] * tan(angTop));
244  rinBlock2.emplace_back(zmaxBlock[module] * tan(angTop));
245  routBlock1.emplace_back((zminBlock[module] - z1Beam) * slope);
246  routBlock2.emplace_back((zmaxBlock[module] - z1Beam) * slope);
247  module++;
248  }
249 
250  // Layer 0 (Body)
251  if (modules > 1) {
252  zminBlock.emplace_back(ziL0Body);
253  zmaxBlock.emplace_back(zminBlock[module] + layerT[0] + 0.5*dzStep);
254  rinBlock1.emplace_back(zminBlock[module] * tan(angBot));
255  rinBlock2.emplace_back(zmaxBlock[module] * tan(angBot));
256  routBlock1.emplace_back(zminBlock[module] * tan(angTop));
257  routBlock2.emplace_back(zmaxBlock[module] * tan(angTop));
258  module++;
259  }
260 
261  // Hac1
262  if (modules > 2) {
263  zminBlock.emplace_back(ziNose);
264  zmaxBlock.emplace_back(ziBody);
265  rinBlock1.emplace_back(zminBlock[module] * tan(angTop));
266  rinBlock2.emplace_back(zmaxBlock[module] * tan(angTop));
267  routBlock1.emplace_back((zminBlock[module] - z1Beam) * slope);
268  routBlock2.emplace_back((zmaxBlock[module] - z1Beam) * slope);
269  module++;
270  }
271 
272  // Hac2
273  if (modules > 3) {
274  zminBlock.emplace_back(ziBody);
275  zmaxBlock.emplace_back(zminBlock[module] + layerN[3]*dzStep);
276  rinBlock1.emplace_back(zminBlock[module] * tan(angBot));
277  rinBlock2.emplace_back(zmaxBlock[module] * tan(angBot));
278  routBlock1.emplace_back((zmaxBlock[module-1] - z1Beam) * slope);
279  routBlock2.emplace_back(rout);
280  module++;
281  }
282 
283  // Hac3
284  if (modules > 4) {
285  zminBlock.emplace_back(zmaxBlock[module-1]);
286  zmaxBlock.emplace_back(zminBlock[module] + layerN[4]*dzStep);
287  rinBlock1.emplace_back(zminBlock[module] * tan(angBot));
288  rinBlock2.emplace_back(zmaxBlock[module] * tan(angBot));
289  routBlock1.emplace_back(rout);
290  routBlock2.emplace_back(rout);
291  module++;
292  }
293 
294  // Hac4
295  if (modules > 5) {
296  zminBlock.emplace_back(zmaxBlock[module-1]);
297  zmaxBlock.emplace_back(zminBlock[module] + layerN[5]*dzStep);
298  rinBlock1.emplace_back(zminBlock[module] * tan(angBot));
299  rinBlock2.emplace_back(zmaxBlock[module] * tan(angBot));
300  routBlock1.emplace_back(rout);
301  routBlock2.emplace_back(roDip);
302  module++;
303  }
304 
305 #ifdef EDM_ML_DEBUG
306  for (int i = 0; i < module; i++)
307  edm::LogVerbatim("HCalGeom")
308  << "DDHCalEndcapAlgo: Module " << i << "\tZ/Rin/Rout " << zminBlock[i]
309  << ", " << zmaxBlock[i] << "/ " << rinBlock1[i] << ", " << rinBlock2[i]
310  << "/ " << routBlock1[i] << ", " << routBlock2[i];
311 #endif
312 
313  idName = sArgs["MotherName"];
315  idOffset = int (nArgs["IdOffset"]);
316 
317 #ifdef EDM_ML_DEBUG
318  edm::LogVerbatim("HCalGeom")
319  << "DDHCalEndcapAlgo: Parent " << parent().name() << " idName " << idName
320  << " NameSpace " << idNameSpace << " Offset " << idOffset;
321 #endif
322 
323  tolPos = nArgs["TolPos"];
324  tolAbs = nArgs["TolAbs"];
325 
326 #ifdef EDM_ML_DEBUG
327  edm::LogVerbatim("HCalGeom")
328  <<"DDHCalEndcapAlgo: Tolerances - Positioning " << tolPos << " Absorber "
329  << tolAbs;
330 #endif
331 }
332 
334 // DDHCalEndcapAlgo methods...
336 
338 
339 #ifdef EDM_ML_DEBUG
340  edm::LogVerbatim("HCalGeom") << "==>> Constructing DDHCalEndcapAlgo...";
341 #endif
342 
344 
345 #ifdef EDM_ML_DEBUG
346  edm::LogVerbatim("HCalGeom") << "<<== End of DDHCalEndcapAlgo construction ...";
347 #endif
348 }
349 
350 //----------------------start here for DDD work!!! ---------------
351 
353 
354 #ifdef EDM_ML_DEBUG
355  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapAlgo: General volume...";
356 #endif
357 
358  bool proto = true;
359  for (int i=0; i<3; i++)
360  if (equipModule(i) > 0) proto = false;
361 
362  DDRotation rot;
363  if (DDSplit(getRotation()).first == "NULL") rot = DDRotation();
365 
366 #ifdef EDM_ML_DEBUG
367  edm::LogVerbatim("HCalGeom")
368  << " First " << DDSplit(getRotation()).first << " Second "
369  << DDSplit(getRotation()).second << " Rotation " << rot;
370 #endif
371 
372  DDTranslation r0(0,0,getZShift());
373  double alpha = (1._pi)/getNsectors();
374  double dphi = getNsectortot()*(2._pi)/getNsectors();
375 
377  //vertical walls are allowed in SolidPolyhedra
378  double delz = 0;
379 
380  std::vector<double> pgonZ, pgonRmin, pgonRmax;
381  if (proto) {
382  double zf = getZiBody() + getZShiftHac2();
383  pgonZ.emplace_back(zf - getDzShift());
384  pgonRmin.emplace_back(zf * tan(getAngBot()));
385  pgonRmax.emplace_back((zf - getZ1Beam())*getSlope());
386  } else {
387  pgonZ.emplace_back(getZFront() - getDzShift());
388  pgonRmin.emplace_back(getZFront() * tan(getAngTop()));
389  pgonRmax.emplace_back((getZFront() - getZ1Beam())*getSlope());
390  pgonZ.emplace_back(getZiL0Body() - getDzShift());
391  pgonRmin.emplace_back(getZiL0Body() * tan(getAngTop()));
392  pgonRmax.emplace_back((getZiL0Body() - getZ1Beam())*getSlope());
393  pgonZ.emplace_back(getZiL0Body() - getDzShift());
394  pgonRmin.emplace_back(getZiL0Body() * tan(getAngBot()));
395  pgonRmax.emplace_back((getZiL0Body() - getZ1Beam())*getSlope());
396  }
397  pgonZ.emplace_back(getZiKink() - getDzShift());
398  pgonRmin.emplace_back(getRinKink());
399  pgonRmax.emplace_back(getRout());
400  pgonZ.emplace_back(getZiDip() - getDzShift());
401  pgonRmin.emplace_back(getRinDip());
402  pgonRmax.emplace_back(getRout());
403  pgonZ.emplace_back(getZiDip() - getDzShift() + delz);
404  pgonRmin.emplace_back(getRinDip());
405  pgonRmax.emplace_back(getRoutDip());
406  pgonZ.emplace_back(getZEnd() - getDzShift());
407  pgonRmin.emplace_back(getZEnd() * tan(getAngBot()));
408  pgonRmax.emplace_back(getRoutDip());
409  pgonZ.emplace_back(getZEnd());
410  pgonRmin.emplace_back(getZEnd() * tan(getAngBot()));
411  pgonRmax.emplace_back(getRoutDip());
412 
413  std::string name("Null");
414  DDSolid solid;
416  getNsectortot(), -alpha, dphi, pgonZ,
417  pgonRmin, pgonRmax);
418 #ifdef EDM_ML_DEBUG
419  edm::LogVerbatim("HCalGeom")
420  << "DDHCalEndcapAlgo: " << DDName(idName, idNameSpace)
421  << " Polyhedra made of " << getGenMat() << " with " << getNsectortot()
422  << " sectors from " << convertRadToDeg(-alpha) << " to "
423  << convertRadToDeg(-alpha+dphi) << " and with " << pgonZ.size() <<" sections";
424  for (unsigned int i = 0; i <pgonZ.size(); i++)
425  edm::LogVerbatim("HCalGeom")
426  << "\t\tZ = " << pgonZ[i] << "\tRmin = " << pgonRmin[i] << "\tRmax = "
427  << pgonRmax[i];
428 #endif
429 
431  DDMaterial matter(matname);
432  DDLogicalPart genlogic(DDName(idName, idNameSpace), matter, solid);
433 
434  DDName parentName = parent().name();
435  cpv.position(DDName(idName, idNameSpace), parentName, 1, r0, rot);
436 
437 #ifdef EDM_ML_DEBUG
438  edm::LogVerbatim("HCalGeom")
439  << "DDHCalEndcapAlgo: " << DDName(idName, idNameSpace)
440  << " number 1 positioned in " << parentName << " at " << r0 << " with " <<rot;
441 #endif
442 
443  if (getEndcaps() != 1) {
444  rot = DDRotation(DDName(rotHalf,rotns));
445  cpv.position(DDName(idName, idNameSpace), parentName, 2, r0, rot);
446 
447 #ifdef EDM_ML_DEBUG
448  edm::LogVerbatim("HCalGeom")
449  << "DDHCalEndcapAlgo: " << DDName(idName, idNameSpace) << " number 2 "
450  << "positioned in " << parentName << " at " << r0 << " with " << rot;
451 #endif
452 
453  }
454 
455  //Forward half
456  name = idName + "Front";
457  std::vector<double> pgonZMod, pgonRminMod, pgonRmaxMod;
458  for (unsigned int i=0; i < (pgonZ.size()-1); i++) {
459  pgonZMod.emplace_back(pgonZ[i] + getDzShift());
460  pgonRminMod.emplace_back(pgonRmin[i]);
461  pgonRmaxMod.emplace_back(pgonRmax[i]);
462  }
464  getNsectortot(), -alpha, dphi, pgonZMod,
465  pgonRminMod, pgonRmaxMod);
466 
467 #ifdef EDM_ML_DEBUG
468  edm::LogVerbatim("HCalGeom")
469  << "DDHCalEndcapAlgo: " << DDName(name,idNameSpace) << " Polyhedra made of "
470  << getGenMat() << " with " << getNsectortot() << " sectors from "
471  << convertRadToDeg(-alpha) << " to " << convertRadToDeg(-alpha+dphi)
472  << " and with " << pgonZMod.size() << " sections ";
473  for (unsigned int i = 0; i < pgonZMod.size(); i++)
474  edm::LogVerbatim("HCalGeom")
475  << "\t\tZ = " << pgonZMod[i] << "\tRmin = " << pgonRminMod[i] << "\tRmax = "
476  << pgonRmaxMod[i];
477 #endif
478 
479  DDLogicalPart genlogich(DDName(name, idNameSpace), matter, solid);
480 
481  cpv.position(genlogich, genlogic, 1, DDTranslation(0.0, 0.0, -getDzShift()),
482  DDRotation());
483 
484 #ifdef EDM_ML_DEBUG
485  edm::LogVerbatim("HCalGeom")
486  << "DDHCalEndcapAlgo: " << genlogich.name() << " number 1 positioned in "
487  << genlogic.name() << " at (0,0," << -getDzShift()<< ") with no rotation";
488 #endif
489 
490  //Construct sector (from -alpha to +alpha)
491  name = idName + "Module";
493  1, -alpha, 2*alpha, pgonZMod,
494  pgonRminMod, pgonRmaxMod);
495 #ifdef EDM_ML_DEBUG
496  edm::LogVerbatim("HCalGeom")
497  << "DDHCalEndcapAlgo: " << DDName(name,idNameSpace)<< " Polyhedra made of "
498  << getGenMat() <<" with 1 sector from " << convertRadToDeg(-alpha) << " to "
499  << convertRadToDeg(alpha) << " and with " << pgonZMod.size() << " sections";
500  for (unsigned int i = 0; i < pgonZMod.size(); i++)
501  edm::LogVerbatim("HCalGeom")
502  << "\t\tZ = " << pgonZMod[i] << "\tRmin = " << pgonRminMod[i] << "\tRmax = "
503  << pgonRmaxMod[i];
504 #endif
505 
506  DDLogicalPart seclogic(DDName(name, idNameSpace), matter, solid);
507 
508  for (int ii=0; ii<getNsectortot(); ii++) {
509  double phi = ii*2*alpha;
511  std::string rotstr("NULL");
512  if (phi != 0) {
513  rotstr = "R" + formatAsDegreesInInteger(phi);
514  rotation = DDRotation(DDName(rotstr, rotns));
515  if (!rotation) {
516 #ifdef EDM_ML_DEBUG
517  edm::LogVerbatim("HCalGeom")
518  << "DDHCalEndcapAlgo: Creating a new rotation " << rotstr
519  << "\t 90," << convertRadToDeg(phi) << ", 90,"
520  << convertRadToDeg(phi+90._deg) << ", 0, 0";
521 #endif
522  rotation = DDrot(DDName(rotstr, rotns), 90._deg, phi, 90._deg,
523  (90._deg+phi), 0, 0);
524  } //if !rotation
525  } //if phi!=0
526 
527  cpv.position(seclogic, genlogich, ii+1, DDTranslation(0.0, 0.0, 0.0), rotation);
528 
529 #ifdef EDM_ML_DEBUG
530  edm::LogVerbatim("HCalGeom")
531  << "DDHCalEndcapAlgo: " << seclogic.name() << " number " << ii+1
532  << " positioned in " << genlogich.name() << " at (0,0,0) with " << rotation;
533 #endif
534 
535  }
536 
537  //Construct the things inside the sector
538  constructInsideSector(seclogic, cpv);
539 
540  //Backward half
541  name = idName + "Back";
542  std::vector<double> pgonZBack, pgonRminBack, pgonRmaxBack;
543  pgonZBack.emplace_back(getZEnd() - getDzShift());
544  pgonRminBack.emplace_back(pgonZBack[0]*tan(getAngBot()) + getDrEnd());
545  pgonRmaxBack.emplace_back(getRoutDip());
546  pgonZBack.emplace_back(getZEnd());
547  pgonRminBack.emplace_back(pgonZBack[1]*tan(getAngBot()) + getDrEnd());
548  pgonRmaxBack.emplace_back(getRoutDip());
550  getNsectortot(), -alpha, dphi, pgonZBack,
551  pgonRminBack, pgonRmaxBack);
552 
553 #ifdef EDM_ML_DEBUG
554  edm::LogVerbatim("HCalGeom")
555  << "DDHCalEndcapAlgo: " << DDName(name,idNameSpace) << " Polyhedra made of "
556  << getAbsMat() << " with " << getNsectortot() << " sectors from "
557  << convertRadToDeg(-alpha) << " to " << convertRadToDeg(-alpha+dphi)
558  << " and with " << pgonZBack.size() << " sections";
559  for (unsigned int i = 0; i < pgonZBack.size(); i++)
560  edm::LogVerbatim("HCalGeom")
561  << "\t\tZ = " << pgonZBack[i] << "\tRmin = " << pgonRminBack[i]
562  << "\tRmax = " << pgonRmaxBack[i];
563 #endif
564 
565  DDName absMatname(DDSplit(getAbsMat()).first, DDSplit(getAbsMat()).second);
566  DDMaterial absMatter(absMatname);
567  DDLogicalPart glog(DDName(name, idNameSpace), absMatter, solid);
568 
569  cpv.position(glog, genlogic, 1, DDTranslation(0.0, 0.0, 0.0), DDRotation());
570 
571 #ifdef EDM_ML_DEBUG
572  edm::LogVerbatim("HCalGeom")
573  << "DDHCalEndcapAlgo: " << glog.name() << " number 1 positioned in "
574  << genlogic.name() << " at (0,0,0) with no rotation";
575 #endif
576 }
577 
578 
580 
581 #ifdef EDM_ML_DEBUG
582  edm::LogVerbatim("HCalGeom")
583  << "DDHCalEndcapAlgo: Modules (" << getModules() << ") ...";
584 #endif
585 
586  double alpha = (1._pi)/getNsectors();
587 
588  for (int i = 0; i < getModules(); i++) {
591  DDMaterial matter(matname);
592 
593  if (equipModule(i)>0) {
594  int nsec = getSectionModule(i);
595 
597  //vertical walls are allowed in SolidPolyhedra
598  double deltaz = 0;
599 
600  std::vector<double> pgonZ, pgonRmin, pgonRmax;
601  if (nsec == 3) {
602  double zf = getZminBlock(i) + getZShiftHac2();
603  pgonZ.emplace_back(zf);
604  pgonRmin.emplace_back(zf*tan(getAngBot()));
605  pgonRmax.emplace_back((zf-getZ1Beam())*getSlope());
606  pgonZ.emplace_back(getZiKink());
607  pgonRmin.emplace_back(getRinKink());
608  pgonRmax.emplace_back(getRout());
609  } else {
610  pgonZ.emplace_back(getZminBlock(i));
611  pgonRmin.emplace_back(getRinBlock1(i));
612  pgonRmax.emplace_back(getRoutBlock1(i));
613  }
614  if (nsec == 4) {
615  pgonZ.emplace_back(getZiDip());
616  pgonRmin.emplace_back(getRinDip());
617  pgonRmax.emplace_back(getRout());
618  pgonZ.emplace_back(pgonZ[1] + deltaz);
619  pgonRmin.emplace_back(pgonRmin[1]);
620  pgonRmax.emplace_back(getRoutDip());
621  }
622  pgonZ.emplace_back(getZmaxBlock(i));
623  pgonRmin.emplace_back(getRinBlock2(i));
624  pgonRmax.emplace_back(getRoutBlock2(i));
625 
626  //Solid & volume
627  DDSolid solid;
629  1, -alpha, 2*alpha,
630  pgonZ, pgonRmin, pgonRmax);
631 
632 #ifdef EDM_ML_DEBUG
633  edm::LogVerbatim("HCalGeom")
634  << "DDHCalEndcapAlgo: " << DDName(name,idNameSpace)
635  << " Polyhedra made of " << getModMat(i) << " with 1 sector from "
636  << convertRadToDeg(-alpha) << " to " << convertRadToDeg(alpha)
637  << " and with " << nsec << " sections";
638  for (unsigned int k=0; k<pgonZ.size(); k++)
639  edm::LogVerbatim("HCalGeom")
640  << "\t\tZ = " << pgonZ[k] << "\tRmin = " << pgonRmin[k] << "\tRmax = "
641  << pgonRmax[k];
642 #endif
643 
644  DDLogicalPart glog(DDName(name, idNameSpace), matter, solid);
645 
646  cpv.position(glog, sector, i+1, DDTranslation(0.0, 0.0, 0.0), DDRotation());
647 
648 #ifdef EDM_ML_DEBUG
649  edm::LogVerbatim("HCalGeom")
650  << "DDHCalEndcapAlgo: " << glog.name() << " number " << i+1
651  << " positioned in " << sector.name() <<" at (0,0,0) with no rotation";
652 #endif
653 
654  if (getModType(i) == 0)
655  constructInsideModule0 (glog, i, cpv);
656  else
657  constructInsideModule (glog, i, cpv);
658  }
659  }
660 }
661 
662 void DDHCalEndcapAlgo::parameterLayer0(int mod, int layer, int iphi,
663  double& yh, double& bl, double& tl,
664  double& alp, double& xpos, double& ypos,
665  double& zpos) {
666 
667  //Given module and layer number compute parameters of trapezoid
668  //and positioning parameters
669  double alpha = (1._pi)/getNsectors();
670 
671 #ifdef EDM_ML_DEBUG
672  edm::LogVerbatim("HCalGeom")
673  << "Input " << iphi << " " << layer << " " << iphi << " Alpha "
674  << convertRadToDeg(alpha);
675 #endif
676 
677  double zi, zo;
678  if (iphi == 0) {
679  zi = getZminBlock(mod);
680  zo = zi + getLayerT(layer);
681  } else {
682  zo = getZmaxBlock(mod);
683  zi = zo - getLayerT(layer);
684  }
685  double rin, rout;
686  if (mod == 0) {
687  rin = zo * tan(getAngTop());
688  rout = (zi - getZ1Beam()) * getSlope();
689  } else {
690  rin = zo * tan(getAngBot());
691  rout = zi * tan(getAngTop());
692  }
693  yh = 0.5 * (rout - rin);
694  bl = 0.5 * rin * tan (alpha);
695  tl = 0.5 * rout * tan(alpha);
696  xpos = 0.5 * (rin + rout);
697  ypos = 0.5 * (bl + tl);
698  zpos = 0.5 * (zi + zo);
699  yh -= getTrim(mod,iphi);
700  bl -= getTrim(mod,iphi);
701  tl -= getTrim(mod,iphi);
702  alp = atan(0.5 * tan(alpha));
703  if (iphi == 0) {
704  ypos = -ypos;
705  } else {
706  alp = -alp;
707  }
708 
709 #ifdef EDM_ML_DEBUG
710  edm::LogVerbatim("HCalGeom")
711  << "Output Dimensions " << yh << " " << bl << " " << tl << " "
712  << convertRadToDeg(alp) << " Position " << xpos << " " << ypos << " " << zpos;
713 #endif
714 }
715 
716 void DDHCalEndcapAlgo::parameterLayer(int iphi, double rinF, double routF,
717  double rinB, double routB, double zi,
718  double zo, double& yh1, double& bl1,
719  double& tl1, double& yh2, double& bl2,
720  double& tl2, double& alp, double& theta,
721  double& phi, double& xpos, double& ypos,
722  double& zpos) {
723 
724  //Given rin, rout compute parameters of the trapezoid and
725  //position of the trapezoid for a standrd layer
726  double alpha = (1._pi)/getNsectors();
727 
728 #ifdef EDM_ML_DEBUG
729  edm::LogVerbatim("HCalGeom")
730  << "Input " << iphi << " Front " << rinF << " " << routF << " " << zi
731  << " Back " << rinB << " " << routB << " " << zo << " Alpha "
732  << convertRadToDeg(alpha);
733 #endif
734 
735  yh1 = 0.5 * (routF - rinB);
736  bl1 = 0.5 * rinB * tan(alpha);
737  tl1 = 0.5 * routF * tan(alpha);
738  yh2 = 0.5 * (routF - rinB);
739  bl2 = 0.5 * rinB * tan(alpha);
740  tl2 = 0.5 * routF * tan(alpha);
741  double dx = 0.25* (bl2+tl2-bl1-tl1);
742  double dy = 0.5 * (rinB+routF-rinB-routF);
743  xpos = 0.25*(rinB+routF+rinB+routF);
744  ypos = 0.25*(bl2+tl2+bl1+tl1);
745  zpos = 0.5*(zi+zo);
746  alp = atan(0.5 * tan(alpha));
747  // ypos-= getTolPos();
748  if (iphi == 0) {
749  ypos = -ypos;
750  } else {
751  alp = -alp;
752  dx = -dx;
753  }
754  double r = sqrt (dx*dx + dy*dy);
755  theta= atan (r/(zo-zi));
756  phi = atan2 (dy, dx);
757 
758 #ifdef EDM_ML_DEBUG
759  edm::LogVerbatim("HCalGeom")
760  << "Output Dimensions " << yh1 << " " << bl1 << " " << tl1 << " " << yh2
761  << " " << bl2 << " " << tl2 << " " << convertRadToDeg(alp) << " "
762  << convertRadToDeg(theta) << " " << convertRadToDeg(phi) << " Position "
763  << xpos << " " << ypos << " " << zpos;
764 #endif
765 }
766 
767 
769 
770 #ifdef EDM_ML_DEBUG
771  edm::LogVerbatim("HCalGeom")
772  << "DDHCalEndcapAlgo: \t\tInside module0 ..." << mod;
773 #endif
774 
776  //Pointers to the Rotation Matrices and to the Materials
777  std::string rotstr = getRotMat();
778  DDRotation rot(DDName(rotstr, rotns));
780  DDMaterial matabsorbr(matName);
782  DDMaterial matplastic(plasName);
783 
784  int layer = getLayer(mod,0);
785  int layer0 = getLayer(mod,1);
787  double xpos, ypos, zpos;
788  DDSolid solid;
789  DDLogicalPart glog, plog;
790  for (int iphi = 0; iphi < getPhi(); iphi++) {
791  double yh, bl, tl, alp;
792  parameterLayer0(mod, layer, iphi, yh, bl, tl, alp, xpos, ypos, zpos);
793  name = module.name().name()+getLayerName(layer)+getPhiName(iphi);
794  solid = DDSolidFactory::trap(DDName(name, idNameSpace),
795  0.5*getLayerT(layer), 0, 0, yh,
796  bl, tl, alp, yh, bl, tl, alp);
797 
798 #ifdef EDM_ML_DEBUG
799  edm::LogVerbatim("HCalGeom")
800  << "DDHCalEndcapAlgo: " << solid.name() << " Trap made of " << getPlastMat()
801  << " of dimensions " << 0.5*getLayerT(layer) << ", 0, 0, " << yh << ", "
802  << bl << ", " << tl << ", " << convertRadToDeg(alp) << ", " << yh << ", "
803  << bl << ", " << tl << ", " << convertRadToDeg(alp);
804 #endif
805 
806  glog = DDLogicalPart(solid.ddname(), matplastic, solid);
807 
808  DDTranslation r1(xpos, ypos, zpos);
809  cpv.position(glog, module, idOffset+layer+1, r1, rot);
810 
811 #ifdef EDM_ML_DEBUG
812  edm::LogVerbatim("HCalGeom")
813  << "DDHCalEndcapAlgo: " << glog.name() << " number " << idOffset+layer+1
814  << " positioned in " << module.name() << " at " << r1 << " with " << rot;
815 #endif
816 
817  //Now construct the layer of scintillator inside this
818  int copyNo = layer0*10 + getLayerType(layer);
819  name = getModName(mod)+getLayerName(layer)+getPhiName(iphi);
820  constructScintLayer (glog, getScintT(layer), yh, bl, tl, alp, name, copyNo, cpv);
821  }
822 
823  //Now the absorber layer
824  double zi = getZminBlock(mod) + getLayerT(layer);
825  double zo = zi + 0.5*getDzStep();
826  double rinF, routF, rinB, routB;
827  if (mod == 0) {
828  rinF = zi * tan(getAngTop());
829  routF =(zi - getZ1Beam()) * getSlope();
830  rinB = zo * tan(getAngTop());
831  routB =(zo - getZ1Beam()) * getSlope();
832  } else {
833  rinF = zi * tan(getAngBot());
834  routF = zi * tan(getAngTop());
835  rinB = zo * tan(getAngBot());
836  routB = zo * tan(getAngTop());
837  }
838 
839 #ifdef EDM_ML_DEBUG
840  edm::LogVerbatim("HCalGeom")
841  << "DDHCalEndcapAlgo: Module " << mod << " Front " << zi << ", " << rinF
842  << ", " << routF << " Back " << zo << ", " << rinB << ", " << routB;
843 #endif
844 
845  double yh1, bl1, tl1, yh2, bl2, tl2, theta, phi, alp;
846  parameterLayer(0, rinF, routF, rinB, routB, zi, zo, yh1, bl1, tl1, yh2, bl2,
847  tl2, alp, theta, phi, xpos, ypos, zpos);
848  double fact = getTolAbs();
849 
850 #ifdef EDM_ML_DEBUG
851  edm::LogVerbatim("HCalGeom")
852  << "DDHCalEndcapAlgo: Trim " << fact << " Param " << yh1 << ", " << bl1
853  << ", " << tl1 << ", " << yh2 << ", " << bl2 << ", " << tl2;
854 #endif
855 
856  bl1 -= fact;
857  tl1 -= fact;
858  bl2 -= fact;
859  tl2 -= fact;
860 
861  name = module.name().name()+"Absorber";
862  solid = DDSolidFactory::trap(DDName(name, idNameSpace),
863  0.5*getThick(mod), theta, phi, yh1,
864  bl1, tl1, alp, yh2, bl2, tl2, alp);
865 #ifdef EDM_ML_DEBUG
866  edm::LogVerbatim("HCalGeom")
867  << "DDHCalEndcapAlgo: " << solid.name() << " Trap made of " << getAbsMat()
868  << " of dimensions " << 0.5*getThick(mod) << ", " << convertRadToDeg(theta)
869  << ", " << convertRadToDeg(phi) << ", " << yh1 << ", " << bl1 << ", " << tl1
870  << ", " << convertRadToDeg(alp) << ", " << yh2 << ", " << bl2 << ", " << tl2
871  << ", " << convertRadToDeg(alp);
872 #endif
873 
874  glog = DDLogicalPart(solid.ddname(), matabsorbr, solid);
875 
876  DDTranslation r2(xpos, ypos, zpos);
877  cpv.position(glog, module, 1, r2, rot);
878 
879 #ifdef EDM_ML_DEBUG
880  edm::LogVerbatim("HCalGeom")
881  << "DDHCalEndcapAlgo: " << glog.name() << " number 1 positioned in "
882  << module.name() << " at " << r2 << " with " << rot;
883 #endif
884 }
885 
886 
888 
889 #ifdef EDM_ML_DEBUG
890  edm::LogVerbatim("HCalGeom")
891  << "DDHCalEndcapAlgo: \t\tInside module ..." << mod;
892 #endif
893 
895  //Pointers to the Rotation Matrices and to the Materials
896  std::string rotstr = getRotMat();
897  DDRotation rot(DDName(rotstr, rotns));
899  DDMaterial matter(matName);
901  DDMaterial matplastic(plasName);
902 
903  double alpha = (1._pi)/getNsectors();
904  double zi = getZminBlock(mod);
905 
906  for (int i = 0; i < getLayerN(mod); i++) {
908  DDSolid solid;
909  DDLogicalPart glog, plog;
910  int layer = getLayer(mod,i);
911  double zo = zi + 0.5*getDzStep();
912 
913  for (int iphi = 0; iphi < getPhi(); iphi++) {
914  double ziAir = zo - getThick(mod);
915  double rinF, rinB;
916  if (layer == 1) {
917  rinF = ziAir * tan(getAngTop());
918  rinB = zo * tan(getAngTop());
919  } else {
920  rinF = ziAir * tan(getAngBot());
921  rinB = zo * tan(getAngBot());
922  }
923  double routF = (ziAir - getZ1Beam()) * getSlope();
924  double routB = (zo - getZ1Beam()) * getSlope();
925  if (routF > getRoutBlock2(mod)) routF = getRoutBlock2(mod);
926  if (routB > getRoutBlock2(mod)) routB = getRoutBlock2(mod);
927 
928 #ifdef EDM_ML_DEBUG
929  edm::LogVerbatim("HCalGeom")
930  << "DDHCalEndcapAlgo: Layer " << i <<" Phi " << iphi << " Front "
931  << ziAir << ", " << rinF << ", " << routF << " Back " << zo << ", "
932  << rinB << ", " << routB;
933 #endif
934 
935  double yh1, bl1, tl1, yh2, bl2, tl2, theta, phi, alp;
936  double xpos, ypos, zpos;
937  parameterLayer(iphi, rinF, routF, rinB, routB, ziAir, zo, yh1, bl1, tl1,
938  yh2, bl2, tl2, alp, theta, phi, xpos, ypos, zpos);
939 
940  name = module.name().name()+getLayerName(layer)+getPhiName(iphi)+"Air";
941  solid = DDSolidFactory::trap(DDName(name, idNameSpace),
942  0.5*getThick(mod), theta, phi, yh1,
943  bl1, tl1, alp, yh2, bl2, tl2, alp);
944 
945 #ifdef EDM_ML_DEBUG
946  edm::LogVerbatim("HCalGeom")
947  << "DDHCalEndcapAlgo: " << solid.name() << " Trap made of " << getGenMat()
948  << " of dimensions " << 0.5*getThick(mod) << ", "<< convertRadToDeg(theta)
949  << ", " << convertRadToDeg(phi) << ", " << yh1 << ", " << bl1 << ", "
950  << tl1 << ", " << convertRadToDeg(alp) << ", " << yh2 << ", " << bl2
951  << ", " << tl2 << ", " << convertRadToDeg(alp);
952 #endif
953 
954  glog = DDLogicalPart(solid.ddname(), matter, solid);
955 
956  DDTranslation r1(xpos, ypos, zpos);
957  cpv.position(glog, module, layer+1, r1, rot);
958 
959 #ifdef EDM_ML_DEBUG
960  edm::LogVerbatim("HCalGeom")
961  << "DDHCalEndcapAlgo: " << glog.name() << " number " << layer+1
962  << " positioned in " << module.name() << " at " << r1 << " with " << rot;
963 #endif
964 
965  //Now the plastic with scintillators
966  double yh = 0.5 * (routF - rinB) - getTrim(mod,iphi);
967  double bl = 0.5 * rinB * tan(alpha) - getTrim(mod,iphi);
968  double tl = 0.5 * routF * tan(alpha) - getTrim(mod,iphi);
969  name = module.name().name()+getLayerName(layer)+getPhiName(iphi);
970  solid = DDSolidFactory::trap(DDName(name, idNameSpace),
971  0.5*getLayerT(layer), 0, 0, yh,
972  bl, tl, alp, yh, bl, tl, alp);
973 
974 #ifdef EDM_ML_DEBUG
975  edm::LogVerbatim("HCalGeom")
976  << "DDHCalEndcapAlgo: " << solid.name() << " Trap made of "
977  << getPlastMat() << " of dimensions " << 0.5*getLayerT(layer)
978  << ", 0, 0, " << yh << ", " << bl << ", " << tl << ", "
979  << convertRadToDeg(alp) << ", " << yh << ", " << bl << ", " << tl << ", "
980  << convertRadToDeg(alp);
981 #endif
982 
983  plog = DDLogicalPart(solid.ddname(), matplastic, solid);
984 
985  ypos = 0.5*(routF+rinB) - xpos;
986  DDTranslation r2(0., ypos, 0.);
987  cpv.position(plog, glog, idOffset+layer+1, r2, DDRotation());
988 
989 #ifdef EDM_ML_DEBUG
990  edm::LogVerbatim("HCalGeom")
991  << "DDHCalEndcapAlgo: " << plog.name() << " number " << idOffset+layer+1
992  << " positioned in " << glog.name() << " at " << r2 <<" with no rotation";
993 #endif
994 
995  //Constructin the scintillators inside
996  int copyNo = layer*10 + getLayerType(layer);
997  name = getModName(mod)+getLayerName(layer)+getPhiName(iphi);
998  constructScintLayer (plog, getScintT(layer), yh,bl,tl, alp,name,copyNo, cpv);
999  zo += 0.5*getDzStep();
1000  } // End of loop over phi indices
1001  zi = zo - 0.5*getDzStep();
1002  } // End of loop on layers
1003 }
1004 
1005 
1007  double dz, double yh, double bl,
1008  double tl, double alp,
1009  const std::string& nm, int id,
1010  DDCompactView& cpv) {
1011 
1013  DDMaterial matter(matname);
1014  std::string name = idName+"Scintillator"+nm;
1015 
1016  DDSolid solid = DDSolidFactory::trap(DDName(name, idNameSpace), 0.5*dz, 0, 0,
1017  yh, bl, tl, alp, yh, bl, tl, alp);
1018 
1019 #ifdef EDM_ML_DEBUG
1020  edm::LogVerbatim("HCalGeom")
1021  << "DDHCalEndcapAlgo: " << DDName(name,idNameSpace) << " Trap made of "
1022  << getScintMat() <<" of dimensions " << 0.5*dz << ", 0, 0, " << yh << ", "
1023  << bl << ", " << tl << ", " << convertRadToDeg(alp) << ", " << yh << ", "
1024  << bl << ", " << tl << ", " << convertRadToDeg(alp);
1025 #endif
1026 
1027  DDLogicalPart glog(solid.ddname(), matter, solid);
1028 
1029  cpv.position(glog, detector, id, DDTranslation(0,0,0), DDRotation());
1030 
1031 #ifdef EDM_ML_DEBUG
1032  edm::LogVerbatim("HCalGeom")
1033  << "DDHCalEndcapAlgo: " << glog.name() << " number " << id
1034  << " positioned in " << detector.name() << " at (0,0,0) with no rotation";
1035 #endif
1036 }
double getTrim(unsigned int i, unsigned int j) const
std::string getModName(unsigned int i) const
void execute(DDCompactView &cpv) override
double getZmaxBlock(unsigned i) const
double getDrEnd() const
float alpha
Definition: AMPTWrapper.h:95
std::vector< int > layerN2
double getSlope() const
const N & name() const
Definition: DDBase.h:74
std::vector< int > modType
std::string idNameSpace
std::vector< double > zminBlock
double getRinBlock2(unsigned i) const
double getZiKink() const
double getZShift() const
int getNsectortot() const
std::vector< int > layerN0
std::vector< std::string > modMat
int getEndcaps() const
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
std::string getAbsMat() const
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:43
int getPhi() const
double getRoutBlock2(unsigned i) const
int getModType(unsigned int i) const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
void constructInsideSector(const DDLogicalPart &sector, DDCompactView &cpv)
int getNsectors() const
Geom::Theta< T > theta() const
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
std::vector< double > routBlock1
void constructInsideModule(const DDLogicalPart &module, int mod, DDCompactView &cpv)
double getThick(unsigned int i) const
static std::string & ns()
double getRinKink() const
std::vector< double > zmaxBlock
double getTolAbs() const
double getZEnd() const
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
int getSectionModule(unsigned i) const
std::string formatAsDegreesInInteger(double radianVal)
Definition: DDTypes.cc:86
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
std::string getModMat(unsigned int i) const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
std::string getRotMat() const
std::string getRotation() const
std::vector< double > routBlock2
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:68
U second(std::pair< T, U > const &p)
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
Definition: DDutils.h:7
double getZ1Beam() const
std::vector< std::string > layerName
double getScintT(unsigned int i) const
void parameterLayer0(int mod, int layer, int iphi, double &yh, double &bl, double &tl, double &alp, double &xpos, double &ypos, double &zcpv)
std::vector< int > layerN1
void constructScintLayer(const DDLogicalPart &glog, double pDz, double yh, double bl, double tl, double alp, const std::string &name, int id, DDCompactView &cpv)
double getAngTop() const
double getRout() const
double getRinBlock1(unsigned i) const
double getAngBot() const
std::string plastMat
std::vector< int > layerN4
T sqrt(T t)
Definition: SSEVec.h:18
std::string scintMat
int equipModule(unsigned int i) const
std::vector< int > sectionModule
double getDzStep() const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
double getZiL0Body() const
std::string getPlastMat() const
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
DDRotation DDrot(const DDName &name, std::unique_ptr< DDRotationMatrix > rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:80
std::vector< double > rinBlock1
std::vector< std::string > modName
std::vector< int > layerN5
~DDHCalEndcapAlgo() override
static DDSolid trap(const DDName &name, double pDz, double pTheta, double pPhi, double pDy1, double pDx1, double pDx2, double pAlp1, double pDy2, double pDx3, double pDx4, double pAlp2)
Definition: DDSolid.cc:792
int getLayerN(unsigned int i) const
std::vector< int > eModule
ii
Definition: cuy.py:590
std::vector< int > layerType
int k[5][pyjets_maxn]
std::vector< int > layerN
const double fact
void constructGeneralVolume(DDCompactView &cpv)
int getLayerType(unsigned int i) const
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
void constructInsideModule0(const DDLogicalPart &module, int mod, DDCompactView &cpv)
double getRinDip() const
std::vector< double > rinBlock2
double getLayerT(unsigned int i) const
double getRoutDip() const
std::vector< double > trimRight
double getDzShift() const
int getLayer(unsigned int i, unsigned int j) const
double getZiDip() const
std::string getPhiName(unsigned int i) const
double getZFront() const
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
std::vector< int > layerN3
double getZiBody() const
std::string getGenMat() const
std::string getScintMat() const
std::vector< std::string > phiName
void parameterLayer(int iphi, double rinF, double routF, double rinB, double routB, double zi, double zo, double &yh1, double &bl1, double &tl1, double &yh2, double &bl2, double &tl2, double &alp, double &theta, double &phi, double &xpos, double &ypos, double &zcpv)
std::string genMaterial
double getZminBlock(unsigned i) const
std::vector< double > thick
std::string rotation
std::string getLayerName(unsigned int i) const
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
std::vector< double > scintT
std::vector< double > layerT
Definition: vlib.h:208
const std::string & name() const
Returns the name.
Definition: DDName.cc:53
static DDSolid polyhedra(const DDName &name, int sides, double startPhi, double deltaPhi, const std::vector< double > &z, const std::vector< double > &rmin, const std::vector< double > &rmax)
Creates a polyhedra (refere to Geant3 or Geant4 documentation)
Definition: DDSolid.cc:730
double getZShiftHac2() const
double getRoutBlock1(unsigned i) const
int getModules() const
const N & ddname() const
Definition: DDBase.h:76
std::vector< double > trimLeft