24 theta(0),rmax(0),zoff(0),ttheta(0),layerId(0),layerLabel(0),layerMat(0),
25 layerWidth(0),layerD1(0),layerD2(0),layerAlpha(0),layerT1(0),layerT2(0),
26 layerAbsorb(0),layerGap(0),absorbName(0),absorbMat(0),absorbD(0),absorbT(0),
27 midName(0),midMat(0),midW(0),midT(0),sideMat(0),sideD(0),sideT(0),
28 sideAbsName(0),sideAbsMat(0),sideAbsW(0),detType(0),detdP1(0),detdP2(0),
29 detT11(0),detT12(0),detTsc(0),detT21(0),detT22(0),detWidth1(0),detWidth2(0),
52 rotns = sArgs[
"RotNameSpace"];
54 theta = vArgs[
"Theta"];
72 <<
"\trmax[" <<
i <<
"] = " <<
rmax[
i]
73 <<
"\tzoff[" <<
i <<
"] = " <<
zoff[
i];
123 midName = vsArgs[
"MidAbsName"];
124 midMat = vsArgs[
"MidAbsMat"];
125 midW = vArgs[
"MidAbsW"];
126 midT = vArgs[
"MidAbsT"];
131 <<
" Material " <<
midMat[
i] <<
" W " 137 sideD = vArgs[
"SideD"];
138 sideT = vArgs[
"SideT"];
140 for (
unsigned int i = 0;
i <
sideMat.size();
i++)
165 <<
") Rotation matrix " <<
rotns <<
":" 191 idName = sArgs[
"MotherName"];
196 <<
" idName " <<
idName <<
" NameSpace " 212 edm::LogVerbatim(
"HCalGeom") <<
"<<== End of DDHCalBarrelAlgo construction";
233 int nf = ntot - nsec;
253 std::vector<double> pgonZ = {-zmax, -zstep5,-zstep5,-zstep4,-zstep3,
254 -zstep2,-zstep1, 0, zstep1, zstep2,
255 zstep3, zstep4, zstep5, zstep5, zmax};
257 std::vector<double> pgonRmin = {rmid4,rmid3,rmid3,rmid2,rmid1,
259 rmid1,rmid2,rmid3,rmid3,rmid4};
265 std::vector<double> pgonZHalf = {0, zstep1,zstep2,zstep3,zstep4,zstep5,
268 std::vector<double> pgonRminHalf = {
rin,
rin,rmid1,rmid1,rmid2,rmid3,
287 <<
" and with " << nsec <<
" sections ";
288 for (
unsigned int i = 0;
i <pgonZ.size();
i++)
290 <<
"\tRmin = " << pgonRmin[
i] <<
"\tRmax = " 296 pgonRminHalf, pgonRmaxHalf);
304 <<
" and with " << nsec <<
" sections ";
305 for (
unsigned int i = 0;
i < pgonZHalf.size();
i++)
307 <<
"\tRmin = " << pgonRminHalf[
i]
308 <<
"\tRmax = " << pgonRmaxHalf[
i];
323 <<
" number 1 positioned in " << parentName
324 <<
" at " << r0 <<
" with " <<
rot;
336 <<
" and with " << nf <<
" sections ";
337 for (
unsigned int i = 0;
i < pgonZHalf.size();
i++)
339 <<
"\tRmin = " << pgonRminHalf[
i]
340 <<
"\tRmax = " << pgonRmaxHalf[
i];
345 pgonRminHalf, pgonRmaxHalf);
348 cpv.
position(genlogich, genlogic, 1, r0, rot);
351 <<
" number 1 positioned in " << genlogic.
name()
352 <<
" at " << r0 <<
" with " <<
rot;
356 cpv.
position(genlogich, genlogic, 2, r0, rot);
359 <<
" number 2 positioned in " 360 << genlogic.
name() <<
" at " << r0
371 <<
" with 1 sector from " 375 for (
unsigned int i = 0;
i < pgonZHalf.size();
i++)
377 <<
"\tRmin = " << pgonRminHalf[
i]
378 <<
"\tRmax = " << pgonRmaxHalf[
i];
382 1, -alpha, 2*alpha, pgonZHalf,
383 pgonRminHalf, pgonRmaxHalf);
386 double theta = 90._deg;
389 double phiy = phi + 90._deg;
399 <<
"rotation " << rotstr <<
"\t 90," 407 cpv.
position(seclogic, genlogich,
ii+1, r0, rotation);
410 <<
" number " <<
ii+1 <<
" positioned in " 411 << genlogich.
name() <<
" at " << r0
439 for (
int j = 0; j <
getRzones()-1; j++) {
440 if (rin >=
getRmax(j)) in = j+1;
449 std::vector<double> pgonZ, pgonRmin, pgonRmax;
451 pgonZ.emplace_back(0);
452 pgonRmin.emplace_back(rin);
453 pgonRmax.emplace_back(rout);
455 pgonZ.emplace_back(zout);
456 pgonRmin.emplace_back(rin);
457 pgonRmax.emplace_back(rout);
462 pgonRmin.emplace_back(pgonRmax[1]);
463 pgonRmax.emplace_back(pgonRmax[1]);
470 pgonZ.emplace_back(pgonZ[1] + deltaz);
471 pgonRmin.emplace_back(pgonRmin[1]);
472 pgonRmax.emplace_back(
getRmax(in));
475 pgonRmin.emplace_back(pgonRmin[2]);
476 pgonRmax.emplace_back(pgonRmax[2]);
481 pgonRmin.emplace_back(
getRmax(in));
482 pgonRmax.emplace_back(pgonRmax[1]);
486 pgonRmin.emplace_back(pgonRmin[2]);
487 pgonRmax.emplace_back(pgonRmax[2]);
492 pgonRmin.emplace_back(rout);
493 pgonRmax.emplace_back(rout);
500 double alpha1 =
alpha;
502 double rmid = 0.5*(rin+
rout);
504 alpha1 = atan(width/rmid);
509 <<
" Rmid " << rmid <<
" Reduced width " 515 <<
i <<
") Polyhedra made of " 517 <<
" with 1 sector from " 520 << nsec <<
" sections";
521 for (
unsigned int k=0;
k<pgonZ.size();
k++)
523 << pgonRmin[
k] <<
"\t" << pgonRmax[
k];
526 1, -alpha1, 2*alpha1,
527 pgonZ, pgonRmin, pgonRmax);
535 <<
" positioned in " << sector.
name()
536 <<
" at (0,0,0) with no rotation";
549 int nAbs,
double rin,
double d1,
550 double alpha1,
double d2,
551 double alpha2,
double t1,
576 if (rsi >=
getRmax(i)) in = i+1;
579 dy = 0.5*rsi*(
tan(alpha1)-
tan(alpha2));
582 y = 0.5*rsi*(
tan(alpha1)+
tan(alpha2));
590 <<
" of dimensions " << dx <<
", " << dy
605 <<
" positioned in " << mother.
name()
606 <<
" at " << r11 <<
" with no rotation\n" 607 <<
"DDHCalBarrelAlgo: " << glog.
name()
609 <<
" positioned in " << mother.
name()
610 <<
" at " << r12 <<
" with " <<
rot;
620 if (rsi >=
getRmax(i)) in = i+1;
623 dy = 0.5*rsi*
tan(alpha2);
633 <<
" of dimensions " << dx <<
", " << dy
647 <<
" Number " <<
idOffset+3 <<
" positioned in " 648 << mother.
name() <<
" at " << r21
649 <<
" with no rotation\nDDHCalBarrelAlgo: " 651 <<
" positioned in " << mother.
name() <<
" at " 652 << r22 <<
" with " <<
rot;
660 int nAbs,
double rin,
665 int k =
abs(nAbs) - 1;
672 std::vector<double> pgonZ, pgonRmin, pgonRmax;
674 pgonZ.emplace_back(0.0);
675 pgonRmin.emplace_back(rsi);
676 pgonRmax.emplace_back(rsi+
getSideT(k));
679 pgonRmin.emplace_back(rsi);
680 pgonRmax.emplace_back(pgonRmax[0]);
683 pgonRmin.emplace_back(pgonRmax[1]);
684 pgonRmax.emplace_back(pgonRmax[1]);
686 -alpha, 2*alpha, pgonZ, pgonRmin,
691 <<
" with 1 sector from " 694 << pgonZ.size() <<
" sections";
695 for (
unsigned int ii=0;
ii<pgonZ.size();
ii++)
697 << pgonRmin[
ii] <<
"\tRmax = " <<pgonRmax[
ii];
707 <<
" Number 1 positioned in " << laylog.
name()
708 <<
" at (0,0,0) with no rotation";
712 double rmid = pgonRmax[0];
718 -alpha1, 2*alpha1, pgonZ, pgonRmin,
722 <<
" Polyhedra made of " 724 <<
" with 1 sector from " 727 << pgonZ.size() <<
" sections";
728 for (
unsigned int ii=0;
ii<pgonZ.size();
ii++)
730 <<
"\tRmin = " << pgonRmin[
ii]
731 <<
"\tRmax = " << pgonRmax[
ii];
742 <<
" Number 1 positioned in " 744 <<
" at (0,0,0) with no rotation";
768 std::vector<double> pgonZ, pgonRmin, pgonRmax;
770 pgonZ.emplace_back(0.0);
771 pgonRmin.emplace_back(rsi);
775 pgonRmin.emplace_back(rsi);
776 pgonRmax.emplace_back(pgonRmax[0]);
779 pgonRmin.emplace_back(pgonRmax[1]);
780 pgonRmax.emplace_back(pgonRmax[1]);
782 2*alpha, pgonZ, pgonRmin, pgonRmax);
786 <<
" with 1 sector from " 789 << pgonZ.size() <<
" sections";
790 for (
unsigned int ii=0;
ii<pgonZ.size();
ii++)
792 << pgonRmin[
ii] <<
"\tRmax = " 803 <<
" Number 1 positioned in " << laylog.
name()
804 <<
" at (0,0,0) with no rotation";
807 double rmin = pgonRmin[0];
808 double rmax = pgonRmax[0];
810 for (
int i=0;
i<1;
i++) {
814 -alpha1, 2*alpha1, pgonZ, pgonRmin,
819 <<
" with 1 sector from " 822 << pgonZ.size() <<
" sections";
823 for (
unsigned int ii=0;
ii<pgonZ.size();
ii++)
825 <<
"\tRmin = " << pgonRmin[
ii]
826 <<
"\tRmax = " << pgonRmax[
ii];
837 <<
" Number 1 positioned in " 839 <<
" at (0,0,0) with no rotation";
846 pgonRmin[0] = rmid; pgonRmax[0] =
rmax;
851 -alpha1, 2*alpha1, pgonZ, pgonRmin,
856 <<
" with 1 sector from " 859 << pgonZ.size() <<
" sections";
860 for (
unsigned int ii=0;
ii<pgonZ.size();
ii++)
862 << pgonRmin[
ii] <<
"\tRmax = " 874 <<
" Number 1 positioned in " 876 <<
" at (0,0,0) with no rotation";
882 pgonRmin[0] = rmin; pgonRmax[0] = rmid;
883 pgonRmin[1] = rmin; pgonRmax[1] = rmid; pgonZ[1] =
getZoff(in) + rmin*
getTanTheta(in);
884 pgonRmin[2] = rmid; pgonRmax[2] = rmid; pgonZ[2] =
getZoff(in) + rmid*
getTanTheta(in);
887 -alpha1, 2*alpha1, pgonZ, pgonRmin,
891 <<
" Polyhedra made of " 893 <<
" with 1 sector from " 896 << pgonZ.size() <<
" sections";
897 for (
unsigned int ii=0;
ii<pgonZ.size();
ii++)
899 <<
"\tRmin = " << pgonRmin[
ii]
900 <<
"\tRmax = " << pgonRmax[
ii];
911 <<
" Number " <<
i <<
" positioned in " 912 << mother.
name() <<
" at (0,0,0) with no " 925 double dy,
double dz,
945 double dx1, dx2, shiftX;
964 <<
" of dimensions " << dx1 <<
", " << wid
969 double x = shiftX + dx1 -
dx;
973 <<
" Number 1 positioned in " << detector.
name()
974 <<
" at (" << x <<
"," << y
975 <<
",0) with no rotation";
982 <<
" of dimensions " << 0.5*
getDetTsc(
id)
983 <<
", " << wid <<
", " <<
dz;
992 <<
" Number " << copyNo <<
" positioned in " 993 << detector.
name() <<
" at (" << x <<
"," << y
994 <<
",0) with no rotation";
1000 <<
" of dimensions " << dx2 <<
", " << wid
1009 <<
" Number 1 positioned in " << detector.
name()
1010 <<
" at (" << x <<
"," << y
1011 <<
",0) with no rotation";
std::vector< std::string > absorbMat
std::string getSideAbsName(unsigned int i) const
int getNsectortot() const
std::string getLayerLabel(unsigned i) const
std::string getGenMaterial() const
std::vector< std::string > midMat
double getLayerD1(unsigned i) const
double getAbsorbT(unsigned int i) const
std::vector< double > sideAbsW
std::string getLayerMaterial(unsigned i) const
std::string getMidAbsName(unsigned int i) const
std::vector< std::string > layerLabel
double getRmax(unsigned int i) const
DDMaterial is used to define and access material information.
int getDetPosY(unsigned int i) const
double getLayerD2(unsigned i) const
double getSideAbsW(unsigned int i) const
std::vector< double > layerD2
Geom::Theta< T > theta() const
std::vector< std::string > layerMat
DDName is used to identify DDD entities uniquely.
constexpr NumType convertRadToDeg(NumType radians)
std::string getAbsorbMat(unsigned int i) const
double getLayerAlpha(unsigned i) const
std::vector< int > layerId
static std::string & ns()
std::vector< double > rmax
void constructInsideDetectors(const DDLogicalPart &detector, const std::string &name, int id, double dx, double dy, double dz, int type, DDCompactView &cpv)
std::string getDetMatPl() const
double getMidAbsT(unsigned int i) const
Compact representation of the geometrical detector hierarchy.
std::string formatAsDegreesInInteger(double radianVal)
A DDSolid represents the shape of a part.
void constructInsideSector(const DDLogicalPart §or, DDCompactView &cpv)
std::string getDetMat() const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Represents a uniquely identifyable rotation matrix.
double getZoff(unsigned int i) const
std::string getDetMatSc() const
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< double > layerT1
std::vector< double > detdP2
std::vector< double > detWidth2
double getDetT22(unsigned int i) const
double getLayerGap(unsigned int i) const
std::vector< std::string > sideAbsName
std::vector< double > detdP1
std::vector< double > absorbT
void execute(DDCompactView &cpv) override
std::vector< double > detWidth1
DDLogicalPart constructSideLayer(const DDLogicalPart &laylog, const std::string &nm, int nAbs, double rin, double alpha, DDCompactView &cpv)
double getDetT11(unsigned int i) const
void constructGeneralVolume(DDCompactView &cpv)
int getLayerAbsorb(unsigned int i) const
double getLayerT2(unsigned i) const
int getDetType(unsigned int i) const
double getDetdP1(unsigned int i) const
double getLayerT1(unsigned i) const
int getSideAbsorber() const
double getSideD(unsigned int i) const
double getMidAbsW(unsigned int i) const
std::string getSideAbsMat(unsigned int i) const
std::vector< double > layerGap
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
std::string getSideMat(unsigned int i) const
std::vector< double > layerAlpha
void constructInsideLayers(const DDLogicalPart &laylog, const std::string &name, int id, int nAbs, double rin, double d1, double alpha1, double d2, double alpha2, double t1, double t2, DDCompactView &cpv)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
double getTanTheta(unsigned int i) const
std::vector< double > detT22
std::vector< int > layerAbsorb
std::vector< std::string > sideAbsMat
std::vector< double > sideT
std::vector< double > detTsc
~DDHCalBarrelAlgo() override
double getDetTsc(unsigned int i) const
static DDSolid box(const DDName &name, double xHalf, double yHalf, double zHalf)
Creates a box with side length 2*xHalf, 2*yHalf, 2*zHalf.
int getLayerId(unsigned i) const
std::string getAbsorbName(unsigned int i) const
double getMiddleW() const
double getDetdP2(unsigned int i) const
std::vector< std::string > midName
std::vector< std::string > sideMat
std::vector< double > detT21
std::vector< int > detPosY
double getLayerWidth(unsigned i) const
double getAbsorbD(unsigned int i) const
std::vector< int > detType
double getDetT21(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)
std::vector< double > zoff
std::vector< double > sideD
std::vector< double > detT11
double getMiddleD() const
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
std::vector< double > absorbD
std::vector< double > ttheta
double getDetWidth2(unsigned int i) const
std::vector< double > theta
int getMidAbsorber() const
std::vector< double > layerWidth
std::vector< std::string > absorbName
double getDetT12(unsigned int i) const
std::vector< double > midW
double getDetWidth1(unsigned int i) const
std::vector< double > layerD1
double getSideT(unsigned int i) const
std::vector< double > detT12
std::string getMiddleMat() const
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)
std::vector< double > midT
std::vector< double > layerT2
DDLogicalPart constructMidLayer(const DDLogicalPart &laylog, const std::string &nm, double rin, double alpha, DDCompactView &cpv)
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
std::string getMidAbsMat(unsigned int i) const