CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
HGCalSiliconRotatedModule Struct Reference

Public Member Functions

 HGCalSiliconRotatedModule ()
 
 HGCalSiliconRotatedModule (cms::DDParsingContext &ctxt, xml_h e)
 
void positionSensitive (cms::DDParsingContext &ctxt, xml_h e, const dd4hep::Volume &glog, int layer)
 

Public Attributes

int absorbMode_
 
double alpha_
 
HGCalCassette cassette_
 
int cassettes_
 
std::vector< double > cassetteShift_
 
std::unordered_set< int > copies_
 
std::vector< int > copyNumber_
 
double cosAlpha_
 
int facingTypes_
 
int firstLayer_
 
HGCalGeomTools geomTools_
 
std::vector< int > layers_
 
std::vector< int > layerSense_
 
std::vector< double > layerThick_
 
std::vector< int > layerType_
 
std::vector< int > layerTypes_
 
std::vector< std::string > materials_
 
std::vector< std::string > names_
 
int orientationTypes_
 
int placeOffset_
 
std::vector< double > rMaxFront_
 
std::vector< double > rMinFront_
 
std::string rotstr_
 
int sectors_
 
int sensitiveMode_
 
std::vector< double > slopeB_
 
std::vector< double > slopeT_
 
std::vector< double > thick_
 
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_
 

Detailed Description

Definition at line 30 of file DDHGCalSiliconRotatedModule.cc.

Constructor & Destructor Documentation

◆ HGCalSiliconRotatedModule() [1/2]

HGCalSiliconRotatedModule::HGCalSiliconRotatedModule ( )
inline

Definition at line 31 of file DDHGCalSiliconRotatedModule.cc.

References Exception.

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

◆ HGCalSiliconRotatedModule() [2/2]

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

Definition at line 34 of file DDHGCalSiliconRotatedModule.cc.

References funct::abs(), cms::DDNamespace::addSolidNS(), cms::DDNamespace::addVolumeNS(), writedatasetfile::args, cms::convert2mm(), angle_units::operators::convertRadToDeg(), filterCSVwithJSON::copy, funct::cos(), MillePedeFileConverter_cfg::e, mps_fire::i, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, cuy::ii, dqmiolumiharvest::j, dqmdumpme::k, cms::DDNamespace::material(), g4SimHits_cfi::Material, SiStripPI::min, Skims_PA_cff::name, cms::DDNamespace::name(), HGCalGeometryMode::Polyhedra, PixelTestBeamValidation_cfi::Position, cms::DDNamespace::prepend(), diffTwoXMLs::r1, HGCalGeomTools::radius(), makeMuonMisalignmentScenario::rot, cms::DDNamespace::rotation(), cms::rotation_utils::rotName(), AlCaHLTBitMon_QueryRunRegistry::string, cond::impl::to_string(), cms::DDNamespace::volume(), HGCalTypes::WaferCenteredRotated, HGCalWaferIndex::waferLayer(), HGCalProperty::waferOrient(), HGCalProperty::waferPartial(), HGCalProperty::waferThick(), HGCalWaferIndex::waferU(), HGCalWaferIndex::waferV(), and geometryCSVtoXML::zz.

34  {
35  cms::DDNamespace ns(ctxt, e, true);
37 
38 #ifdef EDM_ML_DEBUG
39  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: Creating an instance";
40 #endif
41  static constexpr double tol1 = 0.01 * dd4hep::mm;
42  static constexpr double tol2 = 0.00001 * dd4hep::mm;
43 
44  dd4hep::Volume mother = ns.volume(args.parentName());
45  waferTypes_ = args.value<int>("WaferTypes");
46  facingTypes_ = args.value<int>("FacingTypes");
47  orientationTypes_ = args.value<int>("OrientationTypes");
48  placeOffset_ = args.value<int>("PlaceOffset");
49 #ifdef EDM_ML_DEBUG
50  edm::LogVerbatim("HGCalGeom") << "Number of types of wafers: " << waferTypes_ << " facings: " << facingTypes_
51  << " Orientations: " << orientationTypes_ << " PlaceOffset: " << placeOffset_;
52 #endif
53  firstLayer_ = args.value<int>("FirstLayer");
54  absorbMode_ = args.value<int>("AbsorberMode");
55  sensitiveMode_ = args.value<int>("SensitiveMode");
56 #ifdef EDM_ML_DEBUG
57  edm::LogVerbatim("HGCalGeom") << "First Layer " << firstLayer_ << " and "
58  << "Absober:Sensitive mode " << absorbMode_ << ":" << sensitiveMode_;
59 #endif
60  zMinBlock_ = args.value<double>("zMinBlock");
61  waferSize_ = args.value<double>("waferSize");
62  waferSepar_ = args.value<double>("SensorSeparation");
63  sectors_ = args.value<int>("Sectors");
64  cassettes_ = args.value<int>("Cassettes");
65  alpha_ = (1._pi) / sectors_;
66  cosAlpha_ = cos(alpha_);
67  rotstr_ = args.value<std::string>("LayerRotation");
68 #ifdef EDM_ML_DEBUG
69  edm::LogVerbatim("HGCalGeom") << "zStart " << cms::convert2mm(zMinBlock_) << " wafer width "
70  << cms::convert2mm(waferSize_) << " separations " << cms::convert2mm(waferSepar_)
71  << " sectors " << sectors_ << ":" << convertRadToDeg(alpha_) << ":" << cosAlpha_
72  << " rotation matrix " << rotstr_ << cassettes_ << " cassettes";
73 #endif
74  waferFull_ = args.value<std::vector<std::string>>("WaferNamesFull");
75  waferPart_ = args.value<std::vector<std::string>>("WaferNamesPartial");
76 #ifdef EDM_ML_DEBUG
77  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << waferFull_.size() << " full and "
78  << waferPart_.size() << " partial modules\nDDHGCalSiliconRotatedModule:Full Modules:";
79  unsigned int i1max = static_cast<unsigned int>(waferFull_.size());
80  for (unsigned int i1 = 0; i1 < i1max; i1 += 2) {
81  std::ostringstream st1;
82  unsigned int i2 = std::min((i1 + 2), i1max);
83  for (unsigned int i = i1; i < i2; ++i)
84  st1 << " [" << i << "] " << waferFull_[i];
85  edm::LogVerbatim("HGCalGeom") << st1.str();
86  }
87  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: Partial Modules:";
88  i1max = static_cast<unsigned int>(waferPart_.size());
89  for (unsigned int i1 = 0; i1 < i1max; i1 += 2) {
90  std::ostringstream st1;
91  unsigned int i2 = std::min((i1 + 2), i1max);
92  for (unsigned int i = i1; i < i2; ++i)
93  st1 << " [" << i << "] " << waferPart_[i];
94  edm::LogVerbatim("HGCalGeom") << st1.str();
95  }
96 #endif
97  materials_ = args.value<std::vector<std::string>>("MaterialNames");
98  names_ = args.value<std::vector<std::string>>("VolumeNames");
99  thick_ = args.value<std::vector<double>>("Thickness");
100  copyNumber_.resize(materials_.size(), 1);
101 #ifdef EDM_ML_DEBUG
102  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << materials_.size() << " types of volumes";
103  for (unsigned int i = 0; i < names_.size(); ++i)
104  edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << names_[i] << " of thickness "
105  << cms::convert2mm(thick_[i]) << " filled with " << materials_[i]
106  << " first copy number " << copyNumber_[i];
107 #endif
108  layers_ = args.value<std::vector<int>>("Layers");
109  layerThick_ = args.value<std::vector<double>>("LayerThick");
110 #ifdef EDM_ML_DEBUG
111  edm::LogVerbatim("HGCalGeom") << "There are " << layers_.size() << " blocks";
112  for (unsigned int i = 0; i < layers_.size(); ++i)
113  edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] of thickness " << cms::convert2mm(layerThick_[i])
114  << " with " << layers_[i] << " layers";
115 #endif
116  layerType_ = args.value<std::vector<int>>("LayerType");
117  layerSense_ = args.value<std::vector<int>>("LayerSense");
118  layerTypes_ = args.value<std::vector<int>>("LayerTypes");
119 #ifdef EDM_ML_DEBUG
120  for (unsigned int i = 0; i < layerTypes_.size(); ++i)
121  edm::LogVerbatim("HGCalGeom") << "LayerTypes [" << i << "] " << layerTypes_[i];
122 #endif
123  if (firstLayer_ > 0) {
124  for (unsigned int i = 0; i < layerType_.size(); ++i) {
125  if (layerSense_[i] > 0) {
126  int ii = layerType_[i];
127  copyNumber_[ii] = (layerSense_[i] == 1) ? firstLayer_ : (firstLayer_ + 1);
128 #ifdef EDM_ML_DEBUG
129  edm::LogVerbatim("HGCalGeom") << "First copy number for layer type " << i << ":" << ii << " with "
130  << materials_[ii] << " changed to " << copyNumber_[ii];
131 #endif
132  }
133  }
134  } else {
135  firstLayer_ = 1;
136  }
137 #ifdef EDM_ML_DEBUG
138  edm::LogVerbatim("HGCalGeom") << "There are " << layerType_.size() << " layers";
139  for (unsigned int i = 0; i < layerType_.size(); ++i)
140  edm::LogVerbatim("HGCalGeom") << "Layer [" << i << "] with material type " << layerType_[i] << " sensitive class "
141  << layerSense_[i];
142 #endif
143  slopeB_ = args.value<std::vector<double>>("SlopeBottom");
144  zFrontB_ = args.value<std::vector<double>>("ZFrontBottom");
145  rMinFront_ = args.value<std::vector<double>>("RMinFront");
146  slopeT_ = args.value<std::vector<double>>("SlopeTop");
147  zFrontT_ = args.value<std::vector<double>>("ZFrontTop");
148  rMaxFront_ = args.value<std::vector<double>>("RMaxFront");
149 #ifdef EDM_ML_DEBUG
150  for (unsigned int i = 0; i < slopeB_.size(); ++i)
151  edm::LogVerbatim("HGCalGeom") << "Bottom Block [" << i << "] Zmin " << cms::convert2mm(zFrontB_[i]) << " Rmin "
152  << cms::convert2mm(rMinFront_[i]) << " Slope " << slopeB_[i];
153  for (unsigned int i = 0; i < slopeT_.size(); ++i)
154  edm::LogVerbatim("HGCalGeom") << "Top Block [" << i << "] Zmin " << cms::convert2mm(zFrontT_[i]) << " Rmax "
155  << cms::convert2mm(rMaxFront_[i]) << " Slope " << slopeT_[i];
156 #endif
157  waferIndex_ = args.value<std::vector<int>>("WaferIndex");
158  waferProperty_ = args.value<std::vector<int>>("WaferProperties");
159  waferLayerStart_ = args.value<std::vector<int>>("WaferLayerStart");
160  cassetteShift_ = args.value<std::vector<double>>("CassetteShift");
161 #ifdef EDM_ML_DEBUG
162  edm::LogVerbatim("HGCalGeom") << "waferProperties with " << waferIndex_.size() << " entries in "
163  << waferLayerStart_.size() << " layers";
164  for (unsigned int k = 0; k < waferLayerStart_.size(); ++k)
165  edm::LogVerbatim("HGCalGeom") << "LayerStart[" << k << "] " << waferLayerStart_[k];
166  for (unsigned int k = 0; k < waferIndex_.size(); ++k)
167  edm::LogVerbatim("HGCalGeom") << "Wafer[" << k << "] " << waferIndex_[k] << " ("
170  << HGCalWaferIndex::waferV(waferIndex_[k]) << ") : ("
174  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << cassetteShift_.size()
175  << " elements for cassette shifts";
176  unsigned int j1max = cassetteShift_.size();
177  for (unsigned int j1 = 0; j1 < j1max; j1 += 6) {
178  std::ostringstream st1;
179  unsigned int j2 = std::min((j1 + 6), j1max);
180  for (unsigned int j = j1; j < j2; ++j)
181  st1 << " [" << j << "] " << std::setw(9) << cassetteShift_[j];
182  edm::LogVerbatim("HGCalGeom") << st1.str();
183  }
184 
185  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: NameSpace " << ns.name();
186 #endif
188 
189 #ifdef EDM_ML_DEBUG
190  edm::LogVerbatim("HGCalGeom") << "==>> Constructing DDHGCalSiliconRotatedModule...";
191  copies_.clear();
192 #endif
193 
194  double zi(zMinBlock_);
195  int laymin(0);
196  for (unsigned int i = 0; i < layers_.size(); ++i) {
197  double zo = zi + layerThick_[i];
198  double routF = HGCalGeomTools::radius(zi, zFrontT_, rMaxFront_, slopeT_);
199  int laymax = laymin + layers_[i];
200  double zz = zi;
201  double thickTot(0);
202  for (int ly = laymin; ly < laymax; ++ly) {
203  int ii = layerType_[ly];
204  int copy = copyNumber_[ii];
205  double hthick = 0.5 * thick_[ii];
206  double rinB = HGCalGeomTools::radius(zo - tol1, zFrontB_, rMinFront_, slopeB_);
207  zz += hthick;
208  thickTot += thick_[ii];
209 
211 #ifdef EDM_ML_DEBUG
212  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: Layer " << ly << ":" << ii << " Front "
213  << cms::convert2mm(zi) << ", " << cms::convert2mm(routF) << " Back "
214  << cms::convert2mm(zo) << ", " << cms::convert2mm(rinB)
215  << " superlayer thickness " << cms::convert2mm(layerThick_[i]);
216 #endif
217 
218  dd4hep::Material matter = ns.material(materials_[ii]);
219  dd4hep::Volume glog;
220 
221  if (layerSense_[ly] < 1) {
222  std::vector<double> pgonZ, pgonRin, pgonRout;
223  double rmax = routF * cosAlpha_ - tol1;
224  HGCalGeomTools::radius(zz - hthick,
225  zz + hthick,
226  zFrontB_,
227  rMinFront_,
228  slopeB_,
229  zFrontT_,
230  rMaxFront_,
231  slopeT_,
232  -layerSense_[ly],
233  pgonZ,
234  pgonRin,
235  pgonRout);
236  for (unsigned int isec = 0; isec < pgonZ.size(); ++isec) {
237  pgonZ[isec] -= zz;
238  if (layerSense_[ly] == 0 || absorbMode_ == 0)
239  pgonRout[isec] = rmax;
240  else
241  pgonRout[isec] = pgonRout[isec] * cosAlpha_ - tol1;
242  }
243  dd4hep::Solid solid = dd4hep::Polyhedra(sectors_, -alpha_, 2._pi, pgonZ, pgonRin, pgonRout);
244  ns.addSolidNS(ns.prepend(name), solid);
245  glog = dd4hep::Volume(solid.name(), solid, matter);
246  ns.addVolumeNS(glog);
247 #ifdef EDM_ML_DEBUG
248  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << solid.name() << " polyhedra of "
249  << sectors_ << " sectors covering " << convertRadToDeg(-alpha_) << ":"
250  << convertRadToDeg(-alpha_ + 2._pi) << " with " << pgonZ.size()
251  << " sections and filled with " << matter.name();
252  for (unsigned int k = 0; k < pgonZ.size(); ++k)
253  edm::LogVerbatim("HGCalGeom") << "[" << k << "] z " << cms::convert2mm(pgonZ[k]) << " R "
254  << cms::convert2mm(pgonRin[k]) << ":" << cms::convert2mm(pgonRout[k]);
255 #endif
256  } else {
257  double rins =
258  (sensitiveMode_ < 1) ? rinB : HGCalGeomTools::radius(zz + hthick - tol1, zFrontB_, rMinFront_, slopeB_);
259  double routs =
260  (sensitiveMode_ < 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_);
261  dd4hep::Solid solid = dd4hep::Tube(rins, routs, hthick, 0.0, 2._pi);
262  ns.addSolidNS(ns.prepend(name), solid);
263  glog = dd4hep::Volume(solid.name(), solid, matter);
264  ns.addVolumeNS(glog);
265 
266 #ifdef EDM_ML_DEBUG
267  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << solid.name() << " Tubs made of "
268  << matter.name() << " of dimensions " << cms::convert2mm(rinB) << ":"
269  << cms::convert2mm(rins) << ", " << cms::convert2mm(routF) << ":"
270  << cms::convert2mm(routs) << ", " << cms::convert2mm(hthick)
271  << ", 0.0, 360.0 and position " << glog.name() << " number " << copy << ":"
273 #endif
274  positionSensitive(ctxt, e, glog, (copy - firstLayer_));
275  }
276 
277  dd4hep::Position r1(0, 0, zz);
278  dd4hep::Rotation3D rot;
279 #ifdef EDM_ML_DEBUG
280  std::string rotName("Null");
281 #endif
283  rot = ns.rotation(rotstr_);
284 #ifdef EDM_ML_DEBUG
285  rotName = rotstr_;
286 #endif
287  }
288  mother.placeVolume(glog, copy, dd4hep::Transform3D(rot, r1));
289  int inc = ((layerSense_[ly] > 0) && (facingTypes_ > 1)) ? 2 : 1;
290  copyNumber_[ii] = copy + inc;
291 #ifdef EDM_ML_DEBUG
292  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << glog.name() << " number " << copy
293  << " positioned in " << mother.name() << " at (0,0," << cms::convert2mm(zz)
294  << ") with " << rotName << " rotation";
295 #endif
296  zz += hthick;
297  } // End of loop over layers in a block
298  zi = zo;
299  laymin = laymax;
300  // Make consistency check of all the partitions of the block
301  if (std::abs(thickTot - layerThick_[i]) >= tol2) {
302  if (thickTot > layerThick_[i]) {
303  edm::LogError("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick_[i])
304  << " is smaller than " << cms::convert2mm(thickTot)
305  << ": thickness of all its components **** ERROR ****";
306  } else {
307  edm::LogWarning("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick_[i])
308  << " does not match with " << cms::convert2mm(thickTot) << " of the components";
309  }
310  }
311  } // End of loop over blocks
312 
313 #ifdef EDM_ML_DEBUG
314  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << copies_.size()
315  << " different wafer copy numbers";
316  int k(0);
317  for (std::unordered_set<int>::const_iterator itr = copies_.begin(); itr != copies_.end(); ++itr, ++k) {
318  edm::LogVerbatim("HGCalGeom") << "Copy [" << k << "] : " << (*itr);
319  }
320  copies_.clear();
321  edm::LogVerbatim("HGCalGeom") << "<<== End of DDHGCalSiliconRotatedModule construction...";
322 #endif
323  }
Log< level::Info, true > LogVerbatim
static constexpr int32_t WaferCenteredRotated
Definition: HGCalTypes.h:71
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
std::string to_string(const V &value)
Definition: OMSAccess.h:71
std::vector< std::string > materials_
Log< level::Error, false > LogError
int32_t waferOrient(const int32_t property)
static const std::string & rotName(const T &rot, const cms::DDParsingContext &context)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< std::string > waferFull_
int32_t waferThick(const int32_t property)
dd4hep::Volume Volume
ii
Definition: cuy.py:589
int32_t waferPartial(const int32_t property)
int32_t waferV(const int32_t index)
std::vector< std::string > names_
Log< level::Warning, false > LogWarning
void positionSensitive(cms::DDParsingContext &ctxt, xml_h e, const dd4hep::Volume &glog, int layer)
void setParameter(int cassette, const std::vector< double > &shifts)
Definition: HGCalCassette.cc:7
std::vector< std::string > waferPart_

Member Function Documentation

◆ positionSensitive()

void HGCalSiliconRotatedModule::positionSensitive ( cms::DDParsingContext ctxt,
xml_h  e,
const dd4hep::Volume &  glog,
int  layer 
)
inline

Definition at line 325 of file DDHGCalSiliconRotatedModule.cc.

References funct::abs(), HGCalCell::cellPlacementIndex(), cms::convert2mm(), filterCSVwithJSON::copy, HGCalTypes::CornerCenteredLambda, HGCalTypes::CornerCenteredY, HGCalTypes::CornerCenterYm, HGCalTypes::CornerCenterYp, PVValHelper::dy, MillePedeFileConverter_cfg::e, mps_fire::i, gpuVertexFinder::iv, dqmdumpme::k, phase1PixelTopology::layer, EgHLTOffHistBins_cfi::nr, HGCalTypes::packTypeUV(), PixelTestBeamValidation_cfi::Position, dttmaxenums::R, alignCSCRings::r, mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, findQualityFiles::v, cms::DDNamespace::volume(), HGCalProperty::waferCassette(), HGCalTypes::WaferCenter, HGCalTypes::WaferCenteredBack, HGCalTypes::WaferFull, HGCalTypes::WaferHDTop, HGCalWaferIndex::waferLayer(), HGCalProperty::waferOrient(), HGCalTypes::WaferPartHDOffset, HGCalProperty::waferPartial(), HGCalTypes::WaferPartLDOffset, HGCalProperty::waferThick(), HGCalTypes::WaferTypeOffset, HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

325  {
326  cms::DDNamespace ns(ctxt, e, true);
327  static const double sqrt3 = std::sqrt(3.0);
328  int layercenter = (layerTypes_[layer] == HGCalTypes::CornerCenteredLambda)
332  int layertype = (layerTypes_[layer] == HGCalTypes::WaferCenteredBack) ? 1 : 0;
333  int firstWafer = waferLayerStart_[layer];
334  int lastWafer = ((layer + 1 < static_cast<int>(waferLayerStart_.size())) ? waferLayerStart_[layer + 1]
335  : static_cast<int>(waferIndex_.size()));
336  double r = 0.5 * (waferSize_ + waferSepar_);
337  double R = 2.0 * r / sqrt3;
338  double dy = 0.75 * R;
339  const auto& xyoff = geomTools_.shiftXY(layercenter, (waferSize_ + waferSepar_));
340 #ifdef EDM_ML_DEBUG
341  int ium(0), ivm(0), kount(0);
342  std::vector<int> ntype(3, 0);
343  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << glog.name() << " r " << cms::convert2mm(r)
344  << " R " << cms::convert2mm(R) << " dy " << cms::convert2mm(dy) << " Shift "
345  << cms::convert2mm(xyoff.first) << ":" << cms::convert2mm(xyoff.second)
346  << " WaferSize " << cms::convert2mm((waferSize_ + waferSepar_)) << " index "
347  << firstWafer << ":" << (lastWafer - 1);
348 #endif
349  for (int k = firstWafer; k < lastWafer; ++k) {
352 #ifdef EDM_ML_DEBUG
353  int iu = std::abs(u);
354  int iv = std::abs(v);
355 #endif
356  int nr = 2 * v;
357  int nc = -2 * u + v;
362  int place = HGCalCell::cellPlacementIndex(1, layertype, orien);
363  auto cshift = cassette_.getShift(layer, 1, cassette);
364  double xpos = xyoff.first + cshift.first + nc * r;
365  double ypos = xyoff.second + cshift.second + nr * dy;
366  std::string wafer;
367  int i(999);
368  if (part == HGCalTypes::WaferFull) {
370  wafer = waferFull_[i];
371  } else {
372  int partoffset =
374  i = (part - partoffset) * facingTypes_ * orientationTypes_ +
376 #ifdef EDM_ML_DEBUG
377  edm::LogVerbatim("HGCalGeom") << " layertype:type:part:orien:cassette:place:offsets:ind " << layertype << ":"
378  << type << ":" << part << ":" << orien << ":" << cassette << ":" << place << ":"
379  << partoffset << ":" << HGCalTypes::WaferTypeOffset[type] << ":" << i << ":"
380  << waferPart_.size();
381 #endif
382  wafer = waferPart_[i];
383  }
384  int copy = HGCalTypes::packTypeUV(type, u, v);
385 #ifdef EDM_ML_DEBUG
386  edm::LogVerbatim("HGCalGeom") << " DDHGCalSiliconRotatedModule: Layer"
387  << HGCalWaferIndex::waferLayer(waferIndex_[k]) << " Wafer " << wafer << " number "
388  << copy << " type:part:orien:ind " << type << ":" << part << ":" << orien << ":"
389  << i << " layer:u:v:indx " << (layer + firstLayer_) << ":" << u << ":" << v;
390  if (iu > ium)
391  ium = iu;
392  if (iv > ivm)
393  ivm = iv;
394  kount++;
395  if (copies_.count(copy) == 0)
396  copies_.insert(copy);
397 #endif
398  dd4hep::Position tran(xpos, ypos, 0.0);
399  glog.placeVolume(ns.volume(wafer), copy, tran);
400 #ifdef EDM_ML_DEBUG
401  ++ntype[type];
402  edm::LogVerbatim("HGCalGeom") << " DDHGCalSiliconRotatedModule: " << wafer << " number " << copy << " type "
403  << layertype << ":" << type << " positioned in " << glog.name() << " at ("
404  << cms::convert2mm(xpos) << "," << cms::convert2mm(ypos) << ",0) with no rotation";
405 #endif
406  }
407 
408 #ifdef EDM_ML_DEBUG
409  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: Maximum # of u " << ium << " # of v " << ivm
410  << " and " << kount << " wafers (" << ntype[0] << ":" << ntype[1] << ":" << ntype[2]
411  << ") for " << glog.name();
412 #endif
413  }
Log< level::Info, true > LogVerbatim
static constexpr int32_t WaferPartLDOffset
Definition: HGCalTypes.h:56
std::pair< double, double > getShift(int layer, int zside, int cassette)
static constexpr int32_t WaferCenter
Definition: HGCalTypes.h:20
int32_t *__restrict__ iv
static constexpr int32_t WaferTypeOffset[3]
Definition: HGCalTypes.h:58
int32_t waferU(const int32_t index)
int32_t waferLayer(const int32_t index)
static constexpr int32_t CornerCenterYm
Definition: HGCalTypes.h:22
constexpr NumType convert2mm(NumType length)
Definition: DDutils.h:7
int32_t waferOrient(const int32_t property)
std::pair< double, double > shiftXY(int waferPosition, double waferSize) const
constexpr std::array< uint8_t, layerIndexSize > layer
int32_t waferCassette(const int32_t property)
static constexpr int32_t WaferFull
Definition: HGCalTypes.h:34
static int32_t cellPlacementIndex(int32_t iz, int32_t fwdBack, int32_t orient)
Definition: HGCalCell.cc:230
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< std::string > waferFull_
int32_t waferThick(const int32_t property)
static constexpr int32_t CornerCenterYp
Definition: HGCalTypes.h:21
static constexpr int32_t WaferPartHDOffset
Definition: HGCalTypes.h:57
static constexpr int32_t WaferCenteredBack
Definition: HGCalTypes.h:68
part
Definition: HCALResponse.h:20
static constexpr int32_t CornerCenteredLambda
Definition: HGCalTypes.h:70
int32_t waferPartial(const int32_t property)
static constexpr int32_t CornerCenteredY
Definition: HGCalTypes.h:69
int32_t waferV(const int32_t index)
static int32_t packTypeUV(int type, int u, int v)
Definition: HGCalTypes.cc:3
static constexpr int32_t WaferHDTop
Definition: HGCalTypes.h:50
std::vector< std::string > waferPart_

Member Data Documentation

◆ absorbMode_

int HGCalSiliconRotatedModule::absorbMode_

Definition at line 424 of file DDHGCalSiliconRotatedModule.cc.

◆ alpha_

double HGCalSiliconRotatedModule::alpha_

Definition at line 454 of file DDHGCalSiliconRotatedModule.cc.

◆ cassette_

HGCalCassette HGCalSiliconRotatedModule::cassette_

Definition at line 417 of file DDHGCalSiliconRotatedModule.cc.

◆ cassettes_

int HGCalSiliconRotatedModule::cassettes_

Definition at line 430 of file DDHGCalSiliconRotatedModule.cc.

◆ cassetteShift_

std::vector<double> HGCalSiliconRotatedModule::cassetteShift_

Definition at line 452 of file DDHGCalSiliconRotatedModule.cc.

◆ copies_

std::unordered_set<int> HGCalSiliconRotatedModule::copies_

Definition at line 453 of file DDHGCalSiliconRotatedModule.cc.

◆ copyNumber_

std::vector<int> HGCalSiliconRotatedModule::copyNumber_

Definition at line 437 of file DDHGCalSiliconRotatedModule.cc.

◆ cosAlpha_

double HGCalSiliconRotatedModule::cosAlpha_

Definition at line 454 of file DDHGCalSiliconRotatedModule.cc.

◆ facingTypes_

int HGCalSiliconRotatedModule::facingTypes_

Definition at line 420 of file DDHGCalSiliconRotatedModule.cc.

◆ firstLayer_

int HGCalSiliconRotatedModule::firstLayer_

Definition at line 423 of file DDHGCalSiliconRotatedModule.cc.

◆ geomTools_

HGCalGeomTools HGCalSiliconRotatedModule::geomTools_

Definition at line 416 of file DDHGCalSiliconRotatedModule.cc.

◆ layers_

std::vector<int> HGCalSiliconRotatedModule::layers_

Definition at line 438 of file DDHGCalSiliconRotatedModule.cc.

◆ layerSense_

std::vector<int> HGCalSiliconRotatedModule::layerSense_

Definition at line 441 of file DDHGCalSiliconRotatedModule.cc.

◆ layerThick_

std::vector<double> HGCalSiliconRotatedModule::layerThick_

Definition at line 439 of file DDHGCalSiliconRotatedModule.cc.

◆ layerType_

std::vector<int> HGCalSiliconRotatedModule::layerType_

Definition at line 440 of file DDHGCalSiliconRotatedModule.cc.

◆ layerTypes_

std::vector<int> HGCalSiliconRotatedModule::layerTypes_

Definition at line 448 of file DDHGCalSiliconRotatedModule.cc.

◆ materials_

std::vector<std::string> HGCalSiliconRotatedModule::materials_

Definition at line 434 of file DDHGCalSiliconRotatedModule.cc.

◆ names_

std::vector<std::string> HGCalSiliconRotatedModule::names_

Definition at line 435 of file DDHGCalSiliconRotatedModule.cc.

◆ orientationTypes_

int HGCalSiliconRotatedModule::orientationTypes_

Definition at line 421 of file DDHGCalSiliconRotatedModule.cc.

◆ placeOffset_

int HGCalSiliconRotatedModule::placeOffset_

Definition at line 422 of file DDHGCalSiliconRotatedModule.cc.

◆ rMaxFront_

std::vector<double> HGCalSiliconRotatedModule::rMaxFront_

Definition at line 447 of file DDHGCalSiliconRotatedModule.cc.

◆ rMinFront_

std::vector<double> HGCalSiliconRotatedModule::rMinFront_

Definition at line 444 of file DDHGCalSiliconRotatedModule.cc.

◆ rotstr_

std::string HGCalSiliconRotatedModule::rotstr_

Definition at line 431 of file DDHGCalSiliconRotatedModule.cc.

◆ sectors_

int HGCalSiliconRotatedModule::sectors_

Definition at line 429 of file DDHGCalSiliconRotatedModule.cc.

◆ sensitiveMode_

int HGCalSiliconRotatedModule::sensitiveMode_

Definition at line 425 of file DDHGCalSiliconRotatedModule.cc.

◆ slopeB_

std::vector<double> HGCalSiliconRotatedModule::slopeB_

Definition at line 442 of file DDHGCalSiliconRotatedModule.cc.

◆ slopeT_

std::vector<double> HGCalSiliconRotatedModule::slopeT_

Definition at line 445 of file DDHGCalSiliconRotatedModule.cc.

◆ thick_

std::vector<double> HGCalSiliconRotatedModule::thick_

Definition at line 436 of file DDHGCalSiliconRotatedModule.cc.

◆ waferFull_

std::vector<std::string> HGCalSiliconRotatedModule::waferFull_

Definition at line 432 of file DDHGCalSiliconRotatedModule.cc.

◆ waferIndex_

std::vector<int> HGCalSiliconRotatedModule::waferIndex_

Definition at line 449 of file DDHGCalSiliconRotatedModule.cc.

◆ waferLayerStart_

std::vector<int> HGCalSiliconRotatedModule::waferLayerStart_

Definition at line 451 of file DDHGCalSiliconRotatedModule.cc.

◆ waferPart_

std::vector<std::string> HGCalSiliconRotatedModule::waferPart_

Definition at line 433 of file DDHGCalSiliconRotatedModule.cc.

◆ waferProperty_

std::vector<int> HGCalSiliconRotatedModule::waferProperty_

Definition at line 450 of file DDHGCalSiliconRotatedModule.cc.

◆ waferSepar_

double HGCalSiliconRotatedModule::waferSepar_

Definition at line 428 of file DDHGCalSiliconRotatedModule.cc.

◆ waferSize_

double HGCalSiliconRotatedModule::waferSize_

Definition at line 427 of file DDHGCalSiliconRotatedModule.cc.

◆ waferTypes_

int HGCalSiliconRotatedModule::waferTypes_

Definition at line 419 of file DDHGCalSiliconRotatedModule.cc.

◆ zFrontB_

std::vector<double> HGCalSiliconRotatedModule::zFrontB_

Definition at line 443 of file DDHGCalSiliconRotatedModule.cc.

◆ zFrontT_

std::vector<double> HGCalSiliconRotatedModule::zFrontT_

Definition at line 446 of file DDHGCalSiliconRotatedModule.cc.

◆ zMinBlock_

double HGCalSiliconRotatedModule::zMinBlock_

Definition at line 426 of file DDHGCalSiliconRotatedModule.cc.