CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes
DDHCalEndcapAlgo Class Reference

#include <DDHCalEndcapAlgo.h>

Inheritance diagram for DDHCalEndcapAlgo:

Public Member Functions

 DDHCalEndcapAlgo ()
 
int equipModule (unsigned int i) const
 
void execute (DDCompactView &cpv) override
 
std::string getAbsMat () const
 
double getAngBot () const
 
double getAngGap () const
 
double getAngTop () const
 
double getDrEnd () const
 
double getDzShift () const
 
double getDzStep () const
 
int getEndcaps () const
 
std::string getGenMat () const
 
double getHeboxDepth () const
 
int getLayer (unsigned int i, unsigned int j) const
 
int getLayerN (unsigned int i) const
 
std::string getLayerName (unsigned int i) const
 
int getLayers () const
 
double getLayerT (unsigned int i) const
 
int getLayerType (unsigned int i) const
 
std::string getModMat (unsigned int i) const
 
std::string getModName (unsigned int i) const
 
int getModType (unsigned int i) const
 
int getModules () const
 
int getNsectors () const
 
int getNsectortot () const
 
int getPhi () const
 
std::string getPhiName (unsigned int i) const
 
std::string getPlastMat () const
 
double getRinBlock1 (unsigned i) const
 
double getRinBlock2 (unsigned i) const
 
double getRinDip () const
 
double getRinKink () const
 
std::string getRotation () const
 
std::string getRotMat () const
 
double getRout () const
 
double getRoutBlock1 (unsigned i) const
 
double getRoutBlock2 (unsigned i) const
 
double getRoutDip () const
 
std::string getScintMat () const
 
double getScintT (unsigned int i) const
 
int getSectionModule (unsigned i) const
 
double getSlope () const
 
double getThick (unsigned int i) const
 
double getTolAbs () const
 
double getTolPos () const
 
double getTrim (unsigned int i, unsigned int j) const
 
double getZ0Beam () const
 
double getZ1Beam () const
 
double getZEnd () const
 
double getZFront () const
 
double getZiBody () const
 
double getZiDip () const
 
double getZiKink () const
 
double getZiL0Body () const
 
double getZiL0Nose () const
 
double getZiNose () const
 
double getZmaxBlock (unsigned i) const
 
double getZminBlock (unsigned i) const
 
double getZShift () const
 
double getZShiftHac2 () const
 
void initialize (const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
 
 ~DDHCalEndcapAlgo () override
 

Protected Member Functions

void constructGeneralVolume (DDCompactView &cpv)
 
void constructInsideModule (const DDLogicalPart &module, int mod, DDCompactView &cpv)
 
void constructInsideModule0 (const DDLogicalPart &module, int mod, DDCompactView &cpv)
 
void constructInsideSector (const DDLogicalPart &sector, DDCompactView &cpv)
 
void constructScintLayer (const DDLogicalPart &glog, double pDz, double yh, double bl, double tl, double alp, const std::string &name, int id, DDCompactView &cpv)
 
void parameterLayer (int iphi, double rinF, double routF, double rinB, double routB, double zi, double zo, double &yh1, double &bl1, double &tl1, double &yh2, double &bl2, double &tl2, double &alp, double &theta, double &phi, double &xpos, double &ypos, double &zcpv)
 
void parameterLayer0 (int mod, int layer, int iphi, double &yh, double &bl, double &tl, double &alp, double &xpos, double &ypos, double &zcpv)
 

Private Attributes

std::string absMat
 
double angBot
 
double angGap
 
double angTop
 
double drEnd
 
double dzShift
 
double dzStep
 
std::vector< int > eModule
 
std::string genMaterial
 
double heboxDepth
 
std::string idName
 
std::string idNameSpace
 
int idOffset
 
std::vector< int > layerN
 
std::vector< int > layerN0
 
std::vector< int > layerN1
 
std::vector< int > layerN2
 
std::vector< int > layerN3
 
std::vector< int > layerN4
 
std::vector< int > layerN5
 
std::vector< std::string > layerName
 
int layers
 
std::vector< double > layerT
 
std::vector< int > layerType
 
std::vector< std::string > modMat
 
std::vector< std::string > modName
 
std::vector< int > modType
 
int modules
 
int nEndcap
 
int nsectors
 
int nsectortot
 
std::vector< std::string > phiName
 
int phiSections
 
std::string plastMat
 
double riDip
 
double riKink
 
std::vector< double > rinBlock1
 
std::vector< double > rinBlock2
 
double roDip
 
std::string rotation
 
std::string rotHalf
 
std::string rotmat
 
std::string rotns
 
double rout
 
std::vector< double > routBlock1
 
std::vector< double > routBlock2
 
std::string scintMat
 
std::vector< double > scintT
 
std::vector< int > sectionModule
 
double slope
 
std::vector< double > thick
 
double tolAbs
 
double tolPos
 
std::vector< double > trimLeft
 
std::vector< double > trimRight
 
double z0Beam
 
double z1Beam
 
double zEnd
 
double zFront
 
double ziBody
 
double ziDip
 
double ziKink
 
double ziL0Body
 
double ziL0Nose
 
double ziNose
 
std::vector< double > zmaxBlock
 
std::vector< double > zminBlock
 
double zShift
 
double zShiftHac2
 

Detailed Description

Definition at line 10 of file DDHCalEndcapAlgo.h.

Constructor & Destructor Documentation

DDHCalEndcapAlgo::DDHCalEndcapAlgo ( )

Definition at line 23 of file DDHCalEndcapAlgo.cc.

23  :
25  layerN2(0),layerN3(0),layerN4(0),layerN5(0),thick(0),trimLeft(0),
27  rinBlock2(0),routBlock2(0),layerType(0),layerT(0),scintT(0) {
28 
29 #ifdef EDM_ML_DEBUG
30  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapAlgo: Creating an instance";
31 #endif
32 }
std::vector< int > layerN2
std::vector< int > modType
std::vector< double > zminBlock
std::vector< int > layerN0
std::vector< std::string > modMat
std::vector< double > routBlock1
std::vector< double > zmaxBlock
std::vector< double > routBlock2
std::vector< int > layerN1
std::vector< int > layerN4
std::vector< int > sectionModule
std::vector< double > rinBlock1
std::vector< int > layerN5
std::vector< int > layerType
std::vector< int > layerN
std::vector< double > rinBlock2
std::vector< double > trimRight
std::vector< int > layerN3
std::vector< double > thick
std::vector< double > scintT
std::vector< double > layerT
std::vector< double > trimLeft
DDHCalEndcapAlgo::~DDHCalEndcapAlgo ( )
override

Definition at line 34 of file DDHCalEndcapAlgo.cc.

34 {}

Member Function Documentation

void DDHCalEndcapAlgo::constructGeneralVolume ( DDCompactView cpv)
protected

!!!!!!!!!!!!!!!!Should be zero. And removed as soon as

Definition at line 352 of file DDHCalEndcapAlgo.cc.

References alpha, constructInsideSector(), geant_units::operators::convertRadToDeg(), DDrot(), DDSplit(), equipModule(), plotBeamSpotDB::first, formatAsDegreesInInteger(), getAbsMat(), getAngBot(), getAngTop(), getDrEnd(), getDzShift(), getEndcaps(), getGenMat(), getNsectors(), getNsectortot(), getRinDip(), getRinKink(), getRotation(), getRout(), getRoutDip(), getSlope(), getZ1Beam(), getZEnd(), getZFront(), getZiBody(), getZiDip(), getZiKink(), getZiL0Body(), getZShift(), getZShiftHac2(), mps_fire::i, idName, idNameSpace, cuy::ii, dataset::name, DDBase< N, C >::name(), class-composition::parent, phi, DDSolidFactory::polyhedra(), DDCompactView::position(), makeMuonMisalignmentScenario::rot, rotation, rotHalf, rotns, edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, and funct::tan().

Referenced by execute(), and getTolAbs().

352  {
353 
354 #ifdef EDM_ML_DEBUG
355  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapAlgo: General volume...";
356 #endif
357 
358  bool proto = true;
359  for (int i=0; i<3; i++)
360  if (equipModule(i) > 0) proto = false;
361 
362  DDRotation rot;
363  if (DDSplit(getRotation()).first == "NULL") rot = DDRotation();
365 
366 #ifdef EDM_ML_DEBUG
367  edm::LogVerbatim("HCalGeom")
368  << " First " << DDSplit(getRotation()).first << " Second "
369  << DDSplit(getRotation()).second << " Rotation " << rot;
370 #endif
371 
372  DDTranslation r0(0,0,getZShift());
373  double alpha = (1._pi)/getNsectors();
374  double dphi = getNsectortot()*(2._pi)/getNsectors();
375 
377  //vertical walls are allowed in SolidPolyhedra
378  double delz = 0;
379 
380  std::vector<double> pgonZ, pgonRmin, pgonRmax;
381  if (proto) {
382  double zf = getZiBody() + getZShiftHac2();
383  pgonZ.emplace_back(zf - getDzShift());
384  pgonRmin.emplace_back(zf * tan(getAngBot()));
385  pgonRmax.emplace_back((zf - getZ1Beam())*getSlope());
386  } else {
387  pgonZ.emplace_back(getZFront() - getDzShift());
388  pgonRmin.emplace_back(getZFront() * tan(getAngTop()));
389  pgonRmax.emplace_back((getZFront() - getZ1Beam())*getSlope());
390  pgonZ.emplace_back(getZiL0Body() - getDzShift());
391  pgonRmin.emplace_back(getZiL0Body() * tan(getAngTop()));
392  pgonRmax.emplace_back((getZiL0Body() - getZ1Beam())*getSlope());
393  pgonZ.emplace_back(getZiL0Body() - getDzShift());
394  pgonRmin.emplace_back(getZiL0Body() * tan(getAngBot()));
395  pgonRmax.emplace_back((getZiL0Body() - getZ1Beam())*getSlope());
396  }
397  pgonZ.emplace_back(getZiKink() - getDzShift());
398  pgonRmin.emplace_back(getRinKink());
399  pgonRmax.emplace_back(getRout());
400  pgonZ.emplace_back(getZiDip() - getDzShift());
401  pgonRmin.emplace_back(getRinDip());
402  pgonRmax.emplace_back(getRout());
403  pgonZ.emplace_back(getZiDip() - getDzShift() + delz);
404  pgonRmin.emplace_back(getRinDip());
405  pgonRmax.emplace_back(getRoutDip());
406  pgonZ.emplace_back(getZEnd() - getDzShift());
407  pgonRmin.emplace_back(getZEnd() * tan(getAngBot()));
408  pgonRmax.emplace_back(getRoutDip());
409  pgonZ.emplace_back(getZEnd());
410  pgonRmin.emplace_back(getZEnd() * tan(getAngBot()));
411  pgonRmax.emplace_back(getRoutDip());
412 
413  std::string name("Null");
414  DDSolid solid;
416  getNsectortot(), -alpha, dphi, pgonZ,
417  pgonRmin, pgonRmax);
418 #ifdef EDM_ML_DEBUG
419  edm::LogVerbatim("HCalGeom")
420  << "DDHCalEndcapAlgo: " << DDName(idName, idNameSpace)
421  << " Polyhedra made of " << getGenMat() << " with " << getNsectortot()
422  << " sectors from " << convertRadToDeg(-alpha) << " to "
423  << convertRadToDeg(-alpha+dphi) << " and with " << pgonZ.size() <<" sections";
424  for (unsigned int i = 0; i <pgonZ.size(); i++)
425  edm::LogVerbatim("HCalGeom")
426  << "\t\tZ = " << pgonZ[i] << "\tRmin = " << pgonRmin[i] << "\tRmax = "
427  << pgonRmax[i];
428 #endif
429 
431  DDMaterial matter(matname);
432  DDLogicalPart genlogic(DDName(idName, idNameSpace), matter, solid);
433 
434  DDName parentName = parent().name();
435  cpv.position(DDName(idName, idNameSpace), parentName, 1, r0, rot);
436 
437 #ifdef EDM_ML_DEBUG
438  edm::LogVerbatim("HCalGeom")
439  << "DDHCalEndcapAlgo: " << DDName(idName, idNameSpace)
440  << " number 1 positioned in " << parentName << " at " << r0 << " with " <<rot;
441 #endif
442 
443  if (getEndcaps() != 1) {
444  rot = DDRotation(DDName(rotHalf,rotns));
445  cpv.position(DDName(idName, idNameSpace), parentName, 2, r0, rot);
446 
447 #ifdef EDM_ML_DEBUG
448  edm::LogVerbatim("HCalGeom")
449  << "DDHCalEndcapAlgo: " << DDName(idName, idNameSpace) << " number 2 "
450  << "positioned in " << parentName << " at " << r0 << " with " << rot;
451 #endif
452 
453  }
454 
455  //Forward half
456  name = idName + "Front";
457  std::vector<double> pgonZMod, pgonRminMod, pgonRmaxMod;
458  for (unsigned int i=0; i < (pgonZ.size()-1); i++) {
459  pgonZMod.emplace_back(pgonZ[i] + getDzShift());
460  pgonRminMod.emplace_back(pgonRmin[i]);
461  pgonRmaxMod.emplace_back(pgonRmax[i]);
462  }
464  getNsectortot(), -alpha, dphi, pgonZMod,
465  pgonRminMod, pgonRmaxMod);
466 
467 #ifdef EDM_ML_DEBUG
468  edm::LogVerbatim("HCalGeom")
469  << "DDHCalEndcapAlgo: " << DDName(name,idNameSpace) << " Polyhedra made of "
470  << getGenMat() << " with " << getNsectortot() << " sectors from "
471  << convertRadToDeg(-alpha) << " to " << convertRadToDeg(-alpha+dphi)
472  << " and with " << pgonZMod.size() << " sections ";
473  for (unsigned int i = 0; i < pgonZMod.size(); i++)
474  edm::LogVerbatim("HCalGeom")
475  << "\t\tZ = " << pgonZMod[i] << "\tRmin = " << pgonRminMod[i] << "\tRmax = "
476  << pgonRmaxMod[i];
477 #endif
478 
479  DDLogicalPart genlogich(DDName(name, idNameSpace), matter, solid);
480 
481  cpv.position(genlogich, genlogic, 1, DDTranslation(0.0, 0.0, -getDzShift()),
482  DDRotation());
483 
484 #ifdef EDM_ML_DEBUG
485  edm::LogVerbatim("HCalGeom")
486  << "DDHCalEndcapAlgo: " << genlogich.name() << " number 1 positioned in "
487  << genlogic.name() << " at (0,0," << -getDzShift()<< ") with no rotation";
488 #endif
489 
490  //Construct sector (from -alpha to +alpha)
491  name = idName + "Module";
493  1, -alpha, 2*alpha, pgonZMod,
494  pgonRminMod, pgonRmaxMod);
495 #ifdef EDM_ML_DEBUG
496  edm::LogVerbatim("HCalGeom")
497  << "DDHCalEndcapAlgo: " << DDName(name,idNameSpace)<< " Polyhedra made of "
498  << getGenMat() <<" with 1 sector from " << convertRadToDeg(-alpha) << " to "
499  << convertRadToDeg(alpha) << " and with " << pgonZMod.size() << " sections";
500  for (unsigned int i = 0; i < pgonZMod.size(); i++)
501  edm::LogVerbatim("HCalGeom")
502  << "\t\tZ = " << pgonZMod[i] << "\tRmin = " << pgonRminMod[i] << "\tRmax = "
503  << pgonRmaxMod[i];
504 #endif
505 
506  DDLogicalPart seclogic(DDName(name, idNameSpace), matter, solid);
507 
508  for (int ii=0; ii<getNsectortot(); ii++) {
509  double phi = ii*2*alpha;
511  std::string rotstr("NULL");
512  if (phi != 0) {
513  rotstr = "R" + formatAsDegreesInInteger(phi);
514  rotation = DDRotation(DDName(rotstr, rotns));
515  if (!rotation) {
516 #ifdef EDM_ML_DEBUG
517  edm::LogVerbatim("HCalGeom")
518  << "DDHCalEndcapAlgo: Creating a new rotation " << rotstr
519  << "\t 90," << convertRadToDeg(phi) << ", 90,"
520  << convertRadToDeg(phi+90._deg) << ", 0, 0";
521 #endif
522  rotation = DDrot(DDName(rotstr, rotns), 90._deg, phi, 90._deg,
523  (90._deg+phi), 0, 0);
524  } //if !rotation
525  } //if phi!=0
526 
527  cpv.position(seclogic, genlogich, ii+1, DDTranslation(0.0, 0.0, 0.0), rotation);
528 
529 #ifdef EDM_ML_DEBUG
530  edm::LogVerbatim("HCalGeom")
531  << "DDHCalEndcapAlgo: " << seclogic.name() << " number " << ii+1
532  << " positioned in " << genlogich.name() << " at (0,0,0) with " << rotation;
533 #endif
534 
535  }
536 
537  //Construct the things inside the sector
538  constructInsideSector(seclogic, cpv);
539 
540  //Backward half
541  name = idName + "Back";
542  std::vector<double> pgonZBack, pgonRminBack, pgonRmaxBack;
543  pgonZBack.emplace_back(getZEnd() - getDzShift());
544  pgonRminBack.emplace_back(pgonZBack[0]*tan(getAngBot()) + getDrEnd());
545  pgonRmaxBack.emplace_back(getRoutDip());
546  pgonZBack.emplace_back(getZEnd());
547  pgonRminBack.emplace_back(pgonZBack[1]*tan(getAngBot()) + getDrEnd());
548  pgonRmaxBack.emplace_back(getRoutDip());
550  getNsectortot(), -alpha, dphi, pgonZBack,
551  pgonRminBack, pgonRmaxBack);
552 
553 #ifdef EDM_ML_DEBUG
554  edm::LogVerbatim("HCalGeom")
555  << "DDHCalEndcapAlgo: " << DDName(name,idNameSpace) << " Polyhedra made of "
556  << getAbsMat() << " with " << getNsectortot() << " sectors from "
557  << convertRadToDeg(-alpha) << " to " << convertRadToDeg(-alpha+dphi)
558  << " and with " << pgonZBack.size() << " sections";
559  for (unsigned int i = 0; i < pgonZBack.size(); i++)
560  edm::LogVerbatim("HCalGeom")
561  << "\t\tZ = " << pgonZBack[i] << "\tRmin = " << pgonRminBack[i]
562  << "\tRmax = " << pgonRmaxBack[i];
563 #endif
564 
565  DDName absMatname(DDSplit(getAbsMat()).first, DDSplit(getAbsMat()).second);
566  DDMaterial absMatter(absMatname);
567  DDLogicalPart glog(DDName(name, idNameSpace), absMatter, solid);
568 
569  cpv.position(glog, genlogic, 1, DDTranslation(0.0, 0.0, 0.0), DDRotation());
570 
571 #ifdef EDM_ML_DEBUG
572  edm::LogVerbatim("HCalGeom")
573  << "DDHCalEndcapAlgo: " << glog.name() << " number 1 positioned in "
574  << genlogic.name() << " at (0,0,0) with no rotation";
575 #endif
576 }
double getDrEnd() const
float alpha
Definition: AMPTWrapper.h:95
double getSlope() const
std::string idNameSpace
double getZiKink() const
double getZShift() const
int getNsectortot() const
int getEndcaps() const
std::string getAbsMat() const
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:43
void constructInsideSector(const DDLogicalPart &sector, DDCompactView &cpv)
int getNsectors() const
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
double getRinKink() const
double getZEnd() const
std::string formatAsDegreesInInteger(double radianVal)
Definition: DDTypes.cc:86
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
std::string getRotation() const
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:68
U second(std::pair< T, U > const &p)
double getZ1Beam() const
double getAngTop() const
double getRout() const
double getAngBot() const
int equipModule(unsigned int i) const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
double getZiL0Body() const
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
DDRotation DDrot(const DDName &name, std::unique_ptr< DDRotationMatrix > rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:80
ii
Definition: cuy.py:590
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
double getRinDip() const
double getRoutDip() const
double getDzShift() const
double getZiDip() const
double getZFront() const
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
double getZiBody() const
std::string getGenMat() const
std::string rotation
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:730
double getZShiftHac2() const
void DDHCalEndcapAlgo::constructInsideModule ( const DDLogicalPart module,
int  mod,
DDCompactView cpv 
)
protected

Definition at line 887 of file DDHCalEndcapAlgo.cc.

References alpha, constructScintLayer(), geant_units::operators::convertRadToDeg(), DDBase< N, C >::ddname(), DDSplit(), plotBeamSpotDB::first, getAngBot(), getAngTop(), getDzStep(), getGenMat(), getLayer(), getLayerN(), getLayerName(), getLayerT(), getLayerType(), getModName(), getNsectors(), getPhi(), getPhiName(), getPlastMat(), getRotMat(), getRoutBlock2(), getScintT(), getSlope(), getThick(), getTrim(), getZ1Beam(), getZminBlock(), mps_fire::i, idNameSpace, idOffset, mod(), DDName::name(), dataset::name, DDBase< N, C >::name(), parameterLayer(), phi, DDCompactView::position(), diffTwoXMLs::r1, diffTwoXMLs::r2, makeMuonMisalignmentScenario::rot, rotns, edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, funct::tan(), theta(), and DDSolidFactory::trap().

Referenced by constructInsideSector(), and getTolAbs().

887  {
888 
889 #ifdef EDM_ML_DEBUG
890  edm::LogVerbatim("HCalGeom")
891  << "DDHCalEndcapAlgo: \t\tInside module ..." << mod;
892 #endif
893 
895  //Pointers to the Rotation Matrices and to the Materials
896  std::string rotstr = getRotMat();
897  DDRotation rot(DDName(rotstr, rotns));
899  DDMaterial matter(matName);
901  DDMaterial matplastic(plasName);
902 
903  double alpha = (1._pi)/getNsectors();
904  double zi = getZminBlock(mod);
905 
906  for (int i = 0; i < getLayerN(mod); i++) {
908  DDSolid solid;
909  DDLogicalPart glog, plog;
910  int layer = getLayer(mod,i);
911  double zo = zi + 0.5*getDzStep();
912 
913  for (int iphi = 0; iphi < getPhi(); iphi++) {
914  double ziAir = zo - getThick(mod);
915  double rinF, rinB;
916  if (layer == 1) {
917  rinF = ziAir * tan(getAngTop());
918  rinB = zo * tan(getAngTop());
919  } else {
920  rinF = ziAir * tan(getAngBot());
921  rinB = zo * tan(getAngBot());
922  }
923  double routF = (ziAir - getZ1Beam()) * getSlope();
924  double routB = (zo - getZ1Beam()) * getSlope();
925  if (routF > getRoutBlock2(mod)) routF = getRoutBlock2(mod);
926  if (routB > getRoutBlock2(mod)) routB = getRoutBlock2(mod);
927 
928 #ifdef EDM_ML_DEBUG
929  edm::LogVerbatim("HCalGeom")
930  << "DDHCalEndcapAlgo: Layer " << i <<" Phi " << iphi << " Front "
931  << ziAir << ", " << rinF << ", " << routF << " Back " << zo << ", "
932  << rinB << ", " << routB;
933 #endif
934 
935  double yh1, bl1, tl1, yh2, bl2, tl2, theta, phi, alp;
936  double xpos, ypos, zpos;
937  parameterLayer(iphi, rinF, routF, rinB, routB, ziAir, zo, yh1, bl1, tl1,
938  yh2, bl2, tl2, alp, theta, phi, xpos, ypos, zpos);
939 
940  name = module.name().name()+getLayerName(layer)+getPhiName(iphi)+"Air";
941  solid = DDSolidFactory::trap(DDName(name, idNameSpace),
942  0.5*getThick(mod), theta, phi, yh1,
943  bl1, tl1, alp, yh2, bl2, tl2, alp);
944 
945 #ifdef EDM_ML_DEBUG
946  edm::LogVerbatim("HCalGeom")
947  << "DDHCalEndcapAlgo: " << solid.name() << " Trap made of " << getGenMat()
948  << " of dimensions " << 0.5*getThick(mod) << ", "<< convertRadToDeg(theta)
949  << ", " << convertRadToDeg(phi) << ", " << yh1 << ", " << bl1 << ", "
950  << tl1 << ", " << convertRadToDeg(alp) << ", " << yh2 << ", " << bl2
951  << ", " << tl2 << ", " << convertRadToDeg(alp);
952 #endif
953 
954  glog = DDLogicalPart(solid.ddname(), matter, solid);
955 
956  DDTranslation r1(xpos, ypos, zpos);
957  cpv.position(glog, module, layer+1, r1, rot);
958 
959 #ifdef EDM_ML_DEBUG
960  edm::LogVerbatim("HCalGeom")
961  << "DDHCalEndcapAlgo: " << glog.name() << " number " << layer+1
962  << " positioned in " << module.name() << " at " << r1 << " with " << rot;
963 #endif
964 
965  //Now the plastic with scintillators
966  double yh = 0.5 * (routF - rinB) - getTrim(mod,iphi);
967  double bl = 0.5 * rinB * tan(alpha) - getTrim(mod,iphi);
968  double tl = 0.5 * routF * tan(alpha) - getTrim(mod,iphi);
969  name = module.name().name()+getLayerName(layer)+getPhiName(iphi);
970  solid = DDSolidFactory::trap(DDName(name, idNameSpace),
971  0.5*getLayerT(layer), 0, 0, yh,
972  bl, tl, alp, yh, bl, tl, alp);
973 
974 #ifdef EDM_ML_DEBUG
975  edm::LogVerbatim("HCalGeom")
976  << "DDHCalEndcapAlgo: " << solid.name() << " Trap made of "
977  << getPlastMat() << " of dimensions " << 0.5*getLayerT(layer)
978  << ", 0, 0, " << yh << ", " << bl << ", " << tl << ", "
979  << convertRadToDeg(alp) << ", " << yh << ", " << bl << ", " << tl << ", "
980  << convertRadToDeg(alp);
981 #endif
982 
983  plog = DDLogicalPart(solid.ddname(), matplastic, solid);
984 
985  ypos = 0.5*(routF+rinB) - xpos;
986  DDTranslation r2(0., ypos, 0.);
987  cpv.position(plog, glog, idOffset+layer+1, r2, DDRotation());
988 
989 #ifdef EDM_ML_DEBUG
990  edm::LogVerbatim("HCalGeom")
991  << "DDHCalEndcapAlgo: " << plog.name() << " number " << idOffset+layer+1
992  << " positioned in " << glog.name() << " at " << r2 <<" with no rotation";
993 #endif
994 
995  //Constructin the scintillators inside
996  int copyNo = layer*10 + getLayerType(layer);
997  name = getModName(mod)+getLayerName(layer)+getPhiName(iphi);
998  constructScintLayer (plog, getScintT(layer), yh,bl,tl, alp,name,copyNo, cpv);
999  zo += 0.5*getDzStep();
1000  } // End of loop over phi indices
1001  zi = zo - 0.5*getDzStep();
1002  } // End of loop on layers
1003 }
double getTrim(unsigned int i, unsigned int j) const
std::string getModName(unsigned int i) const
float alpha
Definition: AMPTWrapper.h:95
double getSlope() const
const N & name() const
Definition: DDBase.h:74
std::string idNameSpace
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:43
int getPhi() const
double getRoutBlock2(unsigned i) const
int getNsectors() const
Geom::Theta< T > theta() const
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
double getThick(unsigned int i) const
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
std::string getRotMat() const
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:68
U second(std::pair< T, U > const &p)
double getZ1Beam() const
double getScintT(unsigned int i) const
void constructScintLayer(const DDLogicalPart &glog, double pDz, double yh, double bl, double tl, double alp, const std::string &name, int id, DDCompactView &cpv)
double getAngTop() const
double getAngBot() const
double getDzStep() const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
std::string getPlastMat() const
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:792
int getLayerN(unsigned int i) const
int getLayerType(unsigned int i) const
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
double getLayerT(unsigned int i) const
int getLayer(unsigned int i, unsigned int j) const
std::string getPhiName(unsigned int i) const
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
std::string getGenMat() const
void parameterLayer(int iphi, double rinF, double routF, double rinB, double routB, double zi, double zo, double &yh1, double &bl1, double &tl1, double &yh2, double &bl2, double &tl2, double &alp, double &theta, double &phi, double &xpos, double &ypos, double &zcpv)
double getZminBlock(unsigned i) const
std::string getLayerName(unsigned int i) const
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
const std::string & name() const
Returns the name.
Definition: DDName.cc:53
const N & ddname() const
Definition: DDBase.h:76
void DDHCalEndcapAlgo::constructInsideModule0 ( const DDLogicalPart module,
int  mod,
DDCompactView cpv 
)
protected

Definition at line 768 of file DDHCalEndcapAlgo.cc.

References constructScintLayer(), geant_units::operators::convertRadToDeg(), DDBase< N, C >::ddname(), DDSplit(), fact, plotBeamSpotDB::first, getAbsMat(), getAngBot(), getAngTop(), getDzStep(), getLayer(), getLayerName(), getLayerT(), getLayerType(), getModName(), getPhi(), getPhiName(), getPlastMat(), getRotMat(), getScintT(), getSlope(), getThick(), getTolAbs(), getZ1Beam(), getZminBlock(), idNameSpace, idOffset, mod(), DDName::name(), dataset::name, DDBase< N, C >::name(), parameterLayer(), parameterLayer0(), phi, DDCompactView::position(), diffTwoXMLs::r1, diffTwoXMLs::r2, makeMuonMisalignmentScenario::rot, rotns, edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, funct::tan(), theta(), and DDSolidFactory::trap().

Referenced by constructInsideSector(), and getTolAbs().

768  {
769 
770 #ifdef EDM_ML_DEBUG
771  edm::LogVerbatim("HCalGeom")
772  << "DDHCalEndcapAlgo: \t\tInside module0 ..." << mod;
773 #endif
774 
776  //Pointers to the Rotation Matrices and to the Materials
777  std::string rotstr = getRotMat();
778  DDRotation rot(DDName(rotstr, rotns));
780  DDMaterial matabsorbr(matName);
782  DDMaterial matplastic(plasName);
783 
784  int layer = getLayer(mod,0);
785  int layer0 = getLayer(mod,1);
787  double xpos, ypos, zpos;
788  DDSolid solid;
789  DDLogicalPart glog, plog;
790  for (int iphi = 0; iphi < getPhi(); iphi++) {
791  double yh, bl, tl, alp;
792  parameterLayer0(mod, layer, iphi, yh, bl, tl, alp, xpos, ypos, zpos);
793  name = module.name().name()+getLayerName(layer)+getPhiName(iphi);
794  solid = DDSolidFactory::trap(DDName(name, idNameSpace),
795  0.5*getLayerT(layer), 0, 0, yh,
796  bl, tl, alp, yh, bl, tl, alp);
797 
798 #ifdef EDM_ML_DEBUG
799  edm::LogVerbatim("HCalGeom")
800  << "DDHCalEndcapAlgo: " << solid.name() << " Trap made of " << getPlastMat()
801  << " of dimensions " << 0.5*getLayerT(layer) << ", 0, 0, " << yh << ", "
802  << bl << ", " << tl << ", " << convertRadToDeg(alp) << ", " << yh << ", "
803  << bl << ", " << tl << ", " << convertRadToDeg(alp);
804 #endif
805 
806  glog = DDLogicalPart(solid.ddname(), matplastic, solid);
807 
808  DDTranslation r1(xpos, ypos, zpos);
809  cpv.position(glog, module, idOffset+layer+1, r1, rot);
810 
811 #ifdef EDM_ML_DEBUG
812  edm::LogVerbatim("HCalGeom")
813  << "DDHCalEndcapAlgo: " << glog.name() << " number " << idOffset+layer+1
814  << " positioned in " << module.name() << " at " << r1 << " with " << rot;
815 #endif
816 
817  //Now construct the layer of scintillator inside this
818  int copyNo = layer0*10 + getLayerType(layer);
819  name = getModName(mod)+getLayerName(layer)+getPhiName(iphi);
820  constructScintLayer (glog, getScintT(layer), yh, bl, tl, alp, name, copyNo, cpv);
821  }
822 
823  //Now the absorber layer
824  double zi = getZminBlock(mod) + getLayerT(layer);
825  double zo = zi + 0.5*getDzStep();
826  double rinF, routF, rinB, routB;
827  if (mod == 0) {
828  rinF = zi * tan(getAngTop());
829  routF =(zi - getZ1Beam()) * getSlope();
830  rinB = zo * tan(getAngTop());
831  routB =(zo - getZ1Beam()) * getSlope();
832  } else {
833  rinF = zi * tan(getAngBot());
834  routF = zi * tan(getAngTop());
835  rinB = zo * tan(getAngBot());
836  routB = zo * tan(getAngTop());
837  }
838 
839 #ifdef EDM_ML_DEBUG
840  edm::LogVerbatim("HCalGeom")
841  << "DDHCalEndcapAlgo: Module " << mod << " Front " << zi << ", " << rinF
842  << ", " << routF << " Back " << zo << ", " << rinB << ", " << routB;
843 #endif
844 
845  double yh1, bl1, tl1, yh2, bl2, tl2, theta, phi, alp;
846  parameterLayer(0, rinF, routF, rinB, routB, zi, zo, yh1, bl1, tl1, yh2, bl2,
847  tl2, alp, theta, phi, xpos, ypos, zpos);
848  double fact = getTolAbs();
849 
850 #ifdef EDM_ML_DEBUG
851  edm::LogVerbatim("HCalGeom")
852  << "DDHCalEndcapAlgo: Trim " << fact << " Param " << yh1 << ", " << bl1
853  << ", " << tl1 << ", " << yh2 << ", " << bl2 << ", " << tl2;
854 #endif
855 
856  bl1 -= fact;
857  tl1 -= fact;
858  bl2 -= fact;
859  tl2 -= fact;
860 
861  name = module.name().name()+"Absorber";
862  solid = DDSolidFactory::trap(DDName(name, idNameSpace),
863  0.5*getThick(mod), theta, phi, yh1,
864  bl1, tl1, alp, yh2, bl2, tl2, alp);
865 #ifdef EDM_ML_DEBUG
866  edm::LogVerbatim("HCalGeom")
867  << "DDHCalEndcapAlgo: " << solid.name() << " Trap made of " << getAbsMat()
868  << " of dimensions " << 0.5*getThick(mod) << ", " << convertRadToDeg(theta)
869  << ", " << convertRadToDeg(phi) << ", " << yh1 << ", " << bl1 << ", " << tl1
870  << ", " << convertRadToDeg(alp) << ", " << yh2 << ", " << bl2 << ", " << tl2
871  << ", " << convertRadToDeg(alp);
872 #endif
873 
874  glog = DDLogicalPart(solid.ddname(), matabsorbr, solid);
875 
876  DDTranslation r2(xpos, ypos, zpos);
877  cpv.position(glog, module, 1, r2, rot);
878 
879 #ifdef EDM_ML_DEBUG
880  edm::LogVerbatim("HCalGeom")
881  << "DDHCalEndcapAlgo: " << glog.name() << " number 1 positioned in "
882  << module.name() << " at " << r2 << " with " << rot;
883 #endif
884 }
std::string getModName(unsigned int i) const
double getSlope() const
const N & name() const
Definition: DDBase.h:74
std::string idNameSpace
std::string getAbsMat() const
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:43
int getPhi() const
Geom::Theta< T > theta() const
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
double getThick(unsigned int i) const
double getTolAbs() const
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
std::string getRotMat() const
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:68
U second(std::pair< T, U > const &p)
double getZ1Beam() const
double getScintT(unsigned int i) const
void parameterLayer0(int mod, int layer, int iphi, double &yh, double &bl, double &tl, double &alp, double &xpos, double &ypos, double &zcpv)
void constructScintLayer(const DDLogicalPart &glog, double pDz, double yh, double bl, double tl, double alp, const std::string &name, int id, DDCompactView &cpv)
double getAngTop() const
double getAngBot() const
double getDzStep() const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
std::string getPlastMat() const
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:792
const double fact
int getLayerType(unsigned int i) const
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
double getLayerT(unsigned int i) const
int getLayer(unsigned int i, unsigned int j) const
std::string getPhiName(unsigned int i) const
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
void parameterLayer(int iphi, double rinF, double routF, double rinB, double routB, double zi, double zo, double &yh1, double &bl1, double &tl1, double &yh2, double &bl2, double &tl2, double &alp, double &theta, double &phi, double &xpos, double &ypos, double &zcpv)
double getZminBlock(unsigned i) const
std::string getLayerName(unsigned int i) const
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
const std::string & name() const
Returns the name.
Definition: DDName.cc:53
const N & ddname() const
Definition: DDBase.h:76
void DDHCalEndcapAlgo::constructInsideSector ( const DDLogicalPart sector,
DDCompactView cpv 
)
protected

!!!!!!!!!!!!!!!!Should be zero. And removed as soon as

Definition at line 579 of file DDHCalEndcapAlgo.cc.

References alpha, constructInsideModule(), constructInsideModule0(), geant_units::operators::convertRadToDeg(), DDSplit(), equipModule(), plotBeamSpotDB::first, getAngBot(), getModMat(), getModName(), getModType(), getModules(), getNsectors(), getRinBlock1(), getRinBlock2(), getRinDip(), getRinKink(), getRout(), getRoutBlock1(), getRoutBlock2(), getRoutDip(), getSectionModule(), getSlope(), getZ1Beam(), getZiDip(), getZiKink(), getZmaxBlock(), getZminBlock(), getZShiftHac2(), mps_fire::i, idName, idNameSpace, gen::k, dataset::name, DDBase< N, C >::name(), DDSolidFactory::polyhedra(), DDCompactView::position(), edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, and funct::tan().

Referenced by constructGeneralVolume(), and getTolAbs().

579  {
580 
581 #ifdef EDM_ML_DEBUG
582  edm::LogVerbatim("HCalGeom")
583  << "DDHCalEndcapAlgo: Modules (" << getModules() << ") ...";
584 #endif
585 
586  double alpha = (1._pi)/getNsectors();
587 
588  for (int i = 0; i < getModules(); i++) {
591  DDMaterial matter(matname);
592 
593  if (equipModule(i)>0) {
594  int nsec = getSectionModule(i);
595 
597  //vertical walls are allowed in SolidPolyhedra
598  double deltaz = 0;
599 
600  std::vector<double> pgonZ, pgonRmin, pgonRmax;
601  if (nsec == 3) {
602  double zf = getZminBlock(i) + getZShiftHac2();
603  pgonZ.emplace_back(zf);
604  pgonRmin.emplace_back(zf*tan(getAngBot()));
605  pgonRmax.emplace_back((zf-getZ1Beam())*getSlope());
606  pgonZ.emplace_back(getZiKink());
607  pgonRmin.emplace_back(getRinKink());
608  pgonRmax.emplace_back(getRout());
609  } else {
610  pgonZ.emplace_back(getZminBlock(i));
611  pgonRmin.emplace_back(getRinBlock1(i));
612  pgonRmax.emplace_back(getRoutBlock1(i));
613  }
614  if (nsec == 4) {
615  pgonZ.emplace_back(getZiDip());
616  pgonRmin.emplace_back(getRinDip());
617  pgonRmax.emplace_back(getRout());
618  pgonZ.emplace_back(pgonZ[1] + deltaz);
619  pgonRmin.emplace_back(pgonRmin[1]);
620  pgonRmax.emplace_back(getRoutDip());
621  }
622  pgonZ.emplace_back(getZmaxBlock(i));
623  pgonRmin.emplace_back(getRinBlock2(i));
624  pgonRmax.emplace_back(getRoutBlock2(i));
625 
626  //Solid & volume
627  DDSolid solid;
629  1, -alpha, 2*alpha,
630  pgonZ, pgonRmin, pgonRmax);
631 
632 #ifdef EDM_ML_DEBUG
633  edm::LogVerbatim("HCalGeom")
634  << "DDHCalEndcapAlgo: " << DDName(name,idNameSpace)
635  << " Polyhedra made of " << getModMat(i) << " with 1 sector from "
636  << convertRadToDeg(-alpha) << " to " << convertRadToDeg(alpha)
637  << " and with " << nsec << " sections";
638  for (unsigned int k=0; k<pgonZ.size(); k++)
639  edm::LogVerbatim("HCalGeom")
640  << "\t\tZ = " << pgonZ[k] << "\tRmin = " << pgonRmin[k] << "\tRmax = "
641  << pgonRmax[k];
642 #endif
643 
644  DDLogicalPart glog(DDName(name, idNameSpace), matter, solid);
645 
646  cpv.position(glog, sector, i+1, DDTranslation(0.0, 0.0, 0.0), DDRotation());
647 
648 #ifdef EDM_ML_DEBUG
649  edm::LogVerbatim("HCalGeom")
650  << "DDHCalEndcapAlgo: " << glog.name() << " number " << i+1
651  << " positioned in " << sector.name() <<" at (0,0,0) with no rotation";
652 #endif
653 
654  if (getModType(i) == 0)
655  constructInsideModule0 (glog, i, cpv);
656  else
657  constructInsideModule (glog, i, cpv);
658  }
659  }
660 }
std::string getModName(unsigned int i) const
double getZmaxBlock(unsigned i) const
float alpha
Definition: AMPTWrapper.h:95
double getSlope() const
const N & name() const
Definition: DDBase.h:74
std::string idNameSpace
double getRinBlock2(unsigned i) const
double getZiKink() const
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:43
double getRoutBlock2(unsigned i) const
int getModType(unsigned int i) const
int getNsectors() const
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
void constructInsideModule(const DDLogicalPart &module, int mod, DDCompactView &cpv)
double getRinKink() const
int getSectionModule(unsigned i) const
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
std::string getModMat(unsigned int i) const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:68
U second(std::pair< T, U > const &p)
double getZ1Beam() const
double getRout() const
double getRinBlock1(unsigned i) const
double getAngBot() const
int equipModule(unsigned int i) const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
int k[5][pyjets_maxn]
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
void constructInsideModule0(const DDLogicalPart &module, int mod, DDCompactView &cpv)
double getRinDip() const
double getRoutDip() const
double getZiDip() const
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
double getZminBlock(unsigned i) const
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:730
double getZShiftHac2() const
double getRoutBlock1(unsigned i) const
int getModules() const
void DDHCalEndcapAlgo::constructScintLayer ( const DDLogicalPart glog,
double  pDz,
double  yh,
double  bl,
double  tl,
double  alp,
const std::string &  name,
int  id,
DDCompactView cpv 
)
protected

Definition at line 1006 of file DDHCalEndcapAlgo.cc.

References geant_units::operators::convertRadToDeg(), DDBase< N, C >::ddname(), DDSplit(), plotBeamSpotDB::first, getScintMat(), idName, idNameSpace, dataset::name, DDBase< N, C >::name(), DDCompactView::position(), edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, and DDSolidFactory::trap().

Referenced by constructInsideModule(), constructInsideModule0(), and getTolAbs().

1010  {
1011 
1013  DDMaterial matter(matname);
1014  std::string name = idName+"Scintillator"+nm;
1015 
1016  DDSolid solid = DDSolidFactory::trap(DDName(name, idNameSpace), 0.5*dz, 0, 0,
1017  yh, bl, tl, alp, yh, bl, tl, alp);
1018 
1019 #ifdef EDM_ML_DEBUG
1020  edm::LogVerbatim("HCalGeom")
1021  << "DDHCalEndcapAlgo: " << DDName(name,idNameSpace) << " Trap made of "
1022  << getScintMat() <<" of dimensions " << 0.5*dz << ", 0, 0, " << yh << ", "
1023  << bl << ", " << tl << ", " << convertRadToDeg(alp) << ", " << yh << ", "
1024  << bl << ", " << tl << ", " << convertRadToDeg(alp);
1025 #endif
1026 
1027  DDLogicalPart glog(solid.ddname(), matter, solid);
1028 
1029  cpv.position(glog, detector, id, DDTranslation(0,0,0), DDRotation());
1030 
1031 #ifdef EDM_ML_DEBUG
1032  edm::LogVerbatim("HCalGeom")
1033  << "DDHCalEndcapAlgo: " << glog.name() << " number " << id
1034  << " positioned in " << detector.name() << " at (0,0,0) with no rotation";
1035 #endif
1036 }
const N & name() const
Definition: DDBase.h:74
std::string idNameSpace
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:43
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:68
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:792
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
std::string getScintMat() const
const N & ddname() const
Definition: DDBase.h:76
int DDHCalEndcapAlgo::equipModule ( unsigned int  i) const
inline

Definition at line 22 of file DDHCalEndcapAlgo.h.

References eModule, and mps_fire::i.

Referenced by constructGeneralVolume(), and constructInsideSector().

22 {return eModule[i];}
std::vector< int > eModule
void DDHCalEndcapAlgo::execute ( DDCompactView cpv)
override

Definition at line 337 of file DDHCalEndcapAlgo.cc.

References constructGeneralVolume().

Referenced by getTolAbs().

337  {
338 
339 #ifdef EDM_ML_DEBUG
340  edm::LogVerbatim("HCalGeom") << "==>> Constructing DDHCalEndcapAlgo...";
341 #endif
342 
344 
345 #ifdef EDM_ML_DEBUG
346  edm::LogVerbatim("HCalGeom") << "<<== End of DDHCalEndcapAlgo construction ...";
347 #endif
348 }
void constructGeneralVolume(DDCompactView &cpv)
std::string DDHCalEndcapAlgo::getAbsMat ( ) const
inline

Definition at line 50 of file DDHCalEndcapAlgo.h.

References absMat.

Referenced by constructGeneralVolume(), and constructInsideModule0().

50 {return absMat;}
double DDHCalEndcapAlgo::getAngBot ( ) const
inline
double DDHCalEndcapAlgo::getAngGap ( ) const
inline

Definition at line 47 of file DDHCalEndcapAlgo.h.

References angGap.

47 {return angGap;}
double DDHCalEndcapAlgo::getAngTop ( ) const
inline
double DDHCalEndcapAlgo::getDrEnd ( ) const
inline

Definition at line 44 of file DDHCalEndcapAlgo.h.

References drEnd.

Referenced by constructGeneralVolume().

44 {return drEnd;}
double DDHCalEndcapAlgo::getDzShift ( ) const
inline

Definition at line 36 of file DDHCalEndcapAlgo.h.

References dzShift.

Referenced by constructGeneralVolume().

36 {return dzShift;}
double DDHCalEndcapAlgo::getDzStep ( ) const
inline

Definition at line 35 of file DDHCalEndcapAlgo.h.

References dzStep.

Referenced by constructInsideModule(), and constructInsideModule0().

35 {return dzStep;}
int DDHCalEndcapAlgo::getEndcaps ( ) const
inline

Definition at line 21 of file DDHCalEndcapAlgo.h.

References nEndcap.

Referenced by constructGeneralVolume().

21 {return nEndcap;}
std::string DDHCalEndcapAlgo::getGenMat ( ) const
inline

Definition at line 17 of file DDHCalEndcapAlgo.h.

References genMaterial.

Referenced by constructGeneralVolume(), and constructInsideModule().

17 {return genMaterial;}
std::string genMaterial
double DDHCalEndcapAlgo::getHeboxDepth ( ) const
inline

Definition at line 43 of file DDHCalEndcapAlgo.h.

References heboxDepth.

43 {return heboxDepth;}
int DDHCalEndcapAlgo::getLayer ( unsigned int  i,
unsigned int  j 
) const

Definition at line 36 of file DDHCalEndcapAlgo.cc.

References layerN0, layerN1, layerN2, layerN3, layerN4, and layerN5.

Referenced by constructInsideModule(), constructInsideModule0(), and getLayerN().

36  {
37 
38  switch (i) {
39  case 0:
40  return layerN0[j];
41  break;
42 
43  case 1:
44  return layerN1[j];
45  break;
46 
47  case 2:
48  return layerN2[j];
49  break;
50 
51  case 3:
52  return layerN3[j];
53  break;
54 
55  case 4:
56  return layerN4[j];
57  break;
58 
59  case 5:
60  return layerN5[j];
61  break;
62 
63  default:
64  return 0;
65  }
66 }
std::vector< int > layerN2
std::vector< int > layerN0
std::vector< int > layerN1
std::vector< int > layerN4
std::vector< int > layerN5
std::vector< int > layerN3
int DDHCalEndcapAlgo::getLayerN ( unsigned int  i) const
inline

Definition at line 56 of file DDHCalEndcapAlgo.h.

References getLayer(), mps_fire::i, and layerN.

Referenced by constructInsideModule().

56 {return layerN[i];}
std::vector< int > layerN
std::string DDHCalEndcapAlgo::getLayerName ( unsigned int  i) const
inline

Definition at line 70 of file DDHCalEndcapAlgo.h.

References mps_fire::i, and layerName.

Referenced by constructInsideModule(), and constructInsideModule0().

70 {return layerName[i];}
std::vector< std::string > layerName
int DDHCalEndcapAlgo::getLayers ( ) const
inline

Definition at line 69 of file DDHCalEndcapAlgo.h.

References layers.

69 {return layers;}
double DDHCalEndcapAlgo::getLayerT ( unsigned int  i) const
inline

Definition at line 72 of file DDHCalEndcapAlgo.h.

References mps_fire::i, and layerT.

Referenced by constructInsideModule(), constructInsideModule0(), and parameterLayer0().

72 {return layerT[i];}
std::vector< double > layerT
int DDHCalEndcapAlgo::getLayerType ( unsigned int  i) const
inline

Definition at line 71 of file DDHCalEndcapAlgo.h.

References mps_fire::i, and layerType.

Referenced by constructInsideModule(), and constructInsideModule0().

71 {return layerType[i];}
std::vector< int > layerType
std::string DDHCalEndcapAlgo::getModMat ( unsigned int  i) const
inline

Definition at line 53 of file DDHCalEndcapAlgo.h.

References mps_fire::i, and modMat.

Referenced by constructInsideSector().

53 {return modMat[i];}
std::vector< std::string > modMat
std::string DDHCalEndcapAlgo::getModName ( unsigned int  i) const
inline

Definition at line 52 of file DDHCalEndcapAlgo.h.

References mps_fire::i, and modName.

Referenced by constructInsideModule(), constructInsideModule0(), and constructInsideSector().

52 {return modName[i];}
std::vector< std::string > modName
int DDHCalEndcapAlgo::getModType ( unsigned int  i) const
inline

Definition at line 54 of file DDHCalEndcapAlgo.h.

References mps_fire::i, and modType.

Referenced by constructInsideSector().

54 {return modType[i];}
std::vector< int > modType
int DDHCalEndcapAlgo::getModules ( ) const
inline

Definition at line 51 of file DDHCalEndcapAlgo.h.

References modules.

Referenced by constructInsideSector().

51 {return modules;}
int DDHCalEndcapAlgo::getNsectors ( ) const
inline
int DDHCalEndcapAlgo::getNsectortot ( ) const
inline

Definition at line 20 of file DDHCalEndcapAlgo.h.

References nsectortot.

Referenced by constructGeneralVolume().

20 {return nsectortot;}
int DDHCalEndcapAlgo::getPhi ( ) const
inline

Definition at line 67 of file DDHCalEndcapAlgo.h.

References phiSections.

Referenced by constructInsideModule(), and constructInsideModule0().

67 {return phiSections;}
std::string DDHCalEndcapAlgo::getPhiName ( unsigned int  i) const
inline

Definition at line 68 of file DDHCalEndcapAlgo.h.

References mps_fire::i, and phiName.

Referenced by constructInsideModule(), and constructInsideModule0().

68 {return phiName[i];}
std::vector< std::string > phiName
std::string DDHCalEndcapAlgo::getPlastMat ( ) const
inline

Definition at line 74 of file DDHCalEndcapAlgo.h.

References plastMat.

Referenced by constructInsideModule(), and constructInsideModule0().

74 {return plastMat;}
std::string plastMat
double DDHCalEndcapAlgo::getRinBlock1 ( unsigned  i) const
inline

Definition at line 62 of file DDHCalEndcapAlgo.h.

References mps_fire::i, and rinBlock1.

Referenced by constructInsideSector().

62 {return rinBlock1[i];}
std::vector< double > rinBlock1
double DDHCalEndcapAlgo::getRinBlock2 ( unsigned  i) const
inline

Definition at line 63 of file DDHCalEndcapAlgo.h.

References mps_fire::i, and rinBlock2.

Referenced by constructInsideSector().

63 {return rinBlock2[i];}
std::vector< double > rinBlock2
double DDHCalEndcapAlgo::getRinDip ( ) const
inline

Definition at line 41 of file DDHCalEndcapAlgo.h.

References riDip.

Referenced by constructGeneralVolume(), and constructInsideSector().

41 {return riDip;}
double DDHCalEndcapAlgo::getRinKink ( ) const
inline

Definition at line 40 of file DDHCalEndcapAlgo.h.

References riKink.

Referenced by constructGeneralVolume(), and constructInsideSector().

40 {return riKink;}
std::string DDHCalEndcapAlgo::getRotation ( ) const
inline

Definition at line 18 of file DDHCalEndcapAlgo.h.

References rotation.

Referenced by constructGeneralVolume().

18 {return rotation;}
std::string rotation
std::string DDHCalEndcapAlgo::getRotMat ( ) const
inline

Definition at line 76 of file DDHCalEndcapAlgo.h.

References rotmat.

Referenced by constructInsideModule(), and constructInsideModule0().

76 {return rotmat;}
double DDHCalEndcapAlgo::getRout ( ) const
inline

Definition at line 39 of file DDHCalEndcapAlgo.h.

References rout.

Referenced by constructGeneralVolume(), and constructInsideSector().

39 {return rout;}
double DDHCalEndcapAlgo::getRoutBlock1 ( unsigned  i) const
inline

Definition at line 64 of file DDHCalEndcapAlgo.h.

References mps_fire::i, and routBlock1.

Referenced by constructInsideSector().

64 {return routBlock1[i];}
std::vector< double > routBlock1
double DDHCalEndcapAlgo::getRoutBlock2 ( unsigned  i) const
inline

Definition at line 65 of file DDHCalEndcapAlgo.h.

References mps_fire::i, and routBlock2.

Referenced by constructInsideModule(), and constructInsideSector().

65 {return routBlock2[i];}
std::vector< double > routBlock2
double DDHCalEndcapAlgo::getRoutDip ( ) const
inline

Definition at line 42 of file DDHCalEndcapAlgo.h.

References roDip.

Referenced by constructGeneralVolume(), and constructInsideSector().

42 {return roDip;}
std::string DDHCalEndcapAlgo::getScintMat ( ) const
inline

Definition at line 75 of file DDHCalEndcapAlgo.h.

References scintMat.

Referenced by constructScintLayer().

75 {return scintMat;}
std::string scintMat
double DDHCalEndcapAlgo::getScintT ( unsigned int  i) const
inline

Definition at line 73 of file DDHCalEndcapAlgo.h.

References mps_fire::i, and scintT.

Referenced by constructInsideModule(), and constructInsideModule0().

73 {return scintT[i];}
std::vector< double > scintT
int DDHCalEndcapAlgo::getSectionModule ( unsigned  i) const
inline

Definition at line 55 of file DDHCalEndcapAlgo.h.

References mps_fire::i, and sectionModule.

Referenced by constructInsideSector().

55 {return sectionModule[i];}
std::vector< int > sectionModule
double DDHCalEndcapAlgo::getSlope ( ) const
inline
double DDHCalEndcapAlgo::getThick ( unsigned int  i) const
inline

Definition at line 58 of file DDHCalEndcapAlgo.h.

References getTrim(), mps_fire::i, and thick.

Referenced by constructInsideModule(), and constructInsideModule0().

58 {return thick[i];}
std::vector< double > thick
double DDHCalEndcapAlgo::getTolAbs ( ) const
inline
double DDHCalEndcapAlgo::getTolPos ( ) const
inline

Definition at line 77 of file DDHCalEndcapAlgo.h.

References tolPos.

77 {return tolPos;}
double DDHCalEndcapAlgo::getTrim ( unsigned int  i,
unsigned int  j 
) const

Definition at line 68 of file DDHCalEndcapAlgo.cc.

References mps_fire::i, trimLeft, and trimRight.

Referenced by constructInsideModule(), getThick(), and parameterLayer0().

68  {
69 
70  if (j == 0)
71  return trimLeft[i];
72  else
73  return trimRight[j];
74 }
std::vector< double > trimRight
std::vector< double > trimLeft
double DDHCalEndcapAlgo::getZ0Beam ( ) const
inline

Definition at line 32 of file DDHCalEndcapAlgo.h.

References z0Beam.

32 {return z0Beam;}
double DDHCalEndcapAlgo::getZ1Beam ( ) const
inline
double DDHCalEndcapAlgo::getZEnd ( ) const
inline

Definition at line 26 of file DDHCalEndcapAlgo.h.

References zEnd.

Referenced by constructGeneralVolume().

26 {return zEnd;}
double DDHCalEndcapAlgo::getZFront ( ) const
inline

Definition at line 25 of file DDHCalEndcapAlgo.h.

References zFront.

Referenced by constructGeneralVolume().

25 {return zFront;}
double DDHCalEndcapAlgo::getZiBody ( ) const
inline

Definition at line 29 of file DDHCalEndcapAlgo.h.

References ziBody.

Referenced by constructGeneralVolume().

29 {return ziBody;}
double DDHCalEndcapAlgo::getZiDip ( ) const
inline

Definition at line 34 of file DDHCalEndcapAlgo.h.

References ziDip.

Referenced by constructGeneralVolume(), and constructInsideSector().

34 {return ziDip;}
double DDHCalEndcapAlgo::getZiKink ( ) const
inline

Definition at line 31 of file DDHCalEndcapAlgo.h.

References ziKink.

Referenced by constructGeneralVolume(), and constructInsideSector().

31 {return ziKink;}
double DDHCalEndcapAlgo::getZiL0Body ( ) const
inline

Definition at line 30 of file DDHCalEndcapAlgo.h.

References ziL0Body.

Referenced by constructGeneralVolume().

30 {return ziL0Body;}
double DDHCalEndcapAlgo::getZiL0Nose ( ) const
inline

Definition at line 28 of file DDHCalEndcapAlgo.h.

References ziL0Nose.

28 {return ziL0Nose;}
double DDHCalEndcapAlgo::getZiNose ( ) const
inline

Definition at line 27 of file DDHCalEndcapAlgo.h.

References ziNose.

27 {return ziNose;}
double DDHCalEndcapAlgo::getZmaxBlock ( unsigned  i) const
inline

Definition at line 61 of file DDHCalEndcapAlgo.h.

References mps_fire::i, and zmaxBlock.

Referenced by constructInsideSector(), and parameterLayer0().

61 {return zmaxBlock[i];}
std::vector< double > zmaxBlock
double DDHCalEndcapAlgo::getZminBlock ( unsigned  i) const
inline

Definition at line 60 of file DDHCalEndcapAlgo.h.

References mps_fire::i, and zminBlock.

Referenced by constructInsideModule(), constructInsideModule0(), constructInsideSector(), and parameterLayer0().

60 {return zminBlock[i];}
std::vector< double > zminBlock
double DDHCalEndcapAlgo::getZShift ( ) const
inline

Definition at line 23 of file DDHCalEndcapAlgo.h.

References zShift.

Referenced by constructGeneralVolume().

23 {return zShift;}
double DDHCalEndcapAlgo::getZShiftHac2 ( ) const
inline

Definition at line 37 of file DDHCalEndcapAlgo.h.

References zShiftHac2.

Referenced by constructGeneralVolume(), and constructInsideSector().

37 {return zShiftHac2;}
void DDHCalEndcapAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 76 of file DDHCalEndcapAlgo.cc.

References absMat, angBot, angGap, angTop, geant_units::operators::convertRadToDeg(), dbl_to_int(), drEnd, dzShift, dzStep, eModule, JetChargeProducer_cfi::exp, HFPhase1Reconstructor_cfi::gap, genMaterial, heboxDepth, mps_fire::i, idName, idNameSpace, idOffset, createfilelist::int, layerN, layerN0, layerN1, layerN2, layerN3, layerN4, layerN5, layerName, layers, layerT, layerType, modMat, modName, modType, modules, nEndcap, DDCurrentNamespace::ns(), nsectors, nsectortot, class-composition::parent, phiName, phiSections, plastMat, diffTwoXMLs::r1, riDip, riKink, rinBlock1, rinBlock2, roDip, rotation, rotHalf, rotmat, rotns, rout, routBlock1, routBlock2, scintMat, scintT, sectionModule, funct::sin(), slope, funct::tan(), thick, tolAbs, tolPos, trimLeft, trimRight, z0Beam, z1Beam, zEnd, zFront, ziBody, ziDip, ziKink, ziL0Body, ziL0Nose, ziNose, zmaxBlock, zminBlock, zShift, and zShiftHac2.

Referenced by getTolAbs().

80  {
81 
82  genMaterial = sArgs["MaterialName"];
83  rotation = sArgs["Rotation"];
84  nsectors = int (nArgs["Sector"]);
85  nsectortot = int (nArgs["SectorTot"]);
86  nEndcap = int (nArgs["Endcap"]);
87  rotHalf = sArgs["RotHalf"];
88  rotns = sArgs["RotNameSpace"];
89  zShift = nArgs["ZShift"];
90 
91  zFront = nArgs["ZFront"];
92  zEnd = nArgs["ZEnd"];
93  ziNose = nArgs["ZiNose"];
94  ziL0Nose = nArgs["ZiL0Nose"];
95  ziBody = nArgs["ZiBody"];
96  ziL0Body = nArgs["ZiL0Body"];
97  z0Beam = nArgs["Z0Beam"];
98  ziDip = nArgs["ZiDip"];
99  dzStep = nArgs["DzStep"];
100  zShiftHac2 = nArgs["ZShiftHac2"];
101  double gap = nArgs["Gap"];
102  double z1 = nArgs["Z1"];
103  double r1 = nArgs["R1"];
104  rout = nArgs["Rout"];
105  heboxDepth = nArgs["HEboxDepth"];
106  drEnd = nArgs["DrEnd"];
107  double etamin = nArgs["Etamin"];
108  angBot = nArgs["AngBot"];
109  angGap = nArgs["AngGap"];
110 
111 #ifdef EDM_ML_DEBUG
112  edm::LogVerbatim("HCalGeom")
113  << "DDHCalEndcapAlgo: General material " << genMaterial << "\tSectors "
114  << nsectors << ", " << nsectortot << "\tEndcaps " << nEndcap
115  << "\tRotation matrix for half " << rotns << ":" << rotHalf << "\n\tzFront "
116  << zFront << " zEnd " << zEnd << " ziNose " << ziNose << " ziL0Nose "
117  << ziL0Nose << " ziBody " << ziBody << " ziL0Body " << ziL0Body << " z0Beam "
118  << z0Beam << " ziDip " << ziDip << " dzStep " << dzStep << " Gap " << gap
119  << " z1 " << z1 << "\n\tr1 " << r1 << " rout " << rout << " HeboxDepth "
120  << heboxDepth << " drEnd " << drEnd << "\tetamin " << etamin
121  << " Bottom angle " << angBot << " Gap angle " << angGap << " Z-Shift "
122  << zShift << " " << zShiftHac2;
123 #endif
124 
125  //Derived quantities
126  angTop = 2.0 * atan (exp(-etamin));
127  slope = tan(angGap);
128  z1Beam = z1 - r1/slope;
129  ziKink = z1Beam + rout/slope;
130  riKink = ziKink*tan(angBot);
131  riDip = ziDip*tan(angBot);
132  roDip = rout - heboxDepth;
133  dzShift = (z1Beam - z0Beam) - gap/sin(angGap);
134 
135 #ifdef EDM_ML_DEBUG
136  edm::LogVerbatim("HCalGeom")
137  << "DDHCalEndcapAlgo: angTop " << convertRadToDeg(angTop) <<"\tSlope "
138  << slope << "\tDzShift " << dzShift << "\n\tz1Beam " << z1Beam
139  << "\tziKink" << ziKink << "\triKink " << riKink << "\triDip " << riDip
140  << "\n\troDip " << roDip << "\tRotation " << rotation;
141 #endif
142 
144  //Modules
145  absMat = sArgs["AbsMat"];
146  modules = int(nArgs["Modules"]);
147 
148 #ifdef EDM_ML_DEBUG
149  edm::LogVerbatim("HCalGeom")
150  << "DDHCalEndcapAlgo: Number of modules " << modules
151  << " and absorber material " << absMat;
152 #endif
153 
154  modName = vsArgs["ModuleName"];
155  modMat = vsArgs["ModuleMat"];
156  modType = dbl_to_int(vArgs["ModuleType"]);
157  sectionModule = dbl_to_int(vArgs["SectionModule"]);
158  thick = vArgs["ModuleThick"];
159  trimLeft = vArgs["TrimLeft"];
160  trimRight = vArgs["TrimRight"];
161  eModule = dbl_to_int(vArgs["EquipModule"]);
162  layerN = dbl_to_int(vArgs["LayerN"]);
163  layerN0 = dbl_to_int(vArgs["LayerN0"]);
164  layerN1 = dbl_to_int(vArgs["LayerN1"]);
165  layerN2 = dbl_to_int(vArgs["LayerN2"]);
166  layerN3 = dbl_to_int(vArgs["LayerN3"]);
167  layerN4 = dbl_to_int(vArgs["LayerN4"]);
168  layerN5 = dbl_to_int(vArgs["LayerN5"]);
169 
170 #ifdef EDM_ML_DEBUG
171  for (int i = 0; i < modules; i++) {
172  edm::LogVerbatim("HCalGeom")
173  << "DDHCalEndcapAlgo: " << modName[i] << " type " << modType[i]
174  << " Sections " << sectionModule[i] <<" thickness of absorber/air "
175  << thick[i] << " trim " << trimLeft[i] << ", " << trimRight[i]
176  << " equip module " << eModule[i] << " with " << layerN[i] << " layers";
177  if (i == 0) {
178  for (int j = 0; j < layerN[i]; j++) {
179  edm::LogVerbatim("HCalGeom")
180  << "\t " << layerN0[j] << "/" << layerN0[j+1];
181  }
182  } else if (i == 1) {
183  for (int j = 0; j < layerN[i]; j++) {
184  edm::LogVerbatim("HCalGeom")
185  << "\t " << layerN1[j] << "/" << layerN1[j+1];
186  }
187  } else if (i == 2) {
188  for (int j = 0; j < layerN[i]; j++) {
189  edm::LogVerbatim("HCalGeom") << "\t " << layerN2[j];
190  }
191  } else if (i == 3) {
192  for (int j = 0; j < layerN[i]; j++) {
193  edm::LogVerbatim("HCalGeom") << "\t " << layerN3[j];
194  }
195  } else if (i == 4) {
196  for (int j = 0; j < layerN[i]; j++) {
197  edm::LogVerbatim("HCalGeom") << "\t " << layerN4[j];
198  }
199  } else if (i == 5) {
200  for (int j = 0; j < layerN[i]; j++) {
201  edm::LogVerbatim("HCalGeom") << "\t " << layerN5[j];
202  }
203  }
204  }
205 #endif
206 
208  //Layers
209  phiSections = int(nArgs["PhiSections"]);
210  phiName = vsArgs["PhiName"];
211  layers = int(nArgs["Layers"]);
212  layerName = vsArgs["LayerName"];
213  layerType = dbl_to_int(vArgs["LayerType"]);
214  layerT = vArgs["LayerT"];
215  scintT = vArgs["ScintT"];
216  scintMat = sArgs["ScintMat"];
217  plastMat = sArgs["PlastMat"];
218  rotmat = sArgs["RotMat"];
219 
220 #ifdef EDM_ML_DEBUG
221  edm::LogVerbatim("HCalGeom")
222  << "DDHCalEndcapAlgo: Phi Sections " << phiSections;
223  for (int i = 0; i < phiSections; i++)
224  edm::LogVerbatim("HCalGeom") << "\tName[" << i << "] : " << phiName[i];
225  edm::LogVerbatim("HCalGeom")
226  << "\tPlastic: " << plastMat << "\tScintillator: " << scintMat
227  << "\tRotation matrix " << rotns << ":" << rotmat << "\n\tNumber of layers "
228  << layers;
229  for (int i = 0; i < layers; i++) {
230  edm::LogVerbatim("HCalGeom")
231  << "\t" << layerName[i] << "\tType " << layerType[i] << "\tThickness "
232  << layerT[i] << "\tScint.Thick " << scintT[i];
233  }
234 #endif
235 
237  // Derive bounding of the modules
238  int module = 0;
239  // Layer 0 (Nose)
240  if (modules > 0) {
241  zminBlock.emplace_back(ziL0Nose);
242  zmaxBlock.emplace_back(zminBlock[module] + layerT[0] + 0.5*dzStep);
243  rinBlock1.emplace_back(zminBlock[module] * tan(angTop));
244  rinBlock2.emplace_back(zmaxBlock[module] * tan(angTop));
245  routBlock1.emplace_back((zminBlock[module] - z1Beam) * slope);
246  routBlock2.emplace_back((zmaxBlock[module] - z1Beam) * slope);
247  module++;
248  }
249 
250  // Layer 0 (Body)
251  if (modules > 1) {
252  zminBlock.emplace_back(ziL0Body);
253  zmaxBlock.emplace_back(zminBlock[module] + layerT[0] + 0.5*dzStep);
254  rinBlock1.emplace_back(zminBlock[module] * tan(angBot));
255  rinBlock2.emplace_back(zmaxBlock[module] * tan(angBot));
256  routBlock1.emplace_back(zminBlock[module] * tan(angTop));
257  routBlock2.emplace_back(zmaxBlock[module] * tan(angTop));
258  module++;
259  }
260 
261  // Hac1
262  if (modules > 2) {
263  zminBlock.emplace_back(ziNose);
264  zmaxBlock.emplace_back(ziBody);
265  rinBlock1.emplace_back(zminBlock[module] * tan(angTop));
266  rinBlock2.emplace_back(zmaxBlock[module] * tan(angTop));
267  routBlock1.emplace_back((zminBlock[module] - z1Beam) * slope);
268  routBlock2.emplace_back((zmaxBlock[module] - z1Beam) * slope);
269  module++;
270  }
271 
272  // Hac2
273  if (modules > 3) {
274  zminBlock.emplace_back(ziBody);
275  zmaxBlock.emplace_back(zminBlock[module] + layerN[3]*dzStep);
276  rinBlock1.emplace_back(zminBlock[module] * tan(angBot));
277  rinBlock2.emplace_back(zmaxBlock[module] * tan(angBot));
278  routBlock1.emplace_back((zmaxBlock[module-1] - z1Beam) * slope);
279  routBlock2.emplace_back(rout);
280  module++;
281  }
282 
283  // Hac3
284  if (modules > 4) {
285  zminBlock.emplace_back(zmaxBlock[module-1]);
286  zmaxBlock.emplace_back(zminBlock[module] + layerN[4]*dzStep);
287  rinBlock1.emplace_back(zminBlock[module] * tan(angBot));
288  rinBlock2.emplace_back(zmaxBlock[module] * tan(angBot));
289  routBlock1.emplace_back(rout);
290  routBlock2.emplace_back(rout);
291  module++;
292  }
293 
294  // Hac4
295  if (modules > 5) {
296  zminBlock.emplace_back(zmaxBlock[module-1]);
297  zmaxBlock.emplace_back(zminBlock[module] + layerN[5]*dzStep);
298  rinBlock1.emplace_back(zminBlock[module] * tan(angBot));
299  rinBlock2.emplace_back(zmaxBlock[module] * tan(angBot));
300  routBlock1.emplace_back(rout);
301  routBlock2.emplace_back(roDip);
302  module++;
303  }
304 
305 #ifdef EDM_ML_DEBUG
306  for (int i = 0; i < module; i++)
307  edm::LogVerbatim("HCalGeom")
308  << "DDHCalEndcapAlgo: Module " << i << "\tZ/Rin/Rout " << zminBlock[i]
309  << ", " << zmaxBlock[i] << "/ " << rinBlock1[i] << ", " << rinBlock2[i]
310  << "/ " << routBlock1[i] << ", " << routBlock2[i];
311 #endif
312 
313  idName = sArgs["MotherName"];
315  idOffset = int (nArgs["IdOffset"]);
316 
317 #ifdef EDM_ML_DEBUG
318  edm::LogVerbatim("HCalGeom")
319  << "DDHCalEndcapAlgo: Parent " << parent().name() << " idName " << idName
320  << " NameSpace " << idNameSpace << " Offset " << idOffset;
321 #endif
322 
323  tolPos = nArgs["TolPos"];
324  tolAbs = nArgs["TolAbs"];
325 
326 #ifdef EDM_ML_DEBUG
327  edm::LogVerbatim("HCalGeom")
328  <<"DDHCalEndcapAlgo: Tolerances - Positioning " << tolPos << " Absorber "
329  << tolAbs;
330 #endif
331 }
std::vector< int > layerN2
std::vector< int > modType
std::string idNameSpace
std::vector< double > zminBlock
std::vector< int > layerN0
std::vector< std::string > modMat
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
std::vector< double > routBlock1
static std::string & ns()
std::vector< double > zmaxBlock
std::vector< double > routBlock2
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 > layerName
std::vector< int > layerN1
std::string plastMat
std::vector< int > layerN4
std::string scintMat
std::vector< int > sectionModule
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
std::vector< double > rinBlock1
std::vector< std::string > modName
std::vector< int > layerN5
std::vector< int > eModule
std::vector< int > layerType
std::vector< int > layerN
std::vector< double > rinBlock2
std::vector< double > trimRight
std::vector< int > layerN3
std::vector< std::string > phiName
std::string genMaterial
std::vector< double > thick
std::string rotation
std::vector< double > scintT
std::vector< double > layerT
Definition: vlib.h:208
std::vector< double > trimLeft
void DDHCalEndcapAlgo::parameterLayer ( int  iphi,
double  rinF,
double  routF,
double  rinB,
double  routB,
double  zi,
double  zo,
double &  yh1,
double &  bl1,
double &  tl1,
double &  yh2,
double &  bl2,
double &  tl2,
double &  alp,
double &  theta,
double &  phi,
double &  xpos,
double &  ypos,
double &  zcpv 
)
protected

Definition at line 716 of file DDHCalEndcapAlgo.cc.

References alpha, geant_units::operators::convertRadToDeg(), PVValHelper::dx, PVValHelper::dy, getNsectors(), alignCSCRings::r, mathSSE::sqrt(), and funct::tan().

Referenced by constructInsideModule(), constructInsideModule0(), and getTolAbs().

722  {
723 
724  //Given rin, rout compute parameters of the trapezoid and
725  //position of the trapezoid for a standrd layer
726  double alpha = (1._pi)/getNsectors();
727 
728 #ifdef EDM_ML_DEBUG
729  edm::LogVerbatim("HCalGeom")
730  << "Input " << iphi << " Front " << rinF << " " << routF << " " << zi
731  << " Back " << rinB << " " << routB << " " << zo << " Alpha "
732  << convertRadToDeg(alpha);
733 #endif
734 
735  yh1 = 0.5 * (routF - rinB);
736  bl1 = 0.5 * rinB * tan(alpha);
737  tl1 = 0.5 * routF * tan(alpha);
738  yh2 = 0.5 * (routF - rinB);
739  bl2 = 0.5 * rinB * tan(alpha);
740  tl2 = 0.5 * routF * tan(alpha);
741  double dx = 0.25* (bl2+tl2-bl1-tl1);
742  double dy = 0.5 * (rinB+routF-rinB-routF);
743  xpos = 0.25*(rinB+routF+rinB+routF);
744  ypos = 0.25*(bl2+tl2+bl1+tl1);
745  zpos = 0.5*(zi+zo);
746  alp = atan(0.5 * tan(alpha));
747  // ypos-= getTolPos();
748  if (iphi == 0) {
749  ypos = -ypos;
750  } else {
751  alp = -alp;
752  dx = -dx;
753  }
754  double r = sqrt (dx*dx + dy*dy);
755  theta= atan (r/(zo-zi));
756  phi = atan2 (dy, dx);
757 
758 #ifdef EDM_ML_DEBUG
759  edm::LogVerbatim("HCalGeom")
760  << "Output Dimensions " << yh1 << " " << bl1 << " " << tl1 << " " << yh2
761  << " " << bl2 << " " << tl2 << " " << convertRadToDeg(alp) << " "
762  << convertRadToDeg(theta) << " " << convertRadToDeg(phi) << " Position "
763  << xpos << " " << ypos << " " << zpos;
764 #endif
765 }
float alpha
Definition: AMPTWrapper.h:95
int getNsectors() const
Geom::Theta< T > theta() const
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
T sqrt(T t)
Definition: SSEVec.h:18
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
void DDHCalEndcapAlgo::parameterLayer0 ( int  mod,
int  layer,
int  iphi,
double &  yh,
double &  bl,
double &  tl,
double &  alp,
double &  xpos,
double &  ypos,
double &  zcpv 
)
protected

Definition at line 662 of file DDHCalEndcapAlgo.cc.

References alpha, geant_units::operators::convertRadToDeg(), getAngBot(), getAngTop(), getLayerT(), getNsectors(), getSlope(), getTrim(), getZ1Beam(), getZmaxBlock(), getZminBlock(), rout, and funct::tan().

Referenced by constructInsideModule0(), and getTolAbs().

665  {
666 
667  //Given module and layer number compute parameters of trapezoid
668  //and positioning parameters
669  double alpha = (1._pi)/getNsectors();
670 
671 #ifdef EDM_ML_DEBUG
672  edm::LogVerbatim("HCalGeom")
673  << "Input " << iphi << " " << layer << " " << iphi << " Alpha "
674  << convertRadToDeg(alpha);
675 #endif
676 
677  double zi, zo;
678  if (iphi == 0) {
679  zi = getZminBlock(mod);
680  zo = zi + getLayerT(layer);
681  } else {
682  zo = getZmaxBlock(mod);
683  zi = zo - getLayerT(layer);
684  }
685  double rin, rout;
686  if (mod == 0) {
687  rin = zo * tan(getAngTop());
688  rout = (zi - getZ1Beam()) * getSlope();
689  } else {
690  rin = zo * tan(getAngBot());
691  rout = zi * tan(getAngTop());
692  }
693  yh = 0.5 * (rout - rin);
694  bl = 0.5 * rin * tan (alpha);
695  tl = 0.5 * rout * tan(alpha);
696  xpos = 0.5 * (rin + rout);
697  ypos = 0.5 * (bl + tl);
698  zpos = 0.5 * (zi + zo);
699  yh -= getTrim(mod,iphi);
700  bl -= getTrim(mod,iphi);
701  tl -= getTrim(mod,iphi);
702  alp = atan(0.5 * tan(alpha));
703  if (iphi == 0) {
704  ypos = -ypos;
705  } else {
706  alp = -alp;
707  }
708 
709 #ifdef EDM_ML_DEBUG
710  edm::LogVerbatim("HCalGeom")
711  << "Output Dimensions " << yh << " " << bl << " " << tl << " "
712  << convertRadToDeg(alp) << " Position " << xpos << " " << ypos << " " << zpos;
713 #endif
714 }
double getTrim(unsigned int i, unsigned int j) const
double getZmaxBlock(unsigned i) const
float alpha
Definition: AMPTWrapper.h:95
double getSlope() const
int getNsectors() const
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
double getZ1Beam() const
double getAngTop() const
double getAngBot() const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
double getLayerT(unsigned int i) const
double getZminBlock(unsigned i) const
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4

Member Data Documentation

std::string DDHCalEndcapAlgo::absMat
private

Definition at line 144 of file DDHCalEndcapAlgo.h.

Referenced by getAbsMat(), and initialize().

double DDHCalEndcapAlgo::angBot
private

Definition at line 140 of file DDHCalEndcapAlgo.h.

Referenced by getAngBot(), and initialize().

double DDHCalEndcapAlgo::angGap
private

Definition at line 141 of file DDHCalEndcapAlgo.h.

Referenced by getAngGap(), and initialize().

double DDHCalEndcapAlgo::angTop
private

Definition at line 139 of file DDHCalEndcapAlgo.h.

Referenced by getAngTop(), and initialize().

double DDHCalEndcapAlgo::drEnd
private

Definition at line 137 of file DDHCalEndcapAlgo.h.

Referenced by getDrEnd(), and initialize().

double DDHCalEndcapAlgo::dzShift
private

Definition at line 129 of file DDHCalEndcapAlgo.h.

Referenced by getDzShift(), and initialize().

double DDHCalEndcapAlgo::dzStep
private

Definition at line 128 of file DDHCalEndcapAlgo.h.

Referenced by getDzStep(), and initialize().

std::vector<int> DDHCalEndcapAlgo::eModule
private

Definition at line 112 of file DDHCalEndcapAlgo.h.

Referenced by equipModule(), and initialize().

std::string DDHCalEndcapAlgo::genMaterial
private

Definition at line 108 of file DDHCalEndcapAlgo.h.

Referenced by getGenMat(), and initialize().

double DDHCalEndcapAlgo::heboxDepth
private

Definition at line 136 of file DDHCalEndcapAlgo.h.

Referenced by getHeboxDepth(), and initialize().

std::string DDHCalEndcapAlgo::idName
private
std::string DDHCalEndcapAlgo::idNameSpace
private
int DDHCalEndcapAlgo::idOffset
private

Definition at line 180 of file DDHCalEndcapAlgo.h.

Referenced by constructInsideModule(), constructInsideModule0(), and initialize().

std::vector<int> DDHCalEndcapAlgo::layerN
private

Definition at line 150 of file DDHCalEndcapAlgo.h.

Referenced by getLayerN(), and initialize().

std::vector<int> DDHCalEndcapAlgo::layerN0
private

Definition at line 151 of file DDHCalEndcapAlgo.h.

Referenced by getLayer(), and initialize().

std::vector<int> DDHCalEndcapAlgo::layerN1
private

Definition at line 152 of file DDHCalEndcapAlgo.h.

Referenced by getLayer(), and initialize().

std::vector<int> DDHCalEndcapAlgo::layerN2
private

Definition at line 153 of file DDHCalEndcapAlgo.h.

Referenced by getLayer(), and initialize().

std::vector<int> DDHCalEndcapAlgo::layerN3
private

Definition at line 154 of file DDHCalEndcapAlgo.h.

Referenced by getLayer(), and initialize().

std::vector<int> DDHCalEndcapAlgo::layerN4
private

Definition at line 155 of file DDHCalEndcapAlgo.h.

Referenced by getLayer(), and initialize().

std::vector<int> DDHCalEndcapAlgo::layerN5
private

Definition at line 156 of file DDHCalEndcapAlgo.h.

Referenced by getLayer(), and initialize().

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

Definition at line 170 of file DDHCalEndcapAlgo.h.

Referenced by getLayerName(), and initialize().

int DDHCalEndcapAlgo::layers
private

Definition at line 169 of file DDHCalEndcapAlgo.h.

Referenced by getLayers(), and initialize().

std::vector<double> DDHCalEndcapAlgo::layerT
private

Definition at line 172 of file DDHCalEndcapAlgo.h.

Referenced by getLayerT(), and initialize().

std::vector<int> DDHCalEndcapAlgo::layerType
private

Definition at line 171 of file DDHCalEndcapAlgo.h.

Referenced by getLayerType(), and initialize().

std::vector<std::string> DDHCalEndcapAlgo::modMat
private

Definition at line 147 of file DDHCalEndcapAlgo.h.

Referenced by getModMat(), and initialize().

std::vector<std::string> DDHCalEndcapAlgo::modName
private

Definition at line 146 of file DDHCalEndcapAlgo.h.

Referenced by getModName(), and initialize().

std::vector<int> DDHCalEndcapAlgo::modType
private

Definition at line 148 of file DDHCalEndcapAlgo.h.

Referenced by getModType(), and initialize().

int DDHCalEndcapAlgo::modules
private

Definition at line 145 of file DDHCalEndcapAlgo.h.

Referenced by getModules(), and initialize().

int DDHCalEndcapAlgo::nEndcap
private

Definition at line 111 of file DDHCalEndcapAlgo.h.

Referenced by getEndcaps(), and initialize().

int DDHCalEndcapAlgo::nsectors
private

Definition at line 109 of file DDHCalEndcapAlgo.h.

Referenced by getNsectors(), and initialize().

int DDHCalEndcapAlgo::nsectortot
private

Definition at line 110 of file DDHCalEndcapAlgo.h.

Referenced by getNsectortot(), and initialize().

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

Definition at line 168 of file DDHCalEndcapAlgo.h.

Referenced by getPhiName(), and initialize().

int DDHCalEndcapAlgo::phiSections
private

Definition at line 167 of file DDHCalEndcapAlgo.h.

Referenced by getPhi(), and initialize().

std::string DDHCalEndcapAlgo::plastMat
private

Definition at line 174 of file DDHCalEndcapAlgo.h.

Referenced by getPlastMat(), and initialize().

double DDHCalEndcapAlgo::riDip
private

Definition at line 134 of file DDHCalEndcapAlgo.h.

Referenced by getRinDip(), and initialize().

double DDHCalEndcapAlgo::riKink
private

Definition at line 133 of file DDHCalEndcapAlgo.h.

Referenced by getRinKink(), and initialize().

std::vector<double> DDHCalEndcapAlgo::rinBlock1
private

Definition at line 162 of file DDHCalEndcapAlgo.h.

Referenced by getRinBlock1(), and initialize().

std::vector<double> DDHCalEndcapAlgo::rinBlock2
private

Definition at line 164 of file DDHCalEndcapAlgo.h.

Referenced by getRinBlock2(), and initialize().

double DDHCalEndcapAlgo::roDip
private

Definition at line 135 of file DDHCalEndcapAlgo.h.

Referenced by getRoutDip(), and initialize().

std::string DDHCalEndcapAlgo::rotation
private

Definition at line 115 of file DDHCalEndcapAlgo.h.

Referenced by constructGeneralVolume(), getRotation(), and initialize().

std::string DDHCalEndcapAlgo::rotHalf
private

Definition at line 113 of file DDHCalEndcapAlgo.h.

Referenced by constructGeneralVolume(), and initialize().

std::string DDHCalEndcapAlgo::rotmat
private

Definition at line 176 of file DDHCalEndcapAlgo.h.

Referenced by getRotMat(), and initialize().

std::string DDHCalEndcapAlgo::rotns
private
double DDHCalEndcapAlgo::rout
private

Definition at line 132 of file DDHCalEndcapAlgo.h.

Referenced by getRout(), initialize(), and parameterLayer0().

std::vector<double> DDHCalEndcapAlgo::routBlock1
private

Definition at line 163 of file DDHCalEndcapAlgo.h.

Referenced by getRoutBlock1(), and initialize().

std::vector<double> DDHCalEndcapAlgo::routBlock2
private

Definition at line 165 of file DDHCalEndcapAlgo.h.

Referenced by getRoutBlock2(), and initialize().

std::string DDHCalEndcapAlgo::scintMat
private

Definition at line 175 of file DDHCalEndcapAlgo.h.

Referenced by getScintMat(), and initialize().

std::vector<double> DDHCalEndcapAlgo::scintT
private

Definition at line 173 of file DDHCalEndcapAlgo.h.

Referenced by getScintT(), and initialize().

std::vector<int> DDHCalEndcapAlgo::sectionModule
private

Definition at line 149 of file DDHCalEndcapAlgo.h.

Referenced by getSectionModule(), and initialize().

double DDHCalEndcapAlgo::slope
private
std::vector<double> DDHCalEndcapAlgo::thick
private

Definition at line 157 of file DDHCalEndcapAlgo.h.

Referenced by getThick(), and initialize().

double DDHCalEndcapAlgo::tolAbs
private

Definition at line 182 of file DDHCalEndcapAlgo.h.

Referenced by getTolAbs(), and initialize().

double DDHCalEndcapAlgo::tolPos
private

Definition at line 182 of file DDHCalEndcapAlgo.h.

Referenced by getTolPos(), and initialize().

std::vector<double> DDHCalEndcapAlgo::trimLeft
private

Definition at line 158 of file DDHCalEndcapAlgo.h.

Referenced by getTrim(), and initialize().

std::vector<double> DDHCalEndcapAlgo::trimRight
private

Definition at line 159 of file DDHCalEndcapAlgo.h.

Referenced by getTrim(), and initialize().

double DDHCalEndcapAlgo::z0Beam
private

Definition at line 125 of file DDHCalEndcapAlgo.h.

Referenced by getZ0Beam(), and initialize().

double DDHCalEndcapAlgo::z1Beam
private

Definition at line 126 of file DDHCalEndcapAlgo.h.

Referenced by getZ1Beam(), and initialize().

double DDHCalEndcapAlgo::zEnd
private

Definition at line 119 of file DDHCalEndcapAlgo.h.

Referenced by getZEnd(), and initialize().

double DDHCalEndcapAlgo::zFront
private

Definition at line 118 of file DDHCalEndcapAlgo.h.

Referenced by getZFront(), and initialize().

double DDHCalEndcapAlgo::ziBody
private

Definition at line 122 of file DDHCalEndcapAlgo.h.

Referenced by getZiBody(), and initialize().

double DDHCalEndcapAlgo::ziDip
private

Definition at line 127 of file DDHCalEndcapAlgo.h.

Referenced by getZiDip(), and initialize().

double DDHCalEndcapAlgo::ziKink
private

Definition at line 124 of file DDHCalEndcapAlgo.h.

Referenced by getZiKink(), and initialize().

double DDHCalEndcapAlgo::ziL0Body
private

Definition at line 123 of file DDHCalEndcapAlgo.h.

Referenced by getZiL0Body(), and initialize().

double DDHCalEndcapAlgo::ziL0Nose
private

Definition at line 121 of file DDHCalEndcapAlgo.h.

Referenced by getZiL0Nose(), and initialize().

double DDHCalEndcapAlgo::ziNose
private

Definition at line 120 of file DDHCalEndcapAlgo.h.

Referenced by getZiNose(), and initialize().

std::vector<double> DDHCalEndcapAlgo::zmaxBlock
private

Definition at line 161 of file DDHCalEndcapAlgo.h.

Referenced by getZmaxBlock(), and initialize().

std::vector<double> DDHCalEndcapAlgo::zminBlock
private

Definition at line 160 of file DDHCalEndcapAlgo.h.

Referenced by getZminBlock(), and initialize().

double DDHCalEndcapAlgo::zShift
private

Definition at line 116 of file DDHCalEndcapAlgo.h.

Referenced by getZShift(), and initialize().

double DDHCalEndcapAlgo::zShiftHac2
private

Definition at line 130 of file DDHCalEndcapAlgo.h.

Referenced by getZShiftHac2(), and initialize().