CMS 3D CMS Logo

DDHCalBarrelAlgo.cc
Go to the documentation of this file.
1 // File: DDHCalBarrelAlgo.cc
3 // adapted from CCal(G4)HcalBarrel.cc
4 // Description: Geometry factory class for Hcal Barrel
6 
7 #include <cmath>
8 #include <algorithm>
9 #include <map>
10 #include <string>
11 #include <vector>
12 
17 #include "DD4hep/DetFactoryHelper.h"
18 
19 #define EDM_ML_DEBUG
20 using namespace cms_units::operators;
21 
23  //General Volume
24  // <----- Zmax ------>
25  //Router************************-------
26  // * *Rstep2| Theta angle w.r.t. vertical
27  // * *---------------
28  // * * |
29  // * *Theta[i] Rmax[i]
30  // * *--------------- |
31  // *Theta[0] Rmax[0]| |
32  //Rinner*****************----------------------
33 
34  std::string genMaterial; //General material
35  int nsectors; //Number of potenital straight edges
36  int nsectortot; //Number of straight edges (actual)
37  int nhalf; //Number of half modules
38  double rinner, router; //See picture
39  int rzones; // ....
40  std::vector<double> theta; // .... (in degrees)
41  std::vector<double> rmax; // ....
42  std::vector<double> zoff; // ....
43  std::vector<double> ttheta; //tan(theta)
44  std::string rotHalf; //Rotation matrix of the second half
45  std::string rotns; //Name space for Rotation matrices
46 
47  //Upper layers inside general volume
48  // <---- Zout ---->
49  // | **************** |
50  // | * * Wstep
51  // W * ***** |
52  // | * *
53  // | ********************
54  // <------ Zin ------->
55  // Middle layers inside general volume
56  // <------ Zout ------> Zout = Full sector Z at position
57  // | ******************** Zin = Full sector Z at position
58  // | * *
59  // W * * Angle = Theta sector
60  // | * * )
61  // | ****************--------
62  // <------ Zin ------->
63 
64  // Lower layers
65  // <------ Zout ------> Zin(i)=Zout(i-1)
66  // | ******************** Zout(i)=Zin(i)+W(i)/tan(Theta(i))
67  // | * *
68  // W * * Theta
69  // | * *
70  // | ****************--------
71  // <--- Zin ------>
72 
73  int nLayers; //Number of layers
74  std::vector<int> layerId; //Number identification
75  std::vector<std::string> layerLabel; //String identification
76  std::vector<std::string> layerMat; //Material
77  std::vector<double> layerWidth; //W in picture
78  std::vector<double> layerD1; //d1 in front picture
79  std::vector<double> layerD2; //d2 in front picture
80  std::vector<double> layerAlpha; //Angular width of the middle tiles
81  std::vector<double> layerT1; //t in front picture (side)
82  std::vector<double> layerT2; //t in front picture (front)
83  std::vector<int> layerAbsorb; //Absorber flag
84  std::vector<double> layerGap; //Gap at the edge
85 
86  int nAbsorber; //Number of absorber layers in middle
87  std::vector<std::string> absorbName; //Absorber name
88  std::vector<std::string> absorbMat; //Absorber material
89  std::vector<double> absorbD; //Distance from the bottom surface
90  std::vector<double> absorbT; //Thickness
91  std::string middleMat; //Material of the detector layer
92  double middleD; //Distance from the bottom surface
93  double middleW; //Half width
94  int nMidAbs; //Number of absorbers in front part
95  std::vector<std::string> midName; //Absorber names in the front part
96  std::vector<std::string> midMat; //Absorber material
97  std::vector<double> midW; //Half width
98  std::vector<double> midT; //Thickness
99 
100  std::vector<std::string> sideMat; //Material for special side layers
101  std::vector<double> sideD; //Depth from bottom surface
102  std::vector<double> sideT; //Thickness
103  int nSideAbs; //Number of absorbers in special side
104  std::vector<std::string> sideAbsName; //Absorber name
105  std::vector<std::string> sideAbsMat; //Absorber material
106  std::vector<double> sideAbsW; //Half width
107 
108  // Detectors. Each volume inside the layer has the shape:
109  //
110  // ******************************* |
111  // *\\\\\\\Plastic\\\\\\\\\\\\\\\* T2
112  // ******************************* |
113  // *////Scintillator/////////////* Tsc
114  // ******************************* |
115  // *\\\\\\\Plastic\\\\\\\\\\\\\\\* T1
116  // ******************************* | |
117  // * Air * dP1
118  // ******************************* |
119  //
120  std::string detMat; //fill material
121  std::string detRot; //Rotation matrix for the 2nd
122  std::string detMatPl; //Plastic material
123  std::string detMatSc; //Scintillator material
124  std::vector<int> detType;
125  std::vector<double> detdP1; //Air gap (side)
126  std::vector<double> detdP2; //Air gap (centre)
127  std::vector<double> detT11; //Back plastic thickness (side)
128  std::vector<double> detT12; //Back plastic thickness (centre)
129  std::vector<double> detTsc; //Scintillator
130  std::vector<double> detT21; //Front plastic thickness (side)
131  std::vector<double> detT22; //Front plastic thickness (centre)
132  std::vector<double> detWidth1; //Width of phi(1,4) megatiles
133  std::vector<double> detWidth2; //Width of phi(2,3) megatiles
134  std::vector<int> detPosY; //Positioning of phi(1,4) tiles - 0 centre
135 
136  std::string idName; //Name of the "parent" volume.
137  std::string idNameSpace; //Namespace of this and ALL sub-parts
138  int idOffset; // Geant4 ID's... = 3000;
139 
140  HcalBarrelAlgo() = delete;
141 
143  cms::DDNamespace ns(ctxt, e, true);
144  cms::DDAlgoArguments args(ctxt, e);
145 #ifdef EDM_ML_DEBUG
146  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: Creating an instance";
147 #endif
148 
149  genMaterial = args.value<std::string>("MaterialName");
150  nsectors = args.value<int>("NSector");
151  nsectortot = args.value<int>("NSectorTot");
152  nhalf = args.value<int>("NHalf");
153  rinner = args.value<double>("RIn");
154  router = args.value<double>("ROut");
155  rzones = args.value<int>("RZones");
156  rotHalf = args.value<std::string>("RotHalf");
157  rotns = args.value<std::string>("RotNameSpace");
158 
159  theta = args.value<std::vector<double> >("Theta");
160  rmax = args.value<std::vector<double> >("RMax");
161  zoff = args.value<std::vector<double> >("ZOff");
162  for (int i = 0; i < rzones; i++) {
163  ttheta.emplace_back(tan(theta[i])); //*deg already done in XML
164  }
165  if (rzones > 3)
166  rmax[2] = (zoff[3] - zoff[2]) / ttheta[2];
167 
168 #ifdef EDM_ML_DEBUG
169  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: General material " << genMaterial << "\tSectors " << nsectors
170  << ", " << nsectortot << "\tHalves " << nhalf << "\tRotation matrix " << rotns << ":"
171  << rotHalf << "\n\t\t" << rinner << "\t" << router << "\t" << rzones;
172  for (int i = 0; i < rzones; i++)
173  edm::LogVerbatim("HCalGeom") << "\tTheta[" << i << "] = " << theta[i] << "\trmax[" << i << "] = " << rmax[i]
174  << "\tzoff[" << i << "] = " << zoff[i];
175 #endif
176  //Layers
178  nLayers = args.value<int>("NLayers");
179 #ifdef EDM_ML_DEBUG
180  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: Layer\t" << nLayers;
181 #endif
182  layerId = args.value<std::vector<int> >("Id");
183  layerLabel = args.value<std::vector<std::string> >("LayerLabel");
184  layerMat = args.value<std::vector<std::string> >("LayerMat");
185  layerWidth = args.value<std::vector<double> >("LayerWidth");
186  layerD1 = args.value<std::vector<double> >("D1");
187  layerD2 = args.value<std::vector<double> >("D2");
188  layerAlpha = args.value<std::vector<double> >("Alpha2");
189  layerT1 = args.value<std::vector<double> >("T1");
190  layerT2 = args.value<std::vector<double> >("T2");
191  layerAbsorb = args.value<std::vector<int> >("AbsL");
192  layerGap = args.value<std::vector<double> >("Gap");
193 #ifdef EDM_ML_DEBUG
194  for (int i = 0; i < nLayers; i++)
195  edm::LogVerbatim("HCalGeom") << layerLabel[i] << "\t" << layerId[i] << "\t" << layerMat[i] << "\t"
196  << layerWidth[i] << "\t" << layerD1[i] << "\t" << layerD2[i] << "\t" << layerAlpha[i]
197  << "\t" << layerT1[i] << "\t" << layerT2[i] << "\t" << layerAbsorb[i] << "\t"
198  << layerGap[i];
199 #endif
200 
202  //Absorber Layers and middle part
203  absorbName = args.value<std::vector<std::string> >("AbsorbName");
204  absorbMat = args.value<std::vector<std::string> >("AbsorbMat");
205  absorbD = args.value<std::vector<double> >("AbsorbD");
206  absorbT = args.value<std::vector<double> >("AbsorbT");
207  nAbsorber = absorbName.size();
208 #ifdef EDM_ML_DEBUG
209  for (int i = 0; i < nAbsorber; i++)
210  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << absorbName[i] << " Material " << absorbMat[i] << " d "
211  << absorbD[i] << " t " << absorbT[i];
212 #endif
213  middleMat = args.value<std::string>("MiddleMat");
214  middleD = args.value<double>("MiddleD");
215  middleW = args.value<double>("MiddleW");
216 #ifdef EDM_ML_DEBUG
217  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: Middle material " << middleMat << " d " << middleD << " w "
218  << middleW;
219 #endif
220  midName = args.value<std::vector<std::string> >("MidAbsName");
221  midMat = args.value<std::vector<std::string> >("MidAbsMat");
222  midW = args.value<std::vector<double> >("MidAbsW");
223  midT = args.value<std::vector<double> >("MidAbsT");
224  nMidAbs = midName.size();
225 #ifdef EDM_ML_DEBUG
226  for (int i = 0; i < nMidAbs; i++)
227  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << midName[i] << " Material " << midMat[i] << " W "
228  << midW[i] << " T " << midT[i];
229 #endif
230 
231  //Absorber layers in the side part
232  sideMat = args.value<std::vector<std::string> >("SideMat");
233  sideD = args.value<std::vector<double> >("SideD");
234  sideT = args.value<std::vector<double> >("SideT");
235 #ifdef EDM_ML_DEBUG
236  for (unsigned int i = 0; i < sideMat.size(); i++)
237  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: Side material " << sideMat[i] << " d " << sideD[i] << " t "
238  << sideT[i];
239 #endif
240  sideAbsName = args.value<std::vector<std::string> >("SideAbsName");
241  sideAbsMat = args.value<std::vector<std::string> >("SideAbsMat");
242  sideAbsW = args.value<std::vector<double> >("SideAbsW");
243  nSideAbs = sideAbsName.size();
244 #ifdef EDM_ML_DEBUG
245  for (int i = 0; i < nSideAbs; i++)
246  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << sideAbsName[i] << " Material " << sideAbsMat[i] << " W "
247  << sideAbsW[i];
248 #endif
249 
251  // Detectors
252 
253  detMat = args.value<std::string>("DetMat");
254  detRot = args.value<std::string>("DetRot");
255  detMatPl = args.value<std::string>("DetMatPl");
256  detMatSc = args.value<std::string>("DetMatSc");
257 #ifdef EDM_ML_DEBUG
258  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: Detector (" << nLayers << ") Rotation matrix " << rotns << ":"
259  << detRot << "\n\t\t" << detMat << "\t" << detMatPl << "\t" << detMatSc;
260 #endif
261  detType = args.value<std::vector<int> >("DetType");
262  detdP1 = args.value<std::vector<double> >("DetdP1");
263  detdP2 = args.value<std::vector<double> >("DetdP2");
264  detT11 = args.value<std::vector<double> >("DetT11");
265  detT12 = args.value<std::vector<double> >("DetT12");
266  detTsc = args.value<std::vector<double> >("DetTsc");
267  detT21 = args.value<std::vector<double> >("DetT21");
268  detT22 = args.value<std::vector<double> >("DetT22");
269  detWidth1 = args.value<std::vector<double> >("DetWidth1");
270  detWidth2 = args.value<std::vector<double> >("DetWidth2");
271  detPosY = args.value<std::vector<int> >("DetPosY");
272 #ifdef EDM_ML_DEBUG
273  for (int i = 0; i < nLayers; i++)
274  edm::LogVerbatim("HCalGeom") << i + 1 << "\t" << detType[i] << "\t" << detdP1[i] << ", " << detdP2[i] << "\t"
275  << detT11[i] << ", " << detT12[i] << "\t" << detTsc[i] << "\t" << detT21[i] << ", "
276  << detT22[i] << "\t" << detWidth1[i] << "\t" << detWidth2[i] << "\t" << detPosY[i];
277 #endif
278 
279  // idName = parentName.name();
280  idName = args.value<std::string>("MotherName");
281  idNameSpace = ns.name();
282  idOffset = args.value<int>("IdOffset");
283 #ifdef EDM_ML_DEBUG
284  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: Parent " << args.parentName() << " idName " << idName
285  << " NameSpace " << idNameSpace << " Offset " << idOffset;
286  edm::LogVerbatim("HCalGeom") << "==>> Constructing DDHCalBarrelAlgo...\n"
287  << "DDHCalBarrelAlgo: General volume...";
288 #endif
289 
290  double alpha = (1._pi) / nsectors;
291  double dphi = nsectortot * (2._pi) / nsectors;
292  int nsec, ntot(15);
293  if (nhalf == 1)
294  nsec = 8;
295  else
296  nsec = 15;
297  int nf = ntot - nsec;
298 
299  //Calculate zmin... see HCalBarrel.hh picture. For polyhedra
300  //Rmin and Rmax are distances to vertex
301  double zmax = zoff[3];
302  double zstep5 = zoff[4];
303  double zstep4 = (zoff[1] + rmax[1] * ttheta[1]);
304  if ((zoff[2] + rmax[1] * ttheta[2]) > zstep4)
305  zstep4 = (zoff[2] + rmax[1] * ttheta[2]);
306  double zstep3 = (zoff[1] + rmax[0] * ttheta[1]);
307  double zstep2 = (zoff[0] + rmax[0] * ttheta[0]);
308  double zstep1 = (zoff[0] + rinner * ttheta[0]);
309  double rout = router;
310  double rout1 = rmax[3];
311  double rin = rinner;
312  double rmid1 = rmax[0];
313  double rmid2 = rmax[1];
314  double rmid3 = (zoff[4] - zoff[2]) / ttheta[2];
315  double rmid4 = rmax[2];
316 
317  std::vector<double> pgonZ = {-zmax,
318  -zstep5,
319  -zstep5,
320  -zstep4,
321  -zstep3,
322  -zstep2,
323  -zstep1,
324  0,
325  zstep1,
326  zstep2,
327  zstep3,
328  zstep4,
329  zstep5,
330  zstep5,
331  zmax};
332 
333  std::vector<double> pgonRmin = {
334  rmid4, rmid3, rmid3, rmid2, rmid1, rmid1, rin, rin, rin, rmid1, rmid1, rmid2, rmid3, rmid3, rmid4};
335 
336  std::vector<double> pgonRmax = {
337  rout1, rout1, rout, rout, rout, rout, rout, rout, rout, rout, rout, rout, rout, rout1, rout1};
338 
339  std::vector<double> pgonZHalf = {0, zstep1, zstep2, zstep3, zstep4, zstep5, zstep5, zmax};
340 
341  std::vector<double> pgonRminHalf = {rin, rin, rmid1, rmid1, rmid2, rmid3, rmid3, rmid4};
342 
343  std::vector<double> pgonRmaxHalf = {rout, rout, rout, rout, rout, rout, rout1, rout1};
344 
345  std::string name("Null");
346  dd4hep::Solid solid;
347  if (nf == 0) {
348  solid = dd4hep::Polyhedra(ns.prepend(idName), nsectortot, -alpha, dphi, pgonZ, pgonRmin, pgonRmax);
349 #ifdef EDM_ML_DEBUG
350  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " Polyhedra made of " << genMaterial
351  << " with " << nsectortot << " sectors from " << convertRadToDeg(-alpha) << " to "
352  << convertRadToDeg(-alpha + dphi) << " and with " << nsec << " sections ";
353  for (unsigned int i = 0; i < pgonZ.size(); i++)
354  edm::LogVerbatim("HCalGeom") << "\t"
355  << "\tZ = " << pgonZ[i] << "\tRmin = " << pgonRmin[i]
356  << "\tRmax = " << pgonRmax[i];
357 #endif
358  } else {
359  solid = dd4hep::Polyhedra(ns.prepend(idName), nsectortot, -alpha, dphi, pgonZHalf, pgonRminHalf, pgonRmaxHalf);
360 #ifdef EDM_ML_DEBUG
361  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " Polyhedra made of " << genMaterial
362  << " with " << nsectortot << " sectors from " << convertRadToDeg(-alpha) << " to "
363  << convertRadToDeg(-alpha + dphi) << " and with " << nsec << " sections ";
364  for (unsigned int i = 0; i < pgonZHalf.size(); i++)
365  edm::LogVerbatim("HCalGeom") << "\t"
366  << "\tZ = " << pgonZHalf[i] << "\tRmin = " << pgonRminHalf[i]
367  << "\tRmax = " << pgonRmaxHalf[i];
368 #endif
369  }
370 
371  dd4hep::Material matter = ns.material(genMaterial);
372  dd4hep::Volume genlogic(solid.name(), solid, matter);
373  dd4hep::Volume parentName = ns.volume(args.parentName());
374  parentName.placeVolume(genlogic, 1);
375 #ifdef EDM_ML_DEBUG
376  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << genlogic.name() << " number 1 positioned in "
377  << parentName.name() << " at (0, 0, 0) with no rotation";
378 #endif
379  //Forward and backwards halfs
380  name = idName + "Half";
381  nf = (ntot + 1) / 2;
382  solid = dd4hep::Polyhedra(ns.prepend(name), nsectortot, -alpha, dphi, pgonZHalf, pgonRminHalf, pgonRmaxHalf);
383 #ifdef EDM_ML_DEBUG
384  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " Polyhedra made of " << genMaterial
385  << " with " << nsectortot << " sectors from " << convertRadToDeg(-alpha) << " to "
386  << convertRadToDeg(-alpha + dphi) << " and with " << nf << " sections ";
387  for (unsigned int i = 0; i < pgonZHalf.size(); i++)
388  edm::LogVerbatim("HCalGeom") << "\t"
389  << "\tZ = " << pgonZHalf[i] << "\tRmin = " << pgonRminHalf[i]
390  << "\tRmax = " << pgonRmaxHalf[i];
391 #endif
392  dd4hep::Volume genlogich(solid.name(), solid, matter);
393  genlogic.placeVolume(genlogich, 1);
394 #ifdef EDM_ML_DEBUG
395  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << genlogich.name() << " number 1 positioned in "
396  << genlogic.name() << " at (0, 0, 0) with no rotation";
397 #endif
398  if (nhalf != 1) {
399  dd4hep::Rotation3D rot = getRotation(rotHalf, rotns, ns);
400  genlogic.placeVolume(genlogich, 2, rot);
401 #ifdef EDM_ML_DEBUG
402  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << genlogich.name() << " number 2 positioned in "
403  << genlogic.name() << " at (0, 0, 0) with " << rot;
404 #endif
405  } //end if (getNhalf...
406 
407  //Construct sector (from -alpha to +alpha)
408  name = idName + "Module";
409  solid = dd4hep::Polyhedra(ns.prepend(name), 1, -alpha, 2 * alpha, pgonZHalf, pgonRminHalf, pgonRmaxHalf);
410  dd4hep::Volume seclogic(solid.name(), solid, matter);
411 #ifdef EDM_ML_DEBUG
412  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " Polyhedra made of " << matter.name()
413  << " with 1 sector from " << convertRadToDeg(-alpha) << " to "
414  << convertRadToDeg(alpha) << " and with " << nf << " sections";
415  for (unsigned int i = 0; i < pgonZHalf.size(); i++)
416  edm::LogVerbatim("HCalGeom") << "\t\tZ = " << pgonZHalf[i] << "\tRmin = " << pgonRminHalf[i]
417  << "\tRmax = " << pgonRmaxHalf[i];
418 #endif
419 
420  for (int ii = 0; ii < nsectortot; ii++) {
421  double phi = ii * 2 * alpha;
422  dd4hep::Rotation3D rotation;
423  if (phi != 0) {
424  rotation = dd4hep::RotationZ(phi);
425 #ifdef EDM_ML_DEBUG
426  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: Creating a new "
427  << "rotation around Z " << convertRadToDeg(phi);
428 #endif
429  } //if phideg!=0
430  genlogich.placeVolume(seclogic, ii + 1, rotation);
431 #ifdef EDM_ML_DEBUG
432  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << seclogic.name() << " number " << ii + 1
433  << " positioned in " << genlogich.name() << " at (0, 0, 0) with " << rotation;
434 #endif
435  }
436 
437  //Construct the things inside the sector
438 #ifdef EDM_ML_DEBUG
439  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: Layers (" << nLayers << ") ...";
440 #endif
441  rin = rinner;
442  for (int i = 0; i < nLayers; i++) {
443  std::string name = idName + layerLabel[i];
444  dd4hep::Material matter = ns.material(layerMat[i]);
445  double width = layerWidth[i];
446  double rout = rin + width;
447 
448  int in = 0, out = 0;
449  for (int j = 0; j < rzones - 1; j++) {
450  if (rin >= rmax[j])
451  in = j + 1;
452  if (rout > rmax[j])
453  out = j + 1;
454  }
455  double zout = zoff[in] + rin * ttheta[in];
456 
458  //vertical walls are allowed in SolidPolyhedra
459  int nsec = 2;
460  std::vector<double> pgonZ, pgonRmin, pgonRmax;
461  // index 0
462  pgonZ.emplace_back(0);
463  pgonRmin.emplace_back(rin);
464  pgonRmax.emplace_back(rout);
465  // index 1
466  pgonZ.emplace_back(zout);
467  pgonRmin.emplace_back(rin);
468  pgonRmax.emplace_back(rout);
469  if (in == out) {
470  if (in <= 3) {
471  //index 2
472  pgonZ.emplace_back(zoff[in] + rout * ttheta[in]);
473  pgonRmin.emplace_back(pgonRmax[1]);
474  pgonRmax.emplace_back(pgonRmax[1]);
475  nsec++;
476  }
477  } else {
478  if (in == 3) {
479  //redo index 1, add index 2
480  pgonZ[1] = (zoff[out] + rmax[out] * ttheta[out]);
481  pgonZ.emplace_back(pgonZ[1]);
482  pgonRmin.emplace_back(pgonRmin[1]);
483  pgonRmax.emplace_back(rmax[in]);
484  //index 3
485  pgonZ.emplace_back(zoff[in] + rmax[in] * ttheta[in]);
486  pgonRmin.emplace_back(pgonRmin[2]);
487  pgonRmax.emplace_back(pgonRmax[2]);
488  nsec += 2;
489  } else {
490  //index 2
491  pgonZ.emplace_back(zoff[in] + rmax[in] * ttheta[in]);
492  pgonRmin.emplace_back(rmax[in]);
493  pgonRmax.emplace_back(pgonRmax[1]);
494  nsec++;
495  if (in == 0) {
496  pgonZ.emplace_back(zoff[out] + rmax[in] * ttheta[out]);
497  pgonRmin.emplace_back(pgonRmin[2]);
498  pgonRmax.emplace_back(pgonRmax[2]);
499  nsec++;
500  }
501  if (in <= 1) {
502  pgonZ.emplace_back(zoff[out] + rout * ttheta[out]);
503  pgonRmin.emplace_back(rout);
504  pgonRmax.emplace_back(rout);
505  nsec++;
506  }
507  }
508  }
509  //Solid & volume
510  dd4hep::Solid solid;
511  double alpha1 = alpha;
512  if (layerGap[i] > 1.e-6) {
513  double rmid = 0.5 * (rin + rout);
514  double width = rmid * tan(alpha) - layerGap[i];
515  alpha1 = atan(width / rmid);
516 #ifdef EDM_ML_DEBUG
517  edm::LogVerbatim("HCalGeom") << "\tAlpha_1 modified from " << convertRadToDeg(alpha) << " to "
518  << convertRadToDeg(alpha1) << " Rmid " << rmid << " Reduced width " << width;
519 #endif
520  }
521  solid = dd4hep::Polyhedra(ns.prepend(name), 1, -alpha1, 2 * alpha1, pgonZ, pgonRmin, pgonRmax);
522  dd4hep::Volume glog(solid.name(), solid, matter);
523 #ifdef EDM_ML_DEBUG
524  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " (Layer " << i << ") Polyhedra made of "
525  << matter.name() << " with 1 sector from " << convertRadToDeg(-alpha1) << " to "
526  << convertRadToDeg(alpha1) << " and with " << nsec << " sections";
527  for (unsigned int k = 0; k < pgonZ.size(); k++)
528  edm::LogVerbatim("HCalGeom") << "\t\t" << pgonZ[k] << "\t" << pgonRmin[k] << "\t" << pgonRmax[k];
529 #endif
530 
531  seclogic.placeVolume(glog, layerId[i]);
532 #ifdef EDM_ML_DEBUG
533  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << glog.name() << " number " << layerId[i]
534  << " positioned in " << seclogic.name() << " at (0,0,0) with no rotation";
535 #endif
536  constructInsideLayers(glog,
537  layerLabel[i],
538  layerId[i],
539  layerAbsorb[i],
540  rin,
541  layerD1[i],
542  alpha1,
543  layerD2[i],
544  layerAlpha[i],
545  layerT1[i],
546  layerT2[i],
547  ns);
548  rin = rout;
549  }
550  }
551 
553  const std::string& nm,
554  int id,
555  int nAbs,
556  double rin,
557  double d1,
558  double alpha1,
559  double d2,
560  double alpha2,
561  double t1,
562  double t2,
563  cms::DDNamespace& ns) {
564 #ifdef EDM_ML_DEBUG
565  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: \t\tInside layer " << id << "...";
566 #endif
567 
569  //Pointers to the Rotation Matrices and to the Materials
570  dd4hep::Rotation3D rot = getRotation(detRot, rotns, ns);
571 
572  std::string nam0 = nm + "In";
573  std::string name = idName + nam0;
574  dd4hep::Material matter = ns.material(detMat);
575 
576  dd4hep::Solid solid;
577  dd4hep::Volume glog, mother;
578  double rsi, dx, dy, dz, x, y;
579  int i, in;
580  //Two lower volumes
581  if (alpha1 > 0) {
582  rsi = rin + d1;
583  in = 0;
584  for (i = 0; i < rzones - 1; i++) {
585  if (rsi >= rmax[i])
586  in = i + 1;
587  }
588  dx = 0.5 * t1;
589  dy = 0.5 * rsi * (tan(alpha1) - tan(alpha2));
590  dz = 0.5 * (zoff[in] + rsi * ttheta[in]);
591  x = rsi + dx;
592  y = 0.5 * rsi * (tan(alpha1) + tan(alpha2));
593  dd4hep::Position r11(x, y, dz);
594  dd4hep::Position r12(x, -y, dz);
595 
596  solid = dd4hep::Box(ns.prepend(name + "1"), dx, dy, dz);
597 #ifdef EDM_ML_DEBUG
598  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " Box made of " << matter.name()
599  << " of dimensions " << dx << ", " << dy << ", " << dz;
600 #endif
601  glog = dd4hep::Volume(solid.name(), solid, matter);
602 
603  if (nAbs != 0) {
604  mother = constructSideLayer(laylog, name, nAbs, rin, alpha1, ns);
605  } else {
606  mother = laylog;
607  }
608  mother.placeVolume(glog, idOffset + 1, r11);
609  mother.placeVolume(glog, idOffset + 2, dd4hep::Transform3D(rot, r12));
610 #ifdef EDM_ML_DEBUG
611  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << glog.name() << " Number " << idOffset + 1
612  << " positioned in " << mother.name() << " at " << r11 << " with no rotation\n"
613  << "DDHCalBarrelAlgo: " << glog.name() << " Number " << idOffset + 2
614  << " positioned in " << mother.name() << " at " << r12 << " with " << rot;
615 #endif
616  //Constructin the plastics and scintillators inside
617  constructInsideDetectors(glog, nam0 + "1", id, dx, dy, dz, 1, ns);
618  }
619 
620  //Upper volume
621  rsi = rin + d2;
622  in = 0;
623  for (i = 0; i < rzones - 1; i++) {
624  if (rsi >= rmax[i])
625  in = i + 1;
626  }
627  dx = 0.5 * t2;
628  dy = 0.5 * rsi * tan(alpha2);
629  dz = 0.5 * (zoff[in] + rsi * ttheta[in]);
630  x = rsi + dx;
631  dd4hep::Position r21(x, dy, dz);
632  dd4hep::Position r22(x, -dy, dz);
633 
634  solid = dd4hep::Box(ns.prepend(name + "2"), dx, dy, dz);
635 #ifdef EDM_ML_DEBUG
636  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " Box made of " << matter.name()
637  << " of dimensions " << dx << ", " << dy << ", " << dz;
638 #endif
639  glog = dd4hep::Volume(solid.name(), solid, matter);
640 
641  if (nAbs < 0) {
642  mother = constructMidLayer(laylog, name, rin, alpha1, ns);
643  } else {
644  mother = laylog;
645  }
646  mother.placeVolume(glog, idOffset + 3, r21);
647  mother.placeVolume(glog, idOffset + 4, dd4hep::Transform3D(rot, r22));
648 #ifdef EDM_ML_DEBUG
649  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << glog.name() << " Number " << idOffset + 3
650  << " positioned in " << mother.name() << " at " << r21
651  << " with no rotation\nDDHCalBarrelAlgo: " << glog.name() << " Number " << idOffset + 4
652  << " positioned in " << mother.name() << " at " << r22 << " with " << rot;
653 #endif
654  //Constructin the plastics and scintillators inside
655  constructInsideDetectors(glog, nam0 + "2", id, dx, dy, dz, 2, ns);
656  }
657 
659  dd4hep::Volume& laylog, const std::string& nm, int nAbs, double rin, double alpha, cms::DDNamespace& ns) {
660  //Extra absorber layer
661  int k = abs(nAbs) - 1;
662  std::string namek = nm + "Side";
663  double rsi = rin + sideD[k];
664  int in = 0;
665  for (int i = 0; i < rzones - 1; i++) {
666  if (rsi >= rmax[i])
667  in = i + 1;
668  }
669  std::vector<double> pgonZ, pgonRmin, pgonRmax;
670  // index 0
671  pgonZ.emplace_back(0.0);
672  pgonRmin.emplace_back(rsi);
673  pgonRmax.emplace_back(rsi + sideT[k]);
674  // index 1
675  pgonZ.emplace_back(zoff[in] + rsi * ttheta[in]);
676  pgonRmin.emplace_back(rsi);
677  pgonRmax.emplace_back(pgonRmax[0]);
678  // index 2
679  pgonZ.emplace_back(zoff[in] + pgonRmax[0] * ttheta[in]);
680  pgonRmin.emplace_back(pgonRmax[1]);
681  pgonRmax.emplace_back(pgonRmax[1]);
682  dd4hep::Solid solid = dd4hep::Polyhedra(ns.prepend(namek), 1, -alpha, 2 * alpha, pgonZ, pgonRmin, pgonRmax);
683  dd4hep::Material matter = ns.material(sideMat[k]);
684  dd4hep::Volume glog(solid.name(), solid, matter);
685 #ifdef EDM_ML_DEBUG
686  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " Polyhedra made of " << sideMat[k]
687  << " with 1 sector from " << convertRadToDeg(-alpha) << " to "
688  << convertRadToDeg(alpha) << " and with " << pgonZ.size() << " sections";
689  for (unsigned int ii = 0; ii < pgonZ.size(); ii++)
690  edm::LogVerbatim("HCalGeom") << "\t\tZ = " << pgonZ[ii] << "\tRmin = " << pgonRmin[ii]
691  << "\tRmax = " << pgonRmax[ii];
692 #endif
693 
694  laylog.placeVolume(glog, 1);
695 #ifdef EDM_ML_DEBUG
696  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << glog.name() << " Number 1 positioned in " << laylog.name()
697  << " at (0,0,0) with no rotation";
698 #endif
699  if (nAbs < 0) {
700  dd4hep::Volume mother = glog;
701  double rmid = pgonRmax[0];
702  for (int i = 0; i < nSideAbs; i++) {
703  double alpha1 = atan(sideAbsW[i] / rmid);
704  if (alpha1 > 0) {
705  std::string name = namek + sideAbsName[i];
706  solid = dd4hep::Polyhedra(ns.prepend(name), 1, -alpha1, 2 * alpha1, pgonZ, pgonRmin, pgonRmax);
707  dd4hep::Material matter = ns.material(sideAbsMat[i]);
708  dd4hep::Volume log(solid.name(), solid, matter);
709 #ifdef EDM_ML_DEBUG
710  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " Polyhedra made of " << sideAbsMat[i]
711  << " with 1 sector from " << convertRadToDeg(-alpha1) << " to "
712  << convertRadToDeg(alpha1) << " and with " << pgonZ.size() << " sections";
713  for (unsigned int ii = 0; ii < pgonZ.size(); ii++)
714  edm::LogVerbatim("HCalGeom") << "\t\tZ = " << pgonZ[ii] << "\tRmin = " << pgonRmin[ii]
715  << "\tRmax = " << pgonRmax[ii];
716 #endif
717 
718  mother.placeVolume(log, 1);
719 #ifdef EDM_ML_DEBUG
720  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << log.name() << " Number 1 positioned in "
721  << mother.name() << " at (0,0,0) with no rotation";
722 #endif
723  mother = log;
724  }
725  }
726  }
727  return glog;
728  }
729 
731  dd4hep::Volume laylog, const std::string& nm, double rin, double alpha, cms::DDNamespace& ns) {
732  dd4hep::Solid solid;
733  dd4hep::Volume log, glog;
734  std::string name = nm + "Mid";
735  for (int k = 0; k < nAbsorber; k++) {
736  std::string namek = name + absorbName[k];
737  double rsi = rin + absorbD[k];
738  int in = 0;
739  for (int i = 0; i < rzones - 1; i++) {
740  if (rsi >= rmax[i])
741  in = i + 1;
742  }
743  std::vector<double> pgonZ, pgonRmin, pgonRmax;
744  // index 0
745  pgonZ.emplace_back(0.0);
746  pgonRmin.emplace_back(rsi);
747  pgonRmax.emplace_back(rsi + absorbT[k]);
748  // index 1
749  pgonZ.emplace_back(zoff[in] + rsi * ttheta[in]);
750  pgonRmin.emplace_back(rsi);
751  pgonRmax.emplace_back(pgonRmax[0]);
752  // index 2
753  pgonZ.emplace_back(zoff[in] + pgonRmax[0] * ttheta[in]);
754  pgonRmin.emplace_back(pgonRmax[1]);
755  pgonRmax.emplace_back(pgonRmax[1]);
756  solid = dd4hep::Polyhedra(ns.prepend(namek), 1, -alpha, 2 * alpha, pgonZ, pgonRmin, pgonRmax);
757  dd4hep::Material matter = ns.material(absorbMat[k]);
758  log = dd4hep::Volume(solid.name(), solid, matter);
759 #ifdef EDM_ML_DEBUG
760  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " Polyhedra made of " << matter.name()
761  << " with 1 sector from " << convertRadToDeg(-alpha) << " to "
762  << convertRadToDeg(alpha) << " and with " << pgonZ.size() << " sections";
763  for (unsigned int ii = 0; ii < pgonZ.size(); ii++)
764  edm::LogVerbatim("HCalGeom") << "\t\tZ = " << pgonZ[ii] << "\tRmin = " << pgonRmin[ii]
765  << "\tRmax = " << pgonRmax[ii];
766 #endif
767 
768  laylog.placeVolume(log, 1);
769 #ifdef EDM_ML_DEBUG
770  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << log.name() << " Number 1 positioned in " << laylog.name()
771  << " at (0,0,0) with no rotation";
772 #endif
773  if (k == 0) {
774  double rmin = pgonRmin[0];
775  double rmax = pgonRmax[0];
776  dd4hep::Volume mother = log;
777  for (int i = 0; i < 1; i++) {
778  double alpha1 = atan(midW[i] / rmin);
779  std::string namek = name + midName[i];
780  solid = dd4hep::Polyhedra(ns.prepend(namek), 1, -alpha1, 2 * alpha1, pgonZ, pgonRmin, pgonRmax);
781  dd4hep::Material matter1 = ns.material(midMat[i]);
782  log = dd4hep::Volume(solid.name(), solid, matter1);
783 #ifdef EDM_ML_DEBUG
784  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " Polyhedra made of "
785  << matter1.name() << " with 1 sector from " << convertRadToDeg(-alpha1) << " to "
786  << convertRadToDeg(alpha1) << " and with " << pgonZ.size() << " sections";
787  for (unsigned int ii = 0; ii < pgonZ.size(); ii++)
788  edm::LogVerbatim("HCalGeom") << "\t\tZ = " << pgonZ[ii] << "\tRmin = " << pgonRmin[ii]
789  << "\tRmax = " << pgonRmax[ii];
790 #endif
791 
792  mother.placeVolume(log, 1);
793 #ifdef EDM_ML_DEBUG
794  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << log.name() << " Number 1 positioned in "
795  << mother.name() << " at (0,0,0) with no rotation";
796 #endif
797  mother = log;
798  }
799 
800  // Now the layer with detectors
801  double rmid = rmin + middleD;
802  pgonRmin[0] = rmid;
803  pgonRmax[0] = rmax;
804  pgonRmin[1] = rmid;
805  pgonRmax[1] = rmax;
806  pgonZ[1] = zoff[in] + rmid * ttheta[in];
807  pgonRmin[2] = rmax;
808  pgonRmax[2] = rmax;
809  pgonZ[2] = zoff[in] + rmax * ttheta[in];
810  double alpha1 = atan(middleW / rmin);
811  solid = dd4hep::Polyhedra(ns.prepend(name), 1, -alpha1, 2 * alpha1, pgonZ, pgonRmin, pgonRmax);
812  dd4hep::Material matter1 = ns.material(middleMat);
813  glog = dd4hep::Volume(solid.name(), solid, matter1);
814 #ifdef EDM_ML_DEBUG
815  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " Polyhedra made of " << matter1.name()
816  << " with 1 sector from " << convertRadToDeg(-alpha1) << " to "
817  << convertRadToDeg(alpha1) << " and with " << pgonZ.size() << " sections";
818  for (unsigned int ii = 0; ii < pgonZ.size(); ii++)
819  edm::LogVerbatim("HCalGeom") << "\t\tZ = " << pgonZ[ii] << "\tRmin = " << pgonRmin[ii]
820  << "\tRmax = " << pgonRmax[ii];
821 #endif
822 
823  mother.placeVolume(glog, 1);
824 #ifdef EDM_ML_DEBUG
825  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << glog.name() << " Number 1 positioned in "
826  << mother.name() << " at (0,0,0) with no rotation";
827 #endif
828  // Now the remaining absorber layers
829  for (int i = 1; i < nMidAbs; i++) {
830  namek = name + midName[i];
831  rmid = rmin + midT[i];
832  pgonRmin[0] = rmin;
833  pgonRmax[0] = rmid;
834  pgonRmin[1] = rmin;
835  pgonRmax[1] = rmid;
836  pgonZ[1] = zoff[in] + rmin * ttheta[in];
837  pgonRmin[2] = rmid;
838  pgonRmax[2] = rmid;
839  pgonZ[2] = zoff[in] + rmid * ttheta[in];
840  alpha1 = atan(midW[i] / rmin);
841  solid = dd4hep::Polyhedra(ns.prepend(namek), 1, -alpha1, 2 * alpha1, pgonZ, pgonRmin, pgonRmax);
842  dd4hep::Material matter2 = ns.material(midMat[i]);
843  log = dd4hep::Volume(solid.name(), solid, matter2);
844 #ifdef EDM_ML_DEBUG
845  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " Polyhedra made of "
846  << matter2.name() << " with 1 sector from " << convertRadToDeg(-alpha1) << " to "
847  << convertRadToDeg(alpha1) << " and with " << pgonZ.size() << " sections";
848  for (unsigned int ii = 0; ii < pgonZ.size(); ii++)
849  edm::LogVerbatim("HCalGeom") << "\t\tZ = " << pgonZ[ii] << "\tRmin = " << pgonRmin[ii]
850  << "\tRmax = " << pgonRmax[ii];
851 #endif
852 
853  mother.placeVolume(log, i);
854 #ifdef EDM_ML_DEBUG
855  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << log.name() << " Number " << i << " positioned in "
856  << mother.name() << " at (0,0,0) with no rotation";
857 #endif
858  mother = log;
859  }
860  }
861  }
862  return glog;
863  }
864 
866  const std::string& name,
867  int id,
868  double dx,
869  double dy,
870  double dz,
871  int type,
872  cms::DDNamespace& ns) {
873 #ifdef EDM_ML_DEBUG
874  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: \t\tInside detector " << id << "...";
875 #endif
876 
877  dd4hep::Material plmatter = ns.material(detMatPl);
878  dd4hep::Material scmatter = ns.material(detMatSc);
879  std::string plname = DDSplit(detector.name()).first + "Plastic_";
880  std::string scname = idName + "Scintillator" + name;
881 
882  id--;
883  dd4hep::Solid solid;
884  dd4hep::Volume glog;
885  double wid, y = 0;
886  double dx1, dx2, shiftX;
887 
888  if (type == 1) {
889  wid = 0.5 * detWidth1[id];
890  dx1 = 0.5 * detT11[id];
891  dx2 = 0.5 * detT21[id];
892  shiftX = detdP1[id];
893  if (detPosY[id] > 0)
894  y = -dy + wid;
895  } else {
896  wid = 0.5 * detWidth2[id];
897  dx1 = 0.5 * detT12[id];
898  dx2 = 0.5 * detT22[id];
899  shiftX = detdP2[id];
900  }
901 
902  solid = dd4hep::Box(ns.prepend(plname + "1"), dx1, wid, dz);
903  glog = dd4hep::Volume(solid.name(), solid, plmatter);
904 #ifdef EDM_ML_DEBUG
905  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " Box made of " << plmatter.name()
906  << " of dimensions " << dx1 << ", " << wid << ", " << dz;
907 #endif
908 
909  double x = shiftX + dx1 - dx;
910  detector.placeVolume(glog, 1, dd4hep::Position(x, y, 0));
911 #ifdef EDM_ML_DEBUG
912  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << glog.name() << " Number 1 positioned in " << detector.name()
913  << " at (" << x << "," << y << ",0) with no rotation";
914 #endif
915  solid = dd4hep::Box(ns.prepend(scname), 0.5 * detTsc[id], wid, dz);
916  glog = dd4hep::Volume(solid.name(), solid, scmatter);
917 #ifdef EDM_ML_DEBUG
918  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " Box made of " << scmatter.name()
919  << " of dimensions " << 0.5 * detTsc[id] << ", " << wid << ", " << dz;
920 #endif
921 
922  x += dx1 + 0.5 * detTsc[id];
923  int copyNo = id * 10 + detType[id];
924  detector.placeVolume(glog, copyNo, dd4hep::Position(x, y, 0));
925 #ifdef EDM_ML_DEBUG
926  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << glog.name() << " Number " << copyNo << " positioned in "
927  << detector.name() << " at (" << x << "," << y << ",0) with no rotation";
928 #endif
929  solid = dd4hep::Box(ns.prepend(plname + "2"), dx2, wid, dz);
930  glog = dd4hep::Volume(solid.name(), solid, plmatter);
931 #ifdef EDM_ML_DEBUG
932  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " Box made of " << plmatter.name()
933  << " of dimensions " << dx2 << ", " << wid << ", " << dz;
934 #endif
935 
936  x += 0.5 * detTsc[id] + dx2;
937  detector.placeVolume(glog, 1, dd4hep::Position(x, y, 0));
938 #ifdef EDM_ML_DEBUG
939  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << glog.name() << " Number 1 positioned in " << detector.name()
940  << " at (" << x << "," << y << ",0) with no rotation";
941 #endif
942  }
943 
944  dd4hep::Rotation3D getRotation(std::string& rotation, std::string& rotns, cms::DDNamespace& ns) {
945  std::string rot = (strchr(rotation.c_str(), NAMESPACE_SEP) == nullptr) ? (rotns + ":" + rotation) : rotation;
946 #ifdef EDM_ML_DEBUG
947  edm::LogVerbatim("HCalGeom") << "getRotation: " << rotation << ":" << rot << ":" << ns.rotation(rot);
948 #endif
949  return ns.rotation(rot);
950  }
951 };
952 
953 static long algorithm(dd4hep::Detector& /* description */,
954  cms::DDParsingContext& ctxt,
955  xml_h e,
956  dd4hep::SensitiveDetector& /* sens */) {
957  HcalBarrelAlgo hcalbarrelalgo(ctxt, e);
958 #ifdef EDM_ML_DEBUG
959  edm::LogVerbatim("HCalGeom") << "<<== End of DDHCalBarrelAlgo construction";
960 #endif
961  return cms::s_executed;
962 }
963 
964 // first argument is the type from the xml file
965 DECLARE_DDCMS_DETELEMENT(DDCMS_hcal_DDHCalBarrelAlgo, algorithm)
std::vector< double > rmax
dd4hep::Volume constructMidLayer(dd4hep::Volume laylog, const std::string &nm, double rin, double alpha, cms::DDNamespace &ns)
type
Definition: HCALResponse.h:21
std::string rotHalf
dd4hep::Volume volume(const std::string &name, bool exc=true) const
Definition: DDNamespace.cc:184
std::vector< double > sideAbsW
dd4hep::Rotation3D getRotation(std::string &rotation, std::string &rotns, cms::DDNamespace &ns)
constexpr int nLayers
Definition: Common.h:13
std::vector< int > detPosY
void constructInsideDetectors(dd4hep::Volume &detector, const std::string &name, int id, double dx, double dy, double dz, int type, cms::DDNamespace &ns)
std::vector< double > detWidth1
std::string detRot
std::string detMatPl
std::string rotns
std::vector< double > detdP2
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
T value(const std::string &name) const
std::string detMat
std::string genMaterial
std::string middleMat
HcalBarrelAlgo(cms::DDParsingContext &ctxt, xml_h &e)
std::vector< double > absorbD
std::vector< std::string > sideAbsMat
std::string_view name() const
Definition: DDNamespace.h:68
std::vector< double > detT11
void constructInsideLayers(dd4hep::Volume &laylog, const std::string &nm, int id, int nAbs, double rin, double d1, double alpha1, double d2, double alpha2, double t1, double t2, cms::DDNamespace &ns)
std::vector< double > layerT1
std::vector< std::string > absorbMat
std::vector< std::string > midMat
std::vector< double > detT12
static constexpr long s_executed
std::vector< std::string > midName
std::vector< double > layerAlpha
std::vector< std::string > sideAbsName
std::vector< double > sideD
std::string detMatSc
std::vector< double > absorbT
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
dd4hep::Material material(const std::string &name) const
Definition: DDNamespace.cc:121
std::vector< double > detWidth2
std::vector< double > zoff
std::string prepend(const std::string &) const
Definition: DDNamespace.cc:66
std::vector< int > detType
dd4hep::Volume constructSideLayer(dd4hep::Volume &laylog, const std::string &nm, int nAbs, double rin, double alpha, cms::DDNamespace &ns)
std::vector< double > detT22
std::string idNameSpace
std::string idName
dd4hep::Volume Volume
ii
Definition: cuy.py:590
std::vector< double > theta
std::vector< double > detT21
std::vector< int > layerAbsorb
std::vector< double > layerD1
std::vector< std::string > absorbName
static long algorithm(dd4hep::Detector &, cms::DDParsingContext &ctxt, xml_h e, dd4hep::SensitiveDetector &)
std::vector< double > layerT2
std::vector< double > sideT
const dd4hep::Rotation3D & rotation(const std::string &name) const
Definition: DDNamespace.cc:130
std::vector< double > detdP1
std::vector< std::string > layerMat
std::vector< double > layerGap
std::vector< double > midT
std::vector< double > layerWidth
alpha
zGenParticlesMatch = cms.InputTag(""),
std::vector< double > midW
#define DECLARE_DDCMS_DETELEMENT(name, func)
Definition: DDPlugins.h:30
std::vector< std::string > layerLabel
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
std::vector< double > detTsc
std::string parentName() const
Access value of rParent child node.
std::vector< double > layerD2
std::vector< std::string > sideMat
std::vector< double > ttheta
#define NAMESPACE_SEP
Definition: DDNamespace.h:79
std::vector< int > layerId