24 modMat(0),modType(0),sectionModule(0),layerN(0),layerN0(0),layerN1(0),
25 layerN2(0),layerN3(0),layerN4(0),layerN5(0),thick(0),trimLeft(0),
26 trimRight(0),zminBlock(0),zmaxBlock(0),rinBlock1(0),routBlock1(0),
27 rinBlock2(0),routBlock2(0),layerType(0),layerT(0),scintT(0) {
88 rotns = sArgs[
"RotNameSpace"];
98 ziDip = nArgs[
"ZiDip"];
101 double gap = nArgs[
"Gap"];
102 double z1 = nArgs[
"Z1"];
103 double r1 = nArgs[
"R1"];
104 rout = nArgs[
"Rout"];
106 drEnd = nArgs[
"DrEnd"];
107 double etamin = nArgs[
"Etamin"];
113 <<
"DDHCalEndcapAlgo: General material " <<
genMaterial <<
"\tSectors " 115 <<
"\tRotation matrix for half " <<
rotns <<
":" <<
rotHalf <<
"\n\tzFront " 119 <<
" z1 " << z1 <<
"\n\tr1 " << r1 <<
" rout " <<
rout <<
" HeboxDepth " 121 <<
" Bottom angle " <<
angBot <<
" Gap angle " <<
angGap <<
" Z-Shift " 150 <<
"DDHCalEndcapAlgo: Number of modules " <<
modules 151 <<
" and absorber material " <<
absMat;
154 modName = vsArgs[
"ModuleName"];
155 modMat = vsArgs[
"ModuleMat"];
158 thick = vArgs[
"ModuleThick"];
174 <<
" Sections " <<
sectionModule[
i] <<
" thickness of absorber/air " 176 <<
" equip module " <<
eModule[
i] <<
" with " <<
layerN[
i] <<
" layers";
178 for (
int j = 0; j < layerN[
i]; j++) {
183 for (
int j = 0; j < layerN[
i]; j++) {
188 for (
int j = 0; j < layerN[
i]; j++) {
192 for (
int j = 0; j < layerN[
i]; j++) {
196 for (
int j = 0; j < layerN[
i]; j++) {
200 for (
int j = 0; j < layerN[
i]; j++) {
222 <<
"DDHCalEndcapAlgo: Phi Sections " <<
phiSections;
227 <<
"\tRotation matrix " <<
rotns <<
":" <<
rotmat <<
"\n\tNumber of layers " 306 for (
int i = 0;
i < module;
i++)
308 <<
"DDHCalEndcapAlgo: Module " <<
i <<
"\tZ/Rin/Rout " <<
zminBlock[
i]
313 idName = sArgs[
"MotherName"];
319 <<
"DDHCalEndcapAlgo: Parent " <<
parent().name() <<
" idName " <<
idName 328 <<
"DDHCalEndcapAlgo: Tolerances - Positioning " <<
tolPos <<
" Absorber " 346 edm::LogVerbatim(
"HCalGeom") <<
"<<== End of DDHCalEndcapAlgo construction ...";
359 for (
int i=0;
i<3;
i++)
380 std::vector<double> pgonZ, pgonRmin, pgonRmax;
399 pgonRmax.emplace_back(
getRout());
402 pgonRmax.emplace_back(
getRout());
423 <<
convertRadToDeg(-alpha+dphi) <<
" and with " << pgonZ.size() <<
" sections";
424 for (
unsigned int i = 0;
i <pgonZ.size();
i++)
426 <<
"\t\tZ = " << pgonZ[
i] <<
"\tRmin = " << pgonRmin[
i] <<
"\tRmax = " 440 <<
" number 1 positioned in " << parentName <<
" at " << r0 <<
" with " <<
rot;
450 <<
"positioned in " << parentName <<
" at " << r0 <<
" with " <<
rot;
457 std::vector<double> pgonZMod, pgonRminMod, pgonRmaxMod;
458 for (
unsigned int i=0;
i < (pgonZ.size()-1);
i++) {
460 pgonRminMod.emplace_back(pgonRmin[
i]);
461 pgonRmaxMod.emplace_back(pgonRmax[i]);
465 pgonRminMod, pgonRmaxMod);
472 <<
" and with " << pgonZMod.size() <<
" sections ";
473 for (
unsigned int i = 0;
i < pgonZMod.size();
i++)
475 <<
"\t\tZ = " << pgonZMod[
i] <<
"\tRmin = " << pgonRminMod[
i] <<
"\tRmax = " 486 <<
"DDHCalEndcapAlgo: " << genlogich.
name() <<
" number 1 positioned in " 487 << genlogic.
name() <<
" at (0,0," << -
getDzShift()<<
") with no rotation";
493 1, -alpha, 2*alpha, pgonZMod,
494 pgonRminMod, pgonRmaxMod);
499 <<
convertRadToDeg(alpha) <<
" and with " << pgonZMod.size() <<
" sections";
500 for (
unsigned int i = 0;
i < pgonZMod.size();
i++)
502 <<
"\t\tZ = " << pgonZMod[
i] <<
"\tRmin = " << pgonRminMod[
i] <<
"\tRmax = " 518 <<
"DDHCalEndcapAlgo: Creating a new rotation " << rotstr
523 (90._deg+phi), 0, 0);
531 <<
"DDHCalEndcapAlgo: " << seclogic.
name() <<
" number " <<
ii+1
532 <<
" positioned in " << genlogich.
name() <<
" at (0,0,0) with " <<
rotation;
542 std::vector<double> pgonZBack, pgonRminBack, pgonRmaxBack;
546 pgonZBack.emplace_back(
getZEnd());
551 pgonRminBack, pgonRmaxBack);
558 <<
" and with " << pgonZBack.size() <<
" sections";
559 for (
unsigned int i = 0;
i < pgonZBack.size();
i++)
561 <<
"\t\tZ = " << pgonZBack[
i] <<
"\tRmin = " << pgonRminBack[
i]
562 <<
"\tRmax = " << pgonRmaxBack[
i];
573 <<
"DDHCalEndcapAlgo: " << glog.
name() <<
" number 1 positioned in " 574 << genlogic.
name() <<
" at (0,0,0) with no rotation";
583 <<
"DDHCalEndcapAlgo: Modules (" <<
getModules() <<
") ...";
600 std::vector<double> pgonZ, pgonRmin, pgonRmax;
603 pgonZ.emplace_back(zf);
608 pgonRmax.emplace_back(
getRout());
617 pgonRmax.emplace_back(
getRout());
618 pgonZ.emplace_back(pgonZ[1] + deltaz);
619 pgonRmin.emplace_back(pgonRmin[1]);
630 pgonZ, pgonRmin, pgonRmax);
635 <<
" Polyhedra made of " <<
getModMat(
i) <<
" with 1 sector from " 637 <<
" and with " << nsec <<
" sections";
638 for (
unsigned int k=0;
k<pgonZ.size();
k++)
640 <<
"\t\tZ = " << pgonZ[
k] <<
"\tRmin = " << pgonRmin[
k] <<
"\tRmax = " 650 <<
"DDHCalEndcapAlgo: " << glog.
name() <<
" number " <<
i+1
651 <<
" positioned in " << sector.
name() <<
" at (0,0,0) with no rotation";
663 double& yh,
double& bl,
double& tl,
664 double& alp,
double& xpos,
double& ypos,
673 <<
"Input " << iphi <<
" " << layer <<
" " << iphi <<
" Alpha " 693 yh = 0.5 * (rout - rin);
694 bl = 0.5 * rin *
tan (alpha);
695 tl = 0.5 * rout *
tan(alpha);
696 xpos = 0.5 * (rin +
rout);
697 ypos = 0.5 * (bl + tl);
698 zpos = 0.5 * (zi + zo);
702 alp = atan(0.5 *
tan(alpha));
711 <<
"Output Dimensions " << yh <<
" " << bl <<
" " << tl <<
" " 712 <<
convertRadToDeg(alp) <<
" Position " << xpos <<
" " << ypos <<
" " << zpos;
717 double rinB,
double routB,
double zi,
718 double zo,
double& yh1,
double& bl1,
719 double& tl1,
double& yh2,
double& bl2,
720 double& tl2,
double& alp,
double&
theta,
721 double&
phi,
double& xpos,
double& ypos,
730 <<
"Input " << iphi <<
" Front " << rinF <<
" " << routF <<
" " << zi
731 <<
" Back " << rinB <<
" " << routB <<
" " << zo <<
" Alpha " 735 yh1 = 0.5 * (routF - rinB);
736 bl1 = 0.5 * rinB *
tan(alpha);
737 tl1 = 0.5 * routF *
tan(alpha);
738 yh2 = 0.5 * (routF - rinB);
739 bl2 = 0.5 * rinB *
tan(alpha);
740 tl2 = 0.5 * routF *
tan(alpha);
741 double dx = 0.25* (bl2+tl2-bl1-tl1);
742 double dy = 0.5 * (rinB+routF-rinB-routF);
743 xpos = 0.25*(rinB+routF+rinB+routF);
744 ypos = 0.25*(bl2+tl2+bl1+tl1);
746 alp = atan(0.5 *
tan(alpha));
754 double r =
sqrt (dx*dx + dy*dy);
755 theta= atan (r/(zo-zi));
756 phi = atan2 (dy, dx);
760 <<
"Output Dimensions " << yh1 <<
" " << bl1 <<
" " << tl1 <<
" " << yh2
763 << xpos <<
" " << ypos <<
" " << zpos;
772 <<
"DDHCalEndcapAlgo: \t\tInside module0 ..." <<
mod;
787 double xpos, ypos, zpos;
790 for (
int iphi = 0; iphi <
getPhi(); iphi++) {
791 double yh, bl, tl, alp;
796 bl, tl, alp, yh, bl, tl, alp);
800 <<
"DDHCalEndcapAlgo: " << solid.
name() <<
" Trap made of " <<
getPlastMat()
801 <<
" of dimensions " << 0.5*
getLayerT(layer) <<
", 0, 0, " << yh <<
", " 802 << bl <<
", " << tl <<
", " <<
convertRadToDeg(alp) <<
", " << yh <<
", " 813 <<
"DDHCalEndcapAlgo: " << glog.
name() <<
" number " <<
idOffset+layer+1
814 <<
" positioned in " << module.
name() <<
" at " << r1 <<
" with " <<
rot;
826 double rinF, routF, rinB, routB;
841 <<
"DDHCalEndcapAlgo: Module " << mod <<
" Front " << zi <<
", " << rinF
842 <<
", " << routF <<
" Back " << zo <<
", " << rinB <<
", " << routB;
845 double yh1, bl1, tl1, yh2, bl2, tl2,
theta,
phi, alp;
846 parameterLayer(0, rinF, routF, rinB, routB, zi, zo, yh1, bl1, tl1, yh2, bl2,
847 tl2, alp, theta, phi, xpos, ypos, zpos);
852 <<
"DDHCalEndcapAlgo: Trim " << fact <<
" Param " << yh1 <<
", " << bl1
853 <<
", " << tl1 <<
", " << yh2 <<
", " << bl2 <<
", " << tl2;
861 name = module.
name().
name()+
"Absorber";
864 bl1, tl1, alp, yh2, bl2, tl2, alp);
867 <<
"DDHCalEndcapAlgo: " << solid.
name() <<
" Trap made of " <<
getAbsMat()
869 <<
", " <<
convertRadToDeg(phi) <<
", " << yh1 <<
", " << bl1 <<
", " << tl1
870 <<
", " <<
convertRadToDeg(alp) <<
", " << yh2 <<
", " << bl2 <<
", " << tl2
877 cpv.
position(glog, module, 1, r2, rot);
881 <<
"DDHCalEndcapAlgo: " << glog.
name() <<
" number 1 positioned in " 882 << module.
name() <<
" at " << r2 <<
" with " <<
rot;
891 <<
"DDHCalEndcapAlgo: \t\tInside module ..." <<
mod;
913 for (
int iphi = 0; iphi <
getPhi(); iphi++) {
930 <<
"DDHCalEndcapAlgo: Layer " <<
i <<
" Phi " << iphi <<
" Front " 931 << ziAir <<
", " << rinF <<
", " << routF <<
" Back " << zo <<
", " 932 << rinB <<
", " << routB;
935 double yh1, bl1, tl1, yh2, bl2, tl2,
theta,
phi, alp;
936 double xpos, ypos, zpos;
937 parameterLayer(iphi, rinF, routF, rinB, routB, ziAir, zo, yh1, bl1, tl1,
938 yh2, bl2, tl2, alp, theta, phi, xpos, ypos, zpos);
943 bl1, tl1, alp, yh2, bl2, tl2, alp);
947 <<
"DDHCalEndcapAlgo: " << solid.
name() <<
" Trap made of " <<
getGenMat()
957 cpv.
position(glog, module, layer+1, r1, rot);
961 <<
"DDHCalEndcapAlgo: " << glog.
name() <<
" number " << layer+1
962 <<
" positioned in " << module.
name() <<
" at " << r1 <<
" with " <<
rot;
966 double yh = 0.5 * (routF - rinB) -
getTrim(mod,iphi);
967 double bl = 0.5 * rinB *
tan(alpha) -
getTrim(mod,iphi);
968 double tl = 0.5 * routF *
tan(alpha) -
getTrim(mod,iphi);
972 bl, tl, alp, yh, bl, tl, alp);
976 <<
"DDHCalEndcapAlgo: " << solid.
name() <<
" Trap made of " 978 <<
", 0, 0, " << yh <<
", " << bl <<
", " << tl <<
", " 979 <<
convertRadToDeg(alp) <<
", " << yh <<
", " << bl <<
", " << tl <<
", " 985 ypos = 0.5*(routF+rinB) - xpos;
991 <<
"DDHCalEndcapAlgo: " << plog.
name() <<
" number " <<
idOffset+layer+1
992 <<
" positioned in " << glog.
name() <<
" at " << r2 <<
" with no rotation";
1007 double dz,
double yh,
double bl,
1008 double tl,
double alp,
1017 yh, bl, tl, alp, yh, bl, tl, alp);
1022 <<
getScintMat() <<
" of dimensions " << 0.5*dz <<
", 0, 0, " << yh <<
", " 1023 << bl <<
", " << tl <<
", " <<
convertRadToDeg(alp) <<
", " << yh <<
", " 1033 <<
"DDHCalEndcapAlgo: " << glog.name() <<
" number " <<
id 1034 <<
" positioned in " << detector.
name() <<
" at (0,0,0) with no rotation";
double getTrim(unsigned int i, unsigned int j) const
std::string getModName(unsigned int i) const
void execute(DDCompactView &cpv) override
double getZmaxBlock(unsigned i) const
std::vector< int > layerN2
std::vector< int > modType
std::vector< double > zminBlock
double getRinBlock2(unsigned i) const
int getNsectortot() const
std::vector< int > layerN0
std::vector< std::string > modMat
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
std::string getAbsMat() const
DDMaterial is used to define and access material information.
double getRoutBlock2(unsigned i) const
int getModType(unsigned int i) const
Sin< T >::type sin(const T &t)
void constructInsideSector(const DDLogicalPart §or, DDCompactView &cpv)
Geom::Theta< T > theta() const
DDName is used to identify DDD entities uniquely.
constexpr NumType convertRadToDeg(NumType radians)
std::vector< double > routBlock1
void constructInsideModule(const DDLogicalPart &module, int mod, DDCompactView &cpv)
double getThick(unsigned int i) const
static std::string & ns()
double getRinKink() const
std::vector< double > zmaxBlock
Compact representation of the geometrical detector hierarchy.
int getSectionModule(unsigned i) const
std::string formatAsDegreesInInteger(double radianVal)
A DDSolid represents the shape of a part.
std::string getModMat(unsigned int i) const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
std::string getRotMat() const
std::string getRotation() const
std::vector< double > routBlock2
Represents a uniquely identifyable rotation matrix.
U second(std::pair< T, U > const &p)
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
std::vector< std::string > layerName
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)
std::vector< int > layerN1
void constructScintLayer(const DDLogicalPart &glog, double pDz, double yh, double bl, double tl, double alp, const std::string &name, int id, DDCompactView &cpv)
double getRinBlock1(unsigned i) const
std::vector< int > layerN4
int equipModule(unsigned int i) const
std::vector< int > sectionModule
Tan< T >::type tan(const T &t)
double getZiL0Body() const
std::string getPlastMat() const
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
std::vector< double > rinBlock1
std::vector< std::string > modName
std::vector< int > layerN5
~DDHCalEndcapAlgo() override
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)
int getLayerN(unsigned int i) const
std::vector< int > eModule
std::vector< int > layerType
std::vector< int > layerN
void constructGeneralVolume(DDCompactView &cpv)
int getLayerType(unsigned int i) const
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string ©no, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
void constructInsideModule0(const DDLogicalPart &module, int mod, DDCompactView &cpv)
std::vector< double > rinBlock2
double getLayerT(unsigned int i) const
double getRoutDip() const
std::vector< double > trimRight
double getDzShift() 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 = ':'
std::vector< int > layerN3
std::string getGenMat() const
std::string getScintMat() const
std::vector< std::string > phiName
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::vector< double > thick
std::string getLayerName(unsigned int i) const
T mod(const T &a, const T &b)
std::vector< double > scintT
std::vector< double > layerT
const std::string & name() const
Returns the name.
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)
double getZShiftHac2() const
double getRoutBlock1(unsigned i) const
std::vector< double > trimLeft