CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
DDHCalEndcapModuleAlgo Class Reference
Inheritance diagram for DDHCalEndcapModuleAlgo:

Classes

struct  HcalEndcapPar
 

Public Member Functions

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

Private Member Functions

void constructInsideModule (const DDLogicalPart &module, DDCompactView &cpv)
 
void constructInsideModule0 (const DDLogicalPart &module, DDCompactView &cpv)
 
void constructScintLayer (const DDLogicalPart &detector, double dz, DDHCalEndcapModuleAlgo::HcalEndcapPar parm, const std::string &nm, int id, DDCompactView &cpv)
 
double getRout (double z) const
 
double getTrim (unsigned int j) const
 
HcalEndcapPar parameterLayer (unsigned int iphi, double rinF, double routF, double rinB, double routB, double zi, double zo)
 
HcalEndcapPar parameterLayer0 (unsigned int iphi)
 

Private Attributes

std::string absorberMat
 
double dzStep
 
std::string genMaterial
 
std::string idName
 
std::string idNameSpace
 
int idOffset
 
std::vector< std::string > layerName
 
std::vector< int > layerNumber
 
double layerThick
 
int layerType
 
std::string modName
 
int modNumber
 
int modType
 
double moduleThick
 
std::vector< std::string > phiName
 
std::string plasticMat
 
double rMaxBack
 
double rMaxFront
 
std::string rotstr
 
std::string scintMat
 
double scintThick
 
int sectors
 
double slopeBot
 
double slopeTop
 
double slopeTopF
 
double tolAbs
 
double trimLeft
 
double trimRight
 
double z1Beam
 
double ziDip
 
double zMaxBlock
 
double zMinBlock
 

Detailed Description

Definition at line 29 of file DDHCalEndcapModuleAlgo.cc.

Constructor & Destructor Documentation

◆ DDHCalEndcapModuleAlgo()

DDHCalEndcapModuleAlgo::DDHCalEndcapModuleAlgo ( )

Definition at line 119 of file DDHCalEndcapModuleAlgo.cc.

119  {
120 #ifdef EDM_ML_DEBUG
121  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: Creating an instance";
122 #endif
123 }
Log< level::Info, true > LogVerbatim

◆ ~DDHCalEndcapModuleAlgo()

DDHCalEndcapModuleAlgo::~DDHCalEndcapModuleAlgo ( )
override

Definition at line 125 of file DDHCalEndcapModuleAlgo.cc.

125 {}

Member Function Documentation

◆ constructInsideModule()

void DDHCalEndcapModuleAlgo::constructInsideModule ( const DDLogicalPart module,
DDCompactView cpv 
)
private

Definition at line 337 of file DDHCalEndcapModuleAlgo.cc.

References DDHCalEndcapModuleAlgo::HcalEndcapPar::alp, simBeamSpotPI::alpha, DDHCalEndcapModuleAlgo::HcalEndcapPar::bl1, DDHCalEndcapModuleAlgo::HcalEndcapPar::bl2, angle_units::operators::convertRadToDeg(), DDBase< N, C >::ddname(), DDSplit(), dqmdumpme::first, mps_fire::i, versionedElectronIDProducer_cfi::idName, hcalRecHitTable_cff::iphi, Skims_PA_cff::name, DDBase< N, C >::name(), DDHCalEndcapModuleAlgo::HcalEndcapPar::phi, DDCompactView::position(), diffTwoXMLs::r2, makeMuonMisalignmentScenario::rot, edm::second(), volumeBasedMagneticField_160812_cfi::sectors, AlCaHLTBitMon_QueryRunRegistry::string, funct::tan(), DDHCalEndcapModuleAlgo::HcalEndcapPar::theta, DDHCalEndcapModuleAlgo::HcalEndcapPar::tl1, DDHCalEndcapModuleAlgo::HcalEndcapPar::tl2, DDSolidFactory::trap(), DDHCalEndcapModuleAlgo::HcalEndcapPar::xpos, DDHCalEndcapModuleAlgo::HcalEndcapPar::yh1, DDHCalEndcapModuleAlgo::HcalEndcapPar::yh2, DDHCalEndcapModuleAlgo::HcalEndcapPar::ypos, and DDHCalEndcapModuleAlgo::HcalEndcapPar::zpos.

337  {
338 #ifdef EDM_ML_DEBUG
339  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: \t\tInside module";
340 #endif
341  //Pointers to the Rotation Matrices and to the Materials
345  DDMaterial matter(matName);
347  DDMaterial matplastic(plasName);
348 
349  double alpha = (1._pi) / sectors;
350  double zi = zMinBlock;
351 
352  for (unsigned int i = 0; i < layerName.size(); i++) {
354  DDSolid solid;
355  DDLogicalPart glog, plog;
356  int layer = layerNumber[i];
357  double zo = zi + 0.5 * dzStep;
358 
359  for (unsigned int iphi = 0; iphi < phiName.size(); iphi++) {
360  double ziAir = zo - moduleThick;
361  double rinF, rinB;
362  if (modNumber == 0) {
363  rinF = ziAir * slopeTopF;
364  rinB = zo * slopeTopF;
365  } else {
366  rinF = ziAir * slopeBot;
367  rinB = zo * slopeBot;
368  }
369  double routF = getRout(ziAir);
370  double routB = getRout(zo);
371 #ifdef EDM_ML_DEBUG
372  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: Layer " << i << " Phi " << iphi << " Front " << ziAir
373  << ", " << rinF << ", " << routF << " Back " << zo << ", " << rinB << ", " << routB;
374 #endif
375  DDHCalEndcapModuleAlgo::HcalEndcapPar parm = parameterLayer(iphi, rinF, routF, rinB, routB, ziAir, zo);
376 
377  name = idName + modName + layerName[i] + phiName[iphi] + "Air";
379  0.5 * moduleThick,
380  parm.theta,
381  parm.phi,
382  parm.yh1,
383  parm.bl1,
384  parm.tl1,
385  parm.alp,
386  parm.yh2,
387  parm.bl2,
388  parm.tl2,
389  parm.alp);
390 #ifdef EDM_ML_DEBUG
391  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << solid.name() << " Trap made of " << matName
392  << " of dimensions " << 0.5 * moduleThick << ", " << convertRadToDeg(parm.theta)
393  << ", " << convertRadToDeg(parm.phi) << ", " << parm.yh1 << ", " << parm.bl1 << ", "
394  << parm.tl1 << ", " << convertRadToDeg(parm.alp) << ", " << parm.yh2 << ", "
395  << parm.bl2 << ", " << parm.tl2 << ", " << convertRadToDeg(parm.alp);
396 #endif
397  glog = DDLogicalPart(solid.ddname(), matter, solid);
398 
399  DDTranslation r1(parm.xpos, parm.ypos, parm.zpos);
400  cpv.position(glog, module, layer + 1, r1, rot);
401 #ifdef EDM_ML_DEBUG
402  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << glog.name() << " number " << layer + 1
403  << " positioned in " << module.name() << " at " << r1 << " with " << rot;
404 #endif
405  //Now the plastic with scintillators
406  parm.yh1 = 0.5 * (routF - rinB) - getTrim(iphi);
407  parm.bl1 = 0.5 * rinB * tan(alpha) - getTrim(iphi);
408  parm.tl1 = 0.5 * routF * tan(alpha) - getTrim(iphi);
411  0.5 * layerThick,
412  0,
413  0,
414  parm.yh1,
415  parm.bl1,
416  parm.tl1,
417  parm.alp,
418  parm.yh1,
419  parm.bl1,
420  parm.tl1,
421  parm.alp);
422 #ifdef EDM_ML_DEBUG
423  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << solid.name() << " Trap made of " << plasName
424  << " of dimensions " << 0.5 * layerThick << ", 0, 0, " << parm.yh1 << ", "
425  << parm.bl1 << ", " << parm.tl1 << ", " << convertRadToDeg(parm.alp) << ", "
426  << parm.yh1 << ", " << parm.bl1 << ", " << parm.tl1 << ", "
427  << convertRadToDeg(parm.alp);
428 #endif
429  plog = DDLogicalPart(solid.ddname(), matplastic, solid);
430 
431  double ypos = 0.5 * (routF + rinB) - parm.xpos;
432  DDTranslation r2(0., ypos, 0.);
433  cpv.position(plog, glog, idOffset + layer + 1, r2, DDRotation());
434 #ifdef EDM_ML_DEBUG
435  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << plog.name() << " number " << idOffset + layer + 1
436  << " positioned in " << glog.name() << " at " << r2 << " with no rotation";
437 #endif
438  //Constructin the scintillators inside
439  int copyNo = layer * 10 + layerType;
441  constructScintLayer(plog, scintThick, parm, name, copyNo, cpv);
442  zo += 0.5 * dzStep;
443  } // End of loop over phi indices
444  zi = zo - 0.5 * dzStep;
445  } // End of loop on layers
446 }
Log< level::Info, true > LogVerbatim
HcalEndcapPar parameterLayer(unsigned int iphi, double rinF, double routF, double rinB, double routB, double zi, double zo)
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
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
U second(std::pair< T, U > const &p)
std::vector< std::string > phiName
void constructScintLayer(const DDLogicalPart &detector, double dz, DDHCalEndcapModuleAlgo::HcalEndcapPar parm, const std::string &nm, int id, DDCompactView &cpv)
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
static DDSolid trap(const DDName &name, double pDz, double pTheta, double pPhi, double pDy1, double pDx1, double pDx2, double pAlp1, double pDy2, double pDx3, double pDx4, double pAlp2)
Definition: DDSolid.cc:609
std::vector< std::string > layerName
const N & name() const
Definition: DDBase.h:59
double getTrim(unsigned int j) const
const N & ddname() const
Definition: DDBase.h:61
double getRout(double z) const
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

◆ constructInsideModule0()

void DDHCalEndcapModuleAlgo::constructInsideModule0 ( const DDLogicalPart module,
DDCompactView cpv 
)
private

Definition at line 221 of file DDHCalEndcapModuleAlgo.cc.

References DDHCalEndcapModuleAlgo::HcalEndcapPar::alp, DDHCalEndcapModuleAlgo::HcalEndcapPar::bl1, DDHCalEndcapModuleAlgo::HcalEndcapPar::bl2, angle_units::operators::convertRadToDeg(), DDBase< N, C >::ddname(), DDSplit(), dqmdumpme::first, versionedElectronIDProducer_cfi::idName, hcalRecHitTable_cff::iphi, Skims_PA_cff::name, DDBase< N, C >::name(), DDHCalEndcapModuleAlgo::HcalEndcapPar::phi, DDCompactView::position(), diffTwoXMLs::r2, makeMuonMisalignmentScenario::rot, edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, DDHCalEndcapModuleAlgo::HcalEndcapPar::theta, DDHCalEndcapModuleAlgo::HcalEndcapPar::tl1, DDHCalEndcapModuleAlgo::HcalEndcapPar::tl2, DDSolidFactory::trap(), DDHCalEndcapModuleAlgo::HcalEndcapPar::xpos, DDHCalEndcapModuleAlgo::HcalEndcapPar::yh1, DDHCalEndcapModuleAlgo::HcalEndcapPar::yh2, DDHCalEndcapModuleAlgo::HcalEndcapPar::ypos, and DDHCalEndcapModuleAlgo::HcalEndcapPar::zpos.

221  {
222 #ifdef EDM_ML_DEBUG
223  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: \t\tInside module0";
224 #endif
225  //Pointers to the Rotation Matrices and to the Materials
229  DDMaterial matabsorbr(matName);
231  DDMaterial matplastic(plasName);
232 
233  int layer = layerNumber[0];
234  int layer0 = layerNumber[1];
236  DDSolid solid;
237  DDLogicalPart glog, plog;
238  for (unsigned int iphi = 0; iphi < phiName.size(); iphi++) {
240  name = idName + modName + layerName[0] + phiName[iphi];
242  0.5 * layerThick,
243  0,
244  0,
245  parm.yh1,
246  parm.bl1,
247  parm.tl1,
248  parm.alp,
249  parm.yh2,
250  parm.bl1,
251  parm.tl2,
252  parm.alp);
253 #ifdef EDM_ML_DEBUG
254  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << solid.name() << " Trap made of " << plasName
255  << " of dimensions " << 0.5 * layerThick << ", 0, 0, " << parm.yh1 << ", " << parm.bl1
256  << ", " << parm.tl1 << ", " << convertRadToDeg(parm.alp) << ", " << parm.yh2 << ", "
257  << parm.bl2 << ", " << parm.tl2 << ", " << convertRadToDeg(parm.alp);
258 #endif
259  glog = DDLogicalPart(solid.ddname(), matplastic, solid);
260 
261  DDTranslation r1(parm.xpos, parm.ypos, parm.zpos);
262  cpv.position(glog, module, idOffset + layer + 1, r1, rot);
263 #ifdef EDM_ML_DEBUG
264  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << glog.name() << " number " << idOffset + layer + 1
265  << " positioned in " << module.name() << " at " << r1 << " with " << rot;
266 #endif
267  //Now construct the layer of scintillator inside this
268  int copyNo = layer0 * 10 + layerType;
269  name = modName + layerName[0] + phiName[iphi];
270  constructScintLayer(glog, scintThick, parm, name, copyNo, cpv);
271  }
272 
273  //Now the absorber layer
274  double zi = zMinBlock + layerThick;
275  double zo = zi + 0.5 * dzStep;
276  double rinF, routF, rinB, routB;
277  if (modNumber == 0) {
278  rinF = zi * slopeTopF;
279  routF = (zi - z1Beam) * slopeTop;
280  rinB = zo * slopeTopF;
281  routB = (zo - z1Beam) * slopeTop;
282  } else if (modNumber > 0) {
283  rinF = zi * slopeBot;
284  routF = zi * slopeTopF;
285  rinB = zo * slopeBot;
286  routB = zo * slopeTopF;
287  } else {
288  rinF = zi * slopeBot;
289  routF = (zi - z1Beam) * slopeTop;
290  rinB = zo * slopeBot;
291  routB = (zo - z1Beam) * slopeTop;
292  }
293 #ifdef EDM_ML_DEBUG
294  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: Front " << zi << ", " << rinF << ", " << routF << " Back "
295  << zo << ", " << rinB << ", " << routB;
296 #endif
297  DDHCalEndcapModuleAlgo::HcalEndcapPar parm = parameterLayer(0, rinF, routF, rinB, routB, zi, zo);
298 #ifdef EDM_ML_DEBUG
299  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: Trim " << tolAbs << " Param " << parm.yh1 << ", " << parm.bl1
300  << ", " << parm.tl1 << ", " << parm.yh2 << ", " << parm.bl2 << ", " << parm.tl2;
301 #endif
302  parm.bl1 -= tolAbs;
303  parm.tl1 -= tolAbs;
304  parm.bl2 -= tolAbs;
305  parm.tl2 -= tolAbs;
306 
307  name = idName + modName + layerName[0] + "Absorber";
309  0.5 * moduleThick,
310  parm.theta,
311  parm.phi,
312  parm.yh1,
313  parm.bl1,
314  parm.tl1,
315  parm.alp,
316  parm.yh2,
317  parm.bl2,
318  parm.tl2,
319  parm.alp);
320 #ifdef EDM_ML_DEBUG
321  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << solid.name() << " Trap made of " << matName
322  << " of dimensions " << 0.5 * moduleThick << ", " << convertRadToDeg(parm.theta) << ", "
323  << convertRadToDeg(parm.phi) << ", " << parm.yh1 << ", " << parm.bl1 << ", " << parm.tl1
324  << ", " << convertRadToDeg(parm.alp) << ", " << parm.yh2 << ", " << parm.bl2 << ", "
325  << parm.tl2 << ", " << convertRadToDeg(parm.alp);
326 #endif
327  glog = DDLogicalPart(solid.ddname(), matabsorbr, solid);
328 
329  DDTranslation r2(parm.xpos, parm.ypos, parm.zpos);
330  cpv.position(glog, module, 1, r2, rot);
331 #ifdef EDM_ML_DEBUG
332  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << glog.name() << " number 1 positioned in "
333  << module.name() << " at " << r2 << " with " << rot;
334 #endif
335 }
Log< level::Info, true > LogVerbatim
HcalEndcapPar parameterLayer(unsigned int iphi, double rinF, double routF, double rinB, double routB, double zi, double zo)
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
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
HcalEndcapPar parameterLayer0(unsigned int iphi)
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
U second(std::pair< T, U > const &p)
std::vector< std::string > phiName
void constructScintLayer(const DDLogicalPart &detector, double dz, DDHCalEndcapModuleAlgo::HcalEndcapPar parm, const std::string &nm, int id, DDCompactView &cpv)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
static DDSolid trap(const DDName &name, double pDz, double pTheta, double pPhi, double pDy1, double pDx1, double pDx2, double pAlp1, double pDy2, double pDx3, double pDx4, double pAlp2)
Definition: DDSolid.cc:609
std::vector< std::string > layerName
const N & name() const
Definition: DDBase.h:59
const N & ddname() const
Definition: DDBase.h:61
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

◆ constructScintLayer()

void DDHCalEndcapModuleAlgo::constructScintLayer ( const DDLogicalPart detector,
double  dz,
DDHCalEndcapModuleAlgo::HcalEndcapPar  parm,
const std::string &  nm,
int  id,
DDCompactView cpv 
)
private

Definition at line 549 of file DDHCalEndcapModuleAlgo.cc.

References DDHCalEndcapModuleAlgo::HcalEndcapPar::alp, DDHCalEndcapModuleAlgo::HcalEndcapPar::bl1, angle_units::operators::convertRadToDeg(), DDBase< N, C >::ddname(), DDSplit(), hgcalTestNeighbor_cfi::detector, PVValHelper::dz, dqmdumpme::first, versionedElectronIDProducer_cfi::idName, Skims_PA_cff::name, DDBase< N, C >::name(), DDCompactView::position(), edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, DDHCalEndcapModuleAlgo::HcalEndcapPar::tl1, DDSolidFactory::trap(), and DDHCalEndcapModuleAlgo::HcalEndcapPar::yh1.

554  {
556  DDMaterial matter(matname);
557  std::string name = idName + "Scintillator" + nm;
558 
560  0.5 * dz,
561  0,
562  0,
563  parm.yh1,
564  parm.bl1,
565  parm.tl1,
566  parm.alp,
567  parm.yh1,
568  parm.bl1,
569  parm.tl1,
570  parm.alp);
571 #ifdef EDM_ML_DEBUG
572  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << solid.name() << " Trap made of " << scintMat
573  << " of dimensions " << 0.5 * dz << ", 0, 0, " << parm.yh1 << ", " << parm.bl1 << ", "
574  << parm.tl1 << ", " << convertRadToDeg(parm.alp) << ", " << parm.yh1 << ", " << parm.bl1
575  << ", " << parm.tl1 << ", " << convertRadToDeg(parm.alp);
576 #endif
577  DDLogicalPart glog(solid.ddname(), matter, solid);
578 
579  cpv.position(glog, detector, id, DDTranslation(0, 0, 0), DDRotation());
580 #ifdef EDM_ML_DEBUG
581  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << glog.name() << " number " << id << " positioned in "
582  << detector.name() << " at (0,0,0) with no rotation";
583 #endif
584 }
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)
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
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
U second(std::pair< T, U > const &p)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
static DDSolid trap(const DDName &name, double pDz, double pTheta, double pPhi, double pDy1, double pDx1, double pDx2, double pAlp1, double pDy2, double pDx3, double pDx4, double pAlp2)
Definition: DDSolid.cc:609
const N & name() const
Definition: DDBase.h:59
const N & ddname() const
Definition: DDBase.h:61
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

◆ execute()

void DDHCalEndcapModuleAlgo::execute ( DDCompactView cpv)
override

Definition at line 208 of file DDHCalEndcapModuleAlgo.cc.

References class-composition::parent.

208  {
209 #ifdef EDM_ML_DEBUG
210  edm::LogVerbatim("HCalGeom") << "==>> Constructing DDHCalEndcapModuleAlgo...";
211 #endif
212  if (modType == 0)
214  else
216 #ifdef EDM_ML_DEBUG
217  edm::LogVerbatim("HCalGeom") << "<<== End of DDHCalEndcapModuleAlgo construction ...";
218 #endif
219 }
Log< level::Info, true > LogVerbatim
void constructInsideModule0(const DDLogicalPart &module, DDCompactView &cpv)
void constructInsideModule(const DDLogicalPart &module, DDCompactView &cpv)

◆ getRout()

double DDHCalEndcapModuleAlgo::getRout ( double  z) const
private

Definition at line 593 of file DDHCalEndcapModuleAlgo.cc.

593  {
594  double r = (modNumber >= 0) ? ((z - z1Beam) * slopeTop) : z * slopeTopF;
595  if (z > ziDip) {
596  if (r > rMaxBack)
597  r = rMaxBack;
598  } else {
599  if (r > rMaxFront)
600  r = rMaxFront;
601  }
602  return r;
603 }

◆ getTrim()

double DDHCalEndcapModuleAlgo::getTrim ( unsigned int  j) const
private

Definition at line 586 of file DDHCalEndcapModuleAlgo.cc.

References dqmiolumiharvest::j.

586  {
587  if (j == 0)
588  return trimLeft;
589  else
590  return trimRight;
591 }

◆ initialize()

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

Definition at line 127 of file DDHCalEndcapModuleAlgo.cc.

References dbl_to_int(), mps_fire::i, versionedElectronIDProducer_cfi::idName, createfilelist::int, DDCurrentNamespace::ns(), class-composition::parent, and volumeBasedMagneticField_160812_cfi::sectors.

131  {
132  genMaterial = sArgs["MaterialName"];
133  absorberMat = sArgs["AbsorberMat"];
134  plasticMat = sArgs["PlasticMat"];
135  scintMat = sArgs["ScintMat"];
136  rotstr = sArgs["Rotation"];
137  sectors = int(nArgs["Sectors"]);
138 #ifdef EDM_ML_DEBUG
139  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: General material " << genMaterial << "\tAbsorber "
140  << absorberMat << "\tPlastic " << plasticMat << "\tScintillator " << scintMat
141  << "\tRotation " << rotstr << "\tSectors " << sectors;
142 #endif
143  zMinBlock = nArgs["ZMinBlock"];
144  zMaxBlock = nArgs["ZMaxBlock"];
145  z1Beam = nArgs["Z1Beam"];
146  ziDip = nArgs["ZiDip"];
147  dzStep = nArgs["DzStep"];
148  moduleThick = nArgs["ModuleThick"];
149  layerThick = nArgs["LayerThick"];
150  scintThick = nArgs["ScintThick"];
151 #ifdef EDM_ML_DEBUG
152  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: Zmin " << zMinBlock << "\tZmax " << zMaxBlock << "\tZ1Beam "
153  << z1Beam << "\tZiDip " << ziDip << "\tDzStep " << dzStep << "\tModuleThick "
154  << moduleThick << "\tLayerThick " << layerThick << "\tScintThick " << scintThick;
155 #endif
156  rMaxFront = nArgs["RMaxFront"];
157  rMaxBack = nArgs["RMaxBack"];
158  trimLeft = nArgs["TrimLeft"];
159  trimRight = nArgs["TrimRight"];
160  tolAbs = nArgs["TolAbs"];
161 #ifdef EDM_ML_DEBUG
162  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: RMaxFront " << rMaxFront << "\tRmaxBack " << rMaxBack
163  << "\tTrims " << trimLeft << ":" << trimRight << "\tTolAbs " << tolAbs;
164 #endif
165  slopeBot = nArgs["SlopeBottom"];
166  slopeTop = nArgs["SlopeTop"];
167  slopeTopF = nArgs["SlopeTopFront"];
168  modType = (int)(nArgs["ModType"]);
169  modNumber = (int)(nArgs["ModNumber"]);
170  layerType = (int)(nArgs["LayerType"]);
171 #ifdef EDM_ML_DEBUG
172  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: slopeBot " << slopeBot << "\tslopeTop " << slopeTop
173  << "\tslopeTopF " << slopeTopF << "\tmodType " << modType << "\tmodNumber " << modNumber
174  << "\tlayerType " << layerType;
175 #endif
176  layerNumber = dbl_to_int(vArgs["LayerNumber"]);
177 #ifdef EDM_ML_DEBUG
178  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << layerNumber.size() << " layer Numbers";
179  for (unsigned int i = 0; i < layerNumber.size(); ++i)
180  edm::LogVerbatim("HCalGeom") << "LayerNumber[" << i << "] = " << layerNumber[i];
181 #endif
182  phiName = vsArgs["PhiName"];
183 #ifdef EDM_ML_DEBUG
184  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << phiName.size() << " phi sectors";
185  for (unsigned int i = 0; i < phiName.size(); ++i)
186  edm::LogVerbatim("HCalGeom") << "PhiName[" << i << "] = " << phiName[i];
187 #endif
188  layerName = vsArgs["LayerName"];
189 #ifdef EDM_ML_DEBUG
190  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << layerName.size() << " layers";
191  for (unsigned int i = 0; i < layerName.size(); ++i)
192  edm::LogVerbatim("HCalGeom") << "LayerName[" << i << "] = " << layerName[i];
193 #endif
194  idName = sArgs["MotherName"];
196  idOffset = int(nArgs["IdOffset"]);
197  modName = sArgs["ModName"];
198 #ifdef EDM_ML_DEBUG
199  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: Parent " << parent().name() << " " << modName << " idName "
200  << idName << " NameSpace " << idNameSpace << " Offset " << idOffset;
201 #endif
202 }
Log< level::Info, true > LogVerbatim
static std::string & ns()
std::vector< std::string > phiName
std::vector< std::string > layerName
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

◆ parameterLayer()

DDHCalEndcapModuleAlgo::HcalEndcapPar DDHCalEndcapModuleAlgo::parameterLayer ( unsigned int  iphi,
double  rinF,
double  routF,
double  rinB,
double  routB,
double  zi,
double  zo 
)
private

Definition at line 502 of file DDHCalEndcapModuleAlgo.cc.

References DDHCalEndcapModuleAlgo::HcalEndcapPar::alp, simBeamSpotPI::alpha, DDHCalEndcapModuleAlgo::HcalEndcapPar::bl1, DDHCalEndcapModuleAlgo::HcalEndcapPar::bl2, angle_units::operators::convertRadToDeg(), PVValHelper::dx, PVValHelper::dy, MillePedeFileConverter_cfg::e, hcalRecHitTable_cff::iphi, DDHCalEndcapModuleAlgo::HcalEndcapPar::phi, volumeBasedMagneticField_160812_cfi::sectors, mathSSE::sqrt(), funct::tan(), DDHCalEndcapModuleAlgo::HcalEndcapPar::theta, DDHCalEndcapModuleAlgo::HcalEndcapPar::tl1, DDHCalEndcapModuleAlgo::HcalEndcapPar::tl2, DDHCalEndcapModuleAlgo::HcalEndcapPar::xpos, DDHCalEndcapModuleAlgo::HcalEndcapPar::yh1, DDHCalEndcapModuleAlgo::HcalEndcapPar::yh2, DDHCalEndcapModuleAlgo::HcalEndcapPar::ypos, and DDHCalEndcapModuleAlgo::HcalEndcapPar::zpos.

503  {
505  //Given rin, rout compute parameters of the trapezoid and
506  //position of the trapezoid for a standrd layer
507  double alpha = (1._pi) / sectors;
508 #ifdef EDM_ML_DEBUG
509  edm::LogVerbatim("HCalGeom") << "Input " << iphi << " Front " << rinF << " " << routF << " " << zi << " Back " << rinB
510  << " " << routB << " " << zo << " Alpha " << convertRadToDeg(alpha);
511 #endif
512  parm.yh1 = 0.5 * (routF - rinB);
513  parm.bl1 = 0.5 * rinB * tan(alpha);
514  parm.tl1 = 0.5 * routF * tan(alpha);
515  parm.yh2 = 0.5 * (routF - rinB);
516  parm.bl2 = 0.5 * rinB * tan(alpha);
517  parm.tl2 = 0.5 * routF * tan(alpha);
518  double dx = 0.25 * (parm.bl2 + parm.tl2 - parm.bl1 - parm.tl1);
519  double dy = 0.5 * (rinB + routF - rinB - routF);
520  parm.xpos = 0.25 * (rinB + routF + rinB + routF);
521  parm.ypos = 0.25 * (parm.bl2 + parm.tl2 + parm.bl1 + parm.tl1);
522  parm.zpos = 0.5 * (zi + zo);
523  parm.alp = atan(0.5 * tan(alpha));
524  if (iphi == 0) {
525  parm.ypos = -parm.ypos;
526  } else {
527  parm.alp = -parm.alp;
528  dx = -dx;
529  }
530  double r = sqrt(dx * dx + dy * dy);
531 #ifdef EDM_ML_DEBUG
532  edm::LogVerbatim("HCalGeom") << "dx|dy|r " << dx << ":" << dy << ":" << r;
533 #endif
534  if (r > 1.0e-8) {
535  parm.theta = atan(r / (zo - zi));
536  parm.phi = atan2(dy, dx);
537  } else {
538  parm.theta = parm.phi = 0;
539  }
540 #ifdef EDM_ML_DEBUG
541  edm::LogVerbatim("HCalGeom") << "Output Dimensions " << parm.yh1 << " " << parm.bl1 << " " << parm.tl1 << " "
542  << parm.yh2 << " " << parm.bl2 << " " << parm.tl2 << " " << convertRadToDeg(parm.alp)
543  << " " << convertRadToDeg(parm.theta) << " " << convertRadToDeg(parm.phi) << " Position "
544  << parm.xpos << " " << parm.ypos << " " << parm.zpos;
545 #endif
546  return parm;
547 }
Log< level::Info, true > LogVerbatim
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
T sqrt(T t)
Definition: SSEVec.h:23
Tan< T >::type tan(const T &t)
Definition: Tan.h:22

◆ parameterLayer0()

DDHCalEndcapModuleAlgo::HcalEndcapPar DDHCalEndcapModuleAlgo::parameterLayer0 ( unsigned int  iphi)
private

Definition at line 448 of file DDHCalEndcapModuleAlgo.cc.

References DDHCalEndcapModuleAlgo::HcalEndcapPar::alp, simBeamSpotPI::alpha, DDHCalEndcapModuleAlgo::HcalEndcapPar::bl1, DDHCalEndcapModuleAlgo::HcalEndcapPar::bl2, angle_units::operators::convertRadToDeg(), hcalRecHitTable_cff::iphi, volumeBasedMagneticField_160812_cfi::sectors, funct::tan(), DDHCalEndcapModuleAlgo::HcalEndcapPar::tl1, DDHCalEndcapModuleAlgo::HcalEndcapPar::tl2, DDHCalEndcapModuleAlgo::HcalEndcapPar::xpos, DDHCalEndcapModuleAlgo::HcalEndcapPar::yh1, DDHCalEndcapModuleAlgo::HcalEndcapPar::yh2, DDHCalEndcapModuleAlgo::HcalEndcapPar::ypos, and DDHCalEndcapModuleAlgo::HcalEndcapPar::zpos.

448  {
450  //Given module and layer number compute parameters of trapezoid
451  //and positioning parameters
452  double alpha = (1._pi) / sectors;
453 #ifdef EDM_ML_DEBUG
454  edm::LogVerbatim("HCalGeom") << "Input " << iphi << " Alpha " << convertRadToDeg(alpha);
455 #endif
456  double zi, zo;
457  if (iphi == 0) {
458  zi = zMinBlock;
459  zo = zi + layerThick;
460  } else {
461  zo = zMaxBlock;
462  zi = zo - layerThick;
463  }
464  double rin, rout;
465  if (modNumber == 0) {
466  rin = zo * slopeTopF;
467  rout = (zi - z1Beam) * slopeTop;
468  } else if (modNumber > 0) {
469  rin = zo * slopeBot;
470  rout = zi * slopeTopF;
471  } else {
472  rin = zo * slopeBot;
473  rout = (zi - z1Beam) * slopeTop;
474  }
475 #ifdef EDM_ML_DEBUG
476  edm::LogVerbatim("HCalGeom") << "ModNumber " << modNumber << " " << zi << " " << zo << " " << slopeTopF << " "
477  << slopeTop << " " << slopeBot << " " << rin << " " << rout << " " << getTrim(iphi);
478 #endif
479  double yh = 0.5 * (rout - rin);
480  double bl = 0.5 * rin * tan(alpha);
481  double tl = 0.5 * rout * tan(alpha);
482  parm.xpos = 0.5 * (rin + rout);
483  parm.ypos = 0.5 * (bl + tl);
484  parm.zpos = 0.5 * (zi + zo);
485  parm.yh1 = parm.yh2 = yh - getTrim(iphi);
486  parm.bl1 = parm.bl2 = bl - getTrim(iphi);
487  parm.tl1 = parm.tl2 = tl - getTrim(iphi);
488  parm.alp = atan(0.5 * tan(alpha));
489  if (iphi == 0) {
490  parm.ypos = -parm.ypos;
491  } else {
492  parm.alp = -parm.alp;
493  }
494 #ifdef EDM_ML_DEBUG
495  edm::LogVerbatim("HCalGeom") << "Output Dimensions " << parm.yh1 << " " << parm.bl1 << " " << parm.tl1 << " "
496  << convertRadToDeg(parm.alp) << " Position " << parm.xpos << " " << parm.ypos << " "
497  << parm.zpos;
498 #endif
499  return parm;
500 }
Log< level::Info, true > LogVerbatim
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
double getTrim(unsigned int j) const

Member Data Documentation

◆ absorberMat

std::string DDHCalEndcapModuleAlgo::absorberMat
private

Definition at line 85 of file DDHCalEndcapModuleAlgo.cc.

◆ dzStep

double DDHCalEndcapModuleAlgo::dzStep
private

Definition at line 94 of file DDHCalEndcapModuleAlgo.cc.

◆ genMaterial

std::string DDHCalEndcapModuleAlgo::genMaterial
private

Definition at line 84 of file DDHCalEndcapModuleAlgo.cc.

◆ idName

std::string DDHCalEndcapModuleAlgo::idName
private

Definition at line 113 of file DDHCalEndcapModuleAlgo.cc.

◆ idNameSpace

std::string DDHCalEndcapModuleAlgo::idNameSpace
private

Definition at line 114 of file DDHCalEndcapModuleAlgo.cc.

◆ idOffset

int DDHCalEndcapModuleAlgo::idOffset
private

Definition at line 116 of file DDHCalEndcapModuleAlgo.cc.

◆ layerName

std::vector<std::string> DDHCalEndcapModuleAlgo::layerName
private

Definition at line 111 of file DDHCalEndcapModuleAlgo.cc.

◆ layerNumber

std::vector<int> DDHCalEndcapModuleAlgo::layerNumber
private

Definition at line 109 of file DDHCalEndcapModuleAlgo.cc.

◆ layerThick

double DDHCalEndcapModuleAlgo::layerThick
private

Definition at line 96 of file DDHCalEndcapModuleAlgo.cc.

◆ layerType

int DDHCalEndcapModuleAlgo::layerType
private

Definition at line 108 of file DDHCalEndcapModuleAlgo.cc.

◆ modName

std::string DDHCalEndcapModuleAlgo::modName
private

Definition at line 115 of file DDHCalEndcapModuleAlgo.cc.

◆ modNumber

int DDHCalEndcapModuleAlgo::modNumber
private

Definition at line 107 of file DDHCalEndcapModuleAlgo.cc.

◆ modType

int DDHCalEndcapModuleAlgo::modType
private

Definition at line 106 of file DDHCalEndcapModuleAlgo.cc.

◆ moduleThick

double DDHCalEndcapModuleAlgo::moduleThick
private

Definition at line 95 of file DDHCalEndcapModuleAlgo.cc.

◆ phiName

std::vector<std::string> DDHCalEndcapModuleAlgo::phiName
private

Definition at line 110 of file DDHCalEndcapModuleAlgo.cc.

◆ plasticMat

std::string DDHCalEndcapModuleAlgo::plasticMat
private

Definition at line 86 of file DDHCalEndcapModuleAlgo.cc.

◆ rMaxBack

double DDHCalEndcapModuleAlgo::rMaxBack
private

Definition at line 98 of file DDHCalEndcapModuleAlgo.cc.

◆ rMaxFront

double DDHCalEndcapModuleAlgo::rMaxFront
private

Definition at line 99 of file DDHCalEndcapModuleAlgo.cc.

◆ rotstr

std::string DDHCalEndcapModuleAlgo::rotstr
private

Definition at line 88 of file DDHCalEndcapModuleAlgo.cc.

◆ scintMat

std::string DDHCalEndcapModuleAlgo::scintMat
private

Definition at line 87 of file DDHCalEndcapModuleAlgo.cc.

◆ scintThick

double DDHCalEndcapModuleAlgo::scintThick
private

Definition at line 97 of file DDHCalEndcapModuleAlgo.cc.

◆ sectors

int DDHCalEndcapModuleAlgo::sectors
private

Definition at line 89 of file DDHCalEndcapModuleAlgo.cc.

◆ slopeBot

double DDHCalEndcapModuleAlgo::slopeBot
private

Definition at line 100 of file DDHCalEndcapModuleAlgo.cc.

◆ slopeTop

double DDHCalEndcapModuleAlgo::slopeTop
private

Definition at line 101 of file DDHCalEndcapModuleAlgo.cc.

◆ slopeTopF

double DDHCalEndcapModuleAlgo::slopeTopF
private

Definition at line 102 of file DDHCalEndcapModuleAlgo.cc.

◆ tolAbs

double DDHCalEndcapModuleAlgo::tolAbs
private

Definition at line 105 of file DDHCalEndcapModuleAlgo.cc.

◆ trimLeft

double DDHCalEndcapModuleAlgo::trimLeft
private

Definition at line 103 of file DDHCalEndcapModuleAlgo.cc.

◆ trimRight

double DDHCalEndcapModuleAlgo::trimRight
private

Definition at line 104 of file DDHCalEndcapModuleAlgo.cc.

◆ z1Beam

double DDHCalEndcapModuleAlgo::z1Beam
private

Definition at line 92 of file DDHCalEndcapModuleAlgo.cc.

◆ ziDip

double DDHCalEndcapModuleAlgo::ziDip
private

Definition at line 93 of file DDHCalEndcapModuleAlgo.cc.

◆ zMaxBlock

double DDHCalEndcapModuleAlgo::zMaxBlock
private

Definition at line 91 of file DDHCalEndcapModuleAlgo.cc.

◆ zMinBlock

double DDHCalEndcapModuleAlgo::zMinBlock
private

Definition at line 90 of file DDHCalEndcapModuleAlgo.cc.