CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
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)
 
virtual ~DDHCalEndcapAlgo ()
 

Protected Member Functions

void constructGeneralVolume (DDCompactView &cpv)
 
void constructInsideModule (DDLogicalPart module, int mod, DDCompactView &cpv)
 
void constructInsideModule0 (DDLogicalPart module, int mod, DDCompactView &cpv)
 
void constructInsideSector (DDLogicalPart sector, DDCompactView &cpv)
 
void constructScintLayer (DDLogicalPart glog, double pDz, double yh, double bl, double tl, double alp, 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.

References LogDebug.

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  LogDebug("HCalGeom") << "DDHCalEndcapAlgo info: Creating an instance";
28 }
#define LogDebug(id)
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 ( )
virtual

Definition at line 30 of file DDHCalEndcapAlgo.cc.

30 {}

Member Function Documentation

void DDHCalEndcapAlgo::constructGeneralVolume ( DDCompactView cpv)
protected

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

Definition at line 323 of file DDHCalEndcapAlgo.cc.

References alpha, constructInsideSector(), dbl_to_string(), 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(), i, idName, idNameSpace, cuy::ii, LogDebug, mergeVDriftHistosByStation::name, DDBase< N, C >::name(), confdb::parent, phi, pi, DDSolidFactory::polyhedra(), DDCompactView::position(), makeMuonMisalignmentScenario::rot, rotation, rotHalf, rotns, edm::second(), and funct::tan().

Referenced by execute().

323  {
324 
325  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: General volume...";
326  bool proto = true;
327  for (int i=0; i<3; i++)
328  if (equipModule(i) > 0) proto = false;
329 
330  DDRotation rot;
331  if (DDSplit(getRotation()).first == "NULL") rot = DDRotation();
333  LogDebug("HCalGeom") << " First " << DDSplit(getRotation()).first
334  << " Second " << DDSplit(getRotation()).second
335  << " Rotation " << rot;
336  DDTranslation r0(0,0,getZShift());
337  double alpha = CLHEP::pi/getNsectors();
338  double dphi = getNsectortot()*CLHEP::twopi/getNsectors();
339 
341  //vertical walls are allowed in SolidPolyhedra
342  double delz = 0;
343 
344  vector<double> pgonZ, pgonRmin, pgonRmax;
345  if (proto) {
346  double zf = getZiBody() + getZShiftHac2();
347  pgonZ.push_back(zf - getDzShift());
348  pgonRmin.push_back(zf * tan(getAngBot()));
349  pgonRmax.push_back((zf - getZ1Beam())*getSlope());
350  } else {
351  pgonZ.push_back(getZFront() - getDzShift());
352  pgonRmin.push_back(getZFront() * tan(getAngTop()));
353  pgonRmax.push_back((getZFront() - getZ1Beam())*getSlope());
354  pgonZ.push_back(getZiL0Body() - getDzShift());
355  pgonRmin.push_back(getZiL0Body() * tan(getAngTop()));
356  pgonRmax.push_back((getZiL0Body() - getZ1Beam())*getSlope());
357  pgonZ.push_back(getZiL0Body() - getDzShift());
358  pgonRmin.push_back(getZiL0Body() * tan(getAngBot()));
359  pgonRmax.push_back((getZiL0Body() - getZ1Beam())*getSlope());
360  }
361  pgonZ.push_back(getZiKink() - getDzShift());
362  pgonRmin.push_back(getRinKink());
363  pgonRmax.push_back(getRout());
364  pgonZ.push_back(getZiDip() - getDzShift());
365  pgonRmin.push_back(getRinDip());
366  pgonRmax.push_back(getRout());
367  pgonZ.push_back(getZiDip() - getDzShift() + delz);
368  pgonRmin.push_back(getRinDip());
369  pgonRmax.push_back(getRoutDip());
370  pgonZ.push_back(getZEnd() - getDzShift());
371  pgonRmin.push_back(getZEnd() * tan(getAngBot()));
372  pgonRmax.push_back(getRoutDip());
373  pgonZ.push_back(getZEnd());
374  pgonRmin.push_back(getZEnd() * tan(getAngBot()));
375  pgonRmax.push_back(getRoutDip());
376 
377  string name("Null");
378  unsigned int i=0;
379  DDSolid solid;
381  getNsectortot(), -alpha, dphi, pgonZ,
382  pgonRmin, pgonRmax);
383  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: "
384  << DDName(idName, idNameSpace) << " Polyhedra made of "
385  << getGenMat() << " with " << getNsectortot()
386  << " sectors from " << -alpha/CLHEP::deg << " to "
387  << (-alpha+dphi)/CLHEP::deg << " and with "
388  << pgonZ.size() << " sections";
389  for (i = 0; i <pgonZ.size(); i++)
390  LogDebug("HCalGeom") << "\t\tZ = " << pgonZ[i] << "\tRmin = " <<pgonRmin[i]
391  << "\tRmax = " << pgonRmax[i];
392 
394  DDMaterial matter(matname);
395  DDLogicalPart genlogic(DDName(idName, idNameSpace), matter, solid);
396 
397  DDName parentName = parent().name();
398  cpv.position(DDName(idName, idNameSpace), parentName, 1, r0, rot);
399  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: "
400  << DDName(idName, idNameSpace) << " number 1 positioned"
401  << " in " << parentName << " at " << r0 << " with "
402  << rot;
403  if (getEndcaps() != 1) {
404  rot = DDRotation(DDName(rotHalf,rotns));
405  cpv.position(DDName(idName, idNameSpace), parentName, 2, r0, rot);
406  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: "
407  << DDName(idName, idNameSpace) << " number 2 "
408  << "positioned in " << parentName << " at " << r0
409  << " with " << rot;
410  }
411 
412  //Forward half
413  name = idName + "Front";
414  vector<double> pgonZMod, pgonRminMod, pgonRmaxMod;
415  for (i=0; i < (pgonZ.size()-1); i++) {
416  pgonZMod.push_back(pgonZ[i] + getDzShift());
417  pgonRminMod.push_back(pgonRmin[i]);
418  pgonRmaxMod.push_back(pgonRmax[i]);
419  }
421  getNsectortot(), -alpha, dphi, pgonZMod,
422  pgonRminMod, pgonRmaxMod);
423  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: " << DDName(name,idNameSpace)
424  << " Polyhedra made of " << getGenMat() << " with "
425  << getNsectortot() << " sectors from "
426  << -alpha/CLHEP::deg << " to "
427  << (-alpha+dphi)/CLHEP::deg << " and with "
428  << pgonZMod.size() << " sections ";
429  for (i = 0; i < pgonZMod.size(); i++)
430  LogDebug("HCalGeom") << "\t\tZ = " << pgonZMod[i] << "\tRmin = "
431  << pgonRminMod[i] << "\tRmax = " << pgonRmaxMod[i];
432  DDLogicalPart genlogich(DDName(name, idNameSpace), matter, solid);
433 
434  cpv.position(genlogich, genlogic, 1, DDTranslation(0.0, 0.0, -getDzShift()),
435  DDRotation());
436  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: " << genlogich.name()
437  << " number 1 positioned in " << genlogic.name()
438  << " at (0,0," << -getDzShift() << ") with no rotation";
439 
440  //Construct sector (from -alpha to +alpha)
441  name = idName + "Module";
443  1, -alpha, 2*alpha, pgonZMod,
444  pgonRminMod, pgonRmaxMod);
445  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: " << DDName(name,idNameSpace)
446  << " Polyhedra made of " << getGenMat()
447  <<" with 1 sector from " << -alpha/CLHEP::deg << " to "
448  << alpha/CLHEP::deg << " and with " << pgonZMod.size()
449  << " sections";
450  for (i = 0; i < pgonZMod.size(); i++)
451  LogDebug("HCalGeom") << "\t\tZ = " << pgonZMod[i] << "\tRmin = "
452  << pgonRminMod[i] << "\tRmax = " << pgonRmaxMod[i];
453 
454  DDLogicalPart seclogic(DDName(name, idNameSpace), matter, solid);
455 
456  for (int ii=0; ii<getNsectortot(); ii++) {
457  double phi = ii*2*alpha;
458  double phideg = phi/CLHEP::deg;
459 
461  string rotstr("NULL");
462  if (phideg != 0) {
463  rotstr = "R";
464  if (phideg < 100) rotstr = "R0";
465  rotstr = rotstr + dbl_to_string(phideg);
466  rotation = DDRotation(DDName(rotstr, rotns));
467  if (!rotation) {
468  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: Creating a new "
469  << "rotation " << rotstr << "\t" << 90 << ","
470  << phideg << "," << 90 << "," << (phideg+90)
471  << ", 0, 0";
472  rotation = DDrot(DDName(rotstr, rotns), 90*CLHEP::deg,
473  phideg*CLHEP::deg, 90*CLHEP::deg,
474  (90+phideg)*CLHEP::deg, 0*CLHEP::deg, 0*CLHEP::deg);
475  } //if !rotation
476  } //if phideg!=0
477 
478  cpv.position(seclogic, genlogich, ii+1, DDTranslation(0.0, 0.0, 0.0), rotation);
479  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: " << seclogic.name()
480  << " number " << ii+1 << " positioned in "
481  << genlogich.name() << " at (0,0,0) with " <<rotation;
482  }
483 
484  //Construct the things inside the sector
485  constructInsideSector(seclogic, cpv);
486 
487  //Backward half
488  name = idName + "Back";
489  vector<double> pgonZBack, pgonRminBack, pgonRmaxBack;
490  pgonZBack.push_back(getZEnd() - getDzShift());
491  pgonRminBack.push_back(pgonZBack[0]*tan(getAngBot()) + getDrEnd());
492  pgonRmaxBack.push_back(getRoutDip());
493  pgonZBack.push_back(getZEnd());
494  pgonRminBack.push_back(pgonZBack[1]*tan(getAngBot()) + getDrEnd());
495  pgonRmaxBack.push_back(getRoutDip());
497  getNsectortot(), -alpha, dphi, pgonZBack,
498  pgonRminBack, pgonRmaxBack);
499  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: " << DDName(name,idNameSpace)
500  << " Polyhedra made of " << getAbsMat() << " with "
501  << getNsectortot() << " sectors from "
502  << -alpha/CLHEP::deg << " to "
503  << (-alpha+dphi)/CLHEP::deg << " and with "
504  << pgonZBack.size() << " sections";
505  for (i = 0; i < pgonZBack.size(); i++)
506  LogDebug("HCalGeom") << "\t\tZ = " << pgonZBack[i] << "\tRmin = "
507  << pgonRminBack[i] << "\tRmax = " << pgonRmaxBack[i];
508  DDName absMatname(DDSplit(getAbsMat()).first, DDSplit(getAbsMat()).second);
509  DDMaterial absMatter(absMatname);
510  DDLogicalPart glog(DDName(name, idNameSpace), absMatter, solid);
511 
512  cpv.position(glog, genlogic, 1, DDTranslation(0.0, 0.0, 0.0), DDRotation());
513  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: " << glog.name()
514  << " number 1 positioned in " << genlogic.name()
515  << " at (0,0,0) with no rotation";
516 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
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
parent
Definition: confdb.py:1052
int getNsectors() const
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:14
std::string dbl_to_string(const double &in)
Converts only the integer part of a double to a string.
Definition: DDutils.cc:12
double getRinKink() const
int ii
Definition: cuy.py:588
double getZEnd() const
A DDSolid represents the shape of a part.
Definition: DDSolid.h:35
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:66
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:88
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:90
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:4
double getZiBody() const
std::string getGenMat() const
std::string rotation
void constructInsideSector(DDLogicalPart sector, DDCompactView &cpv)
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:673
double getZShiftHac2() const
void DDHCalEndcapAlgo::constructInsideModule ( DDLogicalPart  module,
int  mod,
DDCompactView cpv 
)
protected

Definition at line 781 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(), i, idNameSpace, idOffset, LogDebug, mod(), DDName::name(), mergeVDriftHistosByStation::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().

781  {
782 
783  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: \t\tInside module ..." <<mod;
784 
786  //Pointers to the Rotation Matrices and to the Materials
787  string rotstr = getRotMat();
788  DDRotation rot(DDName(rotstr, rotns));
790  DDMaterial matter(matName);
792  DDMaterial matplastic(plasName);
793 
794  double alpha = CLHEP::pi/getNsectors();
795  double zi = getZminBlock(mod);
796 
797  for (int i = 0; i < getLayerN(mod); i++) {
798  string name;
799  DDSolid solid;
800  DDLogicalPart glog, plog;
801  int layer = getLayer(mod,i);
802  double zo = zi + 0.5*getDzStep();
803 
804  for (int iphi = 0; iphi < getPhi(); iphi++) {
805  double ziAir = zo - getThick(mod);
806  double rinF, rinB;
807  if (layer == 1) {
808  rinF = ziAir * tan(getAngTop());
809  rinB = zo * tan(getAngTop());
810  } else {
811  rinF = ziAir * tan(getAngBot());
812  rinB = zo * tan(getAngBot());
813  }
814  double routF = (ziAir - getZ1Beam()) * getSlope();
815  double routB = (zo - getZ1Beam()) * getSlope();
816  if (routF > getRoutBlock2(mod)) routF = getRoutBlock2(mod);
817  if (routB > getRoutBlock2(mod)) routB = getRoutBlock2(mod);
818  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: Layer " << i << " Phi "
819  << iphi << " Front " << ziAir << ", " << rinF
820  << ", " << routF << " Back " << zo << ", " << rinB
821  << ", " << routB;
822  double yh1, bl1, tl1, yh2, bl2, tl2, theta, phi, alp;
823  double xpos, ypos, zpos;
824  parameterLayer(iphi, rinF, routF, rinB, routB, ziAir, zo, yh1, bl1, tl1,
825  yh2, bl2, tl2, alp, theta, phi, xpos, ypos, zpos);
826 
827  name = module.name().name()+getLayerName(layer)+getPhiName(iphi)+"Air";
828  solid = DDSolidFactory::trap(DDName(name, idNameSpace),
829  0.5*getThick(mod), theta, phi, yh1,
830  bl1, tl1, alp, yh2, bl2, tl2, alp);
831  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: " << solid.name()
832  << " Trap made of " << getGenMat()
833  << " of dimensions " << 0.5*getThick(mod) << ", "
834  << theta/CLHEP::deg << ", " << phi/CLHEP::deg
835  << ", " << yh1 << ", " << bl1 << ", " << tl1 << ", "
836  << alp/CLHEP::deg << ", " << yh2 << ", " << bl2
837  << ", " << tl2 << ", " << alp/CLHEP::deg;
838  glog = DDLogicalPart(solid.ddname(), matter, solid);
839 
840  DDTranslation r1(xpos, ypos, zpos);
841  cpv.position(glog, module, layer+1, r1, rot);
842  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: " << glog.name()
843  << " number " << layer+1 << " positioned in "
844  << module.name() << " at " << r1 << " with " << rot;
845 
846  //Now the plastic with scintillators
847  double yh = 0.5 * (routF - rinB) - getTrim(mod,iphi);
848  double bl = 0.5 * rinB * tan(alpha) - getTrim(mod,iphi);
849  double tl = 0.5 * routF * tan(alpha) - getTrim(mod,iphi);
850  name = module.name().name()+getLayerName(layer)+getPhiName(iphi);
851  solid = DDSolidFactory::trap(DDName(name, idNameSpace),
852  0.5*getLayerT(layer), 0, 0, yh,
853  bl, tl, alp, yh, bl, tl, alp);
854  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: " << solid.name()
855  << " Trap made of " << getPlastMat()
856  << " of dimensions " << 0.5*getLayerT(layer)
857  << ", 0, 0, " << yh << ", " << bl << ", " << tl
858  << ", " << alp/CLHEP::deg << ", " << yh << ", "
859  << bl << ", " << tl << ", " << alp/CLHEP::deg;
860  plog = DDLogicalPart(solid.ddname(), matplastic, solid);
861 
862  ypos = 0.5*(routF+rinB) - xpos;
863  DDTranslation r2(0., ypos, 0.);
864  cpv.position(plog, glog, idOffset+layer+1, r2, DDRotation());
865  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: " << plog.name()
866  << " number " << idOffset+layer+1
867  << " positioned in " << glog.name() << " at " << r2
868  << " with no rotation";
869 
870  //Constructin the scintillators inside
871  int copyNo = layer*10 + getLayerType(layer);
872  name = getModName(mod)+getLayerName(layer)+getPhiName(iphi);
873  constructScintLayer (plog, getScintT(layer), yh,bl,tl, alp,name,copyNo, cpv);
874  zo += 0.5*getDzStep();
875  } // End of loop over phi indices
876  zi = zo - 0.5*getDzStep();
877  } // End of loop on layers
878 }
#define LogDebug(id)
double getTrim(unsigned int i, unsigned int j) const
std::string getModName(unsigned int i) const
int i
Definition: DBlmapReader.cc:9
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
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:14
double getThick(unsigned int i) const
A DDSolid represents the shape of a part.
Definition: DDSolid.h:35
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:66
U second(std::pair< T, U > const &p)
double getZ1Beam() const
double getScintT(unsigned int i) const
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:88
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:723
int getLayerN(unsigned int i) const
int getLayerType(unsigned int i) const
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:4
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:87
void constructScintLayer(DDLogicalPart glog, double pDz, double yh, double bl, double tl, double alp, std::string name, int id, DDCompactView &cpv)
const N & ddname() const
Definition: DDBase.h:80
void DDHCalEndcapAlgo::constructInsideModule0 ( DDLogicalPart  module,
int  mod,
DDCompactView cpv 
)
protected

Definition at line 686 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, LogDebug, mod(), DDName::name(), mergeVDriftHistosByStation::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().

686  {
687 
688  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: \t\tInside module0 ..."<<mod;
689 
691  //Pointers to the Rotation Matrices and to the Materials
692  string rotstr = getRotMat();
693  DDRotation rot(DDName(rotstr, rotns));
695  DDMaterial matabsorbr(matName);
697  DDMaterial matplastic(plasName);
698 
699  int layer = getLayer(mod,0);
700  int layer0 = getLayer(mod,1);
701  string name;
702  double xpos, ypos, zpos;
703  DDSolid solid;
704  DDLogicalPart glog, plog;
705  for (int iphi = 0; iphi < getPhi(); iphi++) {
706  double yh, bl, tl, alp;
707  parameterLayer0(mod, layer, iphi, yh, bl, tl, alp, xpos, ypos, zpos);
708  name = module.name().name()+getLayerName(layer)+getPhiName(iphi);
709  solid = DDSolidFactory::trap(DDName(name, idNameSpace),
710  0.5*getLayerT(layer), 0, 0, yh,
711  bl, tl, alp, yh, bl, tl, alp);
712  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: " << solid.name()
713  << " Trap made of " << getPlastMat()
714  << " of dimensions " << 0.5*getLayerT(layer)
715  << ", 0, 0, " << yh << ", " << bl << ", " << tl
716  << ", " << alp/CLHEP::deg << ", " << yh << ", " << bl
717  << ", " << tl << ", " << alp/CLHEP::deg;
718  glog = DDLogicalPart(solid.ddname(), matplastic, solid);
719 
720  DDTranslation r1(xpos, ypos, zpos);
721  cpv.position(glog, module, idOffset+layer+1, r1, rot);
722  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: " << glog.name()
723  << " number " << idOffset+layer+1 << " positioned in "
724  << module.name() << " at " << r1 << " with " << rot;
725  //Now construct the layer of scintillator inside this
726  int copyNo = layer0*10 + getLayerType(layer);
727  name = getModName(mod)+getLayerName(layer)+getPhiName(iphi);
728  constructScintLayer (glog, getScintT(layer), yh, bl, tl, alp, name, copyNo, cpv);
729  }
730 
731  //Now the absorber layer
732  double zi = getZminBlock(mod) + getLayerT(layer);
733  double zo = zi + 0.5*getDzStep();
734  double rinF, routF, rinB, routB;
735  if (mod == 0) {
736  rinF = zi * tan(getAngTop());
737  routF =(zi - getZ1Beam()) * getSlope();
738  rinB = zo * tan(getAngTop());
739  routB =(zo - getZ1Beam()) * getSlope();
740  } else {
741  rinF = zi * tan(getAngBot());
742  routF = zi * tan(getAngTop());
743  rinB = zo * tan(getAngBot());
744  routB = zo * tan(getAngTop());
745  }
746  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: Module " << mod << " Front "
747  << zi << ", " << rinF << ", " << routF << " Back "
748  << zo << ", " << rinB << ", " << routB;
749  double yh1, bl1, tl1, yh2, bl2, tl2, theta, phi, alp;
750  parameterLayer(0, rinF, routF, rinB, routB, zi, zo, yh1, bl1, tl1, yh2, bl2,
751  tl2, alp, theta, phi, xpos, ypos, zpos);
752  double fact = getTolAbs();
753  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: Trim " << fact << " Param "
754  << yh1 << ", " << bl1 << ", " << tl1 << ", " << yh2
755  << ", " << bl2 << ", " << tl2;
756  bl1 -= fact;
757  tl1 -= fact;
758  bl2 -= fact;
759  tl2 -= fact;
760 
761  name = module.name().name()+"Absorber";
762  solid = DDSolidFactory::trap(DDName(name, idNameSpace),
763  0.5*getThick(mod), theta, phi, yh1,
764  bl1, tl1, alp, yh2, bl2, tl2, alp);
765  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: " << solid.name()
766  << " Trap made of " << getAbsMat() << " of dimensions "
767  << 0.5*getThick(mod) << ", " << theta/CLHEP::deg << ", "
768  << phi/CLHEP::deg << ", " << yh1 << ", " << bl1 << ", "
769  << tl1 << ", " << alp/CLHEP::deg << ", " << yh2 << ", "
770  << bl2 << ", " << tl2 << ", " << alp/CLHEP::deg;
771  glog = DDLogicalPart(solid.ddname(), matabsorbr, solid);
772 
773  DDTranslation r2(xpos, ypos, zpos);
774  cpv.position(glog, module, 1, r2, rot);
775  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: " << glog.name()
776  << " number 1 positioned in " << module.name() << " at "
777  << r2 << " with " << rot;
778 }
#define LogDebug(id)
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
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:14
double getThick(unsigned int i) const
double getTolAbs() const
A DDSolid represents the shape of a part.
Definition: DDSolid.h:35
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:66
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)
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:88
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:723
const double fact
int getLayerType(unsigned int i) const
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:4
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:87
void constructScintLayer(DDLogicalPart glog, double pDz, double yh, double bl, double tl, double alp, std::string name, int id, DDCompactView &cpv)
const N & ddname() const
Definition: DDBase.h:80
void DDHCalEndcapAlgo::constructInsideSector ( DDLogicalPart  sector,
DDCompactView cpv 
)
protected

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

Definition at line 519 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(), i, idName, idNameSpace, relval_2017::k, LogDebug, mergeVDriftHistosByStation::name, DDBase< N, C >::name(), pi, DDSolidFactory::polyhedra(), DDCompactView::position(), edm::second(), and funct::tan().

Referenced by constructGeneralVolume().

519  {
520 
521  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: Modules (" << getModules()
522  << ") ...";
523  double alpha = CLHEP::pi/getNsectors();
524 
525  for (int i = 0; i < getModules(); i++) {
526  string name = idName + getModName(i);
528  DDMaterial matter(matname);
529 
530  if (equipModule(i)>0) {
531  int nsec = getSectionModule(i);
532 
534  //vertical walls are allowed in SolidPolyhedra
535  double deltaz = 0;
536 
537  vector<double> pgonZ, pgonRmin, pgonRmax;
538  if (nsec == 3) {
539  double zf = getZminBlock(i) + getZShiftHac2();
540  pgonZ.push_back(zf);
541  pgonRmin.push_back(zf*tan(getAngBot()));
542  pgonRmax.push_back((zf-getZ1Beam())*getSlope());
543  pgonZ.push_back(getZiKink());
544  pgonRmin.push_back(getRinKink());
545  pgonRmax.push_back(getRout());
546  } else {
547  pgonZ.push_back(getZminBlock(i));
548  pgonRmin.push_back(getRinBlock1(i));
549  pgonRmax.push_back(getRoutBlock1(i));
550  }
551  if (nsec == 4) {
552  pgonZ.push_back(getZiDip());
553  pgonRmin.push_back(getRinDip());
554  pgonRmax.push_back(getRout());
555  pgonZ.push_back(pgonZ[1] + deltaz);
556  pgonRmin.push_back(pgonRmin[1]);
557  pgonRmax.push_back(getRoutDip());
558  }
559  pgonZ.push_back(getZmaxBlock(i));
560  pgonRmin.push_back(getRinBlock2(i));
561  pgonRmax.push_back(getRoutBlock2(i));
562 
563  //Solid & volume
564  DDSolid solid;
566  1, -alpha, 2*alpha,
567  pgonZ, pgonRmin, pgonRmax);
568  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: "
569  << DDName(name,idNameSpace) << " Polyhedra made of "
570  << getModMat(i) << " with 1 sector from "
571  << -alpha/CLHEP::deg << " to " << alpha/CLHEP::deg
572  << " and with " << nsec << " sections";
573  for (unsigned int k=0; k<pgonZ.size(); k++)
574  LogDebug("HCalGeom") << "\t\tZ = " << pgonZ[k] << "\tRmin = "
575  << pgonRmin[k] << "\tRmax = " << pgonRmax[k];
576 
577  DDLogicalPart glog(DDName(name, idNameSpace), matter, solid);
578 
579  cpv.position(glog, sector, i+1, DDTranslation(0.0, 0.0, 0.0), DDRotation());
580  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: " << glog.name()
581  << " number " << i+1 << " positioned in "
582  << sector.name() << " at (0,0,0) with no rotation";
583 
584  if (getModType(i) == 0)
585  constructInsideModule0 (glog, i, cpv);
586  else
587  constructInsideModule (glog, i, cpv);
588  }
589  }
590 
591 }
#define LogDebug(id)
void constructInsideModule0(DDLogicalPart module, int mod, DDCompactView &cpv)
std::string getModName(unsigned int i) const
int i
Definition: DBlmapReader.cc:9
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
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:14
double getRinKink() const
int getSectionModule(unsigned i) const
A DDSolid represents the shape of a part.
Definition: DDSolid.h:35
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:66
U second(std::pair< T, U > const &p)
double getZ1Beam() const
double getRout() const
double getRinBlock1(unsigned i) const
double getAngBot() const
void constructInsideModule(DDLogicalPart module, int mod, DDCompactView &cpv)
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:88
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:4
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:673
double getZShiftHac2() const
double getRoutBlock1(unsigned i) const
int getModules() const
void DDHCalEndcapAlgo::constructScintLayer ( DDLogicalPart  glog,
double  pDz,
double  yh,
double  bl,
double  tl,
double  alp,
std::string  name,
int  id,
DDCompactView cpv 
)
protected

Definition at line 881 of file DDHCalEndcapAlgo.cc.

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

Referenced by constructInsideModule(), and constructInsideModule0().

883  {
884 
886  DDMaterial matter(matname);
887  string name = idName+"Scintillator"+nm;
888 
889  DDSolid solid = DDSolidFactory::trap(DDName(name, idNameSpace), 0.5*dz, 0, 0,
890  yh, bl, tl, alp, yh, bl, tl, alp);
891  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: " << DDName(name,idNameSpace)
892  << " Trap made of " << getScintMat() <<" of dimensions "
893  << 0.5*dz << ", 0, 0, " << yh << ", " << bl << ", "
894  << tl << ", " << alp/CLHEP::deg << ", " << yh << ", "
895  << bl << ", " << tl << ", " << alp/CLHEP::deg;
896 
897  DDLogicalPart glog(solid.ddname(), matter, solid);
898 
899  cpv.position(glog, detector, id, DDTranslation(0,0,0), DDRotation());
900  LogDebug("HCalGeom") << "DDHCalEndcapAlgo test: " << glog.name()
901  << " number " << id << " positioned in "
902  << detector.name() << " at (0,0,0) with no rotation";
903 
904 }
#define LogDebug(id)
const N & name() const
Definition: DDBase.h:78
std::string idNameSpace
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:14
A DDSolid represents the shape of a part.
Definition: DDSolid.h:35
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
U second(std::pair< T, U > const &p)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:88
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:723
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
std::string getScintMat() const
const std::string & name() const
Returns the name.
Definition: DDName.cc:87
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 i.

Referenced by constructGeneralVolume(), and constructInsideSector().

22 {return eModule[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< int > eModule
void DDHCalEndcapAlgo::execute ( DDCompactView cpv)

Definition at line 314 of file DDHCalEndcapAlgo.cc.

References constructGeneralVolume(), and LogDebug.

314  {
315 
316  LogDebug("HCalGeom") << "==>> Constructing DDHCalEndcapAlgo...";
318  LogDebug("HCalGeom") << "<<== End of DDHCalEndcapAlgo construction ...";
319 }
#define LogDebug(id)
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

Definition at line 45 of file DDHCalEndcapAlgo.h.

References angTop.

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

45 {return angTop;}
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 32 of file DDHCalEndcapAlgo.cc.

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

Referenced by constructInsideModule(), and constructInsideModule0().

32  {
33 
34  switch (i) {
35  case 0:
36  return layerN0[j];
37  break;
38 
39  case 1:
40  return layerN1[j];
41  break;
42 
43  case 2:
44  return layerN2[j];
45  break;
46 
47  case 3:
48  return layerN3[j];
49  break;
50 
51  case 4:
52  return layerN4[j];
53  break;
54 
55  case 5:
56  return layerN5[j];
57  break;
58 
59  default:
60  return 0;
61  }
62 }
int i
Definition: DBlmapReader.cc:9
std::vector< int > layerN2
std::vector< int > layerN0
std::vector< int > layerN1
std::vector< int > layerN4
int j
Definition: DBlmapReader.cc:9
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 i, and layerN.

Referenced by constructInsideModule().

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

Definition at line 70 of file DDHCalEndcapAlgo.h.

References i, and layerName.

Referenced by constructInsideModule(), and constructInsideModule0().

70 {return layerName[i];}
int i
Definition: DBlmapReader.cc:9
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 i, and layerT.

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

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

Definition at line 71 of file DDHCalEndcapAlgo.h.

References i, and layerType.

Referenced by constructInsideModule(), and constructInsideModule0().

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

Definition at line 53 of file DDHCalEndcapAlgo.h.

References i, and modMat.

Referenced by constructInsideSector().

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

Definition at line 52 of file DDHCalEndcapAlgo.h.

References i, and modName.

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

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

Definition at line 54 of file DDHCalEndcapAlgo.h.

References i, and modType.

Referenced by constructInsideSector().

54 {return modType[i];}
int i
Definition: DBlmapReader.cc:9
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 i, and phiName.

Referenced by constructInsideModule(), and constructInsideModule0().

68 {return phiName[i];}
int i
Definition: DBlmapReader.cc:9
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 i, and rinBlock1.

Referenced by constructInsideSector().

62 {return rinBlock1[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > rinBlock1
double DDHCalEndcapAlgo::getRinBlock2 ( unsigned  i) const
inline

Definition at line 63 of file DDHCalEndcapAlgo.h.

References i, and rinBlock2.

Referenced by constructInsideSector().

63 {return rinBlock2[i];}
int i
Definition: DBlmapReader.cc:9
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 i, and routBlock1.

Referenced by constructInsideSector().

64 {return routBlock1[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > routBlock1
double DDHCalEndcapAlgo::getRoutBlock2 ( unsigned  i) const
inline

Definition at line 65 of file DDHCalEndcapAlgo.h.

References i, and routBlock2.

Referenced by constructInsideModule(), and constructInsideSector().

65 {return routBlock2[i];}
int i
Definition: DBlmapReader.cc:9
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 i, and scintT.

Referenced by constructInsideModule(), and constructInsideModule0().

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

Definition at line 55 of file DDHCalEndcapAlgo.h.

References i, and sectionModule.

Referenced by constructInsideSector().

55 {return sectionModule[i];}
int i
Definition: DBlmapReader.cc:9
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 i, and thick.

Referenced by constructInsideModule(), and constructInsideModule0().

58 {return thick[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > thick
double DDHCalEndcapAlgo::getTolAbs ( ) const
inline

Definition at line 78 of file DDHCalEndcapAlgo.h.

References tolAbs.

Referenced by constructInsideModule0().

78 {return tolAbs;}
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 64 of file DDHCalEndcapAlgo.cc.

References i, j, trimLeft, and trimRight.

Referenced by constructInsideModule(), and parameterLayer0().

64  {
65 
66  if (j == 0)
67  return trimLeft[i];
68  else
69  return trimRight[j];
70 }
int i
Definition: DBlmapReader.cc:9
int j
Definition: DBlmapReader.cc:9
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 i, and zmaxBlock.

Referenced by constructInsideSector(), and parameterLayer0().

61 {return zmaxBlock[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< double > zmaxBlock
double DDHCalEndcapAlgo::getZminBlock ( unsigned  i) const
inline

Definition at line 60 of file DDHCalEndcapAlgo.h.

References i, and zminBlock.

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

60 {return zminBlock[i];}
int i
Definition: DBlmapReader.cc:9
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 
)

Definition at line 72 of file DDHCalEndcapAlgo.cc.

References absMat, angBot, angGap, angTop, dbl_to_int(), drEnd, dzShift, dzStep, eModule, create_public_lumi_plots::exp, genMaterial, heboxDepth, i, idName, idNameSpace, idOffset, j, layerN, layerN0, layerN1, layerN2, layerN3, layerN4, layerN5, layerName, layers, layerT, layerType, LogDebug, modMat, modName, modType, python.rootplot.argparse::module, modules, nEndcap, DDCurrentNamespace::ns(), nsectors, nsectortot, confdb::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.

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

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

Referenced by constructInsideModule(), and constructInsideModule0().

647  {
648 
649  //Given rin, rout compute parameters of the trapezoid and
650  //position of the trapezoid for a standrd layer
651  double alpha = CLHEP::pi/getNsectors();
652  LogDebug("HCalGeom") << "Input " << iphi << " Front " << rinF << " " << routF
653  << " " << zi << " Back " << rinB << " " << routB << " "
654  << zo << " Alpha " << alpha/CLHEP::deg;
655 
656  yh1 = 0.5 * (routF - rinB);
657  bl1 = 0.5 * rinB * tan(alpha);
658  tl1 = 0.5 * routF * tan(alpha);
659  yh2 = 0.5 * (routF - rinB);
660  bl2 = 0.5 * rinB * tan(alpha);
661  tl2 = 0.5 * routF * tan(alpha);
662  double dx = 0.25* (bl2+tl2-bl1-tl1);
663  double dy = 0.5 * (rinB+routF-rinB-routF);
664  xpos = 0.25*(rinB+routF+rinB+routF);
665  ypos = 0.25*(bl2+tl2+bl1+tl1);
666  zpos = 0.5*(zi+zo);
667  alp = atan(0.5 * tan(alpha));
668  // ypos-= getTolPos();
669  if (iphi == 0) {
670  ypos = -ypos;
671  } else {
672  alp = -alp;
673  dx = -dx;
674  }
675  double r = sqrt (dx*dx + dy*dy);
676  theta= atan (r/(zo-zi));
677  phi = atan2 (dy, dx);
678  LogDebug("HCalGeom") << "Output Dimensions " << yh1 << " " << bl1 << " "
679  << tl1 << " " << yh2 << " " << bl2 << " " << tl2
680  << " " << alp/CLHEP::deg << " " << theta/CLHEP::deg
681  << " " << phi/CLHEP::deg << " Position " << xpos << " "
682  << ypos << " " << zpos;
683 }
#define LogDebug(id)
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 593 of file DDHCalEndcapAlgo.cc.

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

Referenced by constructInsideModule0().

596  {
597 
598  //Given module and layer number compute parameters of trapezoid
599  //and positioning parameters
600  double alpha = CLHEP::pi/getNsectors();
601  LogDebug("HCalGeom") << "Input " << iphi << " " << layer << " " << iphi
602  << " Alpha " << alpha/CLHEP::deg;
603 
604  double zi, zo;
605  if (iphi == 0) {
606  zi = getZminBlock(mod);
607  zo = zi + getLayerT(layer);
608  } else {
609  zo = getZmaxBlock(mod);
610  zi = zo - getLayerT(layer);
611  }
612  double rin, rout;
613  if (mod == 0) {
614  rin = zo * tan(getAngTop());
615  rout = (zi - getZ1Beam()) * getSlope();
616  } else {
617  rin = zo * tan(getAngBot());
618  rout = zi * tan(getAngTop());
619  }
620  yh = 0.5 * (rout - rin);
621  bl = 0.5 * rin * tan (alpha);
622  tl = 0.5 * rout * tan(alpha);
623  xpos = 0.5 * (rin + rout);
624  ypos = 0.5 * (bl + tl);
625  zpos = 0.5 * (zi + zo);
626  yh -= getTrim(mod,iphi);
627  bl -= getTrim(mod,iphi);
628  tl -= getTrim(mod,iphi);
629  alp = atan(0.5 * tan(alpha));
630  if (iphi == 0) {
631  ypos = -ypos;
632  } else {
633  alp = -alp;
634  }
635  LogDebug("HCalGeom") << "Output Dimensions " << yh << " " << bl << " "
636  << tl << " " << alp/CLHEP::deg << " Position " << xpos
637  << " " << ypos << " " << zpos;
638 }
#define LogDebug(id)
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().