9 namespace std{}
using namespace std;
14 #include "CLHEP/Units/GlobalSystemOfUnits.h"
17 LogDebug(
"HCalGeom") <<
"DDHCalTestBeamAlgo test: Creating an instance";
32 distanceZ = nArgs[
"DistZ"];
34 copyNumber = int (nArgs[
"Number"]);
36 LogDebug(
"HCalGeom") <<
"DDHCalTestBeamAlgo debug: Parameters for position"
37 <<
"ing--" <<
" Eta " <<
eta <<
"\tPhi "
38 <<
phi/CLHEP::deg <<
"\tTheta " <<
theta/CLHEP::deg
39 <<
"\tDistance " <<
distance <<
"/" << distanceZ <<
"/"
40 << dist <<
"\tDz " << dz <<
"\tcopyNumber " << copyNumber;
43 childName = sArgs[
"ChildName"];
45 LogDebug(
"HCalGeom") <<
"DDHCalTestBeamAlgo debug: Parent " << parentName
46 <<
"\tChild " << childName <<
" NameSpace "
52 double thetax = 90.*CLHEP::deg +
theta;
53 double sthx =
sin(thetax);
54 if (
abs(sthx)>1.
e-12) sthx = 1./sthx;
57 double thetay = 90.*CLHEP::deg;
58 double phiy = 90.*CLHEP::deg +
phi;
59 double thetaz =
theta;
63 string rotstr = childName;
64 LogDebug(
"HCalGeom") <<
"DDHCalTestBeamAlgo test: Creating a new rotation "
65 << rotstr <<
"\t" << thetax/CLHEP::deg <<
","
66 << phix/CLHEP::deg <<
"," << thetay/CLHEP::deg <<
","
67 << phiy/CLHEP::deg <<
"," << thetaz/CLHEP::deg <<
","
69 rotation =
DDrot(
DDName(rotstr, idNameSpace), thetax, phix, thetay, phiy,
72 double r = dist*
sin(theta);
73 double xpos = r*
cos(phi);
74 double ypos = r*
sin(phi);
75 double zpos = dist*
cos(theta);
79 cpv.
position(
DDName(childName,idNameSpace), parentName,copyNumber, tran,rotation);
80 LogDebug(
"HCalGeom") <<
"DDHCalTestBeamAlgo test: "
81 <<
DDName(childName, idNameSpace) <<
" number "
82 << copyNumber <<
" positioned in " << parentName
83 <<
" at " << tran <<
" with " <<
rotation;
85 xpos = (dist-dz)*
sin(theta)*
cos(phi);
86 ypos = (dist-dz)*
sin(theta)*
sin(phi);
87 zpos = (dist-dz)*
cos(theta);
89 edm::LogInfo(
"HCalGeom") <<
"DDHCalTestBeamAlgo: Suggested Beam position "
90 <<
"(" << xpos <<
", " << ypos <<
", " << zpos
91 <<
") and (dist, eta, phi) = (" << (dist-dz) <<
", "
92 <<
eta <<
", " << phi <<
")";
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
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
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Represents a uniquely identifyable rotation matrix.
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
virtual ~DDHCalTestBeamAlgo()
void execute(DDCompactView &cpv)
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs)