CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes
DDHGCalMixRotatedFineCassette Class Reference
Inheritance diagram for DDHGCalMixRotatedFineCassette:

Public Member Functions

 DDHGCalMixRotatedFineCassette ()
 
void execute (DDCompactView &cpv) override
 
void initialize (const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
 

Protected Member Functions

void constructLayers (const DDLogicalPart &, DDCompactView &cpv)
 
void positionMix (const DDLogicalPart &glog, const std::string &nameM, int copyM, double thick, const DDMaterial &matter, int absType, bool fine, DDCompactView &cpv)
 

Private 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 Private Attributes

static constexpr double tol1_ = 0.01
 
static constexpr double tol2_ = 0.00001
 

Detailed Description

Definition at line 37 of file DDHGCalMixRotatedFineCassette.cc.

Constructor & Destructor Documentation

◆ DDHGCalMixRotatedFineCassette()

DDHGCalMixRotatedFineCassette::DDHGCalMixRotatedFineCassette ( )

Definition at line 131 of file DDHGCalMixRotatedFineCassette.cc.

131  {
132 #ifdef EDM_ML_DEBUG
133  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Creating an instance";
134 #endif
135 }
Log< level::Info, true > LogVerbatim

Member Function Documentation

◆ constructLayers()

void DDHGCalMixRotatedFineCassette::constructLayers ( const DDLogicalPart module,
DDCompactView cpv 
)
protected

Definition at line 423 of file DDHGCalMixRotatedFineCassette.cc.

References funct::abs(), angle_units::operators::convertRadToDeg(), filterCSVwithJSON::copy, DDBase< N, C >::ddname(), DDSplit(), dqmdumpme::first, mps_fire::i, cuy::ii, l1ctLayer1_patternWriters_cff::isec, isotrackApplyRegressor::k, SiStripPI::min, ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, DDBase< N, C >::name(), mergeVDriftHistosByStation::name, DDSolidFactory::polyhedra(), DDCompactView::position(), HGCalGeomTools::radius(), makeMuonMisalignmentScenario::rot, edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, to_string(), DDSolidFactory::tubs(), and geometryCSVtoXML::zz.

423  {
424  double zi(zMinBlock_);
425  int laymin(0);
426  unsigned int fineLayers = static_cast<unsigned int>(firstCoarseLayer_ - firstFineLayer_);
427  for (unsigned int i = 0; i < layers_.size(); i++) {
428  double zo = zi + layerThick_[i];
429  double routF = HGCalGeomTools::radius(zi, zFrontT_, rMaxFront_, slopeT_);
430  int laymax = laymin + layers_[i];
431  double zz = zi;
432  double thickTot(0);
433  bool fine = (i < fineLayers) ? true : false;
434  for (int ly = laymin; ly < laymax; ++ly) {
435  int ii = layerType_[ly];
436  int copy = copyNumber_[ii];
437  double hthick = 0.5 * thick_[ii];
438  double rinB = HGCalGeomTools::radius(zo, zFrontB_, rMinFront_, slopeB_);
439  zz += hthick;
440  thickTot += thick_[ii];
441 
443 #ifdef EDM_ML_DEBUG
444  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Layer " << ly << ":" << ii << " Front " << zi
445  << ", " << routF << " Back " << zo << ", " << rinB << " superlayer thickness "
446  << layerThick_[i];
447 #endif
449  DDMaterial matter(matName);
450  DDLogicalPart glog;
451  if (layerSense_[ly] == 0) {
452  std::vector<double> pgonZ, pgonRin, pgonRout;
453  double rmax =
455  HGCalGeomTools::radius(zz - hthick,
456  zz + hthick,
457  zFrontB_,
458  rMinFront_,
459  slopeB_,
460  zFrontT_,
461  rMaxFront_,
462  slopeT_,
463  -layerSense_[ly],
464  pgonZ,
465  pgonRin,
466  pgonRout);
467  for (unsigned int isec = 0; isec < pgonZ.size(); ++isec) {
468  pgonZ[isec] -= zz;
469  if (layerSense_[ly] == 0 || absorbMode_ == 0)
470  pgonRout[isec] = rmax;
471  else
472  pgonRout[isec] = pgonRout[isec] * cosAlpha_ - tol1_;
473  }
474  DDSolid solid =
475  DDSolidFactory::polyhedra(DDName(name, nameSpace_), sectors_, -alpha_, 2._pi, pgonZ, pgonRin, pgonRout);
476  glog = DDLogicalPart(solid.ddname(), matter, solid);
477 #ifdef EDM_ML_DEBUG
478  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: " << solid.name() << " polyhedra of "
479  << sectors_ << " sectors covering " << convertRadToDeg(-alpha_) << ":"
480  << convertRadToDeg(-alpha_ + 2._pi) << " with " << pgonZ.size() << " sections";
481  for (unsigned int k = 0; k < pgonZ.size(); ++k)
482  edm::LogVerbatim("HGCalGeom") << "[" << k << "] z " << pgonZ[k] << " R " << pgonRin[k] << ":" << pgonRout[k];
483 #endif
484  } else {
485  int mode = (layerSense_[ly] > 0) ? sensitiveMode_ : absorbMode_;
486  double rins = (mode < 1) ? rinB : HGCalGeomTools::radius(zz + hthick, zFrontB_, rMinFront_, slopeB_);
487  double routs = (mode < 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_);
488  DDSolid solid = DDSolidFactory::tubs(DDName(name, nameSpace_), hthick, rins, routs, 0.0, 2._pi);
489  glog = DDLogicalPart(solid.ddname(), matter, solid);
490 #ifdef EDM_ML_DEBUG
491  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: " << solid.name() << " Tubs made of "
492  << matName << " of dimensions " << rinB << ":" << rins << ", " << routF << ":"
493  << routs << ", " << hthick << ", 0.0, 360.0 and positioned in: " << glog.name()
494  << " number " << copy;
495 #endif
496  positionMix(glog, name, copy, thick_[ii], matter, -layerSense_[ly], fine, cpv);
497  }
498  DDTranslation r1(0, 0, zz);
499  DDRotation rot;
500  cpv.position(glog, module, copy, r1, rot);
501  ++copyNumber_[ii];
502 #ifdef EDM_ML_DEBUG
503  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: " << glog.name() << " number " << copy
504  << " positioned in " << module.name() << " at " << r1 << " with no rotation";
505 #endif
506  zz += hthick;
507  } // End of loop over layers in a block
508  zi = zo;
509  laymin = laymax;
510  // Make consistency check of all the partitions of the block
511  if (std::abs(thickTot - layerThick_[i]) >= tol2_) {
512  if (thickTot > layerThick_[i]) {
513  edm::LogError("HGCalGeom") << "Thickness of the partition " << layerThick_[i] << " is smaller than " << thickTot
514  << ": thickness of all its components **** ERROR ****";
515  } else {
516  edm::LogWarning("HGCalGeom") << "Thickness of the partition " << layerThick_[i] << " does not match with "
517  << thickTot << " of the components";
518  }
519  }
520  } // End of loop over blocks
521 }
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)
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
Log< level::Error, false > LogError
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
static std::string to_string(const XMLCh *ch)
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
U second(std::pair< T, U > const &p)
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:667
ii
Definition: cuy.py:589
const N & name() const
Definition: DDBase.h:58
const N & ddname() const
Definition: DDBase.h:60
void positionMix(const DDLogicalPart &glog, const std::string &nameM, int copyM, double thick, const DDMaterial &matter, int absType, bool fine, DDCompactView &cpv)
Log< level::Warning, false > LogWarning
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
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:565

◆ execute()

void DDHGCalMixRotatedFineCassette::execute ( DDCompactView cpv)
override

Definition at line 405 of file DDHGCalMixRotatedFineCassette.cc.

References DDHGCalGeom::constructLayers(), isotrackApplyRegressor::k, and class-composition::parent.

405  {
406 #ifdef EDM_ML_DEBUG
407  edm::LogVerbatim("HGCalGeom") << "==>> Constructing DDHGCalMixRotatedFineCassette...";
408  copies_.clear();
409 #endif
410  constructLayers(parent(), cpv);
411 #ifdef EDM_ML_DEBUG
412  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: " << copies_.size()
413  << " different wafer copy numbers";
414  int k(0);
415  for (std::unordered_set<int>::const_iterator itr = copies_.begin(); itr != copies_.end(); ++itr, ++k) {
416  edm::LogVerbatim("HGCalGeom") << "Copy [" << k << "] : " << (*itr);
417  }
418  copies_.clear();
419  edm::LogVerbatim("HGCalGeom") << "<<== End of DDHGCalMixRotatedFineCassette construction...";
420 #endif
421 }
Log< level::Info, true > LogVerbatim
void constructLayers(const DDLogicalPart &, DDCompactView &cpv)

◆ initialize()

void DDHGCalMixRotatedFineCassette::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 137 of file DDHGCalMixRotatedFineCassette.cc.

References angle_units::operators::convertRadToDeg(), funct::cos(), dbl_to_int(), mps_fire::i, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, cuy::ii, dqmiolumiharvest::j, isotrackApplyRegressor::k, HGCalTypes::layerType(), M_PI, SiStripPI::min, DDCurrentNamespace::ns(), funct::sin(), HGCalTileIndex::tileUnpack(), HGCalWaferIndex::waferLayer(), HGCalProperty::waferOrient(), HGCalProperty::waferPartial(), HGCalProperty::waferThick(), HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

141  {
142  waferTypes_ = static_cast<int>(nArgs["WaferTypes"]);
143  passiveTypes_ = static_cast<int>(nArgs["PassiveTypes"]);
144  facingTypes_ = static_cast<int>(nArgs["FacingTypes"]);
145  orientationTypes_ = static_cast<int>(nArgs["OrientationTypes"]);
146  partialTypes_ = static_cast<int>(nArgs["PartialTypes"]);
147  placeOffset_ = static_cast<int>(nArgs["PlaceOffset"]);
148  phiBinsScint_ = static_cast<int>(nArgs["NPhiBinScint"]);
149  phiBinsFineScint_ = static_cast<int>(nArgs["NPhiBinFineScint"]);
150 #ifdef EDM_ML_DEBUG
151  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette::Number of types of wafers: " << waferTypes_
152  << " passives: " << passiveTypes_ << " facings: " << facingTypes_
153  << " Orientations: " << orientationTypes_ << " PartialTypes: " << partialTypes_
154  << " PlaceOffset: " << placeOffset_ << "; number of cells along phi "
155  << phiBinsFineScint_ << ":" << phiBinsScint_;
156 #endif
157  firstFineLayer_ = static_cast<int>(nArgs["FirstFineLayer"]);
158  firstCoarseLayer_ = static_cast<int>(nArgs["FirstCoarseLayer"]);
159  absorbMode_ = static_cast<int>(nArgs["AbsorberMode"]);
160  sensitiveMode_ = static_cast<int>(nArgs["SensitiveMode"]);
161  passiveMode_ = static_cast<int>(nArgs["PassiveMode"]);
162 #ifdef EDM_ML_DEBUG
163  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette::First Layers " << firstFineLayer_ << ":"
164  << firstCoarseLayer_ << " and Absober:Sensitive mode " << absorbMode_ << ":"
165  << sensitiveMode_ << ":" << passiveMode_;
166 #endif
167  zMinBlock_ = nArgs["zMinBlock"];
168  waferSize_ = nArgs["waferSize"];
169  waferSepar_ = nArgs["SensorSeparation"];
170  sectors_ = static_cast<int>(nArgs["Sectors"]);
171  cassettes_ = static_cast<int>(nArgs["Cassettes"]);
172  alpha_ = (1._pi) / sectors_;
173  cosAlpha_ = cos(alpha_);
174 #ifdef EDM_ML_DEBUG
175  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: zStart " << zMinBlock_ << " wafer width "
176  << waferSize_ << " separations " << waferSepar_ << " sectors " << sectors_ << ":"
177  << convertRadToDeg(alpha_) << ":" << cosAlpha_ << " with " << cassettes_
178  << " cassettes";
179 #endif
180  slopeB_ = vArgs["SlopeBottom"];
181  zFrontB_ = vArgs["ZFrontBottom"];
182  rMinFront_ = vArgs["RMinFront"];
183  slopeT_ = vArgs["SlopeTop"];
184  zFrontT_ = vArgs["ZFrontTop"];
185  rMaxFront_ = vArgs["RMaxFront"];
186 #ifdef EDM_ML_DEBUG
187  for (unsigned int i = 0; i < slopeB_.size(); ++i)
188  edm::LogVerbatim("HGCalGeom") << "Bottom Block [" << i << "] Zmin " << zFrontB_[i] << " Rmin " << rMinFront_[i]
189  << " Slope " << slopeB_[i];
190  for (unsigned int i = 0; i < slopeT_.size(); ++i)
191  edm::LogVerbatim("HGCalGeom") << "Top Block [" << i << "] Zmin " << zFrontT_[i] << " Rmax " << rMaxFront_[i]
192  << " Slope " << slopeT_[i];
193 #endif
194  waferFull_ = vsArgs["WaferNamesFull"];
195  waferPart_ = vsArgs["WaferNamesPartial"];
196 #ifdef EDM_ML_DEBUG
197  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: " << waferFull_.size() << " full and "
198  << waferPart_.size() << " partial modules\nDDHGCalMixRotatedFineCassette:Full Modules:";
199  unsigned int i1max = static_cast<unsigned int>(waferFull_.size());
200  for (unsigned int i1 = 0; i1 < i1max; i1 += 2) {
201  std::ostringstream st1;
202  unsigned int i2 = std::min((i1 + 2), i1max);
203  for (unsigned int i = i1; i < i2; ++i)
204  st1 << " [" << i << "] " << waferFull_[i];
205  edm::LogVerbatim("HGCalGeom") << st1.str();
206  }
207  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Partial Modules:";
208  i1max = static_cast<unsigned int>(waferPart_.size());
209  for (unsigned int i1 = 0; i1 < i1max; i1 += 2) {
210  std::ostringstream st1;
211  unsigned int i2 = std::min((i1 + 2), i1max);
212  for (unsigned int i = i1; i < i2; ++i)
213  st1 << " [" << i << "] " << waferPart_[i];
214  edm::LogVerbatim("HGCalGeom") << st1.str();
215  }
216 #endif
217  passiveFull_ = vsArgs["PassiveNamesFull"];
218  passivePart_ = vsArgs["PassiveNamesPartial"];
219 #ifdef EDM_ML_DEBUG
220  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedCassette: " << passiveFull_.size() << " full and "
221  << passivePart_.size() << " partial passive modules";
222  i1max = static_cast<unsigned int>(passiveFull_.size());
223  for (unsigned int i1 = 0; i1 < i1max; i1 += 2) {
224  std::ostringstream st1;
225  unsigned int i2 = std::min((i1 + 2), i1max);
226  for (unsigned int i = i1; i < i2; ++i)
227  st1 << " [" << i << "] " << passiveFull_[i];
228  edm::LogVerbatim("HGCalGeom") << st1.str();
229  }
230  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedCassette: Partial Modules:";
231  i1max = static_cast<unsigned int>(passivePart_.size());
232  for (unsigned int i1 = 0; i1 < i1max; i1 += 2) {
233  std::ostringstream st1;
234  unsigned int i2 = std::min((i1 + 2), i1max);
235  for (unsigned int i = i1; i < i2; ++i)
236  st1 << " [" << i << "] " << passivePart_[i];
237  edm::LogVerbatim("HGCalGeom") << st1.str();
238  }
239 #endif
240  materials_ = vsArgs["MaterialNames"];
241  names_ = vsArgs["VolumeNames"];
242  thick_ = vArgs["Thickness"];
243  copyNumber_.resize(materials_.size(), 1);
244 #ifdef EDM_ML_DEBUG
245  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: " << materials_.size() << " types of volumes";
246  for (unsigned int i = 0; i < names_.size(); ++i)
247  edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << names_[i] << " of thickness " << thick_[i]
248  << " filled with " << materials_[i] << " first copy number " << copyNumber_[i];
249 #endif
250  layers_ = dbl_to_int(vArgs["Layers"]);
251  layerThick_ = vArgs["LayerThick"];
252 #ifdef EDM_ML_DEBUG
253  edm::LogVerbatim("HGCalGeom") << "There are " << layers_.size() << " blocks";
254  for (unsigned int i = 0; i < layers_.size(); ++i)
255  edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] of thickness " << layerThick_[i] << " with " << layers_[i]
256  << " layers";
257 #endif
258  layerType_ = dbl_to_int(vArgs["LayerType"]);
259  layerSense_ = dbl_to_int(vArgs["LayerSense"]);
260  layerOrient_ = dbl_to_int(vArgs["LayerTypes"]);
261  for (unsigned int k = 0; k < layerOrient_.size(); ++k)
263 #ifdef EDM_ML_DEBUG
264  for (unsigned int i = 0; i < layerOrient_.size(); ++i)
265  edm::LogVerbatim("HGCalGeom") << "LayerOrient [" << i << "] " << layerOrient_[i];
266 #endif
267  if (firstFineLayer_ > 0) {
268  for (unsigned int i = 0; i < layerType_.size(); ++i) {
269  if (layerSense_[i] != 0) {
270  int ii = layerType_[i];
272 #ifdef EDM_ML_DEBUG
273  edm::LogVerbatim("HGCalGeom") << "First copy number for layer type " << i << ":" << ii << " with "
274  << materials_[ii] << " changed to " << copyNumber_[ii];
275 #endif
276  }
277  }
278  } else {
279  firstFineLayer_ = 1;
280  }
281 #ifdef EDM_ML_DEBUG
282  edm::LogVerbatim("HGCalGeom") << "There are " << layerType_.size() << " layers";
283  for (unsigned int i = 0; i < layerType_.size(); ++i)
284  edm::LogVerbatim("HGCalGeom") << "Layer [" << i << "] with material type " << layerType_[i] << " sensitive class "
285  << layerSense_[i];
286 #endif
287  materialTop_ = vsArgs["TopMaterialNames"];
288  namesTop_ = vsArgs["TopVolumeNames"];
289  layerThickTop_ = vArgs["TopLayerThickness"];
290  layerTypeTop_ = dbl_to_int(vArgs["TopLayerType"]);
292  coverTypeTop_ = static_cast<int>(nArgs["TopCoverLayerType"]);
293  coverTopLayers_ = static_cast<int>(nArgs["TopCoverLayers"]);
295 #ifdef EDM_ML_DEBUG
296  std::ostringstream st0;
297  for (int k = 0; k < coverTopLayers_; ++k)
298  st0 << " " << copyNumberCoverTop_[k];
299  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: " << materialTop_.size()
300  << " types of volumes in the top part; " << coverTopLayers_ << " covers of Type "
301  << coverTypeTop_ << " with initial copy numbers: " << st0.str();
302  for (unsigned int i = 0; i < materialTop_.size(); ++i)
303  edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << namesTop_[i] << " of thickness " << layerThickTop_[i]
304  << " filled with " << materialTop_[i] << " first copy number " << copyNumberTop_[i];
305  edm::LogVerbatim("HGCalGeom") << "There are " << layerTypeTop_.size() << " layers in the top part";
306  for (unsigned int i = 0; i < layerTypeTop_.size(); ++i)
307  edm::LogVerbatim("HGCalGeom") << "Layer [" << i << "] with material type " << layerTypeTop_[i];
308 #endif
309  waferIndex_ = dbl_to_int(vArgs["WaferIndex"]);
310  waferProperty_ = dbl_to_int(vArgs["WaferProperties"]);
311  waferLayerStart_ = dbl_to_int(vArgs["WaferLayerStart"]);
312  cassetteShift_ = vArgs["CassetteShift"];
313 #ifdef EDM_ML_DEBUG
314  edm::LogVerbatim("HGCalGeom") << "waferProperties with " << waferIndex_.size() << " entries in "
315  << waferLayerStart_.size() << " layers";
316  for (unsigned int k = 0; k < waferLayerStart_.size(); ++k)
317  edm::LogVerbatim("HGCalGeom") << "LayerStart[" << k << "] " << waferLayerStart_[k];
318  for (unsigned int k = 0; k < waferIndex_.size(); ++k)
319  edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << waferIndex_[k] << " ("
322  << HGCalWaferIndex::waferV(waferIndex_[k]) << ") : ("
326  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: " << cassetteShift_.size()
327  << " elements for cassette shifts";
328  unsigned int j1max = cassetteShift_.size();
329  for (unsigned int j1 = 0; j1 < j1max; j1 += 6) {
330  std::ostringstream st1;
331  unsigned int j2 = std::min((j1 + 6), j1max);
332  for (unsigned int j = j1; j < j2; ++j)
333  st1 << " [" << j << "] " << std::setw(9) << cassetteShift_[j];
334  edm::LogVerbatim("HGCalGeom") << st1.str();
335  }
336 #endif
337  tileFineRMin_ = vArgs["Tile6RMin"];
338  tileFineRMax_ = vArgs["Tile6RMax"];
339  tileFineIndex_ = dbl_to_int(vArgs["Tile6LayerRings"]);
340  tileFinePhis_ = dbl_to_int(vArgs["Tile6PhiRange"]);
341  tileFineLayerStart_ = dbl_to_int(vArgs["Tile6LayerStart"]);
342  tileCoarseRMin_ = vArgs["TileRMin"];
343  tileCoarseRMax_ = vArgs["TileRMax"];
344  tileCoarseIndex_ = dbl_to_int(vArgs["TileLayerRings"]);
345  tileCoarsePhis_ = dbl_to_int(vArgs["TilePhiRange"]);
346  tileCoarseLayerStart_ = dbl_to_int(vArgs["TileLayerStart"]);
347 #ifdef EDM_ML_DEBUG
348  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette:: with " << tileFineRMin_.size() << ":"
349  << tileCoarseRMin_.size() << " rings";
350  for (unsigned int k = 0; k < tileFineRMin_.size(); ++k)
351  edm::LogVerbatim("HGCalGeom") << "Fine Ring[" << k << "] " << tileFineRMin_[k] << " : " << tileFineRMax_[k];
352  for (unsigned int k = 0; k < tileCoarseRMin_.size(); ++k)
353  edm::LogVerbatim("HGCalGeom") << "Coarse Ring[" << k << "] " << tileCoarseRMin_[k] << " : " << tileCoarseRMax_[k];
354  edm::LogVerbatim("HGCalGeom") << "TileProperties with " << tileFineIndex_.size() << ":" << tileCoarseIndex_.size()
355  << " entries in " << tileFineLayerStart_.size() << ":" << tileCoarseLayerStart_.size()
356  << " layers";
357  for (unsigned int k = 0; k < tileFineLayerStart_.size(); ++k)
358  edm::LogVerbatim("HGCalGeom") << "FineLayerStart[" << k << "] " << tileFineLayerStart_[k];
359  for (unsigned int k = 0; k < tileCoarseLayerStart_.size(); ++k)
360  edm::LogVerbatim("HGCalGeom") << "CoarseLayerStart[" << k << "] " << tileCoarseLayerStart_[k];
361  for (unsigned int k = 0; k < tileFineIndex_.size(); ++k)
362  edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << tileFineIndex_[k] << " ("
363  << "Layer " << std::get<0>(HGCalTileIndex::tileUnpack(tileFineIndex_[k])) << " Ring "
364  << std::get<1>(HGCalTileIndex::tileUnpack(tileFineIndex_[k])) << ":"
365  << std::get<2>(HGCalTileIndex::tileUnpack(tileFineIndex_[k])) << ") Phi "
366  << std::get<1>(HGCalTileIndex::tileUnpack(tileFinePhis_[k])) << ":"
367  << std::get<2>(HGCalTileIndex::tileUnpack(tileFinePhis_[k]));
368  for (unsigned int k = 0; k < tileCoarseIndex_.size(); ++k)
369  edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << tileCoarseIndex_[k] << " ("
370  << "Layer " << std::get<0>(HGCalTileIndex::tileUnpack(tileCoarseIndex_[k]))
371  << " Ring " << std::get<1>(HGCalTileIndex::tileUnpack(tileCoarseIndex_[k])) << ":"
372  << std::get<2>(HGCalTileIndex::tileUnpack(tileCoarseIndex_[k])) << ") Phi "
373  << std::get<1>(HGCalTileIndex::tileUnpack(tileCoarsePhis_[k])) << ":"
374  << std::get<2>(HGCalTileIndex::tileUnpack(tileCoarsePhis_[k]));
375 #endif
376  std::vector<double> retract = vArgs["ScintRetract"];
377  double dphi = M_PI / cassettes_;
378  for (int k = 0; k < cassettes_; ++k) {
379  double phi = (2 * k + 1) * dphi;
380  cassetteShiftScnt_.emplace_back(retract[k] * cos(phi));
381  cassetteShiftScnt_.emplace_back(retract[k] * sin(phi));
382  }
383 #ifdef EDM_ML_DEBUG
384  unsigned int j2max = cassetteShiftScnt_.size();
385  for (unsigned int j1 = 0; j1 < j2max; j1 += 6) {
386  std::ostringstream st1;
387  unsigned int j2 = std::min((j1 + 6), j2max);
388  for (unsigned int j = j1; j < j2; ++j)
389  st1 << " [" << j << "] " << std::setw(9) << cassetteShiftScnt_[j];
390  edm::LogVerbatim("HGCalGeom") << st1.str();
391  }
392 #endif
394 #ifdef EDM_ML_DEBUG
395  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: NameSpace " << nameSpace_ << ":";
396 #endif
399 }
Log< level::Info, true > LogVerbatim
int32_t waferU(const int32_t index)
int32_t waferLayer(const int32_t index)
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
static std::string & ns()
int32_t waferOrient(const int32_t property)
void setParameterScint(const std::vector< double > &shifts)
Cos< T >::type cos(const T &t)
Definition: Cos.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
ii
Definition: cuy.py:589
#define M_PI
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
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)
static int32_t layerType(int type)
Definition: HGCalTypes.cc:42

◆ positionMix()

void DDHGCalMixRotatedFineCassette::positionMix ( const DDLogicalPart glog,
const std::string &  nameM,
int  copyM,
double  thick,
const DDMaterial matter,
int  absType,
bool  fine,
DDCompactView cpv 
)
protected

Definition at line 523 of file DDHGCalMixRotatedFineCassette.cc.

References funct::abs(), angle(), Matriplex::atan2(), HGCalCassette::cassetteType(), HGCalCell::cellPlacementIndex(), angle_units::operators::convertRadToDeg(), filterCSVwithJSON::copy, DDBase< N, C >::ddname(), DDSplit(), PVValHelper::dy, dqmdumpme::first, mps_fire::i, cuy::ii, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::iv, isotrackApplyRegressor::k, HGCalTypes::layerFrontBack(), DDBase< N, C >::name(), mergeVDriftHistosByStation::name, EgHLTOffHistBins_cfi::nr, HGCalTypes::packTypeUV(), DDCompactView::position(), diffTwoXMLs::r2, makeMuonMisalignmentScenario::rot, idealTransformation::rotation, edm::second(), mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, HGCalTileIndex::tileUnpack(), to_string(), DDSolidFactory::tubs(), findQualityFiles::v, 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().

530  {
531  DDRotation rot;
532 
533  // Make the top part first
534  for (unsigned int ly = 0; ly < layerTypeTop_.size(); ++ly) {
535  int ii = layerTypeTop_[ly];
536  copyNumberTop_[ii] = copyM;
537  }
538  double hthick = 0.5 * thick;
539  double dphi = (fine) ? ((2._pi) / phiBinsFineScint_) : ((2._pi) / phiBinsScint_);
540  double thickTot(0), zpos(-hthick);
541 #ifdef EDM_ML_DEBUG
542  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Entry to positionMix with Name " << nameM << " copy "
543  << copyM << " Thick " << thick << " AbsType " << absType << " Fine " << fine << " dphi "
544  << convertRadToDeg(dphi);
545 #endif
546  if (absType < 0) {
547  for (unsigned int ly = 0; ly < layerTypeTop_.size(); ++ly) {
548  int ii = layerTypeTop_[ly];
549  int copy = copyNumberTop_[ii];
550  int layer = (fine) ? (copy - firstFineLayer_) : (copy - firstCoarseLayer_);
551  double hthickl = 0.5 * layerThickTop_[ii];
552  thickTot += layerThickTop_[ii];
553  zpos += hthickl;
555  DDMaterial matter1(matName);
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: Layer " << ly << ":" << ii << ":" << layer
566  << " Copy " << 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 " << r1 << ":" << r2 << " Thick " << (2.0 * hthickl)
606  << " phi " << fimin << ":" << fimax << ":" << convertRadToDeg(phi1) << ":"
607  << convertRadToDeg(phi2) << " cassette " << cassette << ":" << cassette0
608  << " Shift " << cshift.first << ":" << cshift.second;
609 #endif
611  ++k;
612  DDSolid solid = DDSolidFactory::tubs(DDName(name, nameSpace_), hthickl, r1, r2, phi1, phi2);
613  DDLogicalPart glog1 = DDLogicalPart(solid.ddname(), matter1, solid);
614 #ifdef EDM_ML_DEBUG
615  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: " << glog1.name() << " Tubs made of "
616  << matName << " of dimensions " << r1 << ", " << r2 << ", " << hthickl << ", "
617  << convertRadToDeg(phi1) << ", " << convertRadToDeg(phi2);
618 #endif
619  DDTranslation tran(-cshift.first, cshift.second, zpos);
620  cpv.position(glog1, glog, copy, tran, rot);
621 #ifdef EDM_ML_DEBUG
622  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Position " << glog1.name() << " number "
623  << copy << " in " << glog.name() << " at " << tran << " with no rotation";
624 #endif
625  }
626  ++copyNumberTop_[ii];
627  zpos += hthickl;
628  }
629  if (std::abs(thickTot - thick) >= tol2_) {
630  if (thickTot > thick) {
631  edm::LogError("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Thickness of the partition " << thick
632  << " is smaller than " << thickTot
633  << ": thickness of all its components in the top part **** ERROR ****";
634  } else {
635  edm::LogWarning("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Thickness of the partition " << thick
636  << " does not match with " << thickTot << " of the components in top part";
637  }
638  }
639  } else {
640  int ii = coverTypeTop_;
641  int copy = copyNumberCoverTop_[absType - 1];
642  int layer = (fine) ? (copy - firstFineLayer_) : (copy - firstCoarseLayer_);
643  double hthickl = 0.5 * layerThickTop_[ii];
644  zpos += hthickl;
646  DDMaterial matter1(matName);
647  unsigned int k = 0;
648  int firstTile = (fine) ? tileFineLayerStart_[layer] : tileCoarseLayerStart_[layer];
649  int lastTile =
650  (fine) ? ((layer + 1 < static_cast<int>(tileFineLayerStart_.size())) ? tileFineLayerStart_[layer + 1]
651  : static_cast<int>(tileFineIndex_.size()))
652  : ((layer + 1 < static_cast<int>(tileCoarseLayerStart_.size()))
654  : static_cast<int>(tileCoarseIndex_.size()));
655 #ifdef EDM_ML_DEBUG
656  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: TOP Layer " << ii << ":" << layer << " Copy "
657  << copy << " Tiles " << firstTile << ":" << lastTile << " Size "
658  << tileFineIndex_.size() << ":" << tileCoarseIndex_.size() << " Fine " << fine
659  << " absType " << absType;
660 #endif
661  for (int ti = firstTile; ti < lastTile; ++ti) {
662  double r1, r2;
663  int cassette, fimin, fimax;
664 #ifdef EDM_ML_DEBUG
665  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: ti " << ti << ":" << fine << " index "
666  << tileFineIndex_.size() << ":" << tileCoarseIndex_.size() << " Phis "
667  << tileFinePhis_.size() << ":" << tileCoarsePhis_.size();
668 #endif
669  if (fine) {
672  cassette = std::get<0>(HGCalTileIndex::tileUnpack(tileFinePhis_[ti]));
673  fimin = std::get<1>(HGCalTileIndex::tileUnpack(tileFinePhis_[ti]));
674  fimax = std::get<2>(HGCalTileIndex::tileUnpack(tileFinePhis_[ti]));
675  } else {
678  cassette = std::get<0>(HGCalTileIndex::tileUnpack(tileCoarsePhis_[ti]));
679  fimin = std::get<1>(HGCalTileIndex::tileUnpack(tileCoarsePhis_[ti]));
680  fimax = std::get<2>(HGCalTileIndex::tileUnpack(tileCoarsePhis_[ti]));
681  }
682 #ifdef EDM_ML_DEBUG
683  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Casstee|Fimin|Fimax " << cassette << ":" << fimin
684  << ":" << fimax;
685 #endif
686  double phi1 = dphi * (fimin - 1);
687  double phi2 = dphi * (fimax - fimin + 1);
688  auto cshift = cassette_.getShift(layer + 1, 1, cassette, true);
689 #ifdef EDM_ML_DEBUG
690  int cassette0 = HGCalCassette::cassetteType(2, 1, cassette); //
691  int ir1 = (fine) ? std::get<1>(HGCalTileIndex::tileUnpack(tileFineIndex_[ti]))
692  : std::get<1>(HGCalTileIndex::tileUnpack(tileCoarseIndex_[ti]));
693  int ir2 = (fine) ? std::get<2>(HGCalTileIndex::tileUnpack(tileFineIndex_[ti]))
694  : std::get<2>(HGCalTileIndex::tileUnpack(tileCoarseIndex_[ti]));
695  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Layer " << copy << ":" << (layer + 1) << " iR "
696  << ir1 << ":" << ir2 << " R " << r1 << ":" << r2 << " Thick " << (2.0 * hthickl)
697  << " phi " << fimin << ":" << fimax << ":" << convertRadToDeg(phi1) << ":"
698  << convertRadToDeg(phi2) << " cassette " << cassette << ":" << cassette0
699  << " Shift " << cshift.first << ":" << cshift.second;
700 #endif
702  ++k;
703  DDSolid solid = DDSolidFactory::tubs(DDName(name, nameSpace_), hthickl, r1, r2, phi1, phi2);
704  DDLogicalPart glog1 = DDLogicalPart(solid.ddname(), matter1, solid);
705 #ifdef EDM_ML_DEBUG
706  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: " << glog1.name() << " Tubs made of " << matName
707  << " of dimensions " << r1 << ", " << r2 << ", " << hthickl << ", "
708  << convertRadToDeg(phi1) << ", " << convertRadToDeg(phi2);
709 #endif
710  DDTranslation tran(-cshift.first, cshift.second, zpos);
711  cpv.position(glog1, glog, copy, tran, rot);
712 #ifdef EDM_ML_DEBUG
713  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Position " << glog1.name() << " number " << copy
714  << " in " << glog.name() << " at " << tran << " with no rotation";
715 #endif
716  }
717  ++copyNumberCoverTop_[absType - 1];
718  }
719 
720  // Make the bottom part next
721  int layer = (copyM - firstFineLayer_);
722 #ifdef EDM_ML_DEBUG
723  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Start bottom section for layer " << layer
724  << " absType " << absType;
725 #endif
726  if (absType > 0) {
727 #ifdef EDM_ML_DEBUG
728  int kount(0);
729 #endif
730  for (int k = 0; k < cassettes_; ++k) {
731  int cassette = k + 1;
732  auto cshift = cassette_.getShift(layer + 1, -1, cassette);
733  double xpos = -cshift.first;
734  double ypos = cshift.second;
735  int i = layer * cassettes_ + k;
736 #ifdef EDM_ML_DEBUG
737  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette::Passive: layer " << layer + 1 << " cassette "
738  << cassette << " Shift " << cshift.first << ":" << cshift.second << " PassiveIndex "
739  << i << ":" << passiveFull_.size() << ":" << passivePart_.size();
740 #endif
741  std::string passive = (absType <= waferTypes_) ? passiveFull_[i] : passivePart_[i];
742 #ifdef EDM_ML_DEBUG
743  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Passive " << passive << " number " << cassette
744  << " pos " << xpos << ":" << ypos;
745  kount++;
746 #endif
747  DDTranslation tran(xpos, ypos, 0.0);
749  DDName name = DDName(DDSplit(passive).first, DDSplit(passive).second);
750  cpv.position(name, glog.ddname(), cassette, tran, rotation);
751 #ifdef EDM_ML_DEBUG
752  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: " << name << " number " << cassette
753  << " positioned in " << glog.ddname() << " at " << tran << " with no rotation";
754 #endif
755  }
756 #ifdef EDM_ML_DEBUG
757  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: " << kount << " passives of type " << absType
758  << " for " << glog.ddname();
759 #endif
760  } else {
761  static const double sqrt3 = std::sqrt(3.0);
762  int layercenter = layerOrient_[layer];
764  int firstWafer = waferLayerStart_[layer];
765  int lastWafer = ((layer + 1 < static_cast<int>(waferLayerStart_.size())) ? waferLayerStart_[layer + 1]
766  : static_cast<int>(waferIndex_.size()));
767  double delx = 0.5 * (waferSize_ + waferSepar_);
768  double dely = 2.0 * delx / sqrt3;
769  double dy = 0.75 * dely;
770  const auto& xyoff = geomTools_.shiftXY(layercenter, (waferSize_ + waferSepar_));
771 #ifdef EDM_ML_DEBUG
772  int ium(0), ivm(0), kount(0);
773  std::vector<int> ntype(3, 0);
774  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette::Bottom: " << glog.ddname() << " r " << delx
775  << " R " << dely << " dy " << dy << " Shift " << xyoff.first << ":" << xyoff.second
776  << " WaferSize " << (waferSize_ + waferSepar_) << " index " << firstWafer << ":"
777 
778  << (lastWafer - 1) << " Copy " << copyM << ":" << layer;
779 #endif
780  for (int k = firstWafer; k < lastWafer; ++k) {
783 #ifdef EDM_ML_DEBUG
784  int iu = std::abs(u);
785  int iv = std::abs(v);
786 #endif
787  int nr = 2 * v;
788  int nc = -2 * u + v;
793  int place = HGCalCell::cellPlacementIndex(1, layertype, orien);
794 #ifdef EDM_ML_DEBUG
795  edm::LogVerbatim("HGCalGeom")
796  << "DDHGCalMixRotatedFineCassette::index:Property:layertype:type:part:orien:cassette:place:offsets:ind " << k
797  << ":" << waferProperty_[k] << ":" << layertype << ":" << type << ":" << part << ":" << orien << ":"
798  << cassette << ":" << place;
799 #endif
800  auto cshift = cassette_.getShift(layer + 1, -1, cassette, false);
801  double xpos = xyoff.first - cshift.first + nc * delx;
802  double ypos = xyoff.second + cshift.second + nr * dy;
803 #ifdef EDM_ML_DEBUG
804  double xorig = xyoff.first + nc * delx;
805  double yorig = xyoff.second + nr * dy;
806  double angle = std::atan2(yorig, xorig);
807  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette::Wafer: layer " << layer + 1 << " cassette "
808  << cassette << " Shift " << cshift.first << ":" << cshift.second << " Original "
809  << xorig << ":" << yorig << ":" << convertRadToDeg(angle) << " Final " << xpos
810  << ":" << ypos;
811 #endif
812  std::string wafer;
813  int i(999);
814  if (part == HGCalTypes::WaferFull) {
816 #ifdef EDM_ML_DEBUG
817  edm::LogVerbatim("HGCalGeom") << " FullWafer type:place:ind " << type << ":" << place << ":" << i << ":"
818  << waferFull_.size();
819 #endif
820  wafer = waferFull_[i];
821  } else {
822  int partoffset =
824  i = (part - partoffset) * facingTypes_ * orientationTypes_ +
826 #ifdef EDM_ML_DEBUG
827  edm::LogVerbatim("HGCalGeom") << " layertype:type:part:orien:cassette:place:offsets:ind " << layertype << ":"
828  << type << ":" << part << ":" << orien << ":" << cassette << ":" << place << ":"
829  << partoffset << ":" << HGCalTypes::WaferTypeOffset[type] << ":" << i << ":"
830  << waferPart_.size();
831 #endif
832  wafer = waferPart_[i];
833  }
834  int copy = HGCalTypes::packTypeUV(type, u, v);
835 #ifdef EDM_ML_DEBUG
836  edm::LogVerbatim("HGCalGeom") << " DDHGCalMixRotatedFineCassette: Layer "
837  << HGCalWaferIndex::waferLayer(waferIndex_[k]) << " Wafer " << wafer << " number "
838  << copy << " type :part:orien:ind " << type << ":" << part << ":" << orien << ":"
839  << i << " layer:u:v " << (layer + firstFineLayer_) << ":" << u << ":" << v;
840  if (iu > ium)
841  ium = iu;
842  if (iv > ivm)
843  ivm = iv;
844  kount++;
845  if (copies_.count(copy) == 0)
846  copies_.insert(copy);
847 #endif
848  DDTranslation tran(xpos, ypos, 0.0);
849  DDName name = DDName(DDSplit(wafer).first, DDSplit(wafer).second);
850  cpv.position(name, glog.ddname(), copy, tran, rot);
851 #ifdef EDM_ML_DEBUG
852  ++ntype[type];
853  edm::LogVerbatim("HGCalGeom") << " DDHGCalMixRotatedFineCassette: " << name << " number " << copy << " type "
854  << layertype << ":" << type << " positioned in " << glog.ddname() << " at " << tran
855  << " with no rotation";
856 #endif
857  }
858 #ifdef EDM_ML_DEBUG
859  edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedFineCassette: Maximum # of u " << ium << " # of v " << ivm
860  << " and " << kount << " wafers (" << ntype[0] << ":" << ntype[1] << ":" << ntype[2]
861  << ") for " << glog.ddname();
862 #endif
863  }
864 }
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
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
static constexpr int32_t WaferTypeOffset[3]
Definition: HGCalTypes.h:61
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
int32_t waferU(const int32_t index)
int32_t waferLayer(const int32_t index)
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
std::pair< double, double > getShift(int layer, int zside, int cassette, bool scnt=false) const
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
Log< level::Error, false > LogError
int32_t waferOrient(const int32_t property)
std::pair< double, double > shiftXY(int waferPosition, double waferSize) const
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
static std::string to_string(const XMLCh *ch)
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
U second(std::pair< T, U > const &p)
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
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:667
int32_t waferThick(const int32_t property)
ii
Definition: cuy.py:589
const N & name() const
Definition: DDBase.h:58
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
const N & ddname() const
Definition: DDBase.h:60
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
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
static int cassetteType(int det, int zside, int cassette)
MPlex< T, D1, D2, N > atan2(const MPlex< T, D1, D2, N > &y, const MPlex< T, D1, D2, N > &x)
Definition: Matriplex.h:648
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 DDHGCalMixRotatedFineCassette::absorbMode_
private

Definition at line 76 of file DDHGCalMixRotatedFineCassette.cc.

◆ alpha_

double DDHGCalMixRotatedFineCassette::alpha_
private

Definition at line 128 of file DDHGCalMixRotatedFineCassette.cc.

◆ cassette_

HGCalCassette DDHGCalMixRotatedFineCassette::cassette_
private

Definition at line 61 of file DDHGCalMixRotatedFineCassette.cc.

◆ cassettes_

int DDHGCalMixRotatedFineCassette::cassettes_
private

Definition at line 83 of file DDHGCalMixRotatedFineCassette.cc.

◆ cassetteShift_

std::vector<double> DDHGCalMixRotatedFineCassette::cassetteShift_
private

Definition at line 114 of file DDHGCalMixRotatedFineCassette.cc.

◆ cassetteShiftScnt_

std::vector<double> DDHGCalMixRotatedFineCassette::cassetteShiftScnt_
private

Definition at line 125 of file DDHGCalMixRotatedFineCassette.cc.

◆ copies_

std::unordered_set<int> DDHGCalMixRotatedFineCassette::copies_
private

Definition at line 127 of file DDHGCalMixRotatedFineCassette.cc.

◆ copyNumber_

std::vector<int> DDHGCalMixRotatedFineCassette::copyNumber_
private

Definition at line 97 of file DDHGCalMixRotatedFineCassette.cc.

◆ copyNumberCoverTop_

std::vector<int> DDHGCalMixRotatedFineCassette::copyNumberCoverTop_
private

Definition at line 109 of file DDHGCalMixRotatedFineCassette.cc.

◆ copyNumberTop_

std::vector<int> DDHGCalMixRotatedFineCassette::copyNumberTop_
private

Definition at line 106 of file DDHGCalMixRotatedFineCassette.cc.

◆ cosAlpha_

double DDHGCalMixRotatedFineCassette::cosAlpha_
private

Definition at line 128 of file DDHGCalMixRotatedFineCassette.cc.

◆ coverTopLayers_

int DDHGCalMixRotatedFineCassette::coverTopLayers_
private

Definition at line 108 of file DDHGCalMixRotatedFineCassette.cc.

◆ coverTypeTop_

int DDHGCalMixRotatedFineCassette::coverTypeTop_
private

Definition at line 107 of file DDHGCalMixRotatedFineCassette.cc.

◆ facingTypes_

int DDHGCalMixRotatedFineCassette::facingTypes_
private

Definition at line 68 of file DDHGCalMixRotatedFineCassette.cc.

◆ firstCoarseLayer_

int DDHGCalMixRotatedFineCassette::firstCoarseLayer_
private

Definition at line 75 of file DDHGCalMixRotatedFineCassette.cc.

◆ firstFineLayer_

int DDHGCalMixRotatedFineCassette::firstFineLayer_
private

Definition at line 74 of file DDHGCalMixRotatedFineCassette.cc.

◆ geomTools_

HGCalGeomTools DDHGCalMixRotatedFineCassette::geomTools_
private

Definition at line 60 of file DDHGCalMixRotatedFineCassette.cc.

◆ layerOrient_

std::vector<int> DDHGCalMixRotatedFineCassette::layerOrient_
private

Definition at line 110 of file DDHGCalMixRotatedFineCassette.cc.

◆ layers_

std::vector<int> DDHGCalMixRotatedFineCassette::layers_
private

Definition at line 98 of file DDHGCalMixRotatedFineCassette.cc.

◆ layerSense_

std::vector<int> DDHGCalMixRotatedFineCassette::layerSense_
private

Definition at line 101 of file DDHGCalMixRotatedFineCassette.cc.

◆ layerThick_

std::vector<double> DDHGCalMixRotatedFineCassette::layerThick_
private

Definition at line 99 of file DDHGCalMixRotatedFineCassette.cc.

◆ layerThickTop_

std::vector<double> DDHGCalMixRotatedFineCassette::layerThickTop_
private

Definition at line 104 of file DDHGCalMixRotatedFineCassette.cc.

◆ layerType_

std::vector<int> DDHGCalMixRotatedFineCassette::layerType_
private

Definition at line 100 of file DDHGCalMixRotatedFineCassette.cc.

◆ layerTypeTop_

std::vector<int> DDHGCalMixRotatedFineCassette::layerTypeTop_
private

Definition at line 105 of file DDHGCalMixRotatedFineCassette.cc.

◆ materials_

std::vector<std::string> DDHGCalMixRotatedFineCassette::materials_
private

Definition at line 94 of file DDHGCalMixRotatedFineCassette.cc.

◆ materialTop_

std::vector<std::string> DDHGCalMixRotatedFineCassette::materialTop_
private

Definition at line 102 of file DDHGCalMixRotatedFineCassette.cc.

◆ names_

std::vector<std::string> DDHGCalMixRotatedFineCassette::names_
private

Definition at line 95 of file DDHGCalMixRotatedFineCassette.cc.

◆ nameSpace_

std::string DDHGCalMixRotatedFineCassette::nameSpace_
private

Definition at line 126 of file DDHGCalMixRotatedFineCassette.cc.

◆ namesTop_

std::vector<std::string> DDHGCalMixRotatedFineCassette::namesTop_
private

Definition at line 103 of file DDHGCalMixRotatedFineCassette.cc.

◆ orientationTypes_

int DDHGCalMixRotatedFineCassette::orientationTypes_
private

Definition at line 69 of file DDHGCalMixRotatedFineCassette.cc.

◆ partialTypes_

int DDHGCalMixRotatedFineCassette::partialTypes_
private

Definition at line 70 of file DDHGCalMixRotatedFineCassette.cc.

◆ passiveFull_

std::vector<std::string> DDHGCalMixRotatedFineCassette::passiveFull_
private

Definition at line 92 of file DDHGCalMixRotatedFineCassette.cc.

◆ passiveMode_

int DDHGCalMixRotatedFineCassette::passiveMode_
private

Definition at line 78 of file DDHGCalMixRotatedFineCassette.cc.

◆ passivePart_

std::vector<std::string> DDHGCalMixRotatedFineCassette::passivePart_
private

Definition at line 93 of file DDHGCalMixRotatedFineCassette.cc.

◆ passiveTypes_

int DDHGCalMixRotatedFineCassette::passiveTypes_
private

Definition at line 67 of file DDHGCalMixRotatedFineCassette.cc.

◆ phiBinsFineScint_

int DDHGCalMixRotatedFineCassette::phiBinsFineScint_
private

Definition at line 73 of file DDHGCalMixRotatedFineCassette.cc.

◆ phiBinsScint_

int DDHGCalMixRotatedFineCassette::phiBinsScint_
private

Definition at line 72 of file DDHGCalMixRotatedFineCassette.cc.

◆ placeOffset_

int DDHGCalMixRotatedFineCassette::placeOffset_
private

Definition at line 71 of file DDHGCalMixRotatedFineCassette.cc.

◆ rMaxFront_

std::vector<double> DDHGCalMixRotatedFineCassette::rMaxFront_
private

Definition at line 89 of file DDHGCalMixRotatedFineCassette.cc.

◆ rMinFront_

std::vector<double> DDHGCalMixRotatedFineCassette::rMinFront_
private

Definition at line 86 of file DDHGCalMixRotatedFineCassette.cc.

◆ sectors_

int DDHGCalMixRotatedFineCassette::sectors_
private

Definition at line 82 of file DDHGCalMixRotatedFineCassette.cc.

◆ sensitiveMode_

int DDHGCalMixRotatedFineCassette::sensitiveMode_
private

Definition at line 77 of file DDHGCalMixRotatedFineCassette.cc.

◆ slopeB_

std::vector<double> DDHGCalMixRotatedFineCassette::slopeB_
private

Definition at line 84 of file DDHGCalMixRotatedFineCassette.cc.

◆ slopeT_

std::vector<double> DDHGCalMixRotatedFineCassette::slopeT_
private

Definition at line 87 of file DDHGCalMixRotatedFineCassette.cc.

◆ thick_

std::vector<double> DDHGCalMixRotatedFineCassette::thick_
private

Definition at line 96 of file DDHGCalMixRotatedFineCassette.cc.

◆ tileCoarseIndex_

std::vector<int> DDHGCalMixRotatedFineCassette::tileCoarseIndex_
private

Definition at line 122 of file DDHGCalMixRotatedFineCassette.cc.

◆ tileCoarseLayerStart_

std::vector<int> DDHGCalMixRotatedFineCassette::tileCoarseLayerStart_
private

Definition at line 124 of file DDHGCalMixRotatedFineCassette.cc.

◆ tileCoarsePhis_

std::vector<int> DDHGCalMixRotatedFineCassette::tileCoarsePhis_
private

Definition at line 123 of file DDHGCalMixRotatedFineCassette.cc.

◆ tileCoarseRMax_

std::vector<double> DDHGCalMixRotatedFineCassette::tileCoarseRMax_
private

Definition at line 121 of file DDHGCalMixRotatedFineCassette.cc.

◆ tileCoarseRMin_

std::vector<double> DDHGCalMixRotatedFineCassette::tileCoarseRMin_
private

Definition at line 120 of file DDHGCalMixRotatedFineCassette.cc.

◆ tileFineIndex_

std::vector<int> DDHGCalMixRotatedFineCassette::tileFineIndex_
private

Definition at line 117 of file DDHGCalMixRotatedFineCassette.cc.

◆ tileFineLayerStart_

std::vector<int> DDHGCalMixRotatedFineCassette::tileFineLayerStart_
private

Definition at line 119 of file DDHGCalMixRotatedFineCassette.cc.

◆ tileFinePhis_

std::vector<int> DDHGCalMixRotatedFineCassette::tileFinePhis_
private

Definition at line 118 of file DDHGCalMixRotatedFineCassette.cc.

◆ tileFineRMax_

std::vector<double> DDHGCalMixRotatedFineCassette::tileFineRMax_
private

Definition at line 116 of file DDHGCalMixRotatedFineCassette.cc.

◆ tileFineRMin_

std::vector<double> DDHGCalMixRotatedFineCassette::tileFineRMin_
private

Definition at line 115 of file DDHGCalMixRotatedFineCassette.cc.

◆ tol1_

constexpr double DDHGCalMixRotatedFineCassette::tol1_ = 0.01
staticprivate

Definition at line 63 of file DDHGCalMixRotatedFineCassette.cc.

◆ tol2_

constexpr double DDHGCalMixRotatedFineCassette::tol2_ = 0.00001
staticprivate

Definition at line 64 of file DDHGCalMixRotatedFineCassette.cc.

◆ waferFull_

std::vector<std::string> DDHGCalMixRotatedFineCassette::waferFull_
private

Definition at line 90 of file DDHGCalMixRotatedFineCassette.cc.

◆ waferIndex_

std::vector<int> DDHGCalMixRotatedFineCassette::waferIndex_
private

Definition at line 111 of file DDHGCalMixRotatedFineCassette.cc.

◆ waferLayerStart_

std::vector<int> DDHGCalMixRotatedFineCassette::waferLayerStart_
private

Definition at line 113 of file DDHGCalMixRotatedFineCassette.cc.

◆ waferPart_

std::vector<std::string> DDHGCalMixRotatedFineCassette::waferPart_
private

Definition at line 91 of file DDHGCalMixRotatedFineCassette.cc.

◆ waferProperty_

std::vector<int> DDHGCalMixRotatedFineCassette::waferProperty_
private

Definition at line 112 of file DDHGCalMixRotatedFineCassette.cc.

◆ waferSepar_

double DDHGCalMixRotatedFineCassette::waferSepar_
private

Definition at line 81 of file DDHGCalMixRotatedFineCassette.cc.

◆ waferSize_

double DDHGCalMixRotatedFineCassette::waferSize_
private

Definition at line 80 of file DDHGCalMixRotatedFineCassette.cc.

◆ waferTypes_

int DDHGCalMixRotatedFineCassette::waferTypes_
private

Definition at line 66 of file DDHGCalMixRotatedFineCassette.cc.

◆ zFrontB_

std::vector<double> DDHGCalMixRotatedFineCassette::zFrontB_
private

Definition at line 85 of file DDHGCalMixRotatedFineCassette.cc.

◆ zFrontT_

std::vector<double> DDHGCalMixRotatedFineCassette::zFrontT_
private

Definition at line 88 of file DDHGCalMixRotatedFineCassette.cc.

◆ zMinBlock_

double DDHGCalMixRotatedFineCassette::zMinBlock_
private

Definition at line 79 of file DDHGCalMixRotatedFineCassette.cc.