18 #include "CLHEP/Units/GlobalPhysicalConstants.h"
19 #include "CLHEP/Units/GlobalSystemOfUnits.h"
22 edm::LogInfo(
"HCalGeom") <<
"DDHCalEndcapModuleAlgo info: Creating an instance";
37 rotstr = sArgs[
"Rotation"];
38 sectors = int (nArgs[
"Sectors"]);
39 edm::LogInfo(
"HCalGeom") <<
"DDHCalEndcapModuleAlgo: General material "
41 <<
"\tPlastic " <<
plasticMat <<
"\tScintillator "
48 ziDip = nArgs[
"ZiDip"];
56 <<
"\tModuleThick " <<
moduleThick <<
"\tLayerThick "
71 modType = (int)(nArgs[
"ModType"]);
75 <<
"\tslopeTop " <<
slopeTop <<
"\tslopeTopF "
77 <<
"\tmodNumber " <<
modNumber <<
"\tlayerType "
98 idName = sArgs[
"MotherName"];
103 edm::LogInfo(
"HCalGeom") <<
"DDHCalEndcapModuleAlgo debug: Parent "
104 << parentName <<
" " <<
modName <<
" idName "
116 edm::LogInfo(
"HCalGeom") <<
"==>> Constructing DDHCalEndcapModuleAlgo...";
121 edm::LogInfo(
"HCalGeom") <<
"<<== End of DDHCalEndcapModuleAlgo construction ...";
127 edm::LogInfo(
"HCalGeom") <<
"DDHCalEndcapModuleAlgo test: \t\tInside module0";
142 for (
unsigned int iphi=0; iphi<
phiName.size(); iphi++) {
150 <<
" Trap made of " << plasName
152 <<
", 0, 0, " << parm.
yh1 <<
", " << parm.
bl1
153 <<
", " << parm.
tl1 <<
", " << parm.
alp/CLHEP::deg
154 <<
", " << parm.
yh2 <<
", " << parm.
bl2 <<
", "
155 << parm.
tl2 <<
", " << parm.
alp/CLHEP::deg;
161 <<
" number " <<
idOffset+layer+1 <<
" positioned in "
162 << module.
name() <<
" at " << r1 <<
" with " <<
rot;
171 double zo = zi + 0.5*
dzStep;
172 double rinF, routF, rinB, routB;
189 edm::LogInfo(
"HCalGeom") <<
"DDHCalEndcapModuleAlgo test: Front "
190 << zi <<
", " << rinF <<
", " << routF <<
" Back "
191 << zo <<
", " << rinB <<
", " << routB;
196 <<
" Param " << parm.
yh1 <<
", " << parm.
bl1 <<
", "
197 << parm.
tl1 <<
", " << parm.
yh2 <<
", " << parm.
bl2
210 <<
" Trap made of " << matName <<
" of dimensions "
212 <<
", " << parm.
phi/CLHEP::deg <<
", " << parm.
yh1
213 <<
", " << parm.
bl1 <<
", " << parm.
tl1 <<
", "
214 << parm.
alp/CLHEP::deg <<
", " << parm.
yh2 <<
", "
215 << parm.
bl2 <<
", " << parm.
tl2 <<
", "
216 << parm.
alp/CLHEP::deg;
220 cpv.
position(glog, module, 1, r2, rot);
222 <<
" number 1 positioned in " << module.
name()
223 <<
" at " << r2 <<
" with " <<
rot;
229 edm::LogInfo(
"HCalGeom") <<
"DDHCalEndcapModuleAlgo test: \t\tInside module";
247 double zo = zi + 0.5*
dzStep;
249 for (
unsigned int iphi=0; iphi<
phiName.size(); iphi++) {
261 edm::LogInfo(
"HCalGeom") <<
"DDHCalEndcapModuleAlgo test: Layer " <<
i
262 <<
" Phi " << iphi <<
" Front " << ziAir <<
", "
263 << rinF <<
", " << routF <<
" Back " << zo
264 <<
", " << rinB <<
", " << routB;
272 0.5*moduleThick, parm.
theta, parm.
phi,
275 edm::LogInfo(
"HCalGeom") <<
"DDHCalEndcapModuleAlgo test: "
276 << solid.
name() <<
" Trap made of " << matName
277 <<
" of dimensions " << 0.5*moduleThick <<
", "
278 << parm.
theta/CLHEP::deg <<
", "
279 << parm.
phi/CLHEP::deg <<
", " << parm.
yh1
280 <<
", " << parm.
bl1 <<
", " << parm.
tl1 <<
", "
281 << parm.
alp/CLHEP::deg <<
", " << parm.
yh2
282 <<
", " << parm.
bl2 <<
", " << parm.
tl2 <<
", "
283 << parm.
alp/CLHEP::deg;
287 cpv.
position(glog, module, layer+1, r1, rot);
289 <<
" number " << layer+1 <<
" positioned in "
290 << module.
name() <<
" at " << r1 <<
" with "
294 parm.
yh1 = 0.5 * (routF - rinB) -
getTrim(iphi);
303 <<
" Trap made of " << plasName
305 <<
", 0, 0, " << parm.
yh1 <<
", " << parm.
bl1
306 <<
", " << parm.
tl1 <<
", "<< parm.
alp/CLHEP::deg
307 <<
", " << parm.
yh1 <<
", " << parm.
bl1 <<
", "
308 << parm.
tl1 <<
", " << parm.
alp/CLHEP::deg;
311 double ypos = 0.5*(routF+rinB) - parm.
xpos;
316 <<
" positioned in " << glog.
name() <<
" at "
317 <<
r2 <<
" with no rotation";
337 edm::LogInfo(
"HCalGeom") <<
"Input " << iphi <<
" Alpha " <<alpha/CLHEP::deg;
359 double yh = 0.5 * (rout - rin);
360 double bl = 0.5 * rin *
tan (alpha);
361 double tl = 0.5 * rout *
tan(alpha);
362 parm.
xpos = 0.5 * (rin + rout);
363 parm.
ypos = 0.5 * (bl + tl);
364 parm.
zpos = 0.5 * (zi + zo);
368 parm.
alp = atan(0.5 *
tan(alpha));
375 << parm.
bl1 <<
" " << parm.
tl1 <<
" "
376 << parm.
alp/CLHEP::deg <<
" Position " << parm.
xpos
377 <<
" " << parm.
ypos <<
" " << parm.
zpos;
384 double routF,
double rinB,
double routB,
385 double zi,
double zo) {
391 edm::LogInfo(
"HCalGeom") <<
"Input " << iphi <<
" Front " << rinF <<
" "
392 << routF <<
" " << zi <<
" Back " << rinB <<
" "
393 << routB <<
" " << zo<<
" Alpha " <<alpha/CLHEP::deg;
395 parm.
yh1 = 0.5 * (routF - rinB);
396 parm.
bl1 = 0.5 * rinB *
tan(alpha);
397 parm.
tl1 = 0.5 * routF *
tan(alpha);
398 parm.
yh2 = 0.5 * (routF - rinB);
399 parm.
bl2 = 0.5 * rinB *
tan(alpha);
400 parm.
tl2 = 0.5 * routF *
tan(alpha);
401 double dx = 0.25* (parm.
bl2+parm.
tl2-parm.
bl1-parm.
tl1);
402 double dy = 0.5 * (rinB+routF-rinB-routF);
403 parm.
xpos = 0.25*(rinB+routF+rinB+routF);
405 parm.
zpos = 0.5*(zi+zo);
406 parm.
alp = atan(0.5 *
tan(alpha));
413 double r =
sqrt (dx*dx + dy*dy);
414 edm::LogInfo(
"HCalGeom") <<
"dx|dy|r " << dx <<
":" << dy <<
":" <<
r;
416 parm.
theta = atan (r/(zo-zi));
417 parm.
phi = atan2 (dy, dx);
422 << parm.
bl1 <<
" " << parm.
tl1 <<
" " << parm.
yh2
423 <<
" " << parm.
bl2 <<
" " << parm.
tl2 <<
" "
424 << parm.
alp/CLHEP::deg <<
" " <<parm.
theta/CLHEP::deg
425 <<
" " << parm.
phi/CLHEP::deg <<
" Position "
443 <<
" Trap made of " <<
scintMat <<
" of dimensions "
444 << 0.5*dz <<
", 0, 0, " << parm.
yh1 <<
", "
445 << parm.
bl1 <<
", " << parm.
tl1 <<
", "
446 << parm.
alp/CLHEP::deg <<
", " << parm.
yh1 <<
", "
447 << parm.
bl1 <<
", " << parm.
tl1 <<
", "
448 << parm.
alp/CLHEP::deg;
453 edm::LogInfo(
"HCalGeom") <<
"DDHCalEndcapModuleAlgo test: " << glog.name()
454 <<
" number " <<
id <<
" positioned in "
455 << detector.
name() <<
" at (0,0,0) with no rotation";
void constructInsideModule(DDLogicalPart module, DDCompactView &cpv)
HcalEndcapPar parameterLayer(unsigned int iphi, double rinF, double routF, double rinB, double routB, double zi, double zo)
DDMaterial is used to define and access material information.
std::vector< int > layerNumber
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.
static std::string & ns()
type of data representation of DDCompactView
A DDSolid represents the shape of a part.
HcalEndcapPar parameterLayer0(unsigned int iphi)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
void execute(DDCompactView &cpv)
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 constructInsideModule0(DDLogicalPart module, DDCompactView &cpv)
std::vector< std::string > phiName
Tan< T >::type tan(const T &t)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
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)
std::vector< std::string > layerName
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs)
double getTrim(unsigned int j) const
virtual ~DDHCalEndcapModuleAlgo()
double getRout(double z) const
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
void constructScintLayer(DDLogicalPart detector, double dz, DDHCalEndcapModuleAlgo::HcalEndcapPar parm, std::string nm, int id, DDCompactView &cpv)