17 #include "CLHEP/Units/GlobalPhysicalConstants.h" 18 #include "CLHEP/Units/GlobalSystemOfUnits.h" 21 edm::LogInfo(
"HGCalGeom") <<
"DDHGCalHEAlgo info: Creating an instance";
33 names = vsArgs[
"VolumeNames"];
34 thick = vArgs[
"Thickness"];
38 rotstr = sArgs[
"Rotation"];
43 <<
" volumes to be put with rotation " <<
rotstr 44 <<
" in " <<
layerType.size() <<
" layers and " 46 for (
unsigned int i=0;
i<
names.size(); ++
i)
48 <<
" filled with " <<
materials[
i] <<
" of type " 53 edm::LogInfo(
"HGCalGeom") <<
"Layer [" <<
i <<
"] with material type " 58 slopeB = nArgs[
"SlopeBottom"];
59 slopeT = vArgs[
"SlopeTop"];
65 <<
" " <<
slopeT.size() <<
" slopes for top";
66 for (
unsigned int i=0;
i<
slopeT.size(); ++
i)
82 edm::LogInfo(
"HGCalGeom") <<
"==>> Constructing DDHGCalHEAlgo...";
84 edm::LogInfo(
"HGCalGeom") <<
"<<== End of DDHGCalHEAlgo construction ...";
89 edm::LogInfo(
"HGCalGeom") <<
"DDHGCalHEAlgo test: \t\tInside Layers";
107 if((
i % 6)>2) zlayer = zz + thickModule;
110 double rinF = zi *
slopeB;
111 double rinB = zlayer *
slopeB;
116 double routB =
rMax(zo);
118 edm::LogInfo(
"HGCalGeom") <<
"DDHGCalHEAlgo test: Layer " <<
i <<
":" 119 << ii <<
":" << ityp <<
" Front " << zi <<
", " 120 << rinF <<
", " << routF <<
" Back " << zo
121 <<
", " << rinB <<
", " << routB;
126 0.5*thick[ii], parm.
theta,
136 << solid.
name() <<
" Trap made of " << matName
137 <<
" of dimensions " << 0.5*thick[
ii] <<
", " 138 << parm.
theta/CLHEP::deg <<
", " 139 << parm.
phi/CLHEP::deg <<
", " << parm.
yh1 140 <<
", " << parm.
bl1 <<
", " << parm.
tl1 141 <<
", " << parm.
alp/CLHEP::deg <<
", " 142 << parm.
yh2 <<
", " << parm.
bl2 <<
", " 143 << parm.
tl2 <<
", " << parm.
alp/CLHEP::deg;
145 cpv.
position(glog, module, copy, r1, rot);
147 <<
" number " << copy <<
" positioned in " 148 << module.
name() <<
" at " << r1 <<
" with " 156 double routB,
double zi,
double zo) {
163 edm::LogInfo(
"HGCalGeom") <<
"Input: Front " << rinF <<
" " << routF <<
" " 164 << zi <<
" Back " << rinB <<
" " << routB <<
" " 165 << zo <<
" Alpha " << alpha/CLHEP::deg <<
" Rout " 168 parm.
yh2 = parm.
yh1 = 0.5 * (rout*
cos(alpha) - rinB);
171 parm.
xpos = 0.5*(rout*
cos(alpha)+rinB);
173 parm.
zpos = 0.5*(zi+zo);
176 << parm.
bl1 <<
" " << parm.
tl1 <<
" " << parm.
yh2 177 <<
" " << parm.
bl2 <<
" " << parm.
tl2 <<
" " 178 << parm.
alp/CLHEP::deg <<
" "<<parm.
theta/CLHEP::deg
179 <<
" " << parm.
phi/CLHEP::deg <<
" Position " 186 double routB,
double zi,
double zo) {
193 edm::LogInfo(
"HGCalGeom") <<
"Input " << type <<
" Front " << rinF <<
" " 194 << routF <<
" " << zi <<
" Back " << rinB <<
" " 195 << routB <<
" " << zo <<
" Alpha " 196 << alpha/CLHEP::deg <<
" rout " << rout;
198 parm.
yh2 = parm.
yh1 = 0.5 * (rout*
cos(alpha) - rinB);
199 parm.
bl2 = parm.
bl1 = 0.5 * rinB *
tan(alpha);
200 parm.
tl2 = parm.
tl1 = 0.5 * rout *
sin(alpha);
203 parm.
xpos = 0.5*(rout*
cos(alpha)+rinB);
205 parm.
zpos = 0.5*(zi+zo);
206 parm.
alp = atan(0.5 *
tan(alpha));
213 double r =
sqrt (dx*dx + dy*dy);
214 edm::LogInfo(
"HGCalGeom") <<
"dx|dy|r " << dx <<
":" << dy <<
":" <<
r;
216 parm.
theta = atan (r/(zo-zi));
217 parm.
phi = atan2 (dy, dx);
222 << parm.
bl1 <<
" " << parm.
tl1 <<
" " << parm.
yh2 223 <<
" " << parm.
bl2 <<
" " << parm.
tl2 <<
" " 224 << parm.
alp/CLHEP::deg <<
" " <<parm.
theta/CLHEP::deg
225 <<
" " << parm.
phi/CLHEP::deg <<
" Position " 234 for (
unsigned int k=0;
k<
slopeT.size(); ++
k) {
239 edm::LogInfo(
"HGCalGeom") <<
"rMax : " << z <<
":" << ik <<
":" <<
r ;
std::vector< double > zMinBlock
std::vector< double > zFront
DDMaterial is used to define and access material information.
Sin< T >::type sin(const T &t)
void execute(DDCompactView &cpv) override
DDName is used to identify DDD entities uniquely.
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
static std::string & ns()
type of data representation of DDCompactView
~DDHGCalHEAlgo() override
std::vector< int > layerType
A DDSolid represents the shape of a part.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
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.
void constructLayers(const DDLogicalPart &, DDCompactView &cpv)
Cos< T >::type cos(const T &t)
Tan< T >::type tan(const T &t)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
std::vector< std::string > names
std::vector< int > heightType
std::vector< std::string > materials
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)
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string ©no, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
HGCalHEPar parameterLayer(double rinF, double routF, double rinB, double routB, double zi, double zo)
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
std::vector< double > thick
std::vector< double > slopeT
std::vector< double > rMaxFront
std::vector< int > copyNumber