27 using namespace angle_units::operators;
40 double getRin()
const {
return rin; }
45 double getRmax(
unsigned int i)
const {
return rmax[
i]; }
46 double getZoff(
unsigned int i)
const {
return zoff[
i]; }
62 double getSideD(
unsigned int i)
const {
return sideD[
i]; }
63 double getSideT(
unsigned int i)
const {
return sideT[
i]; }
308 nhalf = int(nArgs[
"NHalf"]);
310 rout = nArgs[
"ROut"];
311 rzones = int(nArgs[
"RZones"]);
313 rotns = sArgs[
"RotNameSpace"];
315 theta = vArgs[
"Theta"];
316 rmax = vArgs[
"RMax"];
317 zoff = vArgs[
"ZOff"];
330 <<
"\tzoff[" <<
i <<
"] = " <<
zoff[
i];
334 nLayers = int(nArgs[
"NLayers"]);
375 midName = vsArgs[
"MidAbsName"];
376 midMat = vsArgs[
"MidAbsMat"];
377 midW = vArgs[
"MidAbsW"];
378 midT = vArgs[
"MidAbsT"];
388 sideD = vArgs[
"SideD"];
389 sideT = vArgs[
"SideT"];
391 for (
unsigned int i = 0;
i <
sideMat.size();
i++)
413 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: Detector (" << nLayers <<
") Rotation matrix " <<
rotns <<
":"
435 idName = sArgs[
"MotherName"];
454 edm::LogVerbatim(
"HCalGeom") <<
"<<== End of DDHCalBarrelAlgo construction";
474 int nf = ntot - nsec;
494 std::vector<double> pgonZ = {-zmax,
510 std::vector<double> pgonRmin = {
511 rmid4, rmid3, rmid3, rmid2, rmid1, rmid1,
rin,
rin,
rin, rmid1, rmid1, rmid2, rmid3, rmid3, rmid4};
513 std::vector<double> pgonRmax = {
514 rout1, rout1,
rout,
rout,
rout,
rout,
rout,
rout,
rout,
rout,
rout,
rout,
rout, rout1, rout1};
516 std::vector<double> pgonZHalf = {0, zstep1, zstep2, zstep3, zstep4, zstep5, zstep5, zmax};
518 std::vector<double> pgonRminHalf = {
rin,
rin, rmid1, rmid1, rmid2, rmid3, rmid3, rmid4};
531 << nsec <<
" sections ";
532 for (
unsigned int i = 0;
i < pgonZ.size();
i++)
534 <<
"\tZ = " << pgonZ[
i] <<
"\tRmin = " << pgonRmin[
i] <<
"\tRmax = " << pgonRmax[
i];
543 << nsec <<
" sections ";
544 for (
unsigned int i = 0;
i < pgonZHalf.size();
i++)
546 <<
"\tZ = " << pgonZHalf[
i] <<
"\tRmin = " << pgonRminHalf[
i]
547 <<
"\tRmax = " << pgonRmaxHalf[
i];
560 << parentName <<
" at (0, 0, 0) with no rotation";
569 << nf <<
" sections ";
570 for (
unsigned int i = 0;
i < pgonZHalf.size();
i++)
572 <<
"\tZ = " << pgonZHalf[
i] <<
"\tRmin = " << pgonRminHalf[
i]
573 <<
"\tRmax = " << pgonRmaxHalf[
i];
580 cpv.
position(genlogich, genlogic, 1, r0, rot);
582 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << genlogich.
name() <<
" number 1 positioned in "
583 << genlogic.
name() <<
" at (0, 0, 0) with no rotation";
587 cpv.
position(genlogich, genlogic, 2, r0, rot);
589 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << genlogich.
name() <<
" number 2 positioned in "
590 << genlogic.
name() <<
" at " << r0 <<
" with " <<
rot;
600 for (
unsigned int i = 0;
i < pgonZHalf.size();
i++)
602 <<
"\tZ = " << pgonZHalf[
i] <<
"\tRmin = " << pgonRminHalf[
i]
603 <<
"\tRmax = " << pgonRmaxHalf[
i];
610 double theta = 90._deg;
613 double phiy = phi + 90._deg;
630 cpv.
position(seclogic, genlogich,
ii + 1, r0, rotation);
632 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << seclogic.
name() <<
" number " <<
ii + 1 <<
" positioned in "
633 << genlogich.
name() <<
" at " << r0 <<
" with " <<
rotation;
654 double rout = rin + width;
669 std::vector<double> pgonZ, pgonRmin, pgonRmax;
671 pgonZ.emplace_back(0);
672 pgonRmin.emplace_back(rin);
673 pgonRmax.emplace_back(rout);
675 pgonZ.emplace_back(zout);
676 pgonRmin.emplace_back(rin);
677 pgonRmax.emplace_back(rout);
682 pgonRmin.emplace_back(pgonRmax[1]);
683 pgonRmax.emplace_back(pgonRmax[1]);
690 pgonZ.emplace_back(pgonZ[1] + deltaz);
691 pgonRmin.emplace_back(pgonRmin[1]);
692 pgonRmax.emplace_back(
getRmax(in));
695 pgonRmin.emplace_back(pgonRmin[2]);
696 pgonRmax.emplace_back(pgonRmax[2]);
701 pgonRmin.emplace_back(
getRmax(in));
702 pgonRmax.emplace_back(pgonRmax[1]);
706 pgonRmin.emplace_back(pgonRmin[2]);
707 pgonRmax.emplace_back(pgonRmax[2]);
712 pgonRmin.emplace_back(rout);
713 pgonRmax.emplace_back(rout);
720 double alpha1 =
alpha;
722 double rmid = 0.5 * (rin +
rout);
724 alpha1 = atan(width / rmid);
728 <<
convertRadToDeg(alpha1) <<
" Rmid " << rmid <<
" Reduced width " << width;
732 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << name <<
" (Layer " <<
i <<
") Polyhedra made of "
735 for (
unsigned int k = 0;
k < pgonZ.size();
k++)
737 <<
"\t" << pgonZ[
k] <<
"\t" << pgonRmin[
k] <<
"\t" << pgonRmax[
k];
745 <<
" positioned in " << sector.
name() <<
" at (0,0,0) with no rotation";
776 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: \t\tInside layer " <<
id <<
"...";
800 dy = 0.5 * rsi * (
tan(alpha1) -
tan(alpha2));
803 y = 0.5 * rsi * (
tan(alpha1) +
tan(alpha2));
810 <<
" of dimensions " << dx <<
", " << dy <<
", " <<
dz;
823 <<
" positioned in " << mother.
name() <<
" at " << r11 <<
" with no rotation\n"
824 <<
"DDHCalBarrelAlgo: " << glog.
name() <<
" Number " <<
idOffset + 2
825 <<
" positioned in " << mother.
name() <<
" at " << r12 <<
" with " <<
rot;
839 dy = 0.5 * rsi *
tan(alpha2);
848 <<
" of dimensions " << dx <<
", " << dy <<
", " <<
dz;
861 << mother.
name() <<
" at " << r21
862 <<
" with no rotation\nDDHCalBarrelAlgo: " << glog.
name() <<
" Number " <<
idOffset + 4
863 <<
" positioned in " << mother.
name() <<
" at " << r22 <<
" with " <<
rot;
872 int k =
abs(nAbs) - 1;
880 std::vector<double> pgonZ, pgonRmin, pgonRmax;
882 pgonZ.emplace_back(0.0);
883 pgonRmin.emplace_back(rsi);
884 pgonRmax.emplace_back(rsi +
getSideT(k));
887 pgonRmin.emplace_back(rsi);
888 pgonRmax.emplace_back(pgonRmax[0]);
891 pgonRmin.emplace_back(pgonRmax[1]);
892 pgonRmax.emplace_back(pgonRmax[1]);
898 <<
" and with " << pgonZ.size() <<
" sections";
899 for (
unsigned int ii = 0;
ii < pgonZ.size();
ii++)
901 <<
"\tRmax = " << pgonRmax[
ii];
911 <<
" at (0,0,0) with no rotation";
915 double rmid = pgonRmax[0];
924 <<
convertRadToDeg(alpha1) <<
" and with " << pgonZ.size() <<
" sections";
925 for (
unsigned int ii = 0;
ii < pgonZ.size();
ii++)
927 <<
"\tRmax = " << pgonRmax[
ii];
936 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << log.
name() <<
" Number 1 positioned in "
937 << mother.
name() <<
" at (0,0,0) with no rotation";
959 std::vector<double> pgonZ, pgonRmin, pgonRmax;
961 pgonZ.emplace_back(0.0);
962 pgonRmin.emplace_back(rsi);
966 pgonRmin.emplace_back(rsi);
967 pgonRmax.emplace_back(pgonRmax[0]);
970 pgonRmin.emplace_back(pgonRmax[1]);
971 pgonRmax.emplace_back(pgonRmax[1]);
976 <<
convertRadToDeg(alpha) <<
" and with " << pgonZ.size() <<
" sections";
977 for (
unsigned int ii = 0;
ii < pgonZ.size();
ii++)
979 <<
"\tRmax = " << pgonRmax[
ii];
989 <<
" at (0,0,0) with no rotation";
992 double rmin = pgonRmin[0];
993 double rmax = pgonRmax[0];
995 for (
int i = 0;
i < 1;
i++) {
1003 <<
convertRadToDeg(alpha1) <<
" and with " << pgonZ.size() <<
" sections";
1004 for (
unsigned int ii = 0;
ii < pgonZ.size();
ii++)
1006 <<
"\tRmax = " << pgonRmax[
ii];
1015 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << log.
name() <<
" Number 1 positioned in "
1016 << mother.
name() <<
" at (0,0,0) with no rotation";
1036 <<
convertRadToDeg(alpha1) <<
" and with " << pgonZ.size() <<
" sections";
1037 for (
unsigned int ii = 0;
ii < pgonZ.size();
ii++)
1039 <<
"\tRmax = " << pgonRmax[
ii];
1049 <<
" at (0,0,0) with no rotation";
1069 <<
convertRadToDeg(alpha1) <<
" and with " << pgonZ.size() <<
" sections";
1070 for (
unsigned int ii = 0;
ii < pgonZ.size();
ii++)
1072 <<
"\tRmax = " << pgonRmax[
ii];
1081 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << log.
name() <<
" Number " <<
i <<
" positioned in "
1082 << mother.
name() <<
" at (0,0,0) with no "
1101 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: \t\tInside detector " <<
id <<
"...";
1116 double dx1, dx2, shiftX;
1135 <<
" of dimensions " << dx1 <<
", " << wid <<
", " <<
dz;
1139 double x = shiftX + dx1 -
dx;
1142 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << glog.
name() <<
" Number 1 positioned in " << detector.
name()
1143 <<
" at (" << x <<
"," << y <<
",0) with no rotation";
1148 <<
" of dimensions " << 0.5 *
getDetTsc(
id) <<
", " << wid <<
", " <<
dz;
1156 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << glog.
name() <<
" Number " << copyNo <<
" positioned in "
1157 << detector.
name() <<
" at (" << x <<
"," << y <<
",0) with no rotation";
1162 <<
" of dimensions " << dx2 <<
", " << wid <<
", " <<
dz;
1169 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << glog.
name() <<
" Number 1 positioned in " << detector.
name()
1170 <<
" at (" << x <<
"," << y <<
",0) with no rotation";
std::vector< std::string > absorbMat
Log< level::Info, true > LogVerbatim
static AlgebraicMatrix initialize()
const std::string & getDetMat() const
int getNsectortot() const
static std::vector< std::string > checklist log
std::vector< std::string > midMat
const std::string & getAbsorbName(unsigned int i) const
double getLayerD1(unsigned i) const
double getAbsorbT(unsigned int i) const
std::vector< double > sideAbsW
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string ©no, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
std::vector< std::string > layerLabel
const std::string & getSideMat(unsigned int i) const
const std::string & getAbsorbMat(unsigned int i) const
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
constexpr NumType convertRadToDeg(NumType radians)
std::vector< double > layerD2
Geom::Theta< T > theta() const
std::vector< std::string > layerMat
DDName is used to identify DDD entities uniquely.
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)
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)
const std::string & getGenMaterial() const
Represents a uniquely identifyable rotation matrix.
double getZoff(unsigned int i) const
U second(std::pair< T, U > const &p)
std::vector< double > layerT1
std::vector< double > detdP2
std::vector< double > detWidth2
double getDetT22(unsigned int i) const
const std::string & getDetMatSc() const
const std::string & getMidAbsName(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::vector< double > layerGap
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
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 ...
const std::string & getLayerMaterial(unsigned i) const
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
double getMiddleW() const
double getTheta(unsigned int i) const
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
double getDetdP2(unsigned int i) const
std::vector< std::string > midName
const std::string & getDetMatPl() const
std::vector< std::string > sideMat
std::vector< double > detT21
std::vector< int > detPosY
const std::string & getLayerLabel(unsigned i) const
double getLayerWidth(unsigned i) const
std::vector< int > detType
double getAbsorbD(unsigned int i) const
double getDetT21(unsigned int i) const
std::vector< double > zoff
const std::string & getMidAbsMat(unsigned int i) const
const std::string & getMiddleMat() const
std::vector< double > sideD
const std::string & getSideAbsName(unsigned int i) const
std::vector< double > detT11
double getMiddleD() const
#define DEFINE_EDM_PLUGIN(factory, type, name)
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
const std::string & getSideAbsMat(unsigned int i) const
static constexpr float d1
std::vector< double > midW
double getDetWidth1(unsigned int i) const
std::vector< double > layerD1
double getSideT(unsigned int i) const
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
std::vector< double > detT12
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