CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Static Public Attributes
HGCalMixRotatedFineCassette Struct Reference

Public Member Functions

 HGCalMixRotatedFineCassette ()
 
 HGCalMixRotatedFineCassette (cms::DDParsingContext &ctxt, xml_h e)
 
void positionMix (cms::DDParsingContext &ctxt, xml_h e, const dd4hep::Volume &glog, const std::string &nameM, int copyM, double thick, const dd4hep::Material &matter, int absType, bool fine)
 

Public Attributes

int absorbMode_
 
double alpha_
 
HGCalCassette cassette_
 
int cassettes_
 
std::vector< double > cassetteShift_
 
std::vector< double > cassetteShiftScnt_
 
std::unordered_set< int > copies_
 
std::vector< int > copyNumber_
 
std::vector< int > copyNumberCoverTop_
 
std::vector< int > copyNumberTop_
 
double cosAlpha_
 
int coverTopLayers_
 
int coverTypeTop_
 
int facingTypes_
 
int firstCoarseLayer_
 
int firstFineLayer_
 
HGCalGeomTools geomTools_
 
std::vector< int > layerOrient_
 
std::vector< int > layers_
 
std::vector< int > layerSense_
 
std::vector< double > layerThick_
 
std::vector< double > layerThickTop_
 
std::vector< int > layerType_
 
std::vector< int > layerTypeTop_
 
std::vector< std::string > materials_
 
std::vector< std::string > materialTop_
 
std::vector< std::string > names_
 
std::string nameSpace_
 
std::vector< std::string > namesTop_
 
int orientationTypes_
 
int partialTypes_
 
std::vector< std::string > passiveFull_
 
int passiveMode_
 
std::vector< std::string > passivePart_
 
int passiveTypes_
 
int phiBinsFineScint_
 
int phiBinsScint_
 
int placeOffset_
 
std::vector< double > rMaxFront_
 
std::vector< double > rMinFront_
 
int sectors_
 
int sensitiveMode_
 
std::vector< double > slopeB_
 
std::vector< double > slopeT_
 
std::vector< double > thick_
 
std::vector< int > tileCoarseIndex_
 
std::vector< int > tileCoarseLayerStart_
 
std::vector< int > tileCoarsePhis_
 
std::vector< double > tileCoarseRMax_
 
std::vector< double > tileCoarseRMin_
 
std::vector< int > tileFineIndex_
 
std::vector< int > tileFineLayerStart_
 
std::vector< int > tileFinePhis_
 
std::vector< double > tileFineRMax_
 
std::vector< double > tileFineRMin_
 
std::vector< std::string > waferFull_
 
std::vector< int > waferIndex_
 
std::vector< int > waferLayerStart_
 
std::vector< std::string > waferPart_
 
std::vector< int > waferProperty_
 
double waferSepar_
 
double waferSize_
 
int waferTypes_
 
std::vector< double > zFrontB_
 
std::vector< double > zFrontT_
 
double zMinBlock_
 

Static Public Attributes

static constexpr double tol2_ = 0.00001 * dd4hep::mm
 

Detailed Description

Definition at line 30 of file DDHGCalMixRotatedFineCassette.cc.

Constructor & Destructor Documentation

◆ HGCalMixRotatedFineCassette() [1/2]

HGCalMixRotatedFineCassette::HGCalMixRotatedFineCassette ( )
inline

Definition at line 31 of file DDHGCalMixRotatedFineCassette.cc.

References Exception.

31  {
32  throw cms::Exception("HGCalGeom") << "Wrong initialization to HGCalMixRotatedFineCassette";
33  }

◆ HGCalMixRotatedFineCassette() [2/2]

HGCalMixRotatedFineCassette::HGCalMixRotatedFineCassette ( cms::DDParsingContext ctxt,
xml_h  e 
)
inline

Definition at line 35 of file DDHGCalMixRotatedFineCassette.cc.

References funct::abs(), cms::DDNamespace::addSolidNS(), cms::DDNamespace::addVolumeNS(), writedatasetfile::args, ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), cms::convert2mm(), angle_units::operators::convertRadToDeg(), filterCSVwithJSON::copy, funct::cos(), MillePedeFileConverter_cfg::e, mps_fire::i, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, cuy::ii, l1ctLayer1_patternWriters_cff::isec, dqmiolumiharvest::j, dqmdumpme::k, HGCalTypes::layerType(), M_PI, cms::DDNamespace::material(), g4SimHits_cfi::Material, SiStripPI::min, ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, Skims_PA_cff::name, HGCalGeometryMode::Polyhedra, PixelTestBeamValidation_cfi::Position, cms::DDNamespace::prepend(), HGCalGeomTools::radius(), funct::sin(), AlCaHLTBitMon_QueryRunRegistry::string, HGCalTileIndex::tileUnpack(), to_string(), cms::DDNamespace::volume(), HGCalWaferIndex::waferLayer(), HGCalProperty::waferOrient(), HGCalProperty::waferPartial(), HGCalProperty::waferThick(), HGCalWaferIndex::waferU(), HGCalWaferIndex::waferV(), and geometryCSVtoXML::zz.

35  {
36  cms::DDNamespace ns(ctxt, e, true);
38 
39 #ifdef EDM_ML_DEBUG
40  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Creating an instance";
41 #endif
42  static constexpr double tol1 = 0.01 * dd4hep::mm;
43 
44  dd4hep::Volume mother = ns.volume(args.parentName());
45 
46  waferTypes_ = args.value<int>("WaferTypes");
47  passiveTypes_ = args.value<int>("PassiveTypes");
48  facingTypes_ = args.value<int>("FacingTypes");
49  orientationTypes_ = args.value<int>("OrientationTypes");
50  partialTypes_ = args.value<int>("PartialTypes");
51  placeOffset_ = args.value<int>("PlaceOffset");
52  phiBinsScint_ = args.value<int>("NPhiBinScint");
53  phiBinsFineScint_ = args.value<int>("NPhiBinFineScint");
54 #ifdef EDM_ML_DEBUG
55  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette::Number of types of wafers: " << waferTypes_
56  << " passives: " << passiveTypes_ << " facings: " << facingTypes_
57  << " Orientations: " << orientationTypes_ << " PartialTypes: " << partialTypes_
58  << " PlaceOffset: " << placeOffset_ << "; number of cells along phi "
59  << phiBinsFineScint_ << ":" << phiBinsScint_;
60 #endif
61  firstFineLayer_ = args.value<int>("FirstFineLayer");
62  firstCoarseLayer_ = args.value<int>("FirstCoarseLayer");
63  absorbMode_ = args.value<int>("AbsorberMode");
64  sensitiveMode_ = args.value<int>("SensitiveMode");
65  passiveMode_ = args.value<int>("PassiveMode");
66 #ifdef EDM_ML_DEBUG
67  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette::First Layers " << firstFineLayer_ << ":"
68  << firstCoarseLayer_ << " and Absober:Sensitive mode " << absorbMode_ << ":"
69  << sensitiveMode_ << ":" << passiveMode_;
70 #endif
71  zMinBlock_ = args.value<double>("zMinBlock");
72  waferSize_ = args.value<double>("waferSize");
73  waferSepar_ = args.value<double>("SensorSeparation");
74  sectors_ = args.value<int>("Sectors");
75  cassettes_ = args.value<int>("Cassettes");
76  alpha_ = (1._pi) / sectors_;
77  cosAlpha_ = cos(alpha_);
78 #ifdef EDM_ML_DEBUG
79  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: zStart " << zMinBlock_ << " wafer width "
80  << waferSize_ << " separations " << waferSepar_ << " sectors " << sectors_ << ":"
81  << convertRadToDeg(alpha_) << ":" << cosAlpha_ << " with " << cassettes_
82  << " cassettes";
83 #endif
84  slopeB_ = args.value<std::vector<double>>("SlopeBottom");
85  zFrontB_ = args.value<std::vector<double>>("ZFrontBottom");
86  rMinFront_ = args.value<std::vector<double>>("RMinFront");
87  slopeT_ = args.value<std::vector<double>>("SlopeTop");
88  zFrontT_ = args.value<std::vector<double>>("ZFrontTop");
89  rMaxFront_ = args.value<std::vector<double>>("RMaxFront");
90 #ifdef EDM_ML_DEBUG
91  for (unsigned int i = 0; i < slopeB_.size(); ++i)
92  edm::LogVerbatim("HGCalGeom") << "Bottom Block [" << i << "] Zmin " << zFrontB_[i] << " Rmin " << rMinFront_[i]
93  << " Slope " << slopeB_[i];
94  for (unsigned int i = 0; i < slopeT_.size(); ++i)
95  edm::LogVerbatim("HGCalGeom") << "Top Block [" << i << "] Zmin " << zFrontT_[i] << " Rmax " << rMaxFront_[i]
96  << " Slope " << slopeT_[i];
97 #endif
98  waferFull_ = args.value<std::vector<std::string>>("WaferNamesFull");
99  waferPart_ = args.value<std::vector<std::string>>("WaferNamesPartial");
100 #ifdef EDM_ML_DEBUG
101  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: " << waferFull_.size() << " full and "
102  << waferPart_.size()
103  << " partial modules\nDDHGCalMixRotatedFineCassette:Full Modules:";
104  unsigned int i1max = static_cast<unsigned int>(waferFull_.size());
105  for (unsigned int i1 = 0; i1 < i1max; i1 += 2) {
106  std::ostringstream st1;
107  unsigned int i2 = std::min((i1 + 2), i1max);
108  for (unsigned int i = i1; i < i2; ++i)
109  st1 << " [" << i << "] " << waferFull_[i];
110  edm::LogVerbatim("HGCalGeom") << st1.str();
111  }
112  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Partial Modules:";
113  i1max = static_cast<unsigned int>(waferPart_.size());
114  for (unsigned int i1 = 0; i1 < i1max; i1 += 2) {
115  std::ostringstream st1;
116  unsigned int i2 = std::min((i1 + 2), i1max);
117  for (unsigned int i = i1; i < i2; ++i)
118  st1 << " [" << i << "] " << waferPart_[i];
119  edm::LogVerbatim("HGCalGeom") << st1.str();
120  }
121 #endif
122  passiveFull_ = args.value<std::vector<std::string>>("PassiveNamesFull");
123  passivePart_ = args.value<std::vector<std::string>>("PassiveNamesPartial");
124 #ifdef EDM_ML_DEBUG
125  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedCassette: " << passiveFull_.size() << " full and "
126  << passivePart_.size() << " partial passive modules";
127  i1max = static_cast<unsigned int>(passiveFull_.size());
128  for (unsigned int i1 = 0; i1 < i1max; i1 += 2) {
129  std::ostringstream st1;
130  unsigned int i2 = std::min((i1 + 2), i1max);
131  for (unsigned int i = i1; i < i2; ++i)
132  st1 << " [" << i << "] " << passiveFull_[i];
133  edm::LogVerbatim("HGCalGeom") << st1.str();
134  }
135  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedCassette: Partial Modules:";
136  i1max = static_cast<unsigned int>(passivePart_.size());
137  for (unsigned int i1 = 0; i1 < i1max; i1 += 2) {
138  std::ostringstream st1;
139  unsigned int i2 = std::min((i1 + 2), i1max);
140  for (unsigned int i = i1; i < i2; ++i)
141  st1 << " [" << i << "] " << passivePart_[i];
142  edm::LogVerbatim("HGCalGeom") << st1.str();
143  }
144 #endif
145  materials_ = args.value<std::vector<std::string>>("MaterialNames");
146  names_ = args.value<std::vector<std::string>>("VolumeNames");
147  thick_ = args.value<std::vector<double>>("Thickness");
148  copyNumber_.resize(materials_.size(), 1);
149 #ifdef EDM_ML_DEBUG
150  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: " << materials_.size() << " types of volumes";
151  for (unsigned int i = 0; i < names_.size(); ++i)
152  edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << names_[i] << " of thickness " << thick_[i]
153  << " filled with " << materials_[i] << " first copy number " << copyNumber_[i];
154 #endif
155  layers_ = args.value<std::vector<int>>("Layers");
156  layerThick_ = args.value<std::vector<double>>("LayerThick");
157 #ifdef EDM_ML_DEBUG
158  edm::LogVerbatim("HGCalGeom") << "There are " << layers_.size() << " blocks";
159  for (unsigned int i = 0; i < layers_.size(); ++i)
160  edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] of thickness " << layerThick_[i] << " with " << layers_[i]
161  << " layers";
162 #endif
163  layerType_ = args.value<std::vector<int>>("LayerType");
164  layerSense_ = args.value<std::vector<int>>("LayerSense");
165  layerOrient_ = args.value<std::vector<int>>("LayerTypes");
166  for (unsigned int k = 0; k < layerOrient_.size(); ++k)
168 #ifdef EDM_ML_DEBUG
169  for (unsigned int i = 0; i < layerOrient_.size(); ++i)
170  edm::LogVerbatim("HGCalGeom") << "LayerOrient [" << i << "] " << layerOrient_[i];
171 #endif
172  if (firstFineLayer_ > 0) {
173  for (unsigned int i = 0; i < layerType_.size(); ++i) {
174  if (layerSense_[i] != 0) {
175  int ii = layerType_[i];
177 #ifdef EDM_ML_DEBUG
178  edm::LogVerbatim("HGCalGeom") << "First copy number for layer type " << i << ":" << ii << " with "
179  << materials_[ii] << " changed to " << copyNumber_[ii];
180 #endif
181  }
182  }
183  } else {
184  firstFineLayer_ = 1;
185  }
186 #ifdef EDM_ML_DEBUG
187  edm::LogVerbatim("HGCalGeom") << "There are " << layerType_.size() << " layers";
188  for (unsigned int i = 0; i < layerType_.size(); ++i)
189  edm::LogVerbatim("HGCalGeom") << "Layer [" << i << "] with material type " << layerType_[i] << " sensitive class "
190  << layerSense_[i];
191 #endif
192  materialTop_ = args.value<std::vector<std::string>>("TopMaterialNames");
193  namesTop_ = args.value<std::vector<std::string>>("TopVolumeNames");
194  layerThickTop_ = args.value<std::vector<double>>("TopLayerThickness");
195  layerTypeTop_ = args.value<std::vector<int>>("TopLayerType");
197  coverTypeTop_ = args.value<int>("TopCoverLayerType");
198  coverTopLayers_ = args.value<int>("TopCoverLayers");
200 #ifdef EDM_ML_DEBUG
201  std::ostringstream st0;
202  for (int k = 0; k < coverTopLayers_; ++k)
203  st0 << " " << copyNumberCoverTop_[k];
204  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: " << materialTop_.size()
205  << " types of volumes in the top part; " << coverTopLayers_ << " covers of Type "
206  << coverTypeTop_ << " with initial copy numbers: " << st0.str();
207  for (unsigned int i = 0; i < materialTop_.size(); ++i)
208  edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << namesTop_[i] << " of thickness " << layerThickTop_[i]
209  << " filled with " << materialTop_[i] << " first copy number " << copyNumberTop_[i];
210  edm::LogVerbatim("HGCalGeom") << "There are " << layerTypeTop_.size() << " layers in the top part";
211  for (unsigned int i = 0; i < layerTypeTop_.size(); ++i)
212  edm::LogVerbatim("HGCalGeom") << "Layer [" << i << "] with material type " << layerTypeTop_[i];
213 #endif
214  waferIndex_ = args.value<std::vector<int>>("WaferIndex");
215  waferProperty_ = args.value<std::vector<int>>("WaferProperties");
216  waferLayerStart_ = args.value<std::vector<int>>("WaferLayerStart");
217  cassetteShift_ = args.value<std::vector<double>>("CassetteShift");
218 #ifdef EDM_ML_DEBUG
219  edm::LogVerbatim("HGCalGeom") << "waferProperties with " << waferIndex_.size() << " entries in "
220  << waferLayerStart_.size() << " layers";
221  for (unsigned int k = 0; k < waferLayerStart_.size(); ++k)
222  edm::LogVerbatim("HGCalGeom") << "LayerStart[" << k << "] " << waferLayerStart_[k];
223  for (unsigned int k = 0; k < waferIndex_.size(); ++k)
224  edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << waferIndex_[k] << " ("
227  << HGCalWaferIndex::waferV(waferIndex_[k]) << ") : ("
231  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: " << cassetteShift_.size()
232  << " elements for cassette shifts";
233  unsigned int j1max = cassetteShift_.size();
234  for (unsigned int j1 = 0; j1 < j1max; j1 += 6) {
235  std::ostringstream st1;
236  unsigned int j2 = std::min((j1 + 6), j1max);
237  for (unsigned int j = j1; j < j2; ++j)
238  st1 << " [" << j << "] " << std::setw(9) << cassetteShift_[j];
239  edm::LogVerbatim("HGCalGeom") << st1.str();
240  }
241 #endif
242  tileFineRMin_ = args.value<std::vector<double>>("Tile6RMin");
243  tileFineRMax_ = args.value<std::vector<double>>("Tile6RMax");
244  tileFineIndex_ = args.value<std::vector<int>>("Tile6LayerRings");
245  tileFinePhis_ = args.value<std::vector<int>>("Tile6PhiRange");
246  tileFineLayerStart_ = args.value<std::vector<int>>("Tile6LayerStart");
247  tileCoarseRMin_ = args.value<std::vector<double>>("TileRMin");
248  tileCoarseRMax_ = args.value<std::vector<double>>("TileRMax");
249  tileCoarseIndex_ = args.value<std::vector<int>>("TileLayerRings");
250  tileCoarsePhis_ = args.value<std::vector<int>>("TilePhiRange");
251  tileCoarseLayerStart_ = args.value<std::vector<int>>("TileLayerStart");
252 #ifdef EDM_ML_DEBUG
253  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette:: with " << tileFineRMin_.size() << ":"
254  << tileCoarseRMin_.size() << " rings";
255  for (unsigned int k = 0; k < tileFineRMin_.size(); ++k)
256  edm::LogVerbatim("HGCalGeom") << "Fine Ring[" << k << "] " << tileFineRMin_[k] << " : " << tileFineRMax_[k];
257  for (unsigned int k = 0; k < tileCoarseRMin_.size(); ++k)
258  edm::LogVerbatim("HGCalGeom") << "Coarse Ring[" << k << "] " << tileCoarseRMin_[k] << " : " << tileCoarseRMax_[k];
259  edm::LogVerbatim("HGCalGeom") << "TileProperties with " << tileFineIndex_.size() << ":" << tileCoarseIndex_.size()
260  << " entries in " << tileFineLayerStart_.size() << ":" << tileCoarseLayerStart_.size()
261  << " layers";
262  for (unsigned int k = 0; k < tileFineLayerStart_.size(); ++k)
263  edm::LogVerbatim("HGCalGeom") << "FineLayerStart[" << k << "] " << tileFineLayerStart_[k];
264  for (unsigned int k = 0; k < tileCoarseLayerStart_.size(); ++k)
265  edm::LogVerbatim("HGCalGeom") << "CoarseLayerStart[" << k << "] " << tileCoarseLayerStart_[k];
266  for (unsigned int k = 0; k < tileFineIndex_.size(); ++k)
267  edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << tileFineIndex_[k] << " ("
268  << "Layer " << std::get<0>(HGCalTileIndex::tileUnpack(tileFineIndex_[k]))
269  << " Ring " << std::get<1>(HGCalTileIndex::tileUnpack(tileFineIndex_[k])) << ":"
270  << std::get<2>(HGCalTileIndex::tileUnpack(tileFineIndex_[k])) << ") Phi "
271  << std::get<1>(HGCalTileIndex::tileUnpack(tileFinePhis_[k])) << ":"
272  << std::get<2>(HGCalTileIndex::tileUnpack(tileFinePhis_[k]));
273  for (unsigned int k = 0; k < tileCoarseIndex_.size(); ++k)
274  edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << tileCoarseIndex_[k] << " ("
275  << "Layer " << std::get<0>(HGCalTileIndex::tileUnpack(tileCoarseIndex_[k]))
276  << " Ring " << std::get<1>(HGCalTileIndex::tileUnpack(tileCoarseIndex_[k])) << ":"
277  << std::get<2>(HGCalTileIndex::tileUnpack(tileCoarseIndex_[k])) << ") Phi "
278  << std::get<1>(HGCalTileIndex::tileUnpack(tileCoarsePhis_[k])) << ":"
279  << std::get<2>(HGCalTileIndex::tileUnpack(tileCoarsePhis_[k]));
280 #endif
281  std::vector<double> retract = args.value<std::vector<double>>("ScintRetract");
282  double dphi = M_PI / cassettes_;
283  for (int k = 0; k < cassettes_; ++k) {
284  double phi = (2 * k + 1) * dphi;
285  cassetteShiftScnt_.emplace_back(retract[k] * cos(phi));
286  cassetteShiftScnt_.emplace_back(retract[k] * sin(phi));
287  }
288 #ifdef EDM_ML_DEBUG
289  unsigned int j2max = cassetteShiftScnt_.size();
290  for (unsigned int j1 = 0; j1 < j2max; j1 += 6) {
291  std::ostringstream st1;
292  unsigned int j2 = std::min((j1 + 6), j2max);
293  for (unsigned int j = j1; j < j2; ++j)
294  st1 << " [" << j << "] " << std::setw(9) << cassetteShiftScnt_[j];
295  edm::LogVerbatim("HGCalGeom") << st1.str();
296  }
297 #endif
300 
302  // DDHGCalMixRotatedFineCassette methods...
304 
305 #ifdef EDM_ML_DEBUG
306  edm::LogVerbatim("HGCalGeom") << "==>> Constructing DDHGCalMixRotatedFineCassette...";
307  copies_.clear();
308 #endif
309 
310  double zi(zMinBlock_);
311  int laymin(0);
312  unsigned int fineLayers = static_cast<unsigned int>(firstCoarseLayer_ - firstFineLayer_);
313  for (unsigned int i = 0; i < layers_.size(); i++) {
314  double zo = zi + layerThick_[i];
315  double routF = HGCalGeomTools::radius(zi, zFrontT_, rMaxFront_, slopeT_);
316  int laymax = laymin + layers_[i];
317  double zz = zi;
318  double thickTot(0);
319  bool fine = (i < fineLayers) ? true : false;
320  for (int ly = laymin; ly < laymax; ++ly) {
321  int ii = layerType_[ly];
322  int copy = copyNumber_[ii];
323  double hthick = 0.5 * thick_[ii];
324  double rinB = HGCalGeomTools::radius(zo, zFrontB_, rMinFront_, slopeB_);
325  zz += hthick;
326  thickTot += thick_[ii];
327 
329 #ifdef EDM_ML_DEBUG
330  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Layer " << ly << ":" << ii << " Front "
331  << cms::convert2mm(zi) << ", " << cms::convert2mm(routF) << " Back "
332  << cms::convert2mm(zo) << ", " << cms::convert2mm(rinB)
333  << " superlayer thickness " << layerThick_[i];
334 #endif
335  dd4hep::Material matter = ns.material(materials_[ii]);
336  dd4hep::Volume glog;
337  if (layerSense_[ly] == 0) {
338  std::vector<double> pgonZ, pgonRin, pgonRout;
339  double rmax =
340  (std::min(routF, HGCalGeomTools::radius(zz + hthick, zFrontT_, rMaxFront_, slopeT_)) * cosAlpha_) - tol1;
341  HGCalGeomTools::radius(zz - hthick,
342  zz + hthick,
343  zFrontB_,
344  rMinFront_,
345  slopeB_,
346  zFrontT_,
347  rMaxFront_,
348  slopeT_,
349  -layerSense_[ly],
350  pgonZ,
351  pgonRin,
352  pgonRout);
353  for (unsigned int isec = 0; isec < pgonZ.size(); ++isec) {
354  pgonZ[isec] -= zz;
355  if (layerSense_[ly] == 0 || absorbMode_ == 0)
356  pgonRout[isec] = rmax;
357  else
358  pgonRout[isec] = pgonRout[isec] * cosAlpha_ - tol1;
359  }
360  dd4hep::Solid solid = dd4hep::Polyhedra(sectors_, -alpha_, 2._pi, pgonZ, pgonRin, pgonRout);
361  ns.addSolidNS(ns.prepend(name), solid);
362  glog = dd4hep::Volume(solid.name(), solid, matter);
363  ns.addVolumeNS(glog);
364 #ifdef EDM_ML_DEBUG
365  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: " << solid.name() << " polyhedra of "
366  << sectors_ << " sectors covering " << convertRadToDeg(-alpha_) << ":"
367  << convertRadToDeg(-alpha_ + 2._pi) << " with " << pgonZ.size() << " sections";
368  for (unsigned int k = 0; k < pgonZ.size(); ++k)
369  edm::LogVerbatim("HGCalGeom") << "[" << k << "] z " << cms::convert2mm(pgonZ[k]) << " R "
370  << cms::convert2mm(pgonRin[k]) << ":" << cms::convert2mm(pgonRout[k]);
371 #endif
372  } else {
373  int mode = (layerSense_[ly] > 0) ? sensitiveMode_ : absorbMode_;
374  double rins = (mode < 1) ? rinB : HGCalGeomTools::radius(zz + hthick, zFrontB_, rMinFront_, slopeB_);
375  double routs = (mode < 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_);
376  dd4hep::Solid solid = dd4hep::Tube(rins, routs, hthick, 0.0, 2._pi);
377  ns.addSolidNS(ns.prepend(name), solid);
378  glog = dd4hep::Volume(solid.name(), solid, matter);
379  ns.addVolumeNS(glog);
380 #ifdef EDM_ML_DEBUG
381  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: " << solid.name() << " Tubs made of "
382  << matter.name() << " of dimensions " << cms::convert2mm(rinB) << ":"
383  << cms::convert2mm(rins) << ", " << cms::convert2mm(routF) << ":"
384  << cms::convert2mm(routs) << ", " << cms::convert2mm(hthick)
385  << ", 0.0, 360.0 and positioned in: " << glog.name() << " number " << copy;
386 #endif
387  positionMix(ctxt, e, glog, name, copy, thick_[ii], matter, -layerSense_[ly], fine);
388  }
389  dd4hep::Position r1(0, 0, zz);
390  mother.placeVolume(glog, copy, r1);
391  ++copyNumber_[ii];
392 #ifdef EDM_ML_DEBUG
393  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: " << glog.name() << " number " << copy
394  << " positioned in " << mother.name() << " at (0,0," << cms::convert2mm(zz)
395  << ") with no rotation";
396 #endif
397  zz += hthick;
398  } // End of loop over layers in a block
399  zi = zo;
400  laymin = laymax;
401  // Make consistency check of all the partitions of the block
402  if (std::abs(thickTot - layerThick_[i]) >= tol2_) {
403  if (thickTot > layerThick_[i]) {
404  edm::LogError("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick_[i])
405  << " is smaller than " << cms::convert2mm(thickTot)
406  << ": thickness of all its components **** ERROR ****";
407  } else {
408  edm::LogWarning("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick_[i])
409  << " does not match with " << cms::convert2mm(thickTot) << " of the components";
410  }
411  }
412  } // End of loop over blocks
413 #ifdef EDM_ML_DEBUG
414  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: " << copies_.size()
415  << " different wafer copy numbers";
416  int k(0);
417  for (std::unordered_set<int>::const_iterator itr = copies_.begin(); itr != copies_.end(); ++itr, ++k) {
418  edm::LogVerbatim("HGCalGeom") << "Copy [" << k << "] : " << (*itr);
419  }
420  copies_.clear();
421  edm::LogVerbatim("HGCalGeom") << "<<== End of DDHGCalMixRotatedFineCassette construction...";
422 #endif
423  }
Log< level::Info, true > LogVerbatim
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)
int32_t waferU(const int32_t index)
int32_t waferLayer(const int32_t index)
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
constexpr NumType convert2mm(NumType length)
Definition: DDutils.h:7
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Log< level::Error, false > LogError
int32_t waferOrient(const int32_t property)
void setParameterScint(const std::vector< double > &shifts)
static std::string to_string(const XMLCh *ch)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
void positionMix(cms::DDParsingContext &ctxt, xml_h e, const dd4hep::Volume &glog, const std::string &nameM, int copyM, double thick, const dd4hep::Material &matter, int absType, bool fine)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int32_t waferThick(const int32_t property)
void setParameter(int cassette, const std::vector< double > &shifts, bool both=true)
Definition: HGCalCassette.cc:8
dd4hep::Volume Volume
ii
Definition: cuy.py:589
#define M_PI
std::tuple< int32_t, int32_t, int32_t > tileUnpack(int32_t index)
int32_t waferPartial(const int32_t property)
int32_t waferV(const int32_t index)
Log< level::Warning, false > LogWarning
static int32_t layerType(int type)
Definition: HGCalTypes.cc:42

Member Function Documentation

◆ positionMix()

void HGCalMixRotatedFineCassette::positionMix ( cms::DDParsingContext ctxt,
xml_h  e,
const dd4hep::Volume &  glog,
const std::string &  nameM,
int  copyM,
double  thick,
const dd4hep::Material &  matter,
int  absType,
bool  fine 
)
inline

Definition at line 425 of file DDHGCalMixRotatedFineCassette.cc.

References funct::abs(), cms::DDNamespace::addSolidNS(), cms::DDNamespace::addVolumeNS(), angle(), HGCalCassette::cassetteType(), HGCalCell::cellPlacementIndex(), cms::convert2mm(), angle_units::operators::convertRadToDeg(), filterCSVwithJSON::copy, PVValHelper::dy, MillePedeFileConverter_cfg::e, mps_fire::i, cuy::ii, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::iv, dqmdumpme::k, HGCalTypes::layerFrontBack(), cms::DDNamespace::material(), g4SimHits_cfi::Material, Skims_PA_cff::name, EgHLTOffHistBins_cfi::nr, HGCalTypes::packTypeUV(), PixelTestBeamValidation_cfi::Position, cms::DDNamespace::prepend(), diffTwoXMLs::r2, mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, HGCalTileIndex::tileUnpack(), to_string(), findQualityFiles::v, cms::DDNamespace::volume(), HGCalProperty::waferCassette(), HGCalTypes::WaferFull, HGCalTypes::WaferHDTop, HGCalWaferIndex::waferLayer(), HGCalProperty::waferOrient(), HGCalTypes::WaferPartHDOffset, HGCalProperty::waferPartial(), HGCalTypes::WaferPartLDOffset, HGCalProperty::waferThick(), HGCalTypes::WaferTypeOffset, HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

433  {
434  cms::DDNamespace ns(ctxt, e, true);
435 
436  // Make the top part first
437  for (unsigned int ly = 0; ly < layerTypeTop_.size(); ++ly) {
438  int ii = layerTypeTop_[ly];
439  copyNumberTop_[ii] = copyM;
440  }
441  double hthick = 0.5 * thick;
442  double dphi = (fine) ? ((2._pi) / phiBinsFineScint_) : ((2._pi) / phiBinsScint_);
443  double thickTot(0), zpos(-hthick);
444 #ifdef EDM_ML_DEBUG
445  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Entry to positionMix with Name " << nameM
446  << " copy " << copyM << " Thick " << thick << " AbsType " << absType << " Fine "
447  << fine << " dphi " << convertRadToDeg(dphi);
448 #endif
449  if (absType < 0) {
450  for (unsigned int ly = 0; ly < layerTypeTop_.size(); ++ly) {
451  int ii = layerTypeTop_[ly];
452  int copy = copyNumberTop_[ii];
453  int layer = (fine) ? (copy - firstFineLayer_) : (copy - firstCoarseLayer_);
454  double hthickl = 0.5 * layerThickTop_[ii];
455  thickTot += layerThickTop_[ii];
456  zpos += hthickl;
457  dd4hep::Material matter1 = ns.material(materialTop_[ii]);
458  unsigned int k = 0;
459  int firstTile = (fine) ? tileFineLayerStart_[layer] : tileCoarseLayerStart_[layer];
460  int lastTile = (fine) ? ((layer + 1 < static_cast<int>(tileFineLayerStart_.size()))
462  : static_cast<int>(tileFineIndex_.size()))
463  : ((layer + 1 < static_cast<int>(tileCoarseLayerStart_.size()))
465  : static_cast<int>(tileCoarseIndex_.size()));
466 #ifdef EDM_ML_DEBUG
467  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Layer " << ly << ":" << ii << ":" << layer
468  << " Copy " << copy << " Tiles " << firstTile << ":" << lastTile << " Size "
469  << tileFineIndex_.size() << ":" << tileCoarseIndex_.size() << " Fine " << fine
470  << " absType " << absType;
471 #endif
472  for (int ti = firstTile; ti < lastTile; ++ti) {
473  double r1, r2;
474  int cassette, fimin, fimax;
475 #ifdef EDM_ML_DEBUG
476  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: ti " << ti << ":" << fine << " index "
477  << tileFineIndex_.size() << ":" << tileCoarseIndex_.size() << " Phis "
478  << tileFinePhis_.size() << ":" << tileCoarsePhis_.size();
479 #endif
480  if (fine) {
483  cassette = std::get<0>(HGCalTileIndex::tileUnpack(tileFinePhis_[ti]));
484  fimin = std::get<1>(HGCalTileIndex::tileUnpack(tileFinePhis_[ti]));
485  fimax = std::get<2>(HGCalTileIndex::tileUnpack(tileFinePhis_[ti]));
486  } else {
489  cassette = std::get<0>(HGCalTileIndex::tileUnpack(tileCoarsePhis_[ti]));
490  fimin = std::get<1>(HGCalTileIndex::tileUnpack(tileCoarsePhis_[ti]));
491  fimax = std::get<2>(HGCalTileIndex::tileUnpack(tileCoarsePhis_[ti]));
492  }
493 #ifdef EDM_ML_DEBUG
494  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Casstee|Fimin|Fimax " << cassette << ":"
495  << fimin << ":" << fimax;
496 #endif
497  double phi1 = dphi * (fimin - 1);
498  double phi2 = dphi * (fimax - fimin + 1);
499  auto cshift = cassette_.getShift(layer + 1, 1, cassette, true);
500 #ifdef EDM_ML_DEBUG
501  int cassette0 = HGCalCassette::cassetteType(2, 1, cassette); //
502  int ir1 = (fine) ? std::get<1>(HGCalTileIndex::tileUnpack(tileFineIndex_[ti]))
503  : std::get<1>(HGCalTileIndex::tileUnpack(tileCoarseIndex_[ti]));
504  int ir2 = (fine) ? std::get<2>(HGCalTileIndex::tileUnpack(tileFineIndex_[ti]))
505  : std::get<2>(HGCalTileIndex::tileUnpack(tileCoarseIndex_[ti]));
506  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Layer " << copy << ":" << (layer + 1)
507  << " iR " << ir1 << ":" << ir2 << " R " << cms::convert2mm(r1) << ":"
508  << cms::convert2mm(r2) << " Thick " << cms::convert2mm(2.0 * hthickl) << " phi "
509  << fimin << ":" << fimax << ":" << convertRadToDeg(phi1) << ":"
510  << convertRadToDeg(phi2) << " cassette " << cassette << ":" << cassette0
511  << " Shift " << cms::convert2mm(cshift.first) << ":"
512  << cms::convert2mm(cshift.second);
513 #endif
515  ++k;
516  dd4hep::Solid solid = dd4hep::Tube(r1, r2, hthickl, phi1, phi2);
517  ns.addSolidNS(ns.prepend(name), solid);
518  dd4hep::Volume glog1 = dd4hep::Volume(solid.name(), solid, matter1);
519  ns.addVolumeNS(glog1);
520 #ifdef EDM_ML_DEBUG
521  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: " << glog1.name() << " Tubs made of "
522  << matter1.name() << " of dimensions " << cms::convert2mm(r1) << ", "
523  << cms::convert2mm(r2) << ", " << cms::convert2mm(hthickl) << ", "
524  << convertRadToDeg(phi1) << ", " << convertRadToDeg(phi2);
525 #endif
526  dd4hep::Position tran(-cshift.first, cshift.second, zpos);
527  glog.placeVolume(glog1, copy, tran);
528 #ifdef EDM_ML_DEBUG
529  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Position " << glog1.name() << " number "
530  << copy << " in " << glog.name() << " at (" << cms::convert2mm(cshift.first)
531  << ", " << cms::convert2mm(cshift.second) << ", " << cms::convert2mm(zpos)
532  << ") with no rotation";
533 #endif
534  }
535  ++copyNumberTop_[ii];
536  zpos += hthickl;
537  }
538  if (std::abs(thickTot - thick) >= tol2_) {
539  if (thickTot > thick) {
540  edm::LogError("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Thickness of the partition "
541  << cms::convert2mm(thick) << " is smaller than " << cms::convert2mm(thickTot)
542  << ": thickness of all its components in the top part **** ERROR ****";
543  } else {
544  edm::LogWarning("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Thickness of the partition "
545  << cms::convert2mm(thick) << " does not match with " << cms::convert2mm(thickTot)
546  << " of the components in top part";
547  }
548  }
549  } else {
550  int ii = coverTypeTop_;
551  int copy = copyNumberCoverTop_[absType - 1];
552  int layer = (fine) ? (copy - firstFineLayer_) : (copy - firstCoarseLayer_);
553  double hthickl = 0.5 * layerThickTop_[ii];
554  zpos += hthickl;
555  dd4hep::Material matter1 = ns.material(materialTop_[ii]);
556  unsigned int k = 0;
557  int firstTile = (fine) ? tileFineLayerStart_[layer] : tileCoarseLayerStart_[layer];
558  int lastTile = (fine) ? (((layer + 1) < static_cast<int>(tileFineLayerStart_.size()))
560  : static_cast<int>(tileFineIndex_.size()))
561  : (((layer + 1) < static_cast<int>(tileCoarseLayerStart_.size()))
563  : static_cast<int>(tileCoarseIndex_.size()));
564 #ifdef EDM_ML_DEBUG
565  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: TOP Layer " << ii << ":" << layer << " Copy "
566  << copy << " Tiles " << firstTile << ":" << lastTile << " Size "
567  << tileFineIndex_.size() << ":" << tileCoarseIndex_.size() << " Fine " << fine
568  << " absType " << absType;
569 #endif
570  for (int ti = firstTile; ti < lastTile; ++ti) {
571  double r1, r2;
572  int cassette, fimin, fimax;
573 #ifdef EDM_ML_DEBUG
574  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: ti " << ti << ":" << fine << " index "
575  << tileFineIndex_.size() << ":" << tileCoarseIndex_.size() << " Phis "
576  << tileFinePhis_.size() << ":" << tileCoarsePhis_.size();
577 #endif
578  if (fine) {
581  cassette = std::get<0>(HGCalTileIndex::tileUnpack(tileFinePhis_[ti]));
582  fimin = std::get<1>(HGCalTileIndex::tileUnpack(tileFinePhis_[ti]));
583  fimax = std::get<2>(HGCalTileIndex::tileUnpack(tileFinePhis_[ti]));
584  } else {
587  cassette = std::get<0>(HGCalTileIndex::tileUnpack(tileCoarsePhis_[ti]));
588  fimin = std::get<1>(HGCalTileIndex::tileUnpack(tileCoarsePhis_[ti]));
589  fimax = std::get<2>(HGCalTileIndex::tileUnpack(tileCoarsePhis_[ti]));
590  }
591 #ifdef EDM_ML_DEBUG
592  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Casstee|Fimin|Fimax " << cassette << ":"
593  << fimin << ":" << fimax;
594 #endif
595  double phi1 = dphi * (fimin - 1);
596  double phi2 = dphi * (fimax - fimin + 1);
597  auto cshift = cassette_.getShift(layer + 1, 1, cassette, true);
598 #ifdef EDM_ML_DEBUG
599  int cassette0 = HGCalCassette::cassetteType(2, 1, cassette); //
600  int ir1 = (fine) ? std::get<1>(HGCalTileIndex::tileUnpack(tileFineIndex_[ti]))
601  : std::get<1>(HGCalTileIndex::tileUnpack(tileCoarseIndex_[ti]));
602  int ir2 = (fine) ? std::get<2>(HGCalTileIndex::tileUnpack(tileFineIndex_[ti]))
603  : std::get<2>(HGCalTileIndex::tileUnpack(tileCoarseIndex_[ti]));
604  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Layer " << copy << ":" << (layer + 1) << " iR "
605  << ir1 << ":" << ir2 << " R " << cms::convert2mm(r1) << ":" << cms::convert2mm(r2)
606  << " Thick " << cms::convert2mm(2.0 * hthickl) << " phi " << fimin << ":" << fimax
607  << ":" << convertRadToDeg(phi1) << ":" << convertRadToDeg(phi2) << " cassette "
608  << cassette << ":" << cassette0 << " Shift " << cms::convert2mm(cshift.first)
609  << ":" << cms::convert2mm(cshift.second);
610 #endif
612  ++k;
613  dd4hep::Solid solid = dd4hep::Tube(r1, r2, hthickl, phi1, phi2);
614  ns.addSolidNS(ns.prepend(name), solid);
615  dd4hep::Volume glog1 = dd4hep::Volume(solid.name(), solid, matter1);
616  ns.addVolumeNS(glog1);
617 #ifdef EDM_ML_DEBUG
618  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: " << glog1.name() << " Tubs made of "
619  << matter1.name() << " of dimensions " << cms::convert2mm(r1) << ", "
620  << cms::convert2mm(r2) << ", " << cms::convert2mm(hthickl) << ", "
621  << convertRadToDeg(phi1) << ", " << convertRadToDeg(phi2);
622 #endif
623  dd4hep::Position tran(-cshift.first, cshift.second, zpos);
624  glog.placeVolume(glog1, copy, tran);
625 #ifdef EDM_ML_DEBUG
626  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Position " << glog1.name() << " number "
627  << copy << " in " << glog.name() << " at (" << cms::convert2mm(-cshift.first)
628  << ", " << cms::convert2mm(cshift.second) << ", " << cms::convert2mm(zpos)
629  << ") with no rotation";
630 #endif
631  }
632  ++copyNumberCoverTop_[absType - 1];
633  }
634 
635  // Make the bottom part next
636  int layer = (copyM - firstFineLayer_);
637 #ifdef EDM_ML_DEBUG
638  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Start bottom section for layer " << layer
639  << " absType " << absType;
640 #endif
641  if (absType > 0) {
642 #ifdef EDM_ML_DEBUG
643  int kount(0);
644 #endif
645  for (int k = 0; k < cassettes_; ++k) {
646  int cassette = k + 1;
647  auto cshift = cassette_.getShift(layer + 1, -1, cassette);
648  double xpos = -cshift.first;
649  double ypos = cshift.second;
650  int i = layer * cassettes_ + k;
651 #ifdef EDM_ML_DEBUG
652  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette::Passive: layer " << layer + 1 << " cassette "
653  << cassette << " Shift " << cms::convert2mm(-cshift.first) << ":"
654  << cms::convert2mm(cshift.second) << " PassiveIndex " << i << ":"
655  << passiveFull_.size() << ":" << passivePart_.size();
656 #endif
657  std::string passive = (absType <= waferTypes_) ? passiveFull_[i] : passivePart_[i];
658 #ifdef EDM_ML_DEBUG
659  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Passive " << passive << " number " << cassette
660  << " pos " << cms::convert2mm(xpos) << ":" << cms::convert2mm(ypos);
661  kount++;
662 #endif
663  dd4hep::Position tran(xpos, ypos, 0.0);
664  glog.placeVolume(ns.volume(passive), cassette, tran);
665 #ifdef EDM_ML_DEBUG
666  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: " << passive << " number " << cassette
667  << " positioned in " << glog.name() << " at (" << cms::convert2mm(xpos) << ","
668  << cms::convert2mm(ypos) << ",0) with no rotation";
669 #endif
670  }
671 #ifdef EDM_ML_DEBUG
672  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: " << kount << " passives of type " << absType
673  << " for " << glog.name();
674 #endif
675  } else {
676  static const double sqrt3 = std::sqrt(3.0);
677  int layercenter = layerOrient_[layer];
679  int firstWafer = waferLayerStart_[layer];
680  int lastWafer =
681  (((layer + 1) < static_cast<int>(waferLayerStart_.size())) ? waferLayerStart_[layer + 1]
682  : static_cast<int>(waferIndex_.size()));
683  double delx = 0.5 * (waferSize_ + waferSepar_);
684  double dely = 2.0 * delx / sqrt3;
685  double dy = 0.75 * dely;
686  const auto& xyoff = geomTools_.shiftXY(layercenter, (waferSize_ + waferSepar_));
687 #ifdef EDM_ML_DEBUG
688  int ium(0), ivm(0), kount(0);
689  std::vector<int> ntype(3, 0);
690  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette::Bottom: " << glog.name() << " r "
691  << cms::convert2mm(delx) << " R " << cms::convert2mm(dely) << " dy "
692  << cms::convert2mm(dy) << " Shift " << cms::convert2mm(xyoff.first) << ":"
693  << cms::convert2mm(xyoff.second) << " WaferSize "
694  << cms::convert2mm(waferSize_ + waferSepar_) << " index " << firstWafer << ":"
695  << (lastWafer - 1) << " Copy " << copyM << ":" << layer;
696 #endif
697  for (int k = firstWafer; k < lastWafer; ++k) {
700 #ifdef EDM_ML_DEBUG
701  int iu = std::abs(u);
702  int iv = std::abs(v);
703 #endif
704  int nr = 2 * v;
705  int nc = -2 * u + v;
710  int place = HGCalCell::cellPlacementIndex(1, layertype, orien);
711 #ifdef EDM_ML_DEBUG
712  edm::LogVerbatim("HGCalGeom")
713  << "DDHGCalMixRotatedFineCassette::index:Property:layertype:type:part:orien:cassette:place:offsets:ind "
714  << k << waferProperty_[k] << ":" << layertype << ":" << type << ":" << part << ":" << orien << ":"
715  << cassette << ":" << place;
716 #endif
717  auto cshift = cassette_.getShift(layer + 1, -1, cassette, false);
718  double xpos = xyoff.first - cshift.first + nc * delx;
719  double ypos = xyoff.second + cshift.second + nr * dy;
720 #ifdef EDM_ML_DEBUG
721  double xorig = xyoff.first + nc * delx;
722  double yorig = xyoff.second + nr * dy;
723  double angle = std::atan2(yorig, xorig);
724  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette::Wafer: layer " << layer + 1 << " cassette "
725  << cassette << " Shift " << cms::convert2mm(cshift.first) << ":"
726  << cms::convert2mm(cshift.second) << " Original " << cms::convert2mm(xorig) << ":"
727  << cms::convert2mm(yorig) << ":" << convertRadToDeg(angle) << " Final "
728  << cms::convert2mm(xpos) << ":" << cms::convert2mm(ypos);
729 #endif
730  std::string wafer;
731  int i(999);
732  if (part == HGCalTypes::WaferFull) {
734 #ifdef EDM_ML_DEBUG
735  edm::LogVerbatim("HGCalGeom") << " FullWafer type:place:ind " << type << ":" << place << ":" << i << ":"
736  << waferFull_.size();
737 #endif
738  wafer = waferFull_[i];
739  } else {
740  int partoffset =
742  i = (part - partoffset) * facingTypes_ * orientationTypes_ +
744 #ifdef EDM_ML_DEBUG
745  edm::LogVerbatim("HGCalGeom") << " layertype:type:part:orien:cassette:place:offsets:ind " << layertype << ":"
746  << type << ":" << part << ":" << orien << ":" << cassette << ":" << place << ":"
747  << partoffset << ":" << HGCalTypes::WaferTypeOffset[type] << ":" << i << ":"
748  << waferPart_.size();
749 #endif
750  wafer = waferPart_[i];
751  }
752  int copy = HGCalTypes::packTypeUV(type, u, v);
753 #ifdef EDM_ML_DEBUG
754  edm::LogVerbatim("HGCalGeom") << " DDHGCalMixRotatedFineCassette: Layer "
755  << HGCalWaferIndex::waferLayer(waferIndex_[k]) << " Wafer " << wafer << " number "
756  << copy << " type :part:orien:ind " << type << ":" << part << ":" << orien << ":"
757  << i << " layer:u:v " << (layer + firstFineLayer_) << ":" << u << ":" << v;
758  if (iu > ium)
759  ium = iu;
760  if (iv > ivm)
761  ivm = iv;
762  kount++;
763  if (copies_.count(copy) == 0)
764  copies_.insert(copy);
765 #endif
766  dd4hep::Position tran(xpos, ypos, 0.0);
767  glog.placeVolume(ns.volume(wafer), copy, tran);
768 #ifdef EDM_ML_DEBUG
769  ++ntype[type];
770  edm::LogVerbatim("HGCalGeom") << " DDHGCalMixRotatedFineCassette: " << wafer << " number " << copy << " type "
771  << layertype << ":" << type << " positioned in " << glog.name() << " at ("
772  << cms::convert2mm(xpos) << "," << cms::convert2mm(ypos)
773  << ",0) with no rotation";
774 #endif
775  }
776 #ifdef EDM_ML_DEBUG
777  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Maximum # of u " << ium << " # of v " << ivm
778  << " and " << kount << " wafers (" << ntype[0] << ":" << ntype[1] << ":" << ntype[2]
779  << ") for " << glog.name();
780 #endif
781  }
782  }
Log< level::Info, true > LogVerbatim
static int32_t cellPlacementIndex(int32_t iz, int32_t frontBack, int32_t orient)
Definition: HGCalCell.cc:239
static constexpr int32_t WaferPartLDOffset
Definition: HGCalTypes.h:57
static constexpr int32_t WaferTypeOffset[3]
Definition: HGCalTypes.h:61
int32_t waferU(const int32_t index)
int32_t waferLayer(const int32_t index)
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
constexpr NumType convert2mm(NumType length)
Definition: DDutils.h:7
std::pair< double, double > getShift(int layer, int zside, int cassette, bool scnt=false) const
Log< level::Error, false > LogError
int32_t waferOrient(const int32_t property)
std::pair< double, double > shiftXY(int waferPosition, double waferSize) const
static std::string to_string(const XMLCh *ch)
int32_t waferCassette(const int32_t property)
static constexpr int32_t WaferFull
Definition: HGCalTypes.h:35
T sqrt(T t)
Definition: SSEVec.h:23
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int32_t waferThick(const int32_t property)
dd4hep::Volume Volume
ii
Definition: cuy.py:589
std::tuple< int32_t, int32_t, int32_t > tileUnpack(int32_t index)
static constexpr int32_t WaferPartHDOffset
Definition: HGCalTypes.h:58
part
Definition: HCALResponse.h:20
int32_t waferPartial(const int32_t property)
int32_t waferV(const int32_t index)
static int32_t packTypeUV(int type, int u, int v)
Definition: HGCalTypes.cc:3
static constexpr int32_t WaferHDTop
Definition: HGCalTypes.h:51
Log< level::Warning, false > LogWarning
static int cassetteType(int det, int zside, int cassette)
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
static constexpr int32_t layerFrontBack(int32_t layerOrient)
Definition: HGCalTypes.h:137

Member Data Documentation

◆ absorbMode_

int HGCalMixRotatedFineCassette::absorbMode_

Definition at line 797 of file DDHGCalMixRotatedFineCassette.cc.

◆ alpha_

double HGCalMixRotatedFineCassette::alpha_

Definition at line 849 of file DDHGCalMixRotatedFineCassette.cc.

◆ cassette_

HGCalCassette HGCalMixRotatedFineCassette::cassette_

Definition at line 785 of file DDHGCalMixRotatedFineCassette.cc.

◆ cassettes_

int HGCalMixRotatedFineCassette::cassettes_

Definition at line 804 of file DDHGCalMixRotatedFineCassette.cc.

◆ cassetteShift_

std::vector<double> HGCalMixRotatedFineCassette::cassetteShift_

Definition at line 835 of file DDHGCalMixRotatedFineCassette.cc.

◆ cassetteShiftScnt_

std::vector<double> HGCalMixRotatedFineCassette::cassetteShiftScnt_

Definition at line 846 of file DDHGCalMixRotatedFineCassette.cc.

◆ copies_

std::unordered_set<int> HGCalMixRotatedFineCassette::copies_

Definition at line 848 of file DDHGCalMixRotatedFineCassette.cc.

◆ copyNumber_

std::vector<int> HGCalMixRotatedFineCassette::copyNumber_

Definition at line 818 of file DDHGCalMixRotatedFineCassette.cc.

◆ copyNumberCoverTop_

std::vector<int> HGCalMixRotatedFineCassette::copyNumberCoverTop_

Definition at line 830 of file DDHGCalMixRotatedFineCassette.cc.

◆ copyNumberTop_

std::vector<int> HGCalMixRotatedFineCassette::copyNumberTop_

Definition at line 827 of file DDHGCalMixRotatedFineCassette.cc.

◆ cosAlpha_

double HGCalMixRotatedFineCassette::cosAlpha_

Definition at line 849 of file DDHGCalMixRotatedFineCassette.cc.

◆ coverTopLayers_

int HGCalMixRotatedFineCassette::coverTopLayers_

Definition at line 829 of file DDHGCalMixRotatedFineCassette.cc.

◆ coverTypeTop_

int HGCalMixRotatedFineCassette::coverTypeTop_

Definition at line 828 of file DDHGCalMixRotatedFineCassette.cc.

◆ facingTypes_

int HGCalMixRotatedFineCassette::facingTypes_

Definition at line 789 of file DDHGCalMixRotatedFineCassette.cc.

◆ firstCoarseLayer_

int HGCalMixRotatedFineCassette::firstCoarseLayer_

Definition at line 796 of file DDHGCalMixRotatedFineCassette.cc.

◆ firstFineLayer_

int HGCalMixRotatedFineCassette::firstFineLayer_

Definition at line 795 of file DDHGCalMixRotatedFineCassette.cc.

◆ geomTools_

HGCalGeomTools HGCalMixRotatedFineCassette::geomTools_

Definition at line 784 of file DDHGCalMixRotatedFineCassette.cc.

◆ layerOrient_

std::vector<int> HGCalMixRotatedFineCassette::layerOrient_

Definition at line 831 of file DDHGCalMixRotatedFineCassette.cc.

◆ layers_

std::vector<int> HGCalMixRotatedFineCassette::layers_

Definition at line 819 of file DDHGCalMixRotatedFineCassette.cc.

◆ layerSense_

std::vector<int> HGCalMixRotatedFineCassette::layerSense_

Definition at line 822 of file DDHGCalMixRotatedFineCassette.cc.

◆ layerThick_

std::vector<double> HGCalMixRotatedFineCassette::layerThick_

Definition at line 820 of file DDHGCalMixRotatedFineCassette.cc.

◆ layerThickTop_

std::vector<double> HGCalMixRotatedFineCassette::layerThickTop_

Definition at line 825 of file DDHGCalMixRotatedFineCassette.cc.

◆ layerType_

std::vector<int> HGCalMixRotatedFineCassette::layerType_

Definition at line 821 of file DDHGCalMixRotatedFineCassette.cc.

◆ layerTypeTop_

std::vector<int> HGCalMixRotatedFineCassette::layerTypeTop_

Definition at line 826 of file DDHGCalMixRotatedFineCassette.cc.

◆ materials_

std::vector<std::string> HGCalMixRotatedFineCassette::materials_

Definition at line 815 of file DDHGCalMixRotatedFineCassette.cc.

◆ materialTop_

std::vector<std::string> HGCalMixRotatedFineCassette::materialTop_

Definition at line 823 of file DDHGCalMixRotatedFineCassette.cc.

◆ names_

std::vector<std::string> HGCalMixRotatedFineCassette::names_

Definition at line 816 of file DDHGCalMixRotatedFineCassette.cc.

◆ nameSpace_

std::string HGCalMixRotatedFineCassette::nameSpace_

Definition at line 847 of file DDHGCalMixRotatedFineCassette.cc.

◆ namesTop_

std::vector<std::string> HGCalMixRotatedFineCassette::namesTop_

Definition at line 824 of file DDHGCalMixRotatedFineCassette.cc.

◆ orientationTypes_

int HGCalMixRotatedFineCassette::orientationTypes_

Definition at line 790 of file DDHGCalMixRotatedFineCassette.cc.

◆ partialTypes_

int HGCalMixRotatedFineCassette::partialTypes_

Definition at line 791 of file DDHGCalMixRotatedFineCassette.cc.

◆ passiveFull_

std::vector<std::string> HGCalMixRotatedFineCassette::passiveFull_

Definition at line 813 of file DDHGCalMixRotatedFineCassette.cc.

◆ passiveMode_

int HGCalMixRotatedFineCassette::passiveMode_

Definition at line 799 of file DDHGCalMixRotatedFineCassette.cc.

◆ passivePart_

std::vector<std::string> HGCalMixRotatedFineCassette::passivePart_

Definition at line 814 of file DDHGCalMixRotatedFineCassette.cc.

◆ passiveTypes_

int HGCalMixRotatedFineCassette::passiveTypes_

Definition at line 788 of file DDHGCalMixRotatedFineCassette.cc.

◆ phiBinsFineScint_

int HGCalMixRotatedFineCassette::phiBinsFineScint_

Definition at line 794 of file DDHGCalMixRotatedFineCassette.cc.

◆ phiBinsScint_

int HGCalMixRotatedFineCassette::phiBinsScint_

Definition at line 793 of file DDHGCalMixRotatedFineCassette.cc.

◆ placeOffset_

int HGCalMixRotatedFineCassette::placeOffset_

Definition at line 792 of file DDHGCalMixRotatedFineCassette.cc.

◆ rMaxFront_

std::vector<double> HGCalMixRotatedFineCassette::rMaxFront_

Definition at line 810 of file DDHGCalMixRotatedFineCassette.cc.

◆ rMinFront_

std::vector<double> HGCalMixRotatedFineCassette::rMinFront_

Definition at line 807 of file DDHGCalMixRotatedFineCassette.cc.

◆ sectors_

int HGCalMixRotatedFineCassette::sectors_

Definition at line 803 of file DDHGCalMixRotatedFineCassette.cc.

◆ sensitiveMode_

int HGCalMixRotatedFineCassette::sensitiveMode_

Definition at line 798 of file DDHGCalMixRotatedFineCassette.cc.

◆ slopeB_

std::vector<double> HGCalMixRotatedFineCassette::slopeB_

Definition at line 805 of file DDHGCalMixRotatedFineCassette.cc.

◆ slopeT_

std::vector<double> HGCalMixRotatedFineCassette::slopeT_

Definition at line 808 of file DDHGCalMixRotatedFineCassette.cc.

◆ thick_

std::vector<double> HGCalMixRotatedFineCassette::thick_

Definition at line 817 of file DDHGCalMixRotatedFineCassette.cc.

◆ tileCoarseIndex_

std::vector<int> HGCalMixRotatedFineCassette::tileCoarseIndex_

Definition at line 843 of file DDHGCalMixRotatedFineCassette.cc.

◆ tileCoarseLayerStart_

std::vector<int> HGCalMixRotatedFineCassette::tileCoarseLayerStart_

Definition at line 845 of file DDHGCalMixRotatedFineCassette.cc.

◆ tileCoarsePhis_

std::vector<int> HGCalMixRotatedFineCassette::tileCoarsePhis_

Definition at line 844 of file DDHGCalMixRotatedFineCassette.cc.

◆ tileCoarseRMax_

std::vector<double> HGCalMixRotatedFineCassette::tileCoarseRMax_

Definition at line 842 of file DDHGCalMixRotatedFineCassette.cc.

◆ tileCoarseRMin_

std::vector<double> HGCalMixRotatedFineCassette::tileCoarseRMin_

Definition at line 841 of file DDHGCalMixRotatedFineCassette.cc.

◆ tileFineIndex_

std::vector<int> HGCalMixRotatedFineCassette::tileFineIndex_

Definition at line 838 of file DDHGCalMixRotatedFineCassette.cc.

◆ tileFineLayerStart_

std::vector<int> HGCalMixRotatedFineCassette::tileFineLayerStart_

Definition at line 840 of file DDHGCalMixRotatedFineCassette.cc.

◆ tileFinePhis_

std::vector<int> HGCalMixRotatedFineCassette::tileFinePhis_

Definition at line 839 of file DDHGCalMixRotatedFineCassette.cc.

◆ tileFineRMax_

std::vector<double> HGCalMixRotatedFineCassette::tileFineRMax_

Definition at line 837 of file DDHGCalMixRotatedFineCassette.cc.

◆ tileFineRMin_

std::vector<double> HGCalMixRotatedFineCassette::tileFineRMin_

Definition at line 836 of file DDHGCalMixRotatedFineCassette.cc.

◆ tol2_

constexpr double HGCalMixRotatedFineCassette::tol2_ = 0.00001 * dd4hep::mm
static

Definition at line 850 of file DDHGCalMixRotatedFineCassette.cc.

◆ waferFull_

std::vector<std::string> HGCalMixRotatedFineCassette::waferFull_

Definition at line 811 of file DDHGCalMixRotatedFineCassette.cc.

◆ waferIndex_

std::vector<int> HGCalMixRotatedFineCassette::waferIndex_

Definition at line 832 of file DDHGCalMixRotatedFineCassette.cc.

◆ waferLayerStart_

std::vector<int> HGCalMixRotatedFineCassette::waferLayerStart_

Definition at line 834 of file DDHGCalMixRotatedFineCassette.cc.

◆ waferPart_

std::vector<std::string> HGCalMixRotatedFineCassette::waferPart_

Definition at line 812 of file DDHGCalMixRotatedFineCassette.cc.

◆ waferProperty_

std::vector<int> HGCalMixRotatedFineCassette::waferProperty_

Definition at line 833 of file DDHGCalMixRotatedFineCassette.cc.

◆ waferSepar_

double HGCalMixRotatedFineCassette::waferSepar_

Definition at line 802 of file DDHGCalMixRotatedFineCassette.cc.

◆ waferSize_

double HGCalMixRotatedFineCassette::waferSize_

Definition at line 801 of file DDHGCalMixRotatedFineCassette.cc.

◆ waferTypes_

int HGCalMixRotatedFineCassette::waferTypes_

Definition at line 787 of file DDHGCalMixRotatedFineCassette.cc.

◆ zFrontB_

std::vector<double> HGCalMixRotatedFineCassette::zFrontB_

Definition at line 806 of file DDHGCalMixRotatedFineCassette.cc.

◆ zFrontT_

std::vector<double> HGCalMixRotatedFineCassette::zFrontT_

Definition at line 809 of file DDHGCalMixRotatedFineCassette.cc.

◆ zMinBlock_

double HGCalMixRotatedFineCassette::zMinBlock_

Definition at line 800 of file DDHGCalMixRotatedFineCassette.cc.