CMS 3D CMS Logo

DDHGCalHEAlgo.cc
Go to the documentation of this file.
1 // File: DDHGCalHEAlgo.cc
3 // Description: Geometry factory class for HGCal (Mix)
5 
14 #include "CLHEP/Units/GlobalPhysicalConstants.h"
15 #include "CLHEP/Units/GlobalSystemOfUnits.h"
16 
17 //#define EDM_ML_DEBUG
18 
20 #ifdef EDM_ML_DEBUG
21  edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: Creating an instance";
22 #endif
23 }
24 
26 
28  const DDVectorArguments & vArgs,
29  const DDMapArguments & ,
30  const DDStringArguments & sArgs,
31  const DDStringVectorArguments &vsArgs) {
32 
33  wafers_ = vsArgs["WaferNames"];
34 #ifdef EDM_ML_DEBUG
35  edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << wafers_.size()
36  << " wafers";
37  for (unsigned int i=0; i<wafers_.size(); ++i)
38  edm::LogVerbatim("HGCalGeom") << "Wafer[" << i << "] " << wafers_[i];
39 #endif
40  materials_ = vsArgs["MaterialNames"];
41  names_ = vsArgs["VolumeNames"];
42  thick_ = vArgs["Thickness"];
43  for (unsigned int i=0; i<materials_.size(); ++i) {
44  copyNumber_.emplace_back(1);
45  }
46 #ifdef EDM_ML_DEBUG
47  edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << materials_.size()
48  << " types of volumes";
49  for (unsigned int i=0; i<names_.size(); ++i)
50  edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << names_[i]
51  << " of thickness " << thick_[i]
52  << " filled with " << materials_[i]
53  << " first copy number " << copyNumber_[i];
54 #endif
55  layers_ = dbl_to_int(vArgs["Layers"]);
56  layerThick_ = vArgs["LayerThick"];
57  rMixLayer_ = vArgs["LayerRmix"];
58 #ifdef EDM_ML_DEBUG
59  edm::LogVerbatim("HGCalGeom") << "There are " << layers_.size() << " blocks";
60  for (unsigned int i=0; i<layers_.size(); ++i)
61  edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] of thickness "
62  << layerThick_[i] << " Rmid " <<rMixLayer_[i]
63  << " with " << layers_[i] << " layers";
64 #endif
65  layerType_ = dbl_to_int(vArgs["LayerType"]);
66  layerSense_ = dbl_to_int(vArgs["LayerSense"]);
67  firstLayer_ = (int)(nArgs["FirstLayer"]);
68  if (firstLayer_ > 0) {
69  for (unsigned int i=0; i<layerType_.size(); ++i) {
70  if (layerSense_[i] != 0) {
71  int ii = layerType_[i];
72  copyNumber_[ii] = firstLayer_;
73 #ifdef EDM_ML_DEBUG
74  edm::LogVerbatim("HGCalGeom") << "First copy number for layer type "
75  << i << ":" << ii << " with "
76  << materials_[ii] << " changed to "
77  << copyNumber_[ii];
78 #endif
79  break;
80  }
81  }
82  }
83 #ifdef EDM_ML_DEBUG
84  edm::LogVerbatim("HGCalGeom") << "There are " << layerType_.size()
85  << " layers" ;
86  for (unsigned int i=0; i<layerType_.size(); ++i)
87  edm::LogVerbatim("HGCalGeom") << "Layer [" << i << "] with material type "
88  << layerType_[i] << " sensitive class "
89  << layerSense_[i];
90 #endif
91  materialsTop_ = vsArgs["TopMaterialNames"];
92  namesTop_ = vsArgs["TopVolumeNames"];
93  layerThickTop_= vArgs["TopLayerThickness"];
94  layerTypeTop_ = dbl_to_int(vArgs["TopLayerType"]);
95  for (unsigned int i=0; i<materialsTop_.size(); ++i) {
96  copyNumberTop_.emplace_back(1);
97  }
98 #ifdef EDM_ML_DEBUG
99  edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << materialsTop_.size()
100  << " types of volumes in the top part";
101  for (unsigned int i=0; i<materialsTop_.size(); ++i)
102  edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << namesTop_[i]
103  << " of thickness " << layerThickTop_[i]
104  << " filled with " << materialsTop_[i]
105  << " first copy number " <<copyNumberTop_[i];
106  edm::LogVerbatim("HGCalGeom") << "There are " << layerTypeTop_.size()
107  << " layers in the top part" ;
108  for (unsigned int i=0; i<layerTypeTop_.size(); ++i)
109  edm::LogVerbatim("HGCalGeom") << "Layer [" << i << "] with material type "
110  << layerTypeTop_[i];
111 #endif
112  materialsBot_ = vsArgs["BottomMaterialNames"];
113  namesBot_ = vsArgs["BottomVolumeNames"];
114  layerTypeBot_ = dbl_to_int(vArgs["BottomLayerType"]);
115  layerSenseBot_= dbl_to_int(vArgs["BottomLayerSense"]);
116  layerThickBot_= vArgs["BottomLayerThickness"];
117  for (unsigned int i=0; i<materialsBot_.size(); ++i) {
118  copyNumberBot_.emplace_back(1);
119  }
120 #ifdef EDM_ML_DEBUG
121  edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << materialsBot_.size()
122  << " types of volumes in the bottom part";
123  for (unsigned int i=0; i<materialsBot_.size(); ++i)
124  edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << namesBot_[i]
125  << " of thickness " << layerThickBot_[i]
126  << " filled with " << materialsBot_[i]
127  << " first copy number " <<copyNumberBot_[i];
128  edm::LogVerbatim("HGCalGeom") << "There are " << layerTypeBot_.size()
129  << " layers in the top part" ;
130  for (unsigned int i=0; i<layerTypeBot_.size(); ++i)
131  edm::LogVerbatim("HGCalGeom") << "Layer [" << i << "] with material type "
132  << layerTypeBot_[i] << " sensitive class "
133  << layerSenseBot_[i];
134 #endif
135  zMinBlock_ = nArgs["zMinBlock"];
136  rad100to200_ = vArgs["rad100to200"];
137  rad200to300_ = vArgs["rad200to300"];
138  zMinRadPar_ = nArgs["zMinForRadPar"];
139  choiceType_ = (int)(nArgs["choiceType"]);
140  nCutRadPar_ = (int)(nArgs["nCornerCut"]);
141  fracAreaMin_ = nArgs["fracAreaMin"];
142  waferSize_ = nArgs["waferSize"];
143  waferSepar_ = nArgs["SensorSeparation"];
144  sectors_ = (int)(nArgs["Sectors"]);
145 #ifdef EDM_ML_DEBUG
146  edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: zStart " << zMinBlock_
147  << " radius for wafer type separation uses "
148  << rad100to200_.size() << " parameters; zmin "
149  << zMinRadPar_ << " cutoff " << choiceType_
150  << ":" << nCutRadPar_ << ":" << fracAreaMin_
151  << " wafer width " << waferSize_
152  << " separations " << waferSepar_
153  << " sectors " << sectors_;
154  for (unsigned int k=0; k<rad100to200_.size(); ++k)
155  edm::LogVerbatim("HGCalGeom") << "[" << k << "] 100-200 " <<rad100to200_[k]
156  << " 200-300 " << rad200to300_[k];
157 #endif
158  slopeB_ = vArgs["SlopeBottom"];
159  zFrontB_ = vArgs["ZFrontBottom"];
160  rMinFront_ = vArgs["RMinFront"];
161  slopeT_ = vArgs["SlopeTop"];
162  zFrontT_ = vArgs["ZFrontTop"];
163  rMaxFront_ = vArgs["RMaxFront"];
164 #ifdef EDM_ML_DEBUG
165  for (unsigned int i=0; i<slopeB_.size(); ++i)
166  edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] Zmin " << zFrontB_[i]
167  << " Rmin " << rMinFront_[i] << " Slope "
168  << slopeB_[i];
169  for (unsigned int i=0; i<slopeT_.size(); ++i)
170  edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] Zmin " << zFrontT_[i]
171  << " Rmax " << rMaxFront_[i] << " Slope "
172  << slopeT_[i];
173 #endif
175 #ifdef EDM_ML_DEBUG
176  edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: NameSpace " << nameSpace_;
177 #endif
178 
179  waferType_ = std::make_unique<HGCalWaferType>(rad100to200_, rad200to300_,
183 }
184 
186 // DDHGCalHEAlgo methods...
188 
190 
191 #ifdef EDM_ML_DEBUG
192  edm::LogVerbatim("HGCalGeom") << "==>> Constructing DDHGCalHEAlgo...";
193  copies_.clear();
194 #endif
195  constructLayers (parent(), cpv);
196 #ifdef EDM_ML_DEBUG
197  edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << copies_.size()
198  << " different wafer copy numbers";
199  int k(0);
200  for (std::unordered_set<int>::const_iterator itr=copies_.begin();
201  itr != copies_.end(); ++itr,++k) {
202  edm::LogVerbatim("HGCalGeom") << "Copy [" << k << "] : " << (*itr);
203  }
204  copies_.clear();
205  edm::LogVerbatim("HGCalGeom") << "<<== End of DDHGCalHEAlgo construction...";
206 #endif
207 }
208 
210  DDCompactView& cpv) {
211 
212 #ifdef EDM_ML_DEBUG
213  edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: \t\tInside Layers";
214 #endif
215  double zi(zMinBlock_);
216  int laymin(0);
217  const double tol(0.01);
218  for (unsigned int i=0; i<layers_.size(); i++) {
219  double zo = zi + layerThick_[i];
221  int laymax = laymin+layers_[i];
222  double zz = zi;
223  double thickTot(0);
224  std::vector<double> pgonZ(2), pgonRin(2), pgonRout(2);
225  for (int ly=laymin; ly<laymax; ++ly) {
226  int ii = layerType_[ly];
227  int copy = copyNumber_[ii];
228  double hthick = 0.5*thick_[ii];
230  zz += hthick;
231  thickTot += thick_[ii];
232 
233  std::string name = names_[ii]+std::to_string(copy);
234 #ifdef EDM_ML_DEBUG
235  edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: Layer " << ly << ":"
236  << ii << " Front " << zi << ", " << routF
237  << " Back " << zo << ", " << rinB
238  << " superlayer thickness "
239  << layerThick_[i];
240 #endif
241  DDName matName(DDSplit(materials_[ii]).first,
242  DDSplit(materials_[ii]).second);
243  DDMaterial matter(matName);
244  DDLogicalPart glog;
245  if (layerSense_[ly] == 0) {
246  double alpha = CLHEP::pi/sectors_;
247  double rmax = routF*cos(alpha) - tol;
248  pgonZ[0] =-hthick; pgonZ[1] = hthick;
249  pgonRin[0] = rinB; pgonRin[1] = rinB;
250  pgonRout[0] = rmax; pgonRout[1] = rmax;
252  sectors_,-alpha,CLHEP::twopi,
253  pgonZ, pgonRin, pgonRout);
254  glog = DDLogicalPart(solid.ddname(), matter, solid);
255 #ifdef EDM_ML_DEBUG
256  edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << solid.name()
257  << " polyhedra of " << sectors_
258  << " sectors covering "
259  << -alpha/CLHEP::deg << ":"
260  << (-alpha+CLHEP::twopi)/CLHEP::deg
261  << " with " << pgonZ.size()<<" sections";
262  for (unsigned int k=0; k<pgonZ.size(); ++k)
263  edm::LogVerbatim("HGCalGeom") << "[" << k << "] z " << pgonZ[k]
264  << " R " << pgonRin[k] << ":"
265  << pgonRout[k];
266 #endif
267  } else {
269  hthick, rinB, routF, 0.0,
270  CLHEP::twopi);
271  glog = DDLogicalPart(solid.ddname(), matter, solid);
272 #ifdef EDM_ML_DEBUG
273  edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << solid.name()
274  << " Tubs made of " << matName
275  << " of dimensions " << rinB
276  << ", " << routF << ", " << hthick
277  << ", 0.0, " << CLHEP::twopi/CLHEP::deg;
278  edm::LogVerbatim("HGCalGeom") << "Position in: " << glog.name()
279  << " number " << copy;
280 #endif
281  positionMix(glog, name, copy, thick_[ii], matter, rinB, rMixLayer_[i],
282  routF, zz, cpv);
283  }
284  DDTranslation r1(0,0,zz);
285  DDRotation rot;
286  cpv.position(glog, module, copy, r1, rot);
287  ++copyNumber_[ii];
288 #ifdef EDM_ML_DEBUG
289  edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << glog.name()
290  << " number " << copy
291  << " positioned in " << module.name()
292  << " at " << r1 << " with " << rot;
293 #endif
294  zz += hthick;
295  } // End of loop over layers in a block
296  zi = zo;
297  laymin = laymax;
298  if (std::abs(thickTot-layerThick_[i]) < 0.00001) {
299  } else if (thickTot > layerThick_[i]) {
300  edm::LogError("HGCalGeom") << "Thickness of the partition "
301  << layerThick_[i] << " is smaller than "
302  << thickTot << ": thickness of all its "
303  << "components **** ERROR ****";
304  } else if (thickTot < layerThick_[i]) {
305  edm::LogWarning("HGCalGeom") << "Thickness of the partition "
306  << layerThick_[i] << " does not match with "
307  << thickTot << " of the components";
308  }
309  } // End of loop over blocks
310 }
311 
313  const std::string& nameM, int copyM,
314  double thick, const DDMaterial& matter,
315  double rin, double rmid, double rout,
316  double zz, DDCompactView& cpv) {
317 
318  DDLogicalPart glog1;
319  DDTranslation tran;
320  DDRotation rot;
321  for (unsigned int ly=0; ly<layerTypeTop_.size(); ++ly) {
322  int ii = layerTypeTop_[ly];
323  copyNumberTop_[ii] = copyM;
324  }
325  for (unsigned int ly=0; ly<layerTypeBot_.size(); ++ly) {
326  int ii = layerTypeBot_[ly];
327  copyNumberBot_[ii] = copyM;
328  }
329  double hthick = 0.5*thick;
330  // Make the top part first
331  std::string name = nameM+"Top";
333  hthick, rmid, rout, 0.0,
334  CLHEP::twopi);
335  glog1 = DDLogicalPart(solid.ddname(), matter, solid);
336 #ifdef EDM_ML_DEBUG
337  edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << solid.name()
338  << " Tubs made of " << matter.name()
339  << " of dimensions " << rmid << ", " << rout
340  << ", " << hthick << ", 0.0, "
341  << CLHEP::twopi/CLHEP::deg;
342 #endif
343  cpv.position(glog1, glog, 1, tran, rot);
344 #ifdef EDM_ML_DEBUG
345  edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << glog1.name()
346  << " number 1 positioned in " << glog.name()
347  << " at " << tran << " with " << rot;
348 #endif
349  double thickTot(0), zpos(-hthick);
350  for (unsigned int ly=0; ly<layerTypeTop_.size(); ++ly) {
351  int ii = layerTypeTop_[ly];
352  int copy = copyNumberTop_[ii];
353  double hthickl = 0.5*layerThickTop_[ii];
354  thickTot += layerThickTop_[ii];
355  name = namesTop_[ii]+std::to_string(copy);
356 #ifdef EDM_ML_DEBUG
357  edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: Layer " << ly << ":" << ii
358  << " R " << rmid << ":" << rout << " Thick "
359  << layerThickTop_[ii];
360 #endif
361  DDName matName(DDSplit(materialsTop_[ii]).first,
363  DDMaterial matter1(matName);
364  solid = DDSolidFactory::tubs(DDName(name,nameSpace_), hthickl, rmid, rout,
365  0.0, CLHEP::twopi);
366  DDLogicalPart glog2 = DDLogicalPart(solid.ddname(), matter1, solid);
367 #ifdef EDM_ML_DEBUG
368  double eta1 = -log(tan(0.5*atan(rmid/zz)));
369  double eta2 = -log(tan(0.5*atan(rout/zz)));
370  edm::LogVerbatim("HGCalGeom") << name << " z|rin|rout " << zz << ":"
371  << rmid << ":" << rout << " eta " << eta1
372  << ":" << eta2;
373  edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << solid.name()
374  << " Tubs made of " << matName
375  << " of dimensions " << rmid << ", " << rout
376  << ", " << hthickl <<", 0.0, "
377  << CLHEP::twopi/CLHEP::deg;
378 #endif
379  zpos += hthickl;
380  DDTranslation r1(0,0,zpos);
381  cpv.position(glog2, glog1, copy, r1, rot);
382 #ifdef EDM_ML_DEBUG
383  edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: Position " << glog2.name()
384  << " number " << copy << " in "
385  << glog1.name() << " at " << r1
386  << " with " << rot;
387 #endif
388  ++copyNumberTop_[ii];
389  zpos += hthickl;
390  }
391  if (std::abs(thickTot-thick) < 0.00001) {
392  } else if (thickTot > thick) {
393  edm::LogError("HGCalGeom") << "Thickness of the partition " << thick
394  << " is smaller than " << thickTot
395  << ": thickness of all its components in "
396  << "the top part **** ERROR ****";
397  } else if (thickTot < thick) {
398  edm::LogWarning("HGCalGeom") << "Thickness of the partition " << thick
399  << " does not match with " << thickTot
400  << " of the components in top part";
401  }
402 
403  // Make the bottom part next
404  name = nameM+"Bottom";
405  solid = DDSolidFactory::tubs(DDName(name, nameSpace_),
406  hthick, rin, rmid, 0.0, CLHEP::twopi);
407  glog1 = DDLogicalPart(solid.ddname(), matter, solid);
408 #ifdef EDM_ML_DEBUG
409  edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << solid.name()
410  << " Tubs made of " << matter.name()
411  << " of dimensions " << rin << ", " << rmid
412  << ", " << hthick << ", 0.0, "
413  << CLHEP::twopi/CLHEP::deg;
414 #endif
415  cpv.position(glog1, glog, 1, tran, rot);
416 #ifdef EDM_ML_DEBUG
417  edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << glog1.name()
418  << " number 1 positioned in " << glog.name()
419  << " at " << tran << " with " << rot;
420 #endif
421  thickTot = 0;
422  zpos =-hthick;
423  for (unsigned int ly=0; ly<layerTypeBot_.size(); ++ly) {
424  int ii = layerTypeBot_[ly];
425  int copy = copyNumberBot_[ii];
426  double hthickl = 0.5*layerThickBot_[ii];
427  thickTot += layerThickBot_[ii];
428  name = namesBot_[ii]+std::to_string(copy);
429 #ifdef EDM_ML_DEBUG
430  edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: Layer " << ly << ":" << ii
431  << " R " << rin << ":" << rmid << " Thick "
432  << layerThickBot_[ii];
433 #endif
434  DDName matName(DDSplit(materialsBot_[ii]).first,
436  DDMaterial matter1(matName);
437  solid = DDSolidFactory::tubs(DDName(name,nameSpace_), hthickl, rin, rmid,
438  0.0, CLHEP::twopi);
439  DDLogicalPart glog2 = DDLogicalPart(solid.ddname(), matter1, solid);
440 #ifdef EDM_ML_DEBUG
441  double eta1 = -log(tan(0.5*atan(rin/zz)));
442  double eta2 = -log(tan(0.5*atan(rmid/zz)));
443  edm::LogVerbatim("HGCalGeom") << name << " z|rin|rout " << zz << ":"
444  << rin << ":" << rmid << " eta " << eta1
445  << ":" << eta2;
446  edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << solid.name()
447  << " Tubs made of " << matName
448  << " of dimensions " << rin << ", " << rmid
449  << ", " << hthickl <<", 0.0, "
450  << CLHEP::twopi/CLHEP::deg;
451 #endif
452  zpos += hthickl;
453  DDTranslation r1(0,0,zpos);
454  cpv.position(glog2, glog1, copy, r1, rot);
455 #ifdef EDM_ML_DEBUG
456  edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: Position " << glog2.name()
457  << " number " << copy << " in "
458  << glog1.name() << " at " << r1
459  << " with " << rot;
460 #endif
461  if (layerSenseBot_[ly] != 0)
462  positionSensitive(glog2,rin,rmid,zz+zpos,layerSenseBot_[ly],cpv);
463  zpos += hthickl;
464  ++copyNumberBot_[ii];
465  }
466  if (std::abs(thickTot-thick) < 0.00001) {
467  } else if (thickTot > thick) {
468  edm::LogError("HGCalGeom") << "Thickness of the partition " << thick
469  << " is smaller than " << thickTot
470  << ": thickness of all its components in "
471  << "the top part **** ERROR ****";
472  } else if (thickTot < thick) {
473  edm::LogWarning("HGCalGeom") << "Thickness of the partition " << thick
474  << " does not match with " << thickTot
475  << " of the components in top part";
476  }
477 }
478 
479 void DDHGCalHEAlgo::positionSensitive(const DDLogicalPart& glog, double rin,
480  double rout, double zpos, int layertype,
481  DDCompactView& cpv) {
482  static const double sqrt3 = std::sqrt(3.0);
483  double r = 0.5*(waferSize_ + waferSepar_);
484  double R = 2.0*r/sqrt3;
485  double dy = 0.75*R;
486  int N = (int)(0.5*rout/r) + 2;
487 #ifdef EDM_ML_DEBUG
488  int ium(0), ivm(0), iumAll(0), ivmAll(0), kount(0), ntot(0), nin(0);
489  std::vector<int> ntype(6,0);
490  edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << glog.ddname()
491  << " rout " << rout << " N " << N
492  << " for maximum u, v";
493 #endif
494  for (int u = -N; u <= N; ++u) {
495  int iu = std::abs(u);
496  for (int v = -N; v <= N; ++v) {
497  int iv = std::abs(v);
498  int nr = 2*v;
499  int nc =-2*u+v;
500  double xpos = nc*r;
501  double ypos = nr*dy;
502  std::pair<int,int> corner =
503  HGCalGeomTools::waferCorner(xpos, ypos, r, R, rin, rout, false);
504 #ifdef EDM_ML_DEBUG
505  ++ntot;
506 #endif
507  if (corner.first > 0) {
508  int type = waferType_->getType(xpos,ypos,zpos);
509  int copy = type*1000000 + iv*100 + iu;
510  if (u < 0) copy += 10000;
511  if (v < 0) copy += 100000;
512 #ifdef EDM_ML_DEBUG
513  if (iu > ium) ium = iu;
514  if (iv > ivm) ivm = iv;
515  kount++;
516  if (copies_.count(copy) == 0) copies_.insert(copy);
517 #endif
518  if (corner.first == (int)(HGCalParameters::k_CornerSize)) {
519 #ifdef EDM_ML_DEBUG
520  if (iu > iumAll) iumAll = iu;
521  if (iv > ivmAll) ivmAll = iv;
522  ++nin;
523 #endif
524  DDTranslation tran(xpos, ypos, 0.0);
526  if (layertype > 1) type += 3;
528  DDSplit(wafers_[type]).second);
529  cpv.position(name, glog.ddname(), copy, tran, rotation);
530 #ifdef EDM_ML_DEBUG
531  ++ntype[type];
532  edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << name
533  << " number " << copy
534  << " positioned in " << glog.ddname()
535  << " at " << tran
536  << " with " << rotation;
537 #endif
538  }
539  }
540  }
541  }
542 #ifdef EDM_ML_DEBUG
543  edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: Maximum # of u " << ium
544  << ":" << iumAll << " # of v " << ivm << ":"
545  << ivmAll << " and " << nin << ":" << kount
546  << ":" << ntot << " wafers (" << ntype[0]
547  << ":" << ntype[1] << ":" << ntype[2] << ":"
548  << ntype[3] << ":" << ntype[4] << ":"
549  << ntype[5] << ") for " << glog.ddname()
550  << " R " << rin << ":" << rout;
551 #endif
552 }
std::vector< double > rMixLayer_
Definition: DDHGCalHEAlgo.h:52
type
Definition: HCALResponse.h:21
std::vector< int > layerTypeTop_
Definition: DDHGCalHEAlgo.h:59
float alpha
Definition: AMPTWrapper.h:95
std::vector< double > layerThickBot_
Definition: DDHGCalHEAlgo.h:63
const N & name() const
Definition: DDBase.h:74
void positionMix(const DDLogicalPart &glog, const std::string &name, int copy, double thick, const DDMaterial &matter, double rin, double rmid, double routF, double zz, DDCompactView &cpv)
double zMinBlock_
Definition: DDHGCalHEAlgo.h:68
def copy(args, dbName)
std::vector< double > slopeB_
Definition: DDHGCalHEAlgo.h:78
std::vector< std::string > materials_
Definition: DDHGCalHEAlgo.h:46
static double radius(double z, std::vector< double > const &zFront, std::vector< double > const &rFront, std::vector< double > const &slope)
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:43
std::string nameSpace_
Definition: DDHGCalHEAlgo.h:84
std::vector< double > zFrontB_
Definition: DDHGCalHEAlgo.h:79
void execute(DDCompactView &cpv) override
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
static std::string & ns()
std::vector< double > thick_
Definition: DDHGCalHEAlgo.h:48
std::vector< std::string > namesTop_
Definition: DDHGCalHEAlgo.h:57
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
double zMinRadPar_
Definition: DDHGCalHEAlgo.h:71
~DDHGCalHEAlgo() override
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
int nin
const Double_t pi
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
static std::pair< int32_t, int32_t > waferCorner(double xpos, double ypos, double r, double R, double rMin, double rMax, bool oldBug=false)
std::unique_ptr< HGCalWaferType > waferType_
Definition: DDHGCalHEAlgo.h:43
std::vector< int > layerSense_
Definition: DDHGCalHEAlgo.h:54
std::vector< int > copyNumberBot_
Definition: DDHGCalHEAlgo.h:65
T sqrt(T t)
Definition: SSEVec.h:18
std::vector< std::string > materialsBot_
Definition: DDHGCalHEAlgo.h:61
std::vector< double > slopeT_
Definition: DDHGCalHEAlgo.h:81
void constructLayers(const DDLogicalPart &, DDCompactView &cpv)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
Definition: DDSolid.cc:865
std::vector< int > layers_
Definition: DDHGCalHEAlgo.h:50
std::vector< double > rMinFront_
Definition: DDHGCalHEAlgo.h:80
std::vector< double > rad100to200_
Definition: DDHGCalHEAlgo.h:69
ii
Definition: cuy.py:590
int k[5][pyjets_maxn]
static uint32_t k_CornerSize
std::vector< double > zFrontT_
Definition: DDHGCalHEAlgo.h:82
#define N
Definition: blowfish.cc:9
std::vector< double > layerThickTop_
Definition: DDHGCalHEAlgo.h:58
std::unordered_set< int > copies_
Definition: DDHGCalHEAlgo.h:85
std::vector< int > copyNumber_
Definition: DDHGCalHEAlgo.h:49
double waferSepar_
Definition: DDHGCalHEAlgo.h:76
std::vector< int > layerType_
Definition: DDHGCalHEAlgo.h:53
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
std::vector< std::string > materialsTop_
Definition: DDHGCalHEAlgo.h:56
std::vector< int > copyNumberTop_
Definition: DDHGCalHEAlgo.h:60
void positionSensitive(const DDLogicalPart &glog, double rin, double rout, double zpos, int layertype, DDCompactView &cpv)
std::vector< int > layerSenseBot_
Definition: DDHGCalHEAlgo.h:66
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
std::vector< std::string > wafers_
Definition: DDHGCalHEAlgo.h:45
Definition: vlib.h:208
double fracAreaMin_
Definition: DDHGCalHEAlgo.h:74
std::vector< std::string > namesBot_
Definition: DDHGCalHEAlgo.h:62
std::vector< double > layerThick_
Definition: DDHGCalHEAlgo.h:51
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
std::vector< std::string > names_
Definition: DDHGCalHEAlgo.h:47
std::vector< int > layerTypeBot_
Definition: DDHGCalHEAlgo.h:64
std::vector< double > rMaxFront_
Definition: DDHGCalHEAlgo.h:83
double waferSize_
Definition: DDHGCalHEAlgo.h:75
std::vector< double > rad200to300_
Definition: DDHGCalHEAlgo.h:70
const N & ddname() const
Definition: DDBase.h:76