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 > layerOrient_
 
std::vector< int > layers_
 
std::vector< int > layerSense_
 
std::vector< double > layerThick_
 
std::vector< int > layerType_
 
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, 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(), cms::DDNamespace::material(), g4SimHits_cfi::Material, SiStripPI::min, Skims_PA_cff::name, cms::DDNamespace::name(), HGCalGeometryMode::Polyhedra, PixelTestBeamValidation_cfi::Position, cms::DDNamespace::prepend(), HGCalGeomTools::radius(), makeMuonMisalignmentScenario::rot, cms::DDNamespace::rotation(), cms::rotation_utils::rotName(), AlCaHLTBitMon_QueryRunRegistry::string, to_string(), cms::DDNamespace::volume(), HGCalTypes::WaferCenterR, 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_ << " with " << 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  layerOrient_ = args.value<std::vector<int>>("LayerTypes");
119  for (unsigned int k = 0; k < layerOrient_.size(); ++k)
121 #ifdef EDM_ML_DEBUG
122  for (unsigned int i = 0; i < layerOrient_.size(); ++i)
123  edm::LogVerbatim("HGCalGeom") << "LayerTypes [" << i << "] " << layerOrient_[i];
124 #endif
125  if (firstLayer_ > 0) {
126  for (unsigned int i = 0; i < layerType_.size(); ++i) {
127  if (layerSense_[i] > 0) {
128  int ii = layerType_[i];
129  copyNumber_[ii] = (layerSense_[i] == 1) ? firstLayer_ : (firstLayer_ + 1);
130 #ifdef EDM_ML_DEBUG
131  edm::LogVerbatim("HGCalGeom") << "First copy number for layer type " << i << ":" << ii << " with "
132  << materials_[ii] << " changed to " << copyNumber_[ii];
133 #endif
134  }
135  }
136  } else {
137  firstLayer_ = 1;
138  }
139 #ifdef EDM_ML_DEBUG
140  edm::LogVerbatim("HGCalGeom") << "There are " << layerType_.size() << " layers";
141  for (unsigned int i = 0; i < layerType_.size(); ++i)
142  edm::LogVerbatim("HGCalGeom") << "Layer [" << i << "] with material type " << layerType_[i] << " sensitive class "
143  << layerSense_[i];
144 #endif
145  slopeB_ = args.value<std::vector<double>>("SlopeBottom");
146  zFrontB_ = args.value<std::vector<double>>("ZFrontBottom");
147  rMinFront_ = args.value<std::vector<double>>("RMinFront");
148  slopeT_ = args.value<std::vector<double>>("SlopeTop");
149  zFrontT_ = args.value<std::vector<double>>("ZFrontTop");
150  rMaxFront_ = args.value<std::vector<double>>("RMaxFront");
151 #ifdef EDM_ML_DEBUG
152  for (unsigned int i = 0; i < slopeB_.size(); ++i)
153  edm::LogVerbatim("HGCalGeom") << "Bottom Block [" << i << "] Zmin " << cms::convert2mm(zFrontB_[i]) << " Rmin "
154  << cms::convert2mm(rMinFront_[i]) << " Slope " << slopeB_[i];
155  for (unsigned int i = 0; i < slopeT_.size(); ++i)
156  edm::LogVerbatim("HGCalGeom") << "Top Block [" << i << "] Zmin " << cms::convert2mm(zFrontT_[i]) << " Rmax "
157  << cms::convert2mm(rMaxFront_[i]) << " Slope " << slopeT_[i];
158 #endif
159  waferIndex_ = args.value<std::vector<int>>("WaferIndex");
160  waferProperty_ = args.value<std::vector<int>>("WaferProperties");
161  waferLayerStart_ = args.value<std::vector<int>>("WaferLayerStart");
162  cassetteShift_ = args.value<std::vector<double>>("CassetteShift");
163 #ifdef EDM_ML_DEBUG
164  edm::LogVerbatim("HGCalGeom") << "waferProperties with " << waferIndex_.size() << " entries in "
165  << waferLayerStart_.size() << " layers";
166  for (unsigned int k = 0; k < waferLayerStart_.size(); ++k)
167  edm::LogVerbatim("HGCalGeom") << "LayerStart[" << k << "] " << waferLayerStart_[k];
168  for (unsigned int k = 0; k < waferIndex_.size(); ++k)
169  edm::LogVerbatim("HGCalGeom") << "Wafer[" << k << "] " << waferIndex_[k] << " ("
172  << HGCalWaferIndex::waferV(waferIndex_[k]) << ") : ("
176  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << cassetteShift_.size()
177  << " elements for cassette shifts";
178  unsigned int j1max = cassetteShift_.size();
179  for (unsigned int j1 = 0; j1 < j1max; j1 += 6) {
180  std::ostringstream st1;
181  unsigned int j2 = std::min((j1 + 6), j1max);
182  for (unsigned int j = j1; j < j2; ++j)
183  st1 << " [" << j << "] " << std::setw(9) << cms::convert2mm(cassetteShift_[j]);
184  edm::LogVerbatim("HGCalGeom") << st1.str();
185  }
186 
187  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: NameSpace " << ns.name();
188 #endif
190 
191 #ifdef EDM_ML_DEBUG
192  edm::LogVerbatim("HGCalGeom") << "==>> Constructing DDHGCalSiliconRotatedModule...";
193  copies_.clear();
194 #endif
195 
196  double zi(zMinBlock_);
197  int laymin(0);
198  for (unsigned int i = 0; i < layers_.size(); ++i) {
199  double zo = zi + layerThick_[i];
200  double routF = HGCalGeomTools::radius(zi, zFrontT_, rMaxFront_, slopeT_);
201  int laymax = laymin + layers_[i];
202  double zz = zi;
203  double thickTot(0);
204  for (int ly = laymin; ly < laymax; ++ly) {
205  int ii = layerType_[ly];
206  int copy = copyNumber_[ii];
207  double hthick = 0.5 * thick_[ii];
208  double rinB = HGCalGeomTools::radius(zo - tol1, zFrontB_, rMinFront_, slopeB_);
209  zz += hthick;
210  thickTot += thick_[ii];
211 
213 #ifdef EDM_ML_DEBUG
214  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: Layer " << ly << ":" << ii << " Front "
215  << cms::convert2mm(zi) << ", " << cms::convert2mm(routF) << " Back "
216  << cms::convert2mm(zo) << ", " << cms::convert2mm(rinB)
217  << " superlayer thickness " << cms::convert2mm(layerThick_[i]);
218 #endif
219 
220  dd4hep::Material matter = ns.material(materials_[ii]);
221  dd4hep::Volume glog;
222 
223  if (layerSense_[ly] < 1) {
224  std::vector<double> pgonZ, pgonRin, pgonRout;
225  double rmax = routF * cosAlpha_ - tol1;
226  HGCalGeomTools::radius(zz - hthick,
227  zz + hthick,
228  zFrontB_,
229  rMinFront_,
230  slopeB_,
231  zFrontT_,
232  rMaxFront_,
233  slopeT_,
234  -layerSense_[ly],
235  pgonZ,
236  pgonRin,
237  pgonRout);
238  for (unsigned int isec = 0; isec < pgonZ.size(); ++isec) {
239  pgonZ[isec] -= zz;
240  if (layerSense_[ly] == 0 || absorbMode_ == 0)
241  pgonRout[isec] = rmax;
242  else
243  pgonRout[isec] = pgonRout[isec] * cosAlpha_ - tol1;
244  }
245  dd4hep::Solid solid = dd4hep::Polyhedra(sectors_, -alpha_, 2._pi, pgonZ, pgonRin, pgonRout);
246  ns.addSolidNS(ns.prepend(name), solid);
247  glog = dd4hep::Volume(solid.name(), solid, matter);
248  ns.addVolumeNS(glog);
249 #ifdef EDM_ML_DEBUG
250  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << solid.name() << " polyhedra of "
251  << sectors_ << " sectors covering " << convertRadToDeg(-alpha_) << ":"
252  << convertRadToDeg(-alpha_ + 2._pi) << " with " << pgonZ.size()
253  << " sections and filled with " << matter.name();
254  for (unsigned int k = 0; k < pgonZ.size(); ++k)
255  edm::LogVerbatim("HGCalGeom") << "[" << k << "] z " << cms::convert2mm(pgonZ[k]) << " R "
256  << cms::convert2mm(pgonRin[k]) << ":" << cms::convert2mm(pgonRout[k]);
257 #endif
258  } else {
259  double rins =
260  (sensitiveMode_ < 1) ? rinB : HGCalGeomTools::radius(zz + hthick - tol1, zFrontB_, rMinFront_, slopeB_);
261  double routs =
262  (sensitiveMode_ < 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_);
263  dd4hep::Solid solid = dd4hep::Tube(rins, routs, hthick, 0.0, 2._pi);
264  ns.addSolidNS(ns.prepend(name), solid);
265  glog = dd4hep::Volume(solid.name(), solid, matter);
266  ns.addVolumeNS(glog);
267 
268 #ifdef EDM_ML_DEBUG
269  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << solid.name() << " Tubs made of "
270  << matter.name() << " of dimensions " << cms::convert2mm(rinB) << ":"
271  << cms::convert2mm(rins) << ", " << cms::convert2mm(routF) << ":"
272  << cms::convert2mm(routs) << ", " << cms::convert2mm(hthick)
273  << ", 0.0, 360.0 and position " << glog.name() << " number " << copy << ":"
275 #endif
276  positionSensitive(ctxt, e, glog, (copy - firstLayer_));
277  }
278 
279  dd4hep::Position r1(0, 0, zz);
280  dd4hep::Rotation3D rot;
281 #ifdef EDM_ML_DEBUG
282  std::string rotName("Null");
283 #endif
285  rot = ns.rotation(rotstr_);
286 #ifdef EDM_ML_DEBUG
287  rotName = rotstr_;
288 #endif
289  }
290  mother.placeVolume(glog, copy, dd4hep::Transform3D(rot, r1));
291  int inc = ((layerSense_[ly] > 0) && (facingTypes_ > 1)) ? 2 : 1;
292  copyNumber_[ii] = copy + inc;
293 #ifdef EDM_ML_DEBUG
294  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << glog.name() << " number " << copy
295  << " positioned in " << mother.name() << " at (0,0," << cms::convert2mm(zz)
296  << ") with " << rotName << " rotation";
297 #endif
298  zz += hthick;
299  } // End of loop over layers in a block
300  zi = zo;
301  laymin = laymax;
302  // Make consistency check of all the partitions of the block
303  if (std::abs(thickTot - layerThick_[i]) >= tol2) {
304  if (thickTot > layerThick_[i]) {
305  edm::LogError("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick_[i])
306  << " is smaller than " << cms::convert2mm(thickTot)
307  << ": thickness of all its components **** ERROR ****";
308  } else {
309  edm::LogWarning("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick_[i])
310  << " does not match with " << cms::convert2mm(thickTot) << " of the components";
311  }
312  }
313  } // End of loop over blocks
314 
315 #ifdef EDM_ML_DEBUG
316  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << copies_.size()
317  << " different wafer copy numbers";
318  int k(0);
319  for (std::unordered_set<int>::const_iterator itr = copies_.begin(); itr != copies_.end(); ++itr, ++k) {
320  edm::LogVerbatim("HGCalGeom") << "Copy [" << k << "] : " << (*itr);
321  }
322  copies_.clear();
323  edm::LogVerbatim("HGCalGeom") << "<<== End of DDHGCalSiliconRotatedModule construction...";
324 #endif
325  }
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
std::vector< std::string > materials_
Log< level::Error, false > LogError
int32_t waferOrient(const int32_t property)
static std::string to_string(const XMLCh *ch)
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)
void setParameter(int cassette, const std::vector< double > &shifts, bool both=true)
Definition: HGCalCassette.cc:8
dd4hep::Volume Volume
ii
Definition: cuy.py:589
static constexpr int32_t WaferCenterR
Definition: HGCalTypes.h:27
int32_t waferPartial(const int32_t property)
int32_t waferV(const int32_t index)
std::vector< std::string > names_
Log< level::Warning, false > LogWarning
static int32_t layerType(int type)
Definition: HGCalTypes.cc:42
void positionSensitive(cms::DDParsingContext &ctxt, xml_h e, const dd4hep::Volume &glog, int layer)
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 327 of file DDHGCalSiliconRotatedModule.cc.

References funct::abs(), angle(), HGCalCell::cellPlacementIndex(), cms::convert2mm(), angle_units::operators::convertRadToDeg(), filterCSVwithJSON::copy, PVValHelper::dy, MillePedeFileConverter_cfg::e, mps_fire::i, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::iv, dqmdumpme::k, EgHLTOffHistBins_cfi::nr, HGCalTypes::packTypeUV(), PixelTestBeamValidation_cfi::Position, mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, findQualityFiles::v, cms::DDNamespace::volume(), HGCalProperty::waferCassette(), HGCalTypes::WaferCenterB, HGCalTypes::WaferFull, HGCalTypes::WaferHDTop, HGCalWaferIndex::waferLayer(), HGCalProperty::waferOrient(), HGCalTypes::WaferPartHDOffset, HGCalProperty::waferPartial(), HGCalTypes::WaferPartLDOffset, HGCalProperty::waferThick(), HGCalTypes::WaferTypeOffset, HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

327  {
328  cms::DDNamespace ns(ctxt, e, true);
329  static const double sqrt3 = std::sqrt(3.0);
330  int layercenter = layerOrient_[layer];
331  int layertype = (layerOrient_[layer] == HGCalTypes::WaferCenterB) ? 1 : 0;
332  int firstWafer = waferLayerStart_[layer];
333  int lastWafer = ((layer + 1 < static_cast<int>(waferLayerStart_.size())) ? waferLayerStart_[layer + 1]
334  : static_cast<int>(waferIndex_.size()));
335  double delx = 0.5 * (waferSize_ + waferSepar_);
336  double dely = 2.0 * delx / sqrt3;
337  double dy = 0.75 * dely;
338  const auto& xyoff = geomTools_.shiftXY(layercenter, (waferSize_ + waferSepar_));
339 #ifdef EDM_ML_DEBUG
340  int ium(0), ivm(0), kount(0);
341  std::vector<int> ntype(3, 0);
342  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << glog.name() << " r " << cms::convert2mm(delx)
343  << " R " << cms::convert2mm(dely) << " dy " << cms::convert2mm(dy) << " Shift "
344  << cms::convert2mm(xyoff.first) << ":" << cms::convert2mm(xyoff.second)
345  << " WaferSize " << cms::convert2mm((waferSize_ + waferSepar_)) << " index "
346  << firstWafer << ":" << (lastWafer - 1) << " Layer Center " << layercenter << ":"
347  << layertype;
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, -1, cassette);
364  double xpos = xyoff.first - cshift.first + nc * delx;
365  double ypos = xyoff.second + cshift.second + nr * dy;
366 #ifdef EDM_ML_DEBUG
367  double xorig = xyoff.first + nc * delx;
368  double yorig = xyoff.second + nr * dy;
369  double angle = std::atan2(yorig, xorig);
370  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule::Wafer: layer " << layer + 1 << " cassette "
371  << cassette << " Shift " << cms::convert2mm(cshift.first) << ":"
372  << cms::convert2mm(cshift.second) << " Original " << cms::convert2mm(xorig) << ":"
373  << cms::convert2mm(yorig) << ":" << convertRadToDeg(angle) << " Final "
374  << cms::convert2mm(xpos) << ":" << cms::convert2mm(ypos) << " u|v " << u << ":" << v
375  << " type|part|orient|place " << type << ":" << part << ":" << orien << ":"
376  << place;
377 #endif
378  std::string wafer;
379  int i(999);
380  if (part == HGCalTypes::WaferFull) {
382  wafer = waferFull_[i];
383 #ifdef EDM_ML_DEBUG
384  edm::LogVerbatim("HGCalGeom") << " layertype:type:part:orien:cassette:place:offsets:ind " << layertype << ":"
385  << type << ":" << part << ":" << orien << ":" << cassette << ":" << place << ":"
386  << placeOffset_ << ":" << facingTypes_ << ":" << orientationTypes_ << " wafer "
387  << i << ":" << wafer;
388 #endif
389  } else {
390  int partoffset =
392  i = (part - partoffset) * facingTypes_ * orientationTypes_ +
394 #ifdef EDM_ML_DEBUG
395  edm::LogVerbatim("HGCalGeom") << " layertype:type:part:orien:cassette:place:offsets:ind " << layertype << ":"
396  << type << ":" << part << ":" << orien << ":" << cassette << ":" << place << ":"
397  << partoffset << ":" << HGCalTypes::WaferTypeOffset[type] << ":" << i << ":"
398  << waferPart_.size();
399 #endif
400  wafer = waferPart_[i];
401  }
402  int copy = HGCalTypes::packTypeUV(type, u, v);
403 #ifdef EDM_ML_DEBUG
404  edm::LogVerbatim("HGCalGeom") << " DDHGCalSiliconRotatedModule: Layer"
405  << HGCalWaferIndex::waferLayer(waferIndex_[k]) << " Wafer " << wafer << " number "
406  << copy << " type:part:orien:ind " << type << ":" << part << ":" << orien << ":"
407  << i << " layer:u:v:indx " << (layer + firstLayer_) << ":" << u << ":" << v;
408  if (iu > ium)
409  ium = iu;
410  if (iv > ivm)
411  ivm = iv;
412  kount++;
413  if (copies_.count(copy) == 0)
414  copies_.insert(copy);
415 #endif
416  dd4hep::Position tran(xpos, ypos, 0.0);
417  glog.placeVolume(ns.volume(wafer), copy, tran);
418 #ifdef EDM_ML_DEBUG
419  ++ntype[type];
420  edm::LogVerbatim("HGCalGeom") << " DDHGCalSiliconRotatedModule: " << wafer << " number " << copy << " type "
421  << layertype << ":" << type << " positioned in " << glog.name() << " at ("
422  << cms::convert2mm(xpos) << "," << cms::convert2mm(ypos) << ",0) with no rotation";
423 #endif
424  }
425 
426 #ifdef EDM_ML_DEBUG
427  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: Maximum # of u " << ium << " # of v " << ivm
428  << " and " << kount << " wafers (" << ntype[0] << ":" << ntype[1] << ":" << ntype[2]
429  << ") for " << glog.name();
430 #endif
431  }
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
int32_t waferOrient(const int32_t property)
std::pair< double, double > shiftXY(int waferPosition, double waferSize) const
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
std::vector< std::string > waferFull_
int32_t waferThick(const int32_t property)
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
static constexpr int32_t WaferCenterB
Definition: HGCalTypes.h:26
std::vector< std::string > waferPart_
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11

Member Data Documentation

◆ absorbMode_

int HGCalSiliconRotatedModule::absorbMode_

Definition at line 442 of file DDHGCalSiliconRotatedModule.cc.

◆ alpha_

double HGCalSiliconRotatedModule::alpha_

Definition at line 472 of file DDHGCalSiliconRotatedModule.cc.

◆ cassette_

HGCalCassette HGCalSiliconRotatedModule::cassette_

Definition at line 435 of file DDHGCalSiliconRotatedModule.cc.

◆ cassettes_

int HGCalSiliconRotatedModule::cassettes_

Definition at line 448 of file DDHGCalSiliconRotatedModule.cc.

◆ cassetteShift_

std::vector<double> HGCalSiliconRotatedModule::cassetteShift_

Definition at line 470 of file DDHGCalSiliconRotatedModule.cc.

◆ copies_

std::unordered_set<int> HGCalSiliconRotatedModule::copies_

Definition at line 471 of file DDHGCalSiliconRotatedModule.cc.

◆ copyNumber_

std::vector<int> HGCalSiliconRotatedModule::copyNumber_

Definition at line 455 of file DDHGCalSiliconRotatedModule.cc.

◆ cosAlpha_

double HGCalSiliconRotatedModule::cosAlpha_

Definition at line 472 of file DDHGCalSiliconRotatedModule.cc.

◆ facingTypes_

int HGCalSiliconRotatedModule::facingTypes_

Definition at line 438 of file DDHGCalSiliconRotatedModule.cc.

◆ firstLayer_

int HGCalSiliconRotatedModule::firstLayer_

Definition at line 441 of file DDHGCalSiliconRotatedModule.cc.

◆ geomTools_

HGCalGeomTools HGCalSiliconRotatedModule::geomTools_

Definition at line 434 of file DDHGCalSiliconRotatedModule.cc.

◆ layerOrient_

std::vector<int> HGCalSiliconRotatedModule::layerOrient_

Definition at line 466 of file DDHGCalSiliconRotatedModule.cc.

◆ layers_

std::vector<int> HGCalSiliconRotatedModule::layers_

Definition at line 456 of file DDHGCalSiliconRotatedModule.cc.

◆ layerSense_

std::vector<int> HGCalSiliconRotatedModule::layerSense_

Definition at line 459 of file DDHGCalSiliconRotatedModule.cc.

◆ layerThick_

std::vector<double> HGCalSiliconRotatedModule::layerThick_

Definition at line 457 of file DDHGCalSiliconRotatedModule.cc.

◆ layerType_

std::vector<int> HGCalSiliconRotatedModule::layerType_

Definition at line 458 of file DDHGCalSiliconRotatedModule.cc.

◆ materials_

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

Definition at line 452 of file DDHGCalSiliconRotatedModule.cc.

◆ names_

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

Definition at line 453 of file DDHGCalSiliconRotatedModule.cc.

◆ orientationTypes_

int HGCalSiliconRotatedModule::orientationTypes_

Definition at line 439 of file DDHGCalSiliconRotatedModule.cc.

◆ placeOffset_

int HGCalSiliconRotatedModule::placeOffset_

Definition at line 440 of file DDHGCalSiliconRotatedModule.cc.

◆ rMaxFront_

std::vector<double> HGCalSiliconRotatedModule::rMaxFront_

Definition at line 465 of file DDHGCalSiliconRotatedModule.cc.

◆ rMinFront_

std::vector<double> HGCalSiliconRotatedModule::rMinFront_

Definition at line 462 of file DDHGCalSiliconRotatedModule.cc.

◆ rotstr_

std::string HGCalSiliconRotatedModule::rotstr_

Definition at line 449 of file DDHGCalSiliconRotatedModule.cc.

◆ sectors_

int HGCalSiliconRotatedModule::sectors_

Definition at line 447 of file DDHGCalSiliconRotatedModule.cc.

◆ sensitiveMode_

int HGCalSiliconRotatedModule::sensitiveMode_

Definition at line 443 of file DDHGCalSiliconRotatedModule.cc.

◆ slopeB_

std::vector<double> HGCalSiliconRotatedModule::slopeB_

Definition at line 460 of file DDHGCalSiliconRotatedModule.cc.

◆ slopeT_

std::vector<double> HGCalSiliconRotatedModule::slopeT_

Definition at line 463 of file DDHGCalSiliconRotatedModule.cc.

◆ thick_

std::vector<double> HGCalSiliconRotatedModule::thick_

Definition at line 454 of file DDHGCalSiliconRotatedModule.cc.

◆ waferFull_

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

Definition at line 450 of file DDHGCalSiliconRotatedModule.cc.

◆ waferIndex_

std::vector<int> HGCalSiliconRotatedModule::waferIndex_

Definition at line 467 of file DDHGCalSiliconRotatedModule.cc.

◆ waferLayerStart_

std::vector<int> HGCalSiliconRotatedModule::waferLayerStart_

Definition at line 469 of file DDHGCalSiliconRotatedModule.cc.

◆ waferPart_

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

Definition at line 451 of file DDHGCalSiliconRotatedModule.cc.

◆ waferProperty_

std::vector<int> HGCalSiliconRotatedModule::waferProperty_

Definition at line 468 of file DDHGCalSiliconRotatedModule.cc.

◆ waferSepar_

double HGCalSiliconRotatedModule::waferSepar_

Definition at line 446 of file DDHGCalSiliconRotatedModule.cc.

◆ waferSize_

double HGCalSiliconRotatedModule::waferSize_

Definition at line 445 of file DDHGCalSiliconRotatedModule.cc.

◆ waferTypes_

int HGCalSiliconRotatedModule::waferTypes_

Definition at line 437 of file DDHGCalSiliconRotatedModule.cc.

◆ zFrontB_

std::vector<double> HGCalSiliconRotatedModule::zFrontB_

Definition at line 461 of file DDHGCalSiliconRotatedModule.cc.

◆ zFrontT_

std::vector<double> HGCalSiliconRotatedModule::zFrontT_

Definition at line 464 of file DDHGCalSiliconRotatedModule.cc.

◆ zMinBlock_

double HGCalSiliconRotatedModule::zMinBlock_

Definition at line 444 of file DDHGCalSiliconRotatedModule.cc.