CMS 3D CMS Logo

DDHGCalSiliconRotatedModule.cc
Go to the documentation of this file.
1 // File: DDHGCalSiliconRotatedModule.cc
3 // Description: Geometry factory class for HGCal (EE and HESil) using
4 // information from the file for dd4hep
6 #include <cmath>
7 #include <memory>
8 #include <sstream>
9 #include <string>
10 #include <unordered_set>
11 #include <vector>
12 
21 #include "DD4hep/DetFactoryHelper.h"
26 
27 //#define EDM_ML_DEBUG
28 using namespace angle_units::operators;
29 
32  throw cms::Exception("HGCalGeom") << "Wrong initialization to HGCalSiliconRotatedModule";
33  }
35  cms::DDNamespace ns(ctxt, e, true);
37 
38 #ifdef EDM_ML_DEBUG
39  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: Creating an instance";
40 #endif
41  static constexpr double tol1 = 0.01 * dd4hep::mm;
42  static constexpr double tol2 = 0.00001 * dd4hep::mm;
43 
44  dd4hep::Volume mother = ns.volume(args.parentName());
45  waferTypes_ = args.value<int>("WaferTypes");
46  facingTypes_ = args.value<int>("FacingTypes");
47  orientationTypes_ = args.value<int>("OrientationTypes");
48  placeOffset_ = args.value<int>("PlaceOffset");
49 #ifdef EDM_ML_DEBUG
50  edm::LogVerbatim("HGCalGeom") << "Number of types of wafers: " << waferTypes_ << " facings: " << facingTypes_
51  << " Orientations: " << orientationTypes_ << " PlaceOffset: " << placeOffset_;
52 #endif
53  firstLayer_ = args.value<int>("FirstLayer");
54  absorbMode_ = args.value<int>("AbsorberMode");
55  sensitiveMode_ = args.value<int>("SensitiveMode");
56 #ifdef EDM_ML_DEBUG
57  edm::LogVerbatim("HGCalGeom") << "First Layer " << firstLayer_ << " and "
58  << "Absober:Sensitive mode " << absorbMode_ << ":" << sensitiveMode_;
59 #endif
60  zMinBlock_ = args.value<double>("zMinBlock");
61  waferSize_ = args.value<double>("waferSize");
62  waferSepar_ = args.value<double>("SensorSeparation");
63  sectors_ = args.value<int>("Sectors");
64  cassettes_ = args.value<int>("Cassettes");
65  alpha_ = (1._pi) / sectors_;
66  cosAlpha_ = cos(alpha_);
67  rotstr_ = args.value<std::string>("LayerRotation");
68 #ifdef EDM_ML_DEBUG
69  edm::LogVerbatim("HGCalGeom") << "zStart " << cms::convert2mm(zMinBlock_) << " wafer width "
70  << cms::convert2mm(waferSize_) << " separations " << cms::convert2mm(waferSepar_)
71  << " sectors " << sectors_ << ":" << convertRadToDeg(alpha_) << ":" << cosAlpha_
72  << " rotation matrix " << rotstr_ << cassettes_ << " cassettes";
73 #endif
74  waferFull_ = args.value<std::vector<std::string>>("WaferNamesFull");
75  waferPart_ = args.value<std::vector<std::string>>("WaferNamesPartial");
76 #ifdef EDM_ML_DEBUG
77  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << waferFull_.size() << " full and "
78  << waferPart_.size() << " partial modules\nDDHGCalSiliconRotatedModule:Full Modules:";
79  unsigned int i1max = static_cast<unsigned int>(waferFull_.size());
80  for (unsigned int i1 = 0; i1 < i1max; i1 += 2) {
81  std::ostringstream st1;
82  unsigned int i2 = std::min((i1 + 2), i1max);
83  for (unsigned int i = i1; i < i2; ++i)
84  st1 << " [" << i << "] " << waferFull_[i];
85  edm::LogVerbatim("HGCalGeom") << st1.str();
86  }
87  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: Partial Modules:";
88  i1max = static_cast<unsigned int>(waferPart_.size());
89  for (unsigned int i1 = 0; i1 < i1max; i1 += 2) {
90  std::ostringstream st1;
91  unsigned int i2 = std::min((i1 + 2), i1max);
92  for (unsigned int i = i1; i < i2; ++i)
93  st1 << " [" << i << "] " << waferPart_[i];
94  edm::LogVerbatim("HGCalGeom") << st1.str();
95  }
96 #endif
97  materials_ = args.value<std::vector<std::string>>("MaterialNames");
98  names_ = args.value<std::vector<std::string>>("VolumeNames");
99  thick_ = args.value<std::vector<double>>("Thickness");
100  copyNumber_.resize(materials_.size(), 1);
101 #ifdef EDM_ML_DEBUG
102  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << materials_.size() << " types of volumes";
103  for (unsigned int i = 0; i < names_.size(); ++i)
104  edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << names_[i] << " of thickness "
105  << cms::convert2mm(thick_[i]) << " filled with " << materials_[i]
106  << " first copy number " << copyNumber_[i];
107 #endif
108  layers_ = args.value<std::vector<int>>("Layers");
109  layerThick_ = args.value<std::vector<double>>("LayerThick");
110 #ifdef EDM_ML_DEBUG
111  edm::LogVerbatim("HGCalGeom") << "There are " << layers_.size() << " blocks";
112  for (unsigned int i = 0; i < layers_.size(); ++i)
113  edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] of thickness " << cms::convert2mm(layerThick_[i])
114  << " with " << layers_[i] << " layers";
115 #endif
116  layerType_ = args.value<std::vector<int>>("LayerType");
117  layerSense_ = args.value<std::vector<int>>("LayerSense");
118  layerTypes_ = args.value<std::vector<int>>("LayerTypes");
119 #ifdef EDM_ML_DEBUG
120  for (unsigned int i = 0; i < layerTypes_.size(); ++i)
121  edm::LogVerbatim("HGCalGeom") << "LayerTypes [" << i << "] " << layerTypes_[i];
122 #endif
123  if (firstLayer_ > 0) {
124  for (unsigned int i = 0; i < layerType_.size(); ++i) {
125  if (layerSense_[i] > 0) {
126  int ii = layerType_[i];
127  copyNumber_[ii] = (layerSense_[i] == 1) ? firstLayer_ : (firstLayer_ + 1);
128 #ifdef EDM_ML_DEBUG
129  edm::LogVerbatim("HGCalGeom") << "First copy number for layer type " << i << ":" << ii << " with "
130  << materials_[ii] << " changed to " << copyNumber_[ii];
131 #endif
132  }
133  }
134  } else {
135  firstLayer_ = 1;
136  }
137 #ifdef EDM_ML_DEBUG
138  edm::LogVerbatim("HGCalGeom") << "There are " << layerType_.size() << " layers";
139  for (unsigned int i = 0; i < layerType_.size(); ++i)
140  edm::LogVerbatim("HGCalGeom") << "Layer [" << i << "] with material type " << layerType_[i] << " sensitive class "
141  << layerSense_[i];
142 #endif
143  slopeB_ = args.value<std::vector<double>>("SlopeBottom");
144  zFrontB_ = args.value<std::vector<double>>("ZFrontBottom");
145  rMinFront_ = args.value<std::vector<double>>("RMinFront");
146  slopeT_ = args.value<std::vector<double>>("SlopeTop");
147  zFrontT_ = args.value<std::vector<double>>("ZFrontTop");
148  rMaxFront_ = args.value<std::vector<double>>("RMaxFront");
149 #ifdef EDM_ML_DEBUG
150  for (unsigned int i = 0; i < slopeB_.size(); ++i)
151  edm::LogVerbatim("HGCalGeom") << "Bottom Block [" << i << "] Zmin " << cms::convert2mm(zFrontB_[i]) << " Rmin "
152  << cms::convert2mm(rMinFront_[i]) << " Slope " << slopeB_[i];
153  for (unsigned int i = 0; i < slopeT_.size(); ++i)
154  edm::LogVerbatim("HGCalGeom") << "Top Block [" << i << "] Zmin " << cms::convert2mm(zFrontT_[i]) << " Rmax "
155  << cms::convert2mm(rMaxFront_[i]) << " Slope " << slopeT_[i];
156 #endif
157  waferIndex_ = args.value<std::vector<int>>("WaferIndex");
158  waferProperty_ = args.value<std::vector<int>>("WaferProperties");
159  waferLayerStart_ = args.value<std::vector<int>>("WaferLayerStart");
160  cassetteShift_ = args.value<std::vector<double>>("CassetteShift");
161 #ifdef EDM_ML_DEBUG
162  edm::LogVerbatim("HGCalGeom") << "waferProperties with " << waferIndex_.size() << " entries in "
163  << waferLayerStart_.size() << " layers";
164  for (unsigned int k = 0; k < waferLayerStart_.size(); ++k)
165  edm::LogVerbatim("HGCalGeom") << "LayerStart[" << k << "] " << waferLayerStart_[k];
166  for (unsigned int k = 0; k < waferIndex_.size(); ++k)
167  edm::LogVerbatim("HGCalGeom") << "Wafer[" << k << "] " << waferIndex_[k] << " ("
168  << HGCalWaferIndex::waferLayer(waferIndex_[k]) << ", "
169  << HGCalWaferIndex::waferU(waferIndex_[k]) << ", "
170  << HGCalWaferIndex::waferV(waferIndex_[k]) << ") : ("
171  << HGCalProperty::waferThick(waferProperty_[k]) << ":"
172  << HGCalProperty::waferPartial(waferProperty_[k]) << ":"
173  << HGCalProperty::waferOrient(waferProperty_[k]) << ")";
174  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << cassetteShift_.size()
175  << " elements for cassette shifts";
176  unsigned int j1max = cassetteShift_.size();
177  for (unsigned int j1 = 0; j1 < j1max; j1 += 6) {
178  std::ostringstream st1;
179  unsigned int j2 = std::min((j1 + 6), j1max);
180  for (unsigned int j = j1; j < j2; ++j)
181  st1 << " [" << j << "] " << std::setw(9) << cassetteShift_[j];
182  edm::LogVerbatim("HGCalGeom") << st1.str();
183  }
184 
185  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: NameSpace " << ns.name();
186 #endif
187  cassette_.setParameter(cassettes_, cassetteShift_);
188 
189 #ifdef EDM_ML_DEBUG
190  edm::LogVerbatim("HGCalGeom") << "==>> Constructing DDHGCalSiliconRotatedModule...";
191  copies_.clear();
192 #endif
193 
194  double zi(zMinBlock_);
195  int laymin(0);
196  for (unsigned int i = 0; i < layers_.size(); ++i) {
197  double zo = zi + layerThick_[i];
198  double routF = HGCalGeomTools::radius(zi, zFrontT_, rMaxFront_, slopeT_);
199  int laymax = laymin + layers_[i];
200  double zz = zi;
201  double thickTot(0);
202  for (int ly = laymin; ly < laymax; ++ly) {
203  int ii = layerType_[ly];
204  int copy = copyNumber_[ii];
205  double hthick = 0.5 * thick_[ii];
206  double rinB = HGCalGeomTools::radius(zo - tol1, zFrontB_, rMinFront_, slopeB_);
207  zz += hthick;
208  thickTot += thick_[ii];
209 
210  std::string name = names_[ii] + std::to_string(copy);
211 #ifdef EDM_ML_DEBUG
212  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: Layer " << ly << ":" << ii << " Front "
213  << cms::convert2mm(zi) << ", " << cms::convert2mm(routF) << " Back "
214  << cms::convert2mm(zo) << ", " << cms::convert2mm(rinB)
215  << " superlayer thickness " << cms::convert2mm(layerThick_[i]);
216 #endif
217 
218  dd4hep::Material matter = ns.material(materials_[ii]);
219  dd4hep::Volume glog;
220 
221  if (layerSense_[ly] < 1) {
222  std::vector<double> pgonZ, pgonRin, pgonRout;
223  double rmax = routF * cosAlpha_ - tol1;
224  HGCalGeomTools::radius(zz - hthick,
225  zz + hthick,
226  zFrontB_,
227  rMinFront_,
228  slopeB_,
229  zFrontT_,
230  rMaxFront_,
231  slopeT_,
232  -layerSense_[ly],
233  pgonZ,
234  pgonRin,
235  pgonRout);
236  for (unsigned int isec = 0; isec < pgonZ.size(); ++isec) {
237  pgonZ[isec] -= zz;
238  if (layerSense_[ly] == 0 || absorbMode_ == 0)
239  pgonRout[isec] = rmax;
240  else
241  pgonRout[isec] = pgonRout[isec] * cosAlpha_ - tol1;
242  }
243  dd4hep::Solid solid = dd4hep::Polyhedra(sectors_, -alpha_, 2._pi, pgonZ, pgonRin, pgonRout);
244  ns.addSolidNS(ns.prepend(name), solid);
245  glog = dd4hep::Volume(solid.name(), solid, matter);
246  ns.addVolumeNS(glog);
247 #ifdef EDM_ML_DEBUG
248  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << solid.name() << " polyhedra of "
249  << sectors_ << " sectors covering " << convertRadToDeg(-alpha_) << ":"
250  << convertRadToDeg(-alpha_ + 2._pi) << " with " << pgonZ.size()
251  << " sections and filled with " << matter.name();
252  for (unsigned int k = 0; k < pgonZ.size(); ++k)
253  edm::LogVerbatim("HGCalGeom") << "[" << k << "] z " << cms::convert2mm(pgonZ[k]) << " R "
254  << cms::convert2mm(pgonRin[k]) << ":" << cms::convert2mm(pgonRout[k]);
255 #endif
256  } else {
257  double rins =
258  (sensitiveMode_ < 1) ? rinB : HGCalGeomTools::radius(zz + hthick - tol1, zFrontB_, rMinFront_, slopeB_);
259  double routs =
260  (sensitiveMode_ < 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_);
261  dd4hep::Solid solid = dd4hep::Tube(rins, routs, hthick, 0.0, 2._pi);
262  ns.addSolidNS(ns.prepend(name), solid);
263  glog = dd4hep::Volume(solid.name(), solid, matter);
264  ns.addVolumeNS(glog);
265 
266 #ifdef EDM_ML_DEBUG
267  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << solid.name() << " Tubs made of "
268  << matter.name() << " of dimensions " << cms::convert2mm(rinB) << ":"
269  << cms::convert2mm(rins) << ", " << cms::convert2mm(routF) << ":"
270  << cms::convert2mm(routs) << ", " << cms::convert2mm(hthick)
271  << ", 0.0, 360.0 and position " << glog.name() << " number " << copy << ":"
272  << layerTypes_[copy - firstLayer_];
273 #endif
274  positionSensitive(ctxt, e, glog, (copy - firstLayer_));
275  }
276 
277  dd4hep::Position r1(0, 0, zz);
278  dd4hep::Rotation3D rot;
279 #ifdef EDM_ML_DEBUG
280  std::string rotName("Null");
281 #endif
282  if ((layerSense_[ly] > 0) && (layerTypes_[copy - firstLayer_] == HGCalTypes::WaferCenteredRotated)) {
283  rot = ns.rotation(rotstr_);
284 #ifdef EDM_ML_DEBUG
285  rotName = rotstr_;
286 #endif
287  }
288  mother.placeVolume(glog, copy, dd4hep::Transform3D(rot, r1));
289  int inc = ((layerSense_[ly] > 0) && (facingTypes_ > 1)) ? 2 : 1;
290  copyNumber_[ii] = copy + inc;
291 #ifdef EDM_ML_DEBUG
292  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << glog.name() << " number " << copy
293  << " positioned in " << mother.name() << " at (0,0," << cms::convert2mm(zz)
294  << ") with " << rotName << " rotation";
295 #endif
296  zz += hthick;
297  } // End of loop over layers in a block
298  zi = zo;
299  laymin = laymax;
300  // Make consistency check of all the partitions of the block
301  if (std::abs(thickTot - layerThick_[i]) >= tol2) {
302  if (thickTot > layerThick_[i]) {
303  edm::LogError("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick_[i])
304  << " is smaller than " << cms::convert2mm(thickTot)
305  << ": thickness of all its components **** ERROR ****";
306  } else {
307  edm::LogWarning("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick_[i])
308  << " does not match with " << cms::convert2mm(thickTot) << " of the components";
309  }
310  }
311  } // End of loop over blocks
312 
313 #ifdef EDM_ML_DEBUG
314  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << copies_.size()
315  << " different wafer copy numbers";
316  int k(0);
317  for (std::unordered_set<int>::const_iterator itr = copies_.begin(); itr != copies_.end(); ++itr, ++k) {
318  edm::LogVerbatim("HGCalGeom") << "Copy [" << k << "] : " << (*itr);
319  }
320  copies_.clear();
321  edm::LogVerbatim("HGCalGeom") << "<<== End of DDHGCalSiliconRotatedModule construction...";
322 #endif
323  }
324 
325  void positionSensitive(cms::DDParsingContext& ctxt, xml_h e, const dd4hep::Volume& glog, int layer) {
326  cms::DDNamespace ns(ctxt, e, true);
327  static const double sqrt3 = std::sqrt(3.0);
328  int layercenter = (layerTypes_[layer] == HGCalTypes::CornerCenteredLambda)
332  int layertype = (layerTypes_[layer] == HGCalTypes::WaferCenteredBack) ? 1 : 0;
333  int firstWafer = waferLayerStart_[layer];
334  int lastWafer = ((layer + 1 < static_cast<int>(waferLayerStart_.size())) ? waferLayerStart_[layer + 1]
335  : static_cast<int>(waferIndex_.size()));
336  double r = 0.5 * (waferSize_ + waferSepar_);
337  double R = 2.0 * r / sqrt3;
338  double dy = 0.75 * R;
339  const auto& xyoff = geomTools_.shiftXY(layercenter, (waferSize_ + waferSepar_));
340 #ifdef EDM_ML_DEBUG
341  int ium(0), ivm(0), kount(0);
342  std::vector<int> ntype(3, 0);
343  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << glog.name() << " r " << cms::convert2mm(r)
344  << " R " << cms::convert2mm(R) << " dy " << cms::convert2mm(dy) << " Shift "
345  << cms::convert2mm(xyoff.first) << ":" << cms::convert2mm(xyoff.second)
346  << " WaferSize " << cms::convert2mm((waferSize_ + waferSepar_)) << " index "
347  << firstWafer << ":" << (lastWafer - 1);
348 #endif
349  for (int k = firstWafer; k < lastWafer; ++k) {
350  int u = HGCalWaferIndex::waferU(waferIndex_[k]);
351  int v = HGCalWaferIndex::waferV(waferIndex_[k]);
352 #ifdef EDM_ML_DEBUG
353  int iu = std::abs(u);
354  int iv = std::abs(v);
355 #endif
356  int nr = 2 * v;
357  int nc = -2 * u + v;
358  int type = HGCalProperty::waferThick(waferProperty_[k]);
359  int part = HGCalProperty::waferPartial(waferProperty_[k]);
360  int orien = HGCalProperty::waferOrient(waferProperty_[k]);
361  int cassette = HGCalProperty::waferCassette(waferProperty_[k]);
362  int place = HGCalCell::cellPlacementIndex(1, layertype, orien);
363  auto cshift = cassette_.getShift(layer, 1, cassette);
364  double xpos = xyoff.first + cshift.first + nc * r;
365  double ypos = xyoff.second + cshift.second + nr * dy;
366  std::string wafer;
367  int i(999);
368  if (part == HGCalTypes::WaferFull) {
369  i = type * facingTypes_ * orientationTypes_ + place - placeOffset_;
370  wafer = waferFull_[i];
371  } else {
372  int partoffset =
374  i = (part - partoffset) * facingTypes_ * orientationTypes_ +
375  HGCalTypes::WaferTypeOffset[type] * facingTypes_ * orientationTypes_ + place - placeOffset_;
376 #ifdef EDM_ML_DEBUG
377  edm::LogVerbatim("HGCalGeom") << " layertype:type:part:orien:cassette:place:offsets:ind " << layertype << ":"
378  << type << ":" << part << ":" << orien << ":" << cassette << ":" << place << ":"
379  << partoffset << ":" << HGCalTypes::WaferTypeOffset[type] << ":" << i << ":"
380  << waferPart_.size();
381 #endif
382  wafer = waferPart_[i];
383  }
384  int copy = HGCalTypes::packTypeUV(type, u, v);
385 #ifdef EDM_ML_DEBUG
386  edm::LogVerbatim("HGCalGeom") << " DDHGCalSiliconRotatedModule: Layer"
387  << HGCalWaferIndex::waferLayer(waferIndex_[k]) << " Wafer " << wafer << " number "
388  << copy << " type:part:orien:ind " << type << ":" << part << ":" << orien << ":"
389  << i << " layer:u:v:indx " << (layer + firstLayer_) << ":" << u << ":" << v;
390  if (iu > ium)
391  ium = iu;
392  if (iv > ivm)
393  ivm = iv;
394  kount++;
395  if (copies_.count(copy) == 0)
396  copies_.insert(copy);
397 #endif
398  dd4hep::Position tran(xpos, ypos, 0.0);
399  glog.placeVolume(ns.volume(wafer), copy, tran);
400 #ifdef EDM_ML_DEBUG
401  ++ntype[type];
402  edm::LogVerbatim("HGCalGeom") << " DDHGCalSiliconRotatedModule: " << wafer << " number " << copy << " type "
403  << layertype << ":" << type << " positioned in " << glog.name() << " at ("
404  << cms::convert2mm(xpos) << "," << cms::convert2mm(ypos) << ",0) with no rotation";
405 #endif
406  }
407 
408 #ifdef EDM_ML_DEBUG
409  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: Maximum # of u " << ium << " # of v " << ivm
410  << " and " << kount << " wafers (" << ntype[0] << ":" << ntype[1] << ":" << ntype[2]
411  << ") for " << glog.name();
412 #endif
413  }
414 
415  //Required data members to cache the values from XML file
418 
419  int waferTypes_; // Number of wafer types
420  int facingTypes_; // Types of facings of modules toward IP
421  int orientationTypes_; // Number of wafer orienations
422  int placeOffset_; // Offset for placement
423  int firstLayer_; // Copy # of the first sensitive layer
424  int absorbMode_; // Absorber mode
425  int sensitiveMode_; // Sensitive mode
426  double zMinBlock_; // Starting z-value of the block
427  double waferSize_; // Width of the wafer
428  double waferSepar_; // Sensor separation
429  int sectors_; // Sectors
430  int cassettes_; // Cassettes
431  std::string rotstr_; // Rotation matrix (if needed)
432  std::vector<std::string> waferFull_; // Names of full wafer modules
433  std::vector<std::string> waferPart_; // Names of partial wafer modules
434  std::vector<std::string> materials_; // names of materials
435  std::vector<std::string> names_; // Names of volumes
436  std::vector<double> thick_; // Thickness of the material
437  std::vector<int> copyNumber_; // Initial copy numbers
438  std::vector<int> layers_; // Number of layers in a section
439  std::vector<double> layerThick_; // Thickness of each section
440  std::vector<int> layerType_; // Type of the layer
441  std::vector<int> layerSense_; // Content of a layer (sensitive?)
442  std::vector<double> slopeB_; // Slope at the lower R
443  std::vector<double> zFrontB_; // Starting Z values for the slopes
444  std::vector<double> rMinFront_; // Corresponding rMin's
445  std::vector<double> slopeT_; // Slopes at the larger R
446  std::vector<double> zFrontT_; // Starting Z values for the slopes
447  std::vector<double> rMaxFront_; // Corresponding rMax's
448  std::vector<int> layerTypes_; // Layer type (Centering, rotations..)
449  std::vector<int> waferIndex_; // Wafer index for the types
450  std::vector<int> waferProperty_; // Wafer property
451  std::vector<int> waferLayerStart_; // Index of wafers in each layer
452  std::vector<double> cassetteShift_; // Shifts of the cassetes
453  std::unordered_set<int> copies_; // List of copy #'s
454  double alpha_, cosAlpha_;
455 };
456 
457 static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) {
458  HGCalSiliconRotatedModule eealgo(ctxt, e);
459  return cms::s_executed;
460 }
461 
462 DECLARE_DDCMS_DETELEMENT(DDCMS_hgcal_DDHGCalSiliconRotatedModule, algorithm)
Log< level::Info, true > LogVerbatim
static constexpr int32_t WaferCenteredRotated
Definition: HGCalTypes.h:71
static long algorithm(dd4hep::Detector &, cms::DDParsingContext &ctxt, xml_h e)
static constexpr int32_t WaferPartLDOffset
Definition: HGCalTypes.h:56
static constexpr int32_t WaferCenter
Definition: HGCalTypes.h:20
static void radius(double zf, double zb, std::vector< double > const &zFront1, std::vector< double > const &rFront1, std::vector< double > const &slope1, std::vector< double > const &zFront2, std::vector< double > const &rFront2, std::vector< double > const &slope2, int flag, std::vector< double > &zz, std::vector< double > &rin, std::vector< double > &rout)
const dd4hep::Rotation3D & rotation(const std::string &name) const
Definition: DDNamespace.cc:182
int32_t *__restrict__ iv
static constexpr int32_t WaferTypeOffset[3]
Definition: HGCalTypes.h:58
int32_t waferU(const int32_t index)
int32_t waferLayer(const int32_t index)
static constexpr int32_t CornerCenterYm
Definition: HGCalTypes.h:22
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
constexpr NumType convert2mm(NumType length)
Definition: DDutils.h:7
std::string to_string(const V &value)
Definition: OMSAccess.h:71
std::vector< std::string > materials_
Log< level::Error, false > LogError
dd4hep::Material material(const std::string &name) const
Definition: DDNamespace.cc:166
int32_t waferOrient(const int32_t property)
HGCalSiliconRotatedModule(cms::DDParsingContext &ctxt, xml_h e)
constexpr std::array< uint8_t, layerIndexSize > layer
static const std::string & rotName(const T &rot, const cms::DDParsingContext &context)
int32_t waferCassette(const int32_t property)
#define DECLARE_DDCMS_DETELEMENT(name, func)
Definition: DDPlugins.h:25
static constexpr int32_t WaferFull
Definition: HGCalTypes.h:34
static constexpr long s_executed
static int32_t cellPlacementIndex(int32_t iz, int32_t fwdBack, int32_t orient)
Definition: HGCalCell.cc:230
T sqrt(T t)
Definition: SSEVec.h:19
std::string_view name() const
Definition: DDNamespace.h:79
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< std::string > waferFull_
int32_t waferThick(const int32_t property)
dd4hep::Volume Volume
static constexpr int32_t CornerCenterYp
Definition: HGCalTypes.h:21
ii
Definition: cuy.py:589
static constexpr int32_t WaferPartHDOffset
Definition: HGCalTypes.h:57
static constexpr int32_t WaferCenteredBack
Definition: HGCalTypes.h:68
part
Definition: HCALResponse.h:20
static constexpr int32_t CornerCenteredLambda
Definition: HGCalTypes.h:70
int32_t waferPartial(const int32_t property)
static constexpr int32_t CornerCenteredY
Definition: HGCalTypes.h:69
int32_t waferV(const int32_t index)
std::vector< std::string > names_
static int32_t packTypeUV(int type, int u, int v)
Definition: HGCalTypes.cc:3
static constexpr int32_t WaferHDTop
Definition: HGCalTypes.h:50
Log< level::Warning, false > LogWarning
dd4hep::Volume addVolumeNS(dd4hep::Volume vol) const
Definition: DDNamespace.cc:202
void positionSensitive(cms::DDParsingContext &ctxt, xml_h e, const dd4hep::Volume &glog, int layer)
dd4hep::Volume volume(const std::string &name, bool exc=true) const
Definition: DDNamespace.cc:276
dd4hep::Solid addSolidNS(const std::string &name, dd4hep::Solid solid) const
Definition: DDNamespace.cc:292
std::string prepend(const std::string &) const
Definition: DDNamespace.cc:99
std::vector< std::string > waferPart_