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 22 of file DDHCalEndcapAlgo.cc.

22  :
24  layerN2(0),layerN3(0),layerN4(0),layerN5(0),thick(0),trimLeft(0),
26  rinBlock2(0),routBlock2(0),layerType(0),layerT(0),scintT(0) {
27 
28 #ifdef EDM_ML_DEBUG
29  edm::LogInfo("HCalGeom") << "DDHCalEndcapAlgo info: Creating an instance";
30 #endif
31 }
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 33 of file DDHCalEndcapAlgo.cc.

33 {}

Member Function Documentation

void DDHCalEndcapAlgo::constructGeneralVolume ( DDCompactView cpv)
protected

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

Definition at line 354 of file DDHCalEndcapAlgo.cc.

References alpha, constructInsideSector(), DDrot(), DDSplit(), equipModule(), plotBeamSpotDB::first, 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, pi, DDSolidFactory::polyhedra(), DDCompactView::position(), makeMuonMisalignmentScenario::rot, rotation, rotHalf, rotns, edm::second(), and funct::tan().

Referenced by execute(), and getTolAbs().

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

Definition at line 904 of file DDHCalEndcapAlgo.cc.

References alpha, constructScintLayer(), 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, pi, DDCompactView::position(), diffTwoXMLs::r1, diffTwoXMLs::r2, makeMuonMisalignmentScenario::rot, rotns, edm::second(), funct::tan(), theta(), and DDSolidFactory::trap().

Referenced by constructInsideSector(), and getTolAbs().

904  {
905 
906 #ifdef EDM_ML_DEBUG
907  edm::LogInfo("HCalGeom") << "DDHCalEndcapAlgo test: \t\tInside module ..."
908  << mod;
909 #endif
910 
912  //Pointers to the Rotation Matrices and to the Materials
913  string rotstr = getRotMat();
914  DDRotation rot(DDName(rotstr, rotns));
916  DDMaterial matter(matName);
918  DDMaterial matplastic(plasName);
919 
920  double alpha = CLHEP::pi/getNsectors();
921  double zi = getZminBlock(mod);
922 
923  for (int i = 0; i < getLayerN(mod); i++) {
924  string name;
925  DDSolid solid;
926  DDLogicalPart glog, plog;
927  int layer = getLayer(mod,i);
928  double zo = zi + 0.5*getDzStep();
929 
930  for (int iphi = 0; iphi < getPhi(); iphi++) {
931  double ziAir = zo - getThick(mod);
932  double rinF, rinB;
933  if (layer == 1) {
934  rinF = ziAir * tan(getAngTop());
935  rinB = zo * tan(getAngTop());
936  } else {
937  rinF = ziAir * tan(getAngBot());
938  rinB = zo * tan(getAngBot());
939  }
940  double routF = (ziAir - getZ1Beam()) * getSlope();
941  double routB = (zo - getZ1Beam()) * getSlope();
942  if (routF > getRoutBlock2(mod)) routF = getRoutBlock2(mod);
943  if (routB > getRoutBlock2(mod)) routB = getRoutBlock2(mod);
944 
945 #ifdef EDM_ML_DEBUG
946  edm::LogInfo("HCalGeom") << "DDHCalEndcapAlgo test: Layer " << i <<" Phi "
947  << iphi << " Front " << ziAir << ", " << rinF
948  << ", " << routF << " Back " << zo << ", "
949  << rinB << ", " << routB;
950 #endif
951 
952  double yh1, bl1, tl1, yh2, bl2, tl2, theta, phi, alp;
953  double xpos, ypos, zpos;
954  parameterLayer(iphi, rinF, routF, rinB, routB, ziAir, zo, yh1, bl1, tl1,
955  yh2, bl2, tl2, alp, theta, phi, xpos, ypos, zpos);
956 
957  name = module.name().name()+getLayerName(layer)+getPhiName(iphi)+"Air";
958  solid = DDSolidFactory::trap(DDName(name, idNameSpace),
959  0.5*getThick(mod), theta, phi, yh1,
960  bl1, tl1, alp, yh2, bl2, tl2, alp);
961 
962 #ifdef EDM_ML_DEBUG
963  edm::LogInfo("HCalGeom") << "DDHCalEndcapAlgo test: " << solid.name()
964  << " Trap made of " << getGenMat()
965  << " of dimensions " << 0.5*getThick(mod) << ", "
966  << theta/CLHEP::deg << ", " << phi/CLHEP::deg
967  << ", " << yh1 << ", " << bl1 << ", " << tl1
968  << ", " << alp/CLHEP::deg << ", " << yh2 << ", "
969  << bl2 << ", " << tl2 << ", " << alp/CLHEP::deg;
970 #endif
971 
972  glog = DDLogicalPart(solid.ddname(), matter, solid);
973 
974  DDTranslation r1(xpos, ypos, zpos);
975  cpv.position(glog, module, layer+1, r1, rot);
976 
977 #ifdef EDM_ML_DEBUG
978  edm::LogInfo("HCalGeom") << "DDHCalEndcapAlgo test: " << glog.name()
979  << " number " << layer+1 << " positioned in "
980  << module.name() << " at " << r1 << " with "
981  << rot;
982 #endif
983 
984  //Now the plastic with scintillators
985  double yh = 0.5 * (routF - rinB) - getTrim(mod,iphi);
986  double bl = 0.5 * rinB * tan(alpha) - getTrim(mod,iphi);
987  double tl = 0.5 * routF * tan(alpha) - getTrim(mod,iphi);
988  name = module.name().name()+getLayerName(layer)+getPhiName(iphi);
989  solid = DDSolidFactory::trap(DDName(name, idNameSpace),
990  0.5*getLayerT(layer), 0, 0, yh,
991  bl, tl, alp, yh, bl, tl, alp);
992 
993 #ifdef EDM_ML_DEBUG
994  edm::LogInfo("HCalGeom") << "DDHCalEndcapAlgo test: " << solid.name()
995  << " Trap made of " << getPlastMat()
996  << " of dimensions " << 0.5*getLayerT(layer)
997  << ", 0, 0, " << yh << ", " << bl << ", " << tl
998  << ", " << alp/CLHEP::deg << ", " << yh << ", "
999  << bl << ", " << tl << ", " << alp/CLHEP::deg;
1000 #endif
1001 
1002  plog = DDLogicalPart(solid.ddname(), matplastic, solid);
1003 
1004  ypos = 0.5*(routF+rinB) - xpos;
1005  DDTranslation r2(0., ypos, 0.);
1006  cpv.position(plog, glog, idOffset+layer+1, r2, DDRotation());
1007 
1008 #ifdef EDM_ML_DEBUG
1009  edm::LogInfo("HCalGeom") << "DDHCalEndcapAlgo test: " << plog.name()
1010  << " number " << idOffset+layer+1
1011  << " positioned in " << glog.name() << " at "
1012  << r2 << " with no rotation";
1013 #endif
1014 
1015  //Constructin the scintillators inside
1016  int copyNo = layer*10 + getLayerType(layer);
1017  name = getModName(mod)+getLayerName(layer)+getPhiName(iphi);
1018  constructScintLayer (plog, getScintT(layer), yh,bl,tl, alp,name,copyNo, cpv);
1019  zo += 0.5*getDzStep();
1020  } // End of loop over phi indices
1021  zi = zo - 0.5*getDzStep();
1022  } // End of loop on layers
1023 }
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:78
std::string idNameSpace
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
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
double getThick(unsigned int i) const
A DDSolid represents the shape of a part.
Definition: DDSolid.h:38
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
std::string getRotMat() const
const Double_t pi
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:67
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:92
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:917
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:90
const N & ddname() const
Definition: DDBase.h:80
void DDHCalEndcapAlgo::constructInsideModule0 ( const DDLogicalPart module,
int  mod,
DDCompactView cpv 
)
protected

Definition at line 782 of file DDHCalEndcapAlgo.cc.

References constructScintLayer(), 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(), funct::tan(), theta(), and DDSolidFactory::trap().

Referenced by constructInsideSector(), and getTolAbs().

782  {
783 
784 #ifdef EDM_ML_DEBUG
785  edm::LogInfo("HCalGeom") << "DDHCalEndcapAlgo test: \t\tInside module0 ..."
786  << mod;
787 #endif
788 
790  //Pointers to the Rotation Matrices and to the Materials
791  string rotstr = getRotMat();
792  DDRotation rot(DDName(rotstr, rotns));
794  DDMaterial matabsorbr(matName);
796  DDMaterial matplastic(plasName);
797 
798  int layer = getLayer(mod,0);
799  int layer0 = getLayer(mod,1);
800  string name;
801  double xpos, ypos, zpos;
802  DDSolid solid;
803  DDLogicalPart glog, plog;
804  for (int iphi = 0; iphi < getPhi(); iphi++) {
805  double yh, bl, tl, alp;
806  parameterLayer0(mod, layer, iphi, yh, bl, tl, alp, xpos, ypos, zpos);
807  name = module.name().name()+getLayerName(layer)+getPhiName(iphi);
808  solid = DDSolidFactory::trap(DDName(name, idNameSpace),
809  0.5*getLayerT(layer), 0, 0, yh,
810  bl, tl, alp, yh, bl, tl, alp);
811 
812 #ifdef EDM_ML_DEBUG
813  edm::LogInfo("HCalGeom") << "DDHCalEndcapAlgo test: " << solid.name()
814  << " Trap made of " << getPlastMat()
815  << " of dimensions " << 0.5*getLayerT(layer)
816  << ", 0, 0, " << yh << ", " << bl << ", " << tl
817  << ", " << alp/CLHEP::deg << ", " << yh << ", "
818  << bl << ", " << tl << ", " << alp/CLHEP::deg;
819 #endif
820 
821  glog = DDLogicalPart(solid.ddname(), matplastic, solid);
822 
823  DDTranslation r1(xpos, ypos, zpos);
824  cpv.position(glog, module, idOffset+layer+1, r1, rot);
825 
826 #ifdef EDM_ML_DEBUG
827  edm::LogInfo("HCalGeom") << "DDHCalEndcapAlgo test: " << glog.name()
828  << " number " << idOffset+layer+1
829  << " positioned in " << module.name() << " at "
830  << r1 << " with " << rot;
831 #endif
832 
833  //Now construct the layer of scintillator inside this
834  int copyNo = layer0*10 + getLayerType(layer);
835  name = getModName(mod)+getLayerName(layer)+getPhiName(iphi);
836  constructScintLayer (glog, getScintT(layer), yh, bl, tl, alp, name, copyNo, cpv);
837  }
838 
839  //Now the absorber layer
840  double zi = getZminBlock(mod) + getLayerT(layer);
841  double zo = zi + 0.5*getDzStep();
842  double rinF, routF, rinB, routB;
843  if (mod == 0) {
844  rinF = zi * tan(getAngTop());
845  routF =(zi - getZ1Beam()) * getSlope();
846  rinB = zo * tan(getAngTop());
847  routB =(zo - getZ1Beam()) * getSlope();
848  } else {
849  rinF = zi * tan(getAngBot());
850  routF = zi * tan(getAngTop());
851  rinB = zo * tan(getAngBot());
852  routB = zo * tan(getAngTop());
853  }
854 
855 #ifdef EDM_ML_DEBUG
856  edm::LogInfo("HCalGeom") << "DDHCalEndcapAlgo test: Module " << mod
857  << " Front " << zi << ", " << rinF << ", " << routF
858  << " Back " << zo << ", " << rinB << ", " << routB;
859 #endif
860 
861  double yh1, bl1, tl1, yh2, bl2, tl2, theta, phi, alp;
862  parameterLayer(0, rinF, routF, rinB, routB, zi, zo, yh1, bl1, tl1, yh2, bl2,
863  tl2, alp, theta, phi, xpos, ypos, zpos);
864  double fact = getTolAbs();
865 
866 #ifdef EDM_ML_DEBUG
867  edm::LogInfo("HCalGeom") << "DDHCalEndcapAlgo test: Trim " << fact
868  << " Param " << yh1 << ", " << bl1 << ", " << tl1
869  << ", " << yh2 << ", " << bl2 << ", " << tl2;
870 #endif
871 
872  bl1 -= fact;
873  tl1 -= fact;
874  bl2 -= fact;
875  tl2 -= fact;
876 
877  name = module.name().name()+"Absorber";
878  solid = DDSolidFactory::trap(DDName(name, idNameSpace),
879  0.5*getThick(mod), theta, phi, yh1,
880  bl1, tl1, alp, yh2, bl2, tl2, alp);
881 #ifdef EDM_ML_DEBUG
882  edm::LogInfo("HCalGeom") << "DDHCalEndcapAlgo test: " << solid.name()
883  << " Trap made of " << getAbsMat()
884  << " of dimensions " << 0.5*getThick(mod) << ", "
885  << theta/CLHEP::deg << ", " << phi/CLHEP::deg << ", "
886  << yh1 << ", " << bl1 << ", " << tl1 << ", "
887  << alp/CLHEP::deg << ", " << yh2 << ", "
888  << bl2 << ", " << tl2 << ", " << alp/CLHEP::deg;
889 #endif
890 
891  glog = DDLogicalPart(solid.ddname(), matabsorbr, solid);
892 
893  DDTranslation r2(xpos, ypos, zpos);
894  cpv.position(glog, module, 1, r2, rot);
895 
896 #ifdef EDM_ML_DEBUG
897  edm::LogInfo("HCalGeom") << "DDHCalEndcapAlgo test: " << glog.name()
898  << " number 1 positioned in " << module.name()
899  << " at " << r2 << " with " << rot;
900 #endif
901 }
std::string getModName(unsigned int i) const
double getSlope() const
const N & name() const
Definition: DDBase.h:78
std::string idNameSpace
std::string getAbsMat() const
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
int getPhi() const
Geom::Theta< T > theta() const
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
double getThick(unsigned int i) const
double getTolAbs() const
A DDSolid represents the shape of a part.
Definition: DDSolid.h:38
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:67
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:92
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:917
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:90
const N & ddname() const
Definition: DDBase.h:80
void DDHCalEndcapAlgo::constructInsideSector ( const DDLogicalPart sector,
DDCompactView cpv 
)
protected

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

Definition at line 594 of file DDHCalEndcapAlgo.cc.

References alpha, constructInsideModule(), constructInsideModule0(), 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(), pi, DDSolidFactory::polyhedra(), DDCompactView::position(), edm::second(), and funct::tan().

Referenced by constructGeneralVolume(), and getTolAbs().

594  {
595 
596 #ifdef EDM_ML_DEBUG
597  edm::LogInfo("HCalGeom") << "DDHCalEndcapAlgo test: Modules (" << getModules()
598  << ") ...";
599 #endif
600 
601  double alpha = CLHEP::pi/getNsectors();
602 
603  for (int i = 0; i < getModules(); i++) {
604  string name = idName + getModName(i);
606  DDMaterial matter(matname);
607 
608  if (equipModule(i)>0) {
609  int nsec = getSectionModule(i);
610 
612  //vertical walls are allowed in SolidPolyhedra
613  double deltaz = 0;
614 
615  vector<double> pgonZ, pgonRmin, pgonRmax;
616  if (nsec == 3) {
617  double zf = getZminBlock(i) + getZShiftHac2();
618  pgonZ.emplace_back(zf);
619  pgonRmin.emplace_back(zf*tan(getAngBot()));
620  pgonRmax.emplace_back((zf-getZ1Beam())*getSlope());
621  pgonZ.emplace_back(getZiKink());
622  pgonRmin.emplace_back(getRinKink());
623  pgonRmax.emplace_back(getRout());
624  } else {
625  pgonZ.emplace_back(getZminBlock(i));
626  pgonRmin.emplace_back(getRinBlock1(i));
627  pgonRmax.emplace_back(getRoutBlock1(i));
628  }
629  if (nsec == 4) {
630  pgonZ.emplace_back(getZiDip());
631  pgonRmin.emplace_back(getRinDip());
632  pgonRmax.emplace_back(getRout());
633  pgonZ.emplace_back(pgonZ[1] + deltaz);
634  pgonRmin.emplace_back(pgonRmin[1]);
635  pgonRmax.emplace_back(getRoutDip());
636  }
637  pgonZ.emplace_back(getZmaxBlock(i));
638  pgonRmin.emplace_back(getRinBlock2(i));
639  pgonRmax.emplace_back(getRoutBlock2(i));
640 
641  //Solid & volume
642  DDSolid solid;
644  1, -alpha, 2*alpha,
645  pgonZ, pgonRmin, pgonRmax);
646 
647 #ifdef EDM_ML_DEBUG
648  edm::LogInfo("HCalGeom") << "DDHCalEndcapAlgo test: "
649  << DDName(name,idNameSpace)
650  << " Polyhedra made of " << getModMat(i)
651  << " with 1 sector from " << -alpha/CLHEP::deg
652  << " to " << alpha/CLHEP::deg << " and with "
653  << nsec << " sections";
654  for (unsigned int k=0; k<pgonZ.size(); k++)
655  edm::LogInfo("HCalGeom") << "\t\tZ = " << pgonZ[k] << "\tRmin = "
656  << pgonRmin[k] << "\tRmax = " << pgonRmax[k];
657 #endif
658 
659  DDLogicalPart glog(DDName(name, idNameSpace), matter, solid);
660 
661  cpv.position(glog, sector, i+1, DDTranslation(0.0, 0.0, 0.0), DDRotation());
662 
663 #ifdef EDM_ML_DEBUG
664  edm::LogInfo("HCalGeom") << "DDHCalEndcapAlgo test: " << glog.name()
665  << " number " << i+1 << " positioned in "
666  <<sector.name() <<" at (0,0,0) with no rotation";
667 #endif
668 
669  if (getModType(i) == 0)
670  constructInsideModule0 (glog, i, cpv);
671  else
672  constructInsideModule (glog, i, cpv);
673  }
674  }
675 }
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:78
std::string idNameSpace
double getRinBlock2(unsigned i) const
double getZiKink() const
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
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
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:38
std::string getModMat(unsigned int i) const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
const Double_t pi
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:67
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:92
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:846
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 1026 of file DDHCalEndcapAlgo.cc.

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

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

1028  {
1029 
1031  DDMaterial matter(matname);
1032  string name = idName+"Scintillator"+nm;
1033 
1034  DDSolid solid = DDSolidFactory::trap(DDName(name, idNameSpace), 0.5*dz, 0, 0,
1035  yh, bl, tl, alp, yh, bl, tl, alp);
1036 
1037 #ifdef EDM_ML_DEBUG
1038  edm::LogInfo("HCalGeom") << "DDHCalEndcapAlgo test: "
1039  << DDName(name,idNameSpace) << " Trap made of "
1040  << getScintMat() <<" of dimensions " << 0.5*dz
1041  << ", 0, 0, " << yh << ", " << bl << ", " << tl
1042  << ", " << alp/CLHEP::deg << ", " << yh << ", "
1043  << bl << ", " << tl << ", " << alp/CLHEP::deg;
1044 #endif
1045 
1046  DDLogicalPart glog(solid.ddname(), matter, solid);
1047 
1048  cpv.position(glog, detector, id, DDTranslation(0,0,0), DDRotation());
1049 
1050 #ifdef EDM_ML_DEBUG
1051  edm::LogInfo("HCalGeom") << "DDHCalEndcapAlgo test: " << glog.name()
1052  << " number " << id << " positioned in "
1053  << detector.name() << " at (0,0,0) with no rotation";
1054 #endif
1055 }
const N & name() const
Definition: DDBase.h:78
std::string idNameSpace
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
A DDSolid represents the shape of a part.
Definition: DDSolid.h:38
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:67
U second(std::pair< T, U > const &p)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:92
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:917
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:80
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 339 of file DDHCalEndcapAlgo.cc.

References constructGeneralVolume().

Referenced by getTolAbs().

339  {
340 
341 #ifdef EDM_ML_DEBUG
342  edm::LogInfo("HCalGeom") << "==>> Constructing DDHCalEndcapAlgo...";
343 #endif
344 
346 
347 #ifdef EDM_ML_DEBUG
348  edm::LogInfo("HCalGeom") << "<<== End of DDHCalEndcapAlgo construction ...";
349 #endif
350 }
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 35 of file DDHCalEndcapAlgo.cc.

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

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

35  {
36 
37  switch (i) {
38  case 0:
39  return layerN0[j];
40  break;
41 
42  case 1:
43  return layerN1[j];
44  break;
45 
46  case 2:
47  return layerN2[j];
48  break;
49 
50  case 3:
51  return layerN3[j];
52  break;
53 
54  case 4:
55  return layerN4[j];
56  break;
57 
58  case 5:
59  return layerN5[j];
60  break;
61 
62  default:
63  return 0;
64  }
65 }
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 67 of file DDHCalEndcapAlgo.cc.

References mps_fire::i, trimLeft, and trimRight.

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

67  {
68 
69  if (j == 0)
70  return trimLeft[i];
71  else
72  return trimRight[j];
73 }
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 75 of file DDHCalEndcapAlgo.cc.

References absMat, angBot, angGap, angTop, dbl_to_int(), drEnd, dzShift, dzStep, eModule, JetChargeProducer_cfi::exp, genMaterial, heboxDepth, mps_fire::i, idName, idNameSpace, idOffset, createfilelist::int, layerN, layerN0, layerN1, layerN2, layerN3, layerN4, layerN5, layerName, layers, layerT, layerType, modMat, modName, modType, python.rootplot.argparse::module, 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().

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

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

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

736  {
737 
738  //Given rin, rout compute parameters of the trapezoid and
739  //position of the trapezoid for a standrd layer
740  double alpha = CLHEP::pi/getNsectors();
741 
742 #ifdef EDM_ML_DEBUG
743  edm::LogInfo("HCalGeom") << "Input " << iphi << " Front " << rinF << " "
744  << routF << " " << zi << " Back " << rinB << " "
745  << routB << " " << zo << " Alpha "
746  << alpha/CLHEP::deg;
747 #endif
748 
749  yh1 = 0.5 * (routF - rinB);
750  bl1 = 0.5 * rinB * tan(alpha);
751  tl1 = 0.5 * routF * tan(alpha);
752  yh2 = 0.5 * (routF - rinB);
753  bl2 = 0.5 * rinB * tan(alpha);
754  tl2 = 0.5 * routF * tan(alpha);
755  double dx = 0.25* (bl2+tl2-bl1-tl1);
756  double dy = 0.5 * (rinB+routF-rinB-routF);
757  xpos = 0.25*(rinB+routF+rinB+routF);
758  ypos = 0.25*(bl2+tl2+bl1+tl1);
759  zpos = 0.5*(zi+zo);
760  alp = atan(0.5 * tan(alpha));
761  // ypos-= getTolPos();
762  if (iphi == 0) {
763  ypos = -ypos;
764  } else {
765  alp = -alp;
766  dx = -dx;
767  }
768  double r = sqrt (dx*dx + dy*dy);
769  theta= atan (r/(zo-zi));
770  phi = atan2 (dy, dx);
771 
772 #ifdef EDM_ML_DEBUG
773  edm::LogInfo("HCalGeom") << "Output Dimensions " << yh1 << " " << bl1 << " "
774  << tl1 << " " << yh2 << " " << bl2 << " " << tl2
775  << " " << alp/CLHEP::deg << " " << theta/CLHEP::deg
776  << " " << phi/CLHEP::deg << " Position " << xpos
777  << " " << ypos << " " << zpos;
778 #endif
779 }
float alpha
Definition: AMPTWrapper.h:95
int getNsectors() const
Geom::Theta< T > theta() const
const Double_t pi
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 677 of file DDHCalEndcapAlgo.cc.

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

Referenced by constructInsideModule0(), and getTolAbs().

680  {
681 
682  //Given module and layer number compute parameters of trapezoid
683  //and positioning parameters
684  double alpha = CLHEP::pi/getNsectors();
685 
686 #ifdef EDM_ML_DEBUG
687  edm::LogInfo("HCalGeom") << "Input " << iphi << " " << layer << " " << iphi
688  << " Alpha " << alpha/CLHEP::deg;
689 #endif
690 
691  double zi, zo;
692  if (iphi == 0) {
693  zi = getZminBlock(mod);
694  zo = zi + getLayerT(layer);
695  } else {
696  zo = getZmaxBlock(mod);
697  zi = zo - getLayerT(layer);
698  }
699  double rin, rout;
700  if (mod == 0) {
701  rin = zo * tan(getAngTop());
702  rout = (zi - getZ1Beam()) * getSlope();
703  } else {
704  rin = zo * tan(getAngBot());
705  rout = zi * tan(getAngTop());
706  }
707  yh = 0.5 * (rout - rin);
708  bl = 0.5 * rin * tan (alpha);
709  tl = 0.5 * rout * tan(alpha);
710  xpos = 0.5 * (rin + rout);
711  ypos = 0.5 * (bl + tl);
712  zpos = 0.5 * (zi + zo);
713  yh -= getTrim(mod,iphi);
714  bl -= getTrim(mod,iphi);
715  tl -= getTrim(mod,iphi);
716  alp = atan(0.5 * tan(alpha));
717  if (iphi == 0) {
718  ypos = -ypos;
719  } else {
720  alp = -alp;
721  }
722 
723 #ifdef EDM_ML_DEBUG
724  edm::LogInfo("HCalGeom") << "Output Dimensions " << yh << " " << bl << " "
725  << tl << " " << alp/CLHEP::deg << " Position "
726  << xpos << " " << ypos << " " << zpos;
727 #endif
728 }
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
const Double_t pi
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().