9 namespace std{}
using namespace std;
16 #include "CLHEP/Units/GlobalSystemOfUnits.h"
19 LogDebug(
"HCalGeom") <<
"DDHCalTBZposAlgo test: Creating an instance";
32 shiftX = nArgs[
"ShiftX"];
33 shiftY = nArgs[
"ShiftY"];
34 zoffset = nArgs[
"Zoffset"];
35 dist = nArgs[
"Distance"];
36 tilt = nArgs[
"TiltAngle"];
37 copyNumber = int (nArgs[
"Number"]);
38 LogDebug(
"HCalGeom") <<
"DDHCalTBZposAlgo debug: Parameters for position"
39 <<
"ing--" <<
" Eta " <<
eta <<
"\tTheta "
40 <<
theta/CLHEP::deg <<
"\tShifts " << shiftX <<
", "
41 << shiftY <<
" along x, y axes; \tZoffest " << zoffset
42 <<
"\tRadial Distance " << dist <<
"\tTilt angle "
43 << tilt/CLHEP::deg <<
"\tcopyNumber " << copyNumber;
46 childName = sArgs[
"ChildName"];
48 LogDebug(
"HCalGeom") <<
"DDHCalTBZposAlgo debug: Parent " << parentName
49 <<
"\tChild " << childName <<
" NameSpace "
58 double thetax = 90.*CLHEP::deg -
theta;
59 double z = zoffset + dist*
tan(thetax);
60 double x = shiftX - shiftY*
sin(tilt);
61 double y = shiftY*
cos(tilt);
64 double tiltdeg = tilt/CLHEP::deg;
65 int itilt = int(tiltdeg+0.1);
68 if (tiltdeg < 100) rotstr =
"R0";
72 LogDebug(
"HCalGeom") <<
"DDHCalAngular test: Creating a new rotation "
73 <<
DDName(rotstr,idNameSpace) <<
"\t90, " << tiltdeg
74 <<
", 90, " << (tiltdeg+90) <<
", 0, 0";
75 rot =
DDrot(
DDName(rotstr, idNameSpace), 90*CLHEP::deg, tilt,
76 90*CLHEP::deg, (90*CLHEP::deg+tilt), 0.0, 0.0);
79 cpv.
position(child, mother, copyNumber, tran, rot);
80 LogDebug(
"HCalGeom") <<
"DDHCalTBZposAlgo test: " << child <<
" number "
81 << copyNumber <<
" positioned in " << mother
82 <<
" at " << tran <<
" with " <<
rot;
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()
std::string dbl_to_string(const double &in)
Converts only the integer part of a double to a string.
type of data representation of DDCompactView
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Represents a uniquely identifyable rotation matrix.
U second(std::pair< T, U > const &p)
Cos< T >::type cos(const T &t)
Tan< T >::type tan(const T &t)
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs)
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
void execute(DDCompactView &cpv)
virtual ~DDHCalTBZposAlgo()