32 cellSize = nArgs[
"CellSize"];
33 cellType = (
int)(nArgs[
"CellType"]);
34 childNames = vsArgs[
"ChildNames"];
38 detectorType =
dbl_to_int(vArgs[
"DetectorType"]);
41 << childNames.size() <<
" children: " << childNames[0] <<
"; " 42 << childNames[1] <<
" positioned " << positionX.size()
43 <<
" times with cell size " << cellSize;
44 for (
unsigned int k = 0;
k < positionX.size(); ++
k)
46 <<
"[" <<
k <<
"] x " << positionX[
k] <<
" y " << positionY[
k]
47 <<
" angle " <<
angles[
k] <<
" detector " << detectorType[
k];
49 rotns = sArgs[
"RotNameSpace"];
51 parentName =
parent().name();
54 <<
"DDHGCalWaferAlgo debug: Parent " << parentName <<
" NameSpace " 55 << idNameSpace <<
" for Rotation " << rotns;
63 double dx = 0.5 * cellSize;
64 double dy = 0.5 * dx *
tan(30._deg);
66 for (
unsigned int k = 0;
k < positionX.size(); ++
k) {
77 <<
"DDHGCalWaferAlgo: Creating new rotation " 79 << (
angles[
k] + 90) <<
", 0, 0";
81 rotation =
DDrot(
DDName(rotstr, rotns), 90._deg, phi,
82 90._deg, (90._deg + phi), 0, 0);
85 double xpos = dx * positionX[
k];
86 double ypos = dy * positionY[
k];
88 int copy = cellType * 1000 +
k;
89 cpv.
position(
DDName(name, idNameSpace), parentName, copy, tran, rotation);
92 <<
"DDHGCalWaferAlgo: " <<
DDName(name, idNameSpace) <<
" number " 93 << copy <<
" positioned in " << parentName <<
" at " << tran
DDName is used to identify DDD entities uniquely.
static std::string & ns()
Compact representation of the geometrical detector hierarchy.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Represents a uniquely identifyable rotation matrix.
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
Tan< T >::type tan(const T &t)
constexpr long double convertDegToRad(NumType degrees)
std::string formatAsDegrees(double radianVal)
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string ©no, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
~DDHGCalWaferAlgo() override
void execute(DDCompactView &cpv) override