9 namespace std{}
using namespace std;
14 #include "CLHEP/Units/GlobalSystemOfUnits.h"
17 LogDebug(
"HCalGeom") <<
"DDHCalXtalAlgo info: Creating an instance";
32 angwidth = nArgs[
"AngWidth"];
33 iaxis = int (nArgs[
"Axis"]);
34 names = vsArgs[
"Names"];
36 LogDebug(
"HCalGeom") <<
"DDHCalXtalAlgo debug: Parameters for positioning:: "
37 <<
"Axis " << iaxis <<
"\tRadius " <<
radius
38 <<
"\tOffset " <<
offset <<
"\tDx " << dx <<
"\tDz "
39 << dz <<
"\tAngWidth " << angwidth/CLHEP::deg
40 <<
"\tNumbers " <<
names.size();
41 for (
unsigned int i = 0;
i <
names.size();
i++)
45 idName = sArgs[
"ChildName"];
47 LogDebug(
"HCalGeom") <<
"DDHCalXtalAlgo debug: Parent " << parentName
48 <<
"\tChild " << idName <<
" NameSpace " << idNameSpace;
55 phi[1] = 90*CLHEP::deg;
56 theta[1-iaxis] = 90*CLHEP::deg;
58 int number = (int)(
names.size());
59 for (
int i=0;
i<number;
i++) {
60 double angle = 0.5*angwidth*(2*
i+1-number);
61 theta[iaxis] = 90*CLHEP::deg +
angle;
64 phi[2] = 90*iaxis*CLHEP::deg;
67 phi[2] = 90*(2-3*iaxis)*CLHEP::deg;
69 pos[iaxis] = angle*(dz+
radius);
77 if (
abs(angle) > 0.01*CLHEP::deg) {
78 LogDebug(
"HCalGeom") <<
"DDHCalXtalAlgo test: Creating a new rotation "
79 << rotstr <<
"\t" << theta[0]/CLHEP::deg <<
","
80 << phi[0]/CLHEP::deg <<
"," << theta[1]/CLHEP::deg
81 <<
"," << phi[1]/CLHEP::deg <<
","
82 << theta[2]/CLHEP::deg <<
"," << phi[2]/CLHEP::deg;
83 rotation =
DDrot(
DDName(rotstr, idNameSpace), theta[0], phi[0], theta[1],
84 phi[1], theta[2], phi[2]);
86 cpv.
position(
DDName(idName, idNameSpace), parentName,
i+1, tran, rotation);
87 LogDebug(
"HCalGeom") <<
"DDHCalXtalAlgo test: "
88 <<
DDName(idName,idNameSpace) <<
" number " <<
i+1
89 <<
" positioned in " << parentName <<
" at " << tran
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.
unsigned int offset(bool)
virtual ~DDHCalXtalAlgo()
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs)
static const HistoName names[]
void execute(DDCompactView &cpv)
T angle(T x1, T y1, T z1, T x2, T y2, T z2)