CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes
DDHGCalSiliconModule Class Reference
Inheritance diagram for DDHGCalSiliconModule:

Public Member Functions

 DDHGCalSiliconModule ()
 
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 positionSensitive (const DDLogicalPart &glog, int layer, DDCompactView &cpv)
 

Private Attributes

int absorbMode_
 
double alpha_
 
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_
 
std::string nameSpace_
 
int orientationTypes_
 
int partialTypes_
 
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_
 

Static Private Attributes

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

Detailed Description

Definition at line 36 of file DDHGCalSiliconModule.cc.

Constructor & Destructor Documentation

◆ DDHGCalSiliconModule()

DDHGCalSiliconModule::DDHGCalSiliconModule ( )

Definition at line 94 of file DDHGCalSiliconModule.cc.

94  {
95 #ifdef EDM_ML_DEBUG
96  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: Creating an instance";
97 #endif
98 }
Log< level::Info, true > LogVerbatim

Member Function Documentation

◆ constructLayers()

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

Definition at line 260 of file DDHGCalSiliconModule.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, dqmdumpme::k, Skims_PA_cff::name, DDBase< N, C >::name(), DDSolidFactory::polyhedra(), DDCompactView::position(), HGCalGeomTools::radius(), makeMuonMisalignmentScenario::rot, cms::rotation_utils::rotName(), edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, to_string(), DDSolidFactory::tubs(), HGCalTypes::WaferCenterR, and geometryCSVtoXML::zz.

260  {
261  double zi(zMinBlock_);
262  int laymin(0);
263  for (unsigned int i = 0; i < layers_.size(); i++) {
264  double zo = zi + layerThick_[i];
265  double routF = HGCalGeomTools::radius(zi, zFrontT_, rMaxFront_, slopeT_);
266  int laymax = laymin + layers_[i];
267  double zz = zi;
268  double thickTot(0);
269  for (int ly = laymin; ly < laymax; ++ly) {
270  int ii = layerType_[ly];
271  int copy = copyNumber_[ii];
272  double hthick = 0.5 * thick_[ii];
273  double rinB = HGCalGeomTools::radius(zo - tol1_, zFrontB_, rMinFront_, slopeB_);
274  zz += hthick;
275  thickTot += thick_[ii];
276 
278 #ifdef EDM_ML_DEBUG
279  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: Layer " << ly << ":" << ii << " Front " << zi << ", "
280  << routF << " Back " << zo << ", " << rinB << " superlayer thickness "
281  << layerThick_[i];
282 #endif
284  DDMaterial matter(matName);
285  DDLogicalPart glog;
286  if (layerSense_[ly] < 1) {
287  std::vector<double> pgonZ, pgonRin, pgonRout;
288  double rmax = routF * cosAlpha_ - tol1_;
289  HGCalGeomTools::radius(zz - hthick,
290  zz + hthick,
291  zFrontB_,
292  rMinFront_,
293  slopeB_,
294  zFrontT_,
295  rMaxFront_,
296  slopeT_,
297  -layerSense_[ly],
298  pgonZ,
299  pgonRin,
300  pgonRout);
301  for (unsigned int isec = 0; isec < pgonZ.size(); ++isec) {
302  pgonZ[isec] -= zz;
303  if (layerSense_[ly] == 0 || absorbMode_ == 0)
304  pgonRout[isec] = rmax;
305  else
306  pgonRout[isec] = pgonRout[isec] * cosAlpha_ - tol1_;
307  }
308  DDSolid solid =
309  DDSolidFactory::polyhedra(DDName(name, nameSpace_), sectors_, -alpha_, 2._pi, pgonZ, pgonRin, pgonRout);
310  glog = DDLogicalPart(solid.ddname(), matter, solid);
311 #ifdef EDM_ML_DEBUG
312  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: " << solid.name() << " polyhedra of " << sectors_
313  << " sectors covering " << convertRadToDeg(-alpha_) << ":"
314  << convertRadToDeg(-alpha_ + 2._pi) << " with " << pgonZ.size()
315  << " sections and filled with " << matName;
316  for (unsigned int k = 0; k < pgonZ.size(); ++k)
317  edm::LogVerbatim("HGCalGeom") << "[" << k << "] z " << pgonZ[k] << " R " << pgonRin[k] << ":" << pgonRout[k];
318 #endif
319  } else {
320  double rins =
322  double routs =
323  (sensitiveMode_ < 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_);
324  DDSolid solid = DDSolidFactory::tubs(DDName(name, nameSpace_), hthick, rins, routs, 0.0, 2._pi);
325  glog = DDLogicalPart(solid.ddname(), matter, solid);
326 #ifdef EDM_ML_DEBUG
327  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: " << solid.name() << " Tubs made of " << matName
328  << " of dimensions " << rinB << ":" << rins << ", " << routF << ":" << routs
329  << ", " << hthick << ", 0.0, 360.0 and position " << glog.name() << " number "
330  << copy << ":" << layerOrient_[copy - firstLayer_];
331 #endif
332  positionSensitive(glog, (copy - firstLayer_), cpv);
333  }
334  DDTranslation r1(0, 0, zz);
335  DDRotation rot;
336 #ifdef EDM_ML_DEBUG
337  std::string rotName("Null");
338 #endif
341 #ifdef EDM_ML_DEBUG
342  rotName = rotstr_;
343 #endif
344  }
345  cpv.position(glog, module, copy, r1, rot);
346  int inc = ((layerSense_[ly] > 0) && (facingTypes_ > 1)) ? 2 : 1;
347  copyNumber_[ii] = copy + inc;
348 #ifdef EDM_ML_DEBUG
349  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: " << glog.name() << " number " << copy
350  << " positioned in " << module.name() << " at " << r1 << " with " << rotName
351  << " rotation";
352 #endif
353  zz += hthick;
354  } // End of loop over layers in a block
355  zi = zo;
356  laymin = laymax;
357  // Make consistency check of all the partitions of the block
358  if (std::abs(thickTot - layerThick_[i]) >= tol2_) {
359  if (thickTot > layerThick_[i]) {
360  edm::LogError("HGCalGeom") << "Thickness of the partition " << layerThick_[i] << " is smaller than " << thickTot
361  << ": thickness of all its components **** ERROR ****";
362  } else {
363  edm::LogWarning("HGCalGeom") << "Thickness of the partition " << layerThick_[i] << " does not match with "
364  << thickTot << " of the components";
365  }
366  }
367  } // End of loop over blocks
368 }
std::vector< double > rMaxFront_
Log< level::Info, true > LogVerbatim
std::vector< double > zFrontT_
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)
std::vector< int > layerSense_
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
void positionSensitive(const DDLogicalPart &glog, int layer, DDCompactView &cpv)
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
std::vector< std::string > materials_
std::vector< double > slopeT_
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
std::vector< double > thick_
std::vector< int > layers_
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
static const std::string & rotName(const T &rot, const cms::DDParsingContext &context)
U second(std::pair< T, U > const &p)
std::vector< double > layerThick_
std::vector< std::string > names_
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
std::vector< int > copyNumber_
ii
Definition: cuy.py:589
const N & name() const
Definition: DDBase.h:59
static constexpr int32_t WaferCenterR
Definition: HGCalTypes.h:27
std::vector< int > layerOrient_
static constexpr double tol1_
std::vector< double > zFrontB_
const N & ddname() const
Definition: DDBase.h:61
std::vector< double > rMinFront_
std::vector< int > layerType_
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
static constexpr double tol2_
std::vector< double > slopeB_

◆ execute()

void DDHGCalSiliconModule::execute ( DDCompactView cpv)
override

Definition at line 243 of file DDHGCalSiliconModule.cc.

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

243  {
244 #ifdef EDM_ML_DEBUG
245  edm::LogVerbatim("HGCalGeom") << "==>> Constructing DDHGCalSiliconModule...";
246  copies_.clear();
247 #endif
248  constructLayers(parent(), cpv);
249 #ifdef EDM_ML_DEBUG
250  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: " << copies_.size() << " different wafer copy numbers";
251  int k(0);
252  for (std::unordered_set<int>::const_iterator itr = copies_.begin(); itr != copies_.end(); ++itr, ++k) {
253  edm::LogVerbatim("HGCalGeom") << "Copy [" << k << "] : " << (*itr);
254  }
255  copies_.clear();
256  edm::LogVerbatim("HGCalGeom") << "<<== End of DDHGCalSiliconModule construction...";
257 #endif
258 }
Log< level::Info, true > LogVerbatim
void constructLayers(const DDLogicalPart &, DDCompactView &cpv)
std::unordered_set< int > copies_

◆ initialize()

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

Definition at line 100 of file DDHGCalSiliconModule.cc.

References angle_units::operators::convertRadToDeg(), funct::cos(), dbl_to_int(), mps_fire::i, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, cuy::ii, createfilelist::int, dqmdumpme::k, HGCalTypes::layerType(), SiStripPI::min, DDCurrentNamespace::ns(), HGCalWaferIndex::waferLayer(), HGCalProperty::waferOrient(), HGCalProperty::waferPartial(), HGCalProperty::waferThick(), HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

104  {
105  waferTypes_ = static_cast<int>(nArgs["WaferTypes"]);
106  facingTypes_ = static_cast<int>(nArgs["FacingTypes"]);
107  partialTypes_ = static_cast<int>(nArgs["PartialTypes"]);
108  orientationTypes_ = static_cast<int>(nArgs["OrientationTypes"]);
109 #ifdef EDM_ML_DEBUG
110  edm::LogVerbatim("HGCalGeom") << "Number of types of wafers: " << waferTypes_ << " facings: " << facingTypes_
111  << " partials: " << partialTypes_ << " Orientations: " << orientationTypes_;
112 #endif
113  firstLayer_ = static_cast<int>(nArgs["FirstLayer"]);
114  absorbMode_ = static_cast<int>(nArgs["AbsorberMode"]);
115  sensitiveMode_ = static_cast<int>(nArgs["SensitiveMode"]);
116 #ifdef EDM_ML_DEBUG
117  edm::LogVerbatim("HGCalGeom") << "First Layer " << firstLayer_ << " and "
118  << "Absober:Sensitive mode " << absorbMode_ << ":" << sensitiveMode_;
119 #endif
120  zMinBlock_ = nArgs["zMinBlock"];
121  waferSize_ = nArgs["waferSize"];
122  waferSepar_ = nArgs["SensorSeparation"];
123  sectors_ = (int)(nArgs["Sectors"]);
124  alpha_ = (1._pi) / sectors_;
125  cosAlpha_ = cos(alpha_);
126  rotstr_ = sArgs["LayerRotation"];
127 #ifdef EDM_ML_DEBUG
128  edm::LogVerbatim("HGCalGeom") << "zStart " << zMinBlock_ << " wafer width " << waferSize_ << " separations "
129  << waferSepar_ << " sectors " << sectors_ << ":" << convertRadToDeg(alpha_) << ":"
130  << cosAlpha_ << " rotation matrix " << rotstr_;
131 #endif
132  waferFull_ = vsArgs["WaferNamesFull"];
133  waferPart_ = vsArgs["WaferNamesPartial"];
134 #ifdef EDM_ML_DEBUG
135  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: " << waferFull_.size() << " full and " << waferPart_.size()
136  << " partial modules\nDDHGCalSiliconModule:Full Modules:";
137  unsigned int i1max = static_cast<unsigned int>(waferFull_.size());
138  for (unsigned int i1 = 0; i1 < i1max; i1 += 2) {
139  std::ostringstream st1;
140  unsigned int i2 = std::min((i1 + 2), i1max);
141  for (unsigned int i = i1; i < i2; ++i)
142  st1 << " [" << i << "] " << waferFull_[i];
143  edm::LogVerbatim("HGCalGeom") << st1.str() << std::endl;
144  }
145  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: Partial Modules:";
146  i1max = static_cast<unsigned int>(waferPart_.size());
147  for (unsigned int i1 = 0; i1 < i1max; i1 += 2) {
148  std::ostringstream st1;
149  unsigned int i2 = std::min((i1 + 2), i1max);
150  for (unsigned int i = i1; i < i2; ++i)
151  st1 << " [" << i << "] " << waferPart_[i];
152  edm::LogVerbatim("HGCalGeom") << st1.str() << std::endl;
153  }
154 #endif
155  materials_ = vsArgs["MaterialNames"];
156  names_ = vsArgs["VolumeNames"];
157  thick_ = vArgs["Thickness"];
158  copyNumber_.resize(materials_.size(), 1);
159 #ifdef EDM_ML_DEBUG
160  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: " << materials_.size() << " types of volumes";
161  for (unsigned int i = 0; i < names_.size(); ++i)
162  edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << names_[i] << " of thickness " << thick_[i]
163  << " filled with " << materials_[i] << " first copy number " << copyNumber_[i];
164 #endif
165  layers_ = dbl_to_int(vArgs["Layers"]);
166  layerThick_ = vArgs["LayerThick"];
167 #ifdef EDM_ML_DEBUG
168  edm::LogVerbatim("HGCalGeom") << "There are " << layers_.size() << " blocks";
169  for (unsigned int i = 0; i < layers_.size(); ++i)
170  edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] of thickness " << layerThick_[i] << " with " << layers_[i]
171  << " layers";
172 #endif
173  layerType_ = dbl_to_int(vArgs["LayerType"]);
174  layerSense_ = dbl_to_int(vArgs["LayerSense"]);
175  layerOrient_ = dbl_to_int(vArgs["LayerTypes"]);
176  for (unsigned int k = 0; k < layerOrient_.size(); ++k)
178 #ifdef EDM_ML_DEBUG
179  for (unsigned int i = 0; i < layerOrient_.size(); ++i)
180  edm::LogVerbatim("HGCalGeom") << "LayerTypes [" << i << "] " << layerOrient_[i];
181 #endif
182  if (firstLayer_ > 0) {
183  for (unsigned int i = 0; i < layerType_.size(); ++i) {
184  if (layerSense_[i] > 0) {
185  int ii = layerType_[i];
186  copyNumber_[ii] = (layerSense_[i] == 1) ? firstLayer_ : (firstLayer_ + 1);
187 #ifdef EDM_ML_DEBUG
188  edm::LogVerbatim("HGCalGeom") << "First copy number for layer type " << i << ":" << ii << " with "
189  << materials_[ii] << " changed to " << copyNumber_[ii];
190 #endif
191  }
192  }
193  } else {
194  firstLayer_ = 1;
195  }
196 #ifdef EDM_ML_DEBUG
197  edm::LogVerbatim("HGCalGeom") << "There are " << layerType_.size() << " layers";
198  for (unsigned int i = 0; i < layerType_.size(); ++i)
199  edm::LogVerbatim("HGCalGeom") << "Layer [" << i << "] with material type " << layerType_[i] << " sensitive class "
200  << layerSense_[i];
201 #endif
202  slopeB_ = vArgs["SlopeBottom"];
203  zFrontB_ = vArgs["ZFrontBottom"];
204  rMinFront_ = vArgs["RMinFront"];
205  slopeT_ = vArgs["SlopeTop"];
206  zFrontT_ = vArgs["ZFrontTop"];
207  rMaxFront_ = vArgs["RMaxFront"];
208 #ifdef EDM_ML_DEBUG
209  for (unsigned int i = 0; i < slopeB_.size(); ++i)
210  edm::LogVerbatim("HGCalGeom") << "Bottom Block [" << i << "] Zmin " << zFrontB_[i] << " Rmin " << rMinFront_[i]
211  << " Slope " << slopeB_[i];
212  for (unsigned int i = 0; i < slopeT_.size(); ++i)
213  edm::LogVerbatim("HGCalGeom") << "Top Block [" << i << "] Zmin " << zFrontT_[i] << " Rmax " << rMaxFront_[i]
214  << " Slope " << slopeT_[i];
215 #endif
216  waferIndex_ = dbl_to_int(vArgs["WaferIndex"]);
217  waferProperty_ = dbl_to_int(vArgs["WaferProperties"]);
218  waferLayerStart_ = dbl_to_int(vArgs["WaferLayerStart"]);
219 #ifdef EDM_ML_DEBUG
220  edm::LogVerbatim("HGCalGeom") << "waferProperties with " << waferIndex_.size() << " entries in "
221  << waferLayerStart_.size() << " layers";
222  for (unsigned int k = 0; k < waferLayerStart_.size(); ++k)
223  edm::LogVerbatim("HGCalGeom") << "LayerStart[" << k << "] " << waferLayerStart_[k];
224  for (unsigned int k = 0; k < waferIndex_.size(); ++k)
225  edm::LogVerbatim("HGCalGeom") << "Wafer[" << k << "] " << waferIndex_[k] << " ("
228  << HGCalWaferIndex::waferV(waferIndex_[k]) << ") : ("
232 #endif
234 #ifdef EDM_ML_DEBUG
235  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: NameSpace " << nameSpace_ << ":";
236 #endif
237 }
std::vector< double > rMaxFront_
Log< level::Info, true > LogVerbatim
std::vector< double > zFrontT_
std::vector< int > layerSense_
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::vector< std::string > materials_
std::vector< double > slopeT_
std::vector< int > waferIndex_
static std::string & ns()
std::vector< double > thick_
std::vector< int > layers_
int32_t waferOrient(const int32_t property)
std::vector< int > waferProperty_
std::vector< double > layerThick_
std::vector< std::string > names_
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
int32_t waferThick(const int32_t property)
std::vector< int > copyNumber_
ii
Definition: cuy.py:589
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::vector< int > layerOrient_
std::vector< int > waferLayerStart_
std::vector< double > zFrontB_
std::vector< std::string > waferPart_
std::vector< std::string > waferFull_
int32_t waferPartial(const int32_t property)
std::vector< double > rMinFront_
int32_t waferV(const int32_t index)
std::vector< int > layerType_
static int32_t layerType(int type)
Definition: HGCalTypes.cc:42
std::vector< double > slopeB_

◆ positionSensitive()

void DDHGCalSiliconModule::positionSensitive ( const DDLogicalPart glog,
int  layer,
DDCompactView cpv 
)
protected

Definition at line 370 of file DDHGCalSiliconModule.cc.

References funct::abs(), filterCSVwithJSON::copy, DDBase< N, C >::ddname(), DDSplit(), PVValHelper::dy, dqmdumpme::first, mps_fire::i, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::iv, dqmdumpme::k, Skims_PA_cff::name, EgHLTOffHistBins_cfi::nr, HGCalTypes::packTypeUV(), DDCompactView::position(), dttmaxenums::R, idealTransformation::rotation, edm::second(), mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, findQualityFiles::v, HGCalTypes::WaferCenterB, HGCalTypes::WaferFull, HGCalWaferIndex::waferLayer(), HGCalProperty::waferOrient(), HGCalProperty::waferPartial(), HGCalProperty::waferThick(), HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

370  {
371  static const double sqrt3 = std::sqrt(3.0);
372  int layercenter = layerOrient_[layer];
373  int layertype = (layerOrient_[layer] == HGCalTypes::WaferCenterB) ? 1 : 0;
374  int firstWafer = waferLayerStart_[layer];
375  int lastWafer = ((layer + 1 < static_cast<int>(waferLayerStart_.size())) ? waferLayerStart_[layer + 1]
376  : static_cast<int>(waferIndex_.size()));
377  double r = 0.5 * (waferSize_ + waferSepar_);
378  double R = 2.0 * r / sqrt3;
379  double dy = 0.75 * R;
380  const auto& xyoff = geomTools_.shiftXY(layercenter, (waferSize_ + waferSepar_));
381 #ifdef EDM_ML_DEBUG
382  int ium(0), ivm(0), kount(0);
383  std::vector<int> ntype(3, 0);
384  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: " << glog.ddname() << " r " << r << " R " << R << " dy "
385  << dy << " Shift " << xyoff.first << ":" << xyoff.second << " WaferSize "
386  << (waferSize_ + waferSepar_) << " index " << firstWafer << ":" << (lastWafer - 1);
387 #endif
388  for (int k = firstWafer; k < lastWafer; ++k) {
391 #ifdef EDM_ML_DEBUG
392  int iu = std::abs(u);
393  int iv = std::abs(v);
394 #endif
395  int nr = 2 * v;
396  int nc = -2 * u + v;
397  double xpos = xyoff.first + nc * r;
398  double ypos = xyoff.second + nr * dy;
402  std::string wafer;
403  int i(999);
404  if (part == HGCalTypes::WaferFull) {
405  i = layertype * waferTypes_ + type;
406  wafer = waferFull_[i];
407  } else {
409  type * orientationTypes_ + orien;
410 #ifdef EDM_ML_DEBUG
411  edm::LogVerbatim("HGCalGeom") << " layertype:type:part:orien:ind " << layertype << ":" << type << ":" << part
412  << ":" << orien << ":" << i << ":" << waferPart_.size();
413 #endif
414  wafer = waferPart_[i];
415  }
416  int copy = HGCalTypes::packTypeUV(type, u, v);
417 #ifdef EDM_ML_DEBUG
418  edm::LogVerbatim("HGCalGeom") << " DDHGCalSiliconModule: Layer " << HGCalWaferIndex::waferLayer(waferIndex_[k])
419  << " Wafer " << wafer << " number " << copy << " type:part:orien:ind " << type << ":"
420  << part << ":" << orien << ":" << i << " layer:u:v:indx " << (layer + firstLayer_)
421  << ":" << u << ":" << v;
422  if (iu > ium)
423  ium = iu;
424  if (iv > ivm)
425  ivm = iv;
426  kount++;
427  if (copies_.count(copy) == 0)
428  copies_.insert(copy);
429 #endif
430  DDTranslation tran(xpos, ypos, 0.0);
432  DDName name = DDName(DDSplit(wafer).first, DDSplit(wafer).second);
433  cpv.position(name, glog.ddname(), copy, tran, rotation);
434 #ifdef EDM_ML_DEBUG
435  ++ntype[type];
436  edm::LogVerbatim("HGCalGeom") << " DDHGCalSiliconModule: " << name << " number " << copy << " type " << layertype
437  << ":" << type << " positioned in " << glog.ddname() << " at " << tran
438  << " with no rotation";
439 #endif
440  }
441 #ifdef EDM_ML_DEBUG
442  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: Maximum # of u " << ium << " # of v " << ivm << " and "
443  << kount << " wafers (" << ntype[0] << ":" << ntype[1] << ":" << ntype[2] << ") for "
444  << glog.ddname();
445 #endif
446 }
Log< level::Info, true > LogVerbatim
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
int32_t waferU(const int32_t index)
int32_t waferLayer(const int32_t index)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
std::vector< int > waferIndex_
int32_t waferOrient(const int32_t property)
std::pair< double, double > shiftXY(int waferPosition, double waferSize) const
std::vector< int > waferProperty_
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
U second(std::pair< T, U > const &p)
static constexpr int32_t WaferFull
Definition: HGCalTypes.h:35
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int32_t waferThick(const int32_t property)
std::vector< int > layerOrient_
std::vector< int > waferLayerStart_
part
Definition: HCALResponse.h:20
const N & ddname() const
Definition: DDBase.h:61
std::vector< std::string > waferPart_
std::vector< std::string > waferFull_
int32_t waferPartial(const int32_t property)
std::unordered_set< int > copies_
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 WaferCenterB
Definition: HGCalTypes.h:26
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

Member Data Documentation

◆ absorbMode_

int DDHGCalSiliconModule::absorbMode_
private

Definition at line 62 of file DDHGCalSiliconModule.cc.

◆ alpha_

double DDHGCalSiliconModule::alpha_
private

Definition at line 91 of file DDHGCalSiliconModule.cc.

◆ copies_

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

Definition at line 90 of file DDHGCalSiliconModule.cc.

◆ copyNumber_

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

Definition at line 74 of file DDHGCalSiliconModule.cc.

◆ cosAlpha_

double DDHGCalSiliconModule::cosAlpha_
private

Definition at line 91 of file DDHGCalSiliconModule.cc.

◆ facingTypes_

int DDHGCalSiliconModule::facingTypes_
private

Definition at line 58 of file DDHGCalSiliconModule.cc.

◆ firstLayer_

int DDHGCalSiliconModule::firstLayer_
private

Definition at line 61 of file DDHGCalSiliconModule.cc.

◆ geomTools_

HGCalGeomTools DDHGCalSiliconModule::geomTools_
private

Definition at line 52 of file DDHGCalSiliconModule.cc.

◆ layerOrient_

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

Definition at line 85 of file DDHGCalSiliconModule.cc.

◆ layers_

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

Definition at line 75 of file DDHGCalSiliconModule.cc.

◆ layerSense_

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

Definition at line 78 of file DDHGCalSiliconModule.cc.

◆ layerThick_

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

Definition at line 76 of file DDHGCalSiliconModule.cc.

◆ layerType_

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

Definition at line 77 of file DDHGCalSiliconModule.cc.

◆ materials_

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

Definition at line 71 of file DDHGCalSiliconModule.cc.

◆ names_

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

Definition at line 72 of file DDHGCalSiliconModule.cc.

◆ nameSpace_

std::string DDHGCalSiliconModule::nameSpace_
private

Definition at line 89 of file DDHGCalSiliconModule.cc.

◆ orientationTypes_

int DDHGCalSiliconModule::orientationTypes_
private

Definition at line 60 of file DDHGCalSiliconModule.cc.

◆ partialTypes_

int DDHGCalSiliconModule::partialTypes_
private

Definition at line 59 of file DDHGCalSiliconModule.cc.

◆ rMaxFront_

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

Definition at line 84 of file DDHGCalSiliconModule.cc.

◆ rMinFront_

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

Definition at line 81 of file DDHGCalSiliconModule.cc.

◆ rotstr_

std::string DDHGCalSiliconModule::rotstr_
private

Definition at line 68 of file DDHGCalSiliconModule.cc.

◆ sectors_

int DDHGCalSiliconModule::sectors_
private

Definition at line 67 of file DDHGCalSiliconModule.cc.

◆ sensitiveMode_

int DDHGCalSiliconModule::sensitiveMode_
private

Definition at line 63 of file DDHGCalSiliconModule.cc.

◆ slopeB_

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

Definition at line 79 of file DDHGCalSiliconModule.cc.

◆ slopeT_

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

Definition at line 82 of file DDHGCalSiliconModule.cc.

◆ thick_

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

Definition at line 73 of file DDHGCalSiliconModule.cc.

◆ tol1_

constexpr double DDHGCalSiliconModule::tol1_ = 0.01
staticprivate

Definition at line 54 of file DDHGCalSiliconModule.cc.

◆ tol2_

constexpr double DDHGCalSiliconModule::tol2_ = 0.00001
staticprivate

Definition at line 55 of file DDHGCalSiliconModule.cc.

◆ waferFull_

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

Definition at line 69 of file DDHGCalSiliconModule.cc.

◆ waferIndex_

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

Definition at line 86 of file DDHGCalSiliconModule.cc.

◆ waferLayerStart_

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

Definition at line 88 of file DDHGCalSiliconModule.cc.

◆ waferPart_

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

Definition at line 70 of file DDHGCalSiliconModule.cc.

◆ waferProperty_

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

Definition at line 87 of file DDHGCalSiliconModule.cc.

◆ waferSepar_

double DDHGCalSiliconModule::waferSepar_
private

Definition at line 66 of file DDHGCalSiliconModule.cc.

◆ waferSize_

double DDHGCalSiliconModule::waferSize_
private

Definition at line 65 of file DDHGCalSiliconModule.cc.

◆ waferTypes_

int DDHGCalSiliconModule::waferTypes_
private

Definition at line 57 of file DDHGCalSiliconModule.cc.

◆ zFrontB_

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

Definition at line 80 of file DDHGCalSiliconModule.cc.

◆ zFrontT_

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

Definition at line 83 of file DDHGCalSiliconModule.cc.

◆ zMinBlock_

double DDHGCalSiliconModule::zMinBlock_
private

Definition at line 64 of file DDHGCalSiliconModule.cc.