CMS 3D CMS Logo

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

Public Member Functions

 DDHGCalSiliconRotatedModule ()
 
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_
 
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_
 
std::string nameSpace_
 
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_
 

Static Private Attributes

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

Detailed Description

Definition at line 38 of file DDHGCalSiliconRotatedModule.cc.

Constructor & Destructor Documentation

◆ DDHGCalSiliconRotatedModule()

DDHGCalSiliconRotatedModule::DDHGCalSiliconRotatedModule ( )

Definition at line 99 of file DDHGCalSiliconRotatedModule.cc.

99  {
100 #ifdef EDM_ML_DEBUG
101  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: Creating an instance";
102 #endif
103 }
Log< level::Info, true > LogVerbatim

Member Function Documentation

◆ constructLayers()

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

Definition at line 277 of file DDHGCalSiliconRotatedModule.cc.

References funct::abs(), angle_units::operators::convertRadToDeg(), filterCSVwithJSON::copy, DDBase< N, C >::ddname(), DDSplit(), first, mps_fire::i, cuy::ii, dqmdumpme::k, callgraph::module, Skims_PA_cff::name, DDBase< N, C >::name(), DDSolidFactory::polyhedra(), DDCompactView::position(), diffTwoXMLs::r1, HGCalGeomTools::radius(), makeMuonMisalignmentScenario::rot, cms::rotation_utils::rotName(), edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, cond::impl::to_string(), DDSolidFactory::tubs(), HGCalTypes::WaferCenteredRotated, and geometryCSVtoXML::zz.

277  {
278 #ifdef EDM_ML_DEBUG
279  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: \t\tInside Layers";
280 #endif
281  double zi(zMinBlock_);
282  int laymin(0);
283  for (unsigned int i = 0; i < layers_.size(); i++) {
284  double zo = zi + layerThick_[i];
285  double routF = HGCalGeomTools::radius(zi, zFrontT_, rMaxFront_, slopeT_);
286  int laymax = laymin + layers_[i];
287  double zz = zi;
288  double thickTot(0);
289  for (int ly = laymin; ly < laymax; ++ly) {
290  int ii = layerType_[ly];
291  int copy = copyNumber_[ii];
292  double hthick = 0.5 * thick_[ii];
293  double rinB = HGCalGeomTools::radius(zo - tol1_, zFrontB_, rMinFront_, slopeB_);
294  zz += hthick;
295  thickTot += thick_[ii];
296 
298 #ifdef EDM_ML_DEBUG
299  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: Layer " << ly << ":" << ii << " Front " << zi
300  << ", " << routF << " Back " << zo << ", " << rinB << " superlayer thickness "
301  << layerThick_[i];
302 #endif
304  DDMaterial matter(matName);
305  DDLogicalPart glog;
306  if (layerSense_[ly] < 1) {
307  std::vector<double> pgonZ, pgonRin, pgonRout;
308  double rmax = routF * cosAlpha_ - tol1_;
309  HGCalGeomTools::radius(zz - hthick,
310  zz + hthick,
311  zFrontB_,
312  rMinFront_,
313  slopeB_,
314  zFrontT_,
315  rMaxFront_,
316  slopeT_,
317  -layerSense_[ly],
318  pgonZ,
319  pgonRin,
320  pgonRout);
321  for (unsigned int isec = 0; isec < pgonZ.size(); ++isec) {
322  pgonZ[isec] -= zz;
323  if (layerSense_[ly] == 0 || absorbMode_ == 0)
324  pgonRout[isec] = rmax;
325  else
326  pgonRout[isec] = pgonRout[isec] * cosAlpha_ - tol1_;
327  }
328  DDSolid solid =
329  DDSolidFactory::polyhedra(DDName(name, nameSpace_), sectors_, -alpha_, 2._pi, pgonZ, pgonRin, pgonRout);
330  glog = DDLogicalPart(solid.ddname(), matter, solid);
331 #ifdef EDM_ML_DEBUG
332  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << solid.name() << " polyhedra of " << sectors_
333  << " sectors covering " << convertRadToDeg(-alpha_) << ":"
334  << convertRadToDeg(-alpha_ + 2._pi) << " with " << pgonZ.size()
335  << " sections and filled with " << matName;
336  for (unsigned int k = 0; k < pgonZ.size(); ++k)
337  edm::LogVerbatim("HGCalGeom") << "[" << k << "] z " << pgonZ[k] << " R " << pgonRin[k] << ":" << pgonRout[k];
338 #endif
339  } else {
340  double rins =
342  double routs =
343  (sensitiveMode_ < 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_);
344  DDSolid solid = DDSolidFactory::tubs(DDName(name, nameSpace_), hthick, rins, routs, 0.0, 2._pi);
345  glog = DDLogicalPart(solid.ddname(), matter, solid);
346 #ifdef EDM_ML_DEBUG
347  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << solid.name() << " Tubs made of " << matName
348  << " of dimensions " << rinB << ":" << rins << ", " << routF << ":" << routs
349  << ", " << hthick << ", 0.0, 360.0 and position " << glog.name() << " number "
350  << copy << ":" << layerTypes_[copy - firstLayer_];
351 #endif
352  positionSensitive(glog, (copy - firstLayer_), cpv);
353  }
354  DDTranslation r1(0, 0, zz);
355  DDRotation rot;
356 #ifdef EDM_ML_DEBUG
357  std::string rotName("Null");
358 #endif
361 #ifdef EDM_ML_DEBUG
362  rotName = rotstr_;
363 #endif
364  }
365  cpv.position(glog, module, copy, r1, rot);
366  int inc = ((layerSense_[ly] > 0) && (facingTypes_ > 1)) ? 2 : 1;
367  copyNumber_[ii] = copy + inc;
368 #ifdef EDM_ML_DEBUG
369  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << glog.name() << " number " << copy
370  << " positioned in " << module.name() << " at " << r1 << " with " << rotName
371  << " rotation";
372 #endif
373  zz += hthick;
374  } // End of loop over layers in a block
375  zi = zo;
376  laymin = laymax;
377  // Make consistency check of all the partitions of the block
378  if (std::abs(thickTot - layerThick_[i]) >= tol2_) {
379  if (thickTot > layerThick_[i]) {
380  edm::LogError("HGCalGeom") << "Thickness of the partition " << layerThick_[i] << " is smaller than " << thickTot
381  << ": thickness of all its components **** ERROR ****";
382  } else {
383  edm::LogWarning("HGCalGeom") << "Thickness of the partition " << layerThick_[i] << " does not match with "
384  << thickTot << " of the components";
385  }
386  }
387  } // End of loop over blocks
388 }
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)
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
std::string to_string(const V &value)
Definition: OMSAccess.h:71
void positionSensitive(const DDLogicalPart &glog, int layer, DDCompactView &cpv)
Log< level::Error, false > LogError
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
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)
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:59
const N & ddname() const
Definition: DDBase.h:61
std::vector< std::string > materials_
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 DDHGCalSiliconRotatedModule::execute ( DDCompactView cpv)
override

Definition at line 260 of file DDHGCalSiliconRotatedModule.cc.

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

260  {
261 #ifdef EDM_ML_DEBUG
262  edm::LogVerbatim("HGCalGeom") << "==>> Constructing DDHGCalSiliconRotatedModule...";
263  copies_.clear();
264 #endif
265  constructLayers(parent(), cpv);
266 #ifdef EDM_ML_DEBUG
267  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << copies_.size() << " different wafer copy numbers";
268  int k(0);
269  for (std::unordered_set<int>::const_iterator itr = copies_.begin(); itr != copies_.end(); ++itr, ++k) {
270  edm::LogVerbatim("HGCalGeom") << "Copy [" << k << "] : " << (*itr);
271  }
272  copies_.clear();
273  edm::LogVerbatim("HGCalGeom") << "<<== End of DDHGCalSiliconRotatedModule construction...";
274 #endif
275 }
Log< level::Info, true > LogVerbatim
void constructLayers(const DDLogicalPart &, DDCompactView &cpv)

◆ initialize()

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

Definition at line 105 of file DDHGCalSiliconRotatedModule.cc.

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

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

◆ positionSensitive()

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

Definition at line 390 of file DDHGCalSiliconRotatedModule.cc.

References funct::abs(), HGCalCell::cellPlacementIndex(), filterCSVwithJSON::copy, HGCalTypes::CornerCenteredLambda, HGCalTypes::CornerCenteredY, HGCalTypes::CornerCenterYm, HGCalTypes::CornerCenterYp, DDBase< N, C >::ddname(), DDSplit(), PVValHelper::dy, first, mps_fire::i, gpuVertexFinder::iv, dqmdumpme::k, phase1PixelTopology::layer, Skims_PA_cff::name, EgHLTOffHistBins_cfi::nr, HGCalTypes::packTypeUV(), DDCompactView::position(), dttmaxenums::R, alignCSCRings::r, idealTransformation::rotation, edm::second(), mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, findQualityFiles::v, 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().

390  {
391  static const double sqrt3 = std::sqrt(3.0);
392  int layercenter = (layerTypes_[layer] == HGCalTypes::CornerCenteredLambda)
396  int layertype = (layerTypes_[layer] == HGCalTypes::WaferCenteredBack) ? 1 : 0;
397  int firstWafer = waferLayerStart_[layer];
398  int lastWafer = ((layer + 1 < static_cast<int>(waferLayerStart_.size())) ? waferLayerStart_[layer + 1]
399  : static_cast<int>(waferIndex_.size()));
400  double r = 0.5 * (waferSize_ + waferSepar_);
401  double R = 2.0 * r / sqrt3;
402  double dy = 0.75 * R;
403  const auto& xyoff = geomTools_.shiftXY(layercenter, (waferSize_ + waferSepar_));
404 #ifdef EDM_ML_DEBUG
405  int ium(0), ivm(0), kount(0);
406  std::vector<int> ntype(3, 0);
407  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << glog.ddname() << " r " << r << " R " << R
408  << " dy " << dy << " Shift " << xyoff.first << ":" << xyoff.second << " WaferSize "
409  << (waferSize_ + waferSepar_) << " index " << firstWafer << ":" << (lastWafer - 1);
410 #endif
411  for (int k = firstWafer; k < lastWafer; ++k) {
414 #ifdef EDM_ML_DEBUG
415  int iu = std::abs(u);
416  int iv = std::abs(v);
417 #endif
418  int nr = 2 * v;
419  int nc = -2 * u + v;
424  int place = HGCalCell::cellPlacementIndex(1, layertype, orien);
425  auto cshift = cassette_.getShift(layer, 1, cassette);
426  double xpos = xyoff.first + cshift.first + nc * r;
427  double ypos = xyoff.second + cshift.second + nr * dy;
428  std::string wafer;
429  int i(999);
430  if (part == HGCalTypes::WaferFull) {
432  wafer = waferFull_[i];
433  } else {
435  i = (part - partoffset) * facingTypes_ * orientationTypes_ +
437 #ifdef EDM_ML_DEBUG
438  edm::LogVerbatim("HGCalGeom") << " layertype:type:part:orien:cassette:place:offsets:ind " << layertype << ":"
439  << type << ":" << part << ":" << orien << ":" << cassette << ":" << place << ":"
440  << partoffset << ":" << HGCalTypes::WaferTypeOffset[type] << ":" << i << ":"
441  << waferPart_.size();
442 #endif
443  wafer = waferPart_[i];
444  }
445  int copy = HGCalTypes::packTypeUV(type, u, v);
446 #ifdef EDM_ML_DEBUG
447  edm::LogVerbatim("HGCalGeom") << " DDHGCalSiliconRotatedModule: Layer "
448  << HGCalWaferIndex::waferLayer(waferIndex_[k]) << " Wafer " << wafer << " number "
449  << copy << " type:part:orien:ind " << type << ":" << part << ":" << orien << ":" << i
450  << " layer:u:v:indx " << (layer + firstLayer_) << ":" << u << ":" << v;
451  if (iu > ium)
452  ium = iu;
453  if (iv > ivm)
454  ivm = iv;
455  kount++;
456  if (copies_.count(copy) == 0)
457  copies_.insert(copy);
458 #endif
459  DDTranslation tran(xpos, ypos, 0.0);
461  DDName name = DDName(DDSplit(wafer).first, DDSplit(wafer).second);
462  cpv.position(name, glog.ddname(), copy, tran, rotation);
463 #ifdef EDM_ML_DEBUG
464  ++ntype[type];
465  edm::LogVerbatim("HGCalGeom") << " DDHGCalSiliconRotatedModule: " << name << " number " << copy << " type "
466  << layertype << ":" << type << " positioned in " << glog.ddname() << " at " << tran
467  << " with no rotation";
468 #endif
469  }
470 #ifdef EDM_ML_DEBUG
471  edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: Maximum # of u " << ium << " # of v " << ivm << " and "
472  << kount << " wafers (" << ntype[0] << ":" << ntype[1] << ":" << ntype[2] << ") for "
473  << glog.ddname();
474 #endif
475 }
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
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:58
int32_t waferU(const int32_t index)
int32_t waferLayer(const int32_t index)
static constexpr int32_t CornerCenterYm
Definition: HGCalTypes.h:22
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
std::vector< std::string > waferFull_
int32_t waferOrient(const int32_t property)
std::pair< double, double > shiftXY(int waferPosition, double waferSize) const
constexpr std::array< uint8_t, layerIndexSize > layer
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: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
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
const N & ddname() const
Definition: DDBase.h:61
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::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
std::vector< std::string > waferPart_

Member Data Documentation

◆ absorbMode_

int DDHGCalSiliconRotatedModule::absorbMode_
private

Definition at line 65 of file DDHGCalSiliconRotatedModule.cc.

◆ alpha_

double DDHGCalSiliconRotatedModule::alpha_
private

Definition at line 96 of file DDHGCalSiliconRotatedModule.cc.

◆ cassette_

HGCalCassette DDHGCalSiliconRotatedModule::cassette_
private

Definition at line 55 of file DDHGCalSiliconRotatedModule.cc.

◆ cassettes_

int DDHGCalSiliconRotatedModule::cassettes_
private

Definition at line 71 of file DDHGCalSiliconRotatedModule.cc.

◆ cassetteShift_

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

Definition at line 93 of file DDHGCalSiliconRotatedModule.cc.

◆ copies_

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

Definition at line 95 of file DDHGCalSiliconRotatedModule.cc.

◆ copyNumber_

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

Definition at line 78 of file DDHGCalSiliconRotatedModule.cc.

◆ cosAlpha_

double DDHGCalSiliconRotatedModule::cosAlpha_
private

Definition at line 96 of file DDHGCalSiliconRotatedModule.cc.

◆ facingTypes_

int DDHGCalSiliconRotatedModule::facingTypes_
private

Definition at line 61 of file DDHGCalSiliconRotatedModule.cc.

◆ firstLayer_

int DDHGCalSiliconRotatedModule::firstLayer_
private

Definition at line 64 of file DDHGCalSiliconRotatedModule.cc.

◆ geomTools_

HGCalGeomTools DDHGCalSiliconRotatedModule::geomTools_
private

Definition at line 54 of file DDHGCalSiliconRotatedModule.cc.

◆ layers_

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

Definition at line 79 of file DDHGCalSiliconRotatedModule.cc.

◆ layerSense_

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

Definition at line 82 of file DDHGCalSiliconRotatedModule.cc.

◆ layerThick_

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

Definition at line 80 of file DDHGCalSiliconRotatedModule.cc.

◆ layerType_

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

Definition at line 81 of file DDHGCalSiliconRotatedModule.cc.

◆ layerTypes_

std::vector<int> DDHGCalSiliconRotatedModule::layerTypes_
private

Definition at line 89 of file DDHGCalSiliconRotatedModule.cc.

◆ materials_

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

Definition at line 75 of file DDHGCalSiliconRotatedModule.cc.

◆ names_

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

Definition at line 76 of file DDHGCalSiliconRotatedModule.cc.

◆ nameSpace_

std::string DDHGCalSiliconRotatedModule::nameSpace_
private

Definition at line 94 of file DDHGCalSiliconRotatedModule.cc.

◆ orientationTypes_

int DDHGCalSiliconRotatedModule::orientationTypes_
private

Definition at line 62 of file DDHGCalSiliconRotatedModule.cc.

◆ placeOffset_

int DDHGCalSiliconRotatedModule::placeOffset_
private

Definition at line 63 of file DDHGCalSiliconRotatedModule.cc.

◆ rMaxFront_

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

Definition at line 88 of file DDHGCalSiliconRotatedModule.cc.

◆ rMinFront_

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

Definition at line 85 of file DDHGCalSiliconRotatedModule.cc.

◆ rotstr_

std::string DDHGCalSiliconRotatedModule::rotstr_
private

Definition at line 72 of file DDHGCalSiliconRotatedModule.cc.

◆ sectors_

int DDHGCalSiliconRotatedModule::sectors_
private

Definition at line 70 of file DDHGCalSiliconRotatedModule.cc.

◆ sensitiveMode_

int DDHGCalSiliconRotatedModule::sensitiveMode_
private

Definition at line 66 of file DDHGCalSiliconRotatedModule.cc.

◆ slopeB_

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

Definition at line 83 of file DDHGCalSiliconRotatedModule.cc.

◆ slopeT_

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

Definition at line 86 of file DDHGCalSiliconRotatedModule.cc.

◆ thick_

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

Definition at line 77 of file DDHGCalSiliconRotatedModule.cc.

◆ tol1_

constexpr double DDHGCalSiliconRotatedModule::tol1_ = 0.01
staticprivate

Definition at line 57 of file DDHGCalSiliconRotatedModule.cc.

◆ tol2_

constexpr double DDHGCalSiliconRotatedModule::tol2_ = 0.00001
staticprivate

Definition at line 58 of file DDHGCalSiliconRotatedModule.cc.

◆ waferFull_

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

Definition at line 73 of file DDHGCalSiliconRotatedModule.cc.

◆ waferIndex_

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

Definition at line 90 of file DDHGCalSiliconRotatedModule.cc.

◆ waferLayerStart_

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

Definition at line 92 of file DDHGCalSiliconRotatedModule.cc.

◆ waferPart_

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

Definition at line 74 of file DDHGCalSiliconRotatedModule.cc.

◆ waferProperty_

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

Definition at line 91 of file DDHGCalSiliconRotatedModule.cc.

◆ waferSepar_

double DDHGCalSiliconRotatedModule::waferSepar_
private

Definition at line 69 of file DDHGCalSiliconRotatedModule.cc.

◆ waferSize_

double DDHGCalSiliconRotatedModule::waferSize_
private

Definition at line 68 of file DDHGCalSiliconRotatedModule.cc.

◆ waferTypes_

int DDHGCalSiliconRotatedModule::waferTypes_
private

Definition at line 60 of file DDHGCalSiliconRotatedModule.cc.

◆ zFrontB_

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

Definition at line 84 of file DDHGCalSiliconRotatedModule.cc.

◆ zFrontT_

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

Definition at line 87 of file DDHGCalSiliconRotatedModule.cc.

◆ zMinBlock_

double DDHGCalSiliconRotatedModule::zMinBlock_
private

Definition at line 67 of file DDHGCalSiliconRotatedModule.cc.