28 waferSize_ = nArgs[
"WaferSize"];
29 cellType_ = (
int)(nArgs[
"CellType"]);
30 nColumns_ = (
int)(nArgs[
"NColumns"]);
31 nBottomY_ = (
int)(nArgs[
"NBottomY"]);
32 childNames_ = vsArgs[
"ChildNames"];
35 detectorType_ =
dbl_to_int(vArgs[
"DetectorType"]);
37 parentName_ =
parent().name();
40 << childNames_.size() <<
" children: " << childNames_[0] <<
"; " 41 << childNames_[1] <<
" in namespace " << idNameSpace_
42 <<
" positioned in " << nCellsRow_.size() <<
" rows and " 43 << nColumns_ <<
" columns with lowest column at " << nBottomY_
44 <<
" in mother " << parentName_ <<
" of size " << waferSize_;
45 for (
unsigned int k = 0;
k < nCellsRow_.size(); ++
k)
47 <<
"[" <<
k <<
"] Ncells " << nCellsRow_[
k] <<
" Edge rotations " 48 << angleEdges_[2 *
k] <<
":" << angleEdges_[2 *
k + 1]
49 <<
" Type of edge cells " << detectorType_[2 *
k] <<
":" 50 << detectorType_[2 *
k + 1];
58 double dx = 0.5 * waferSize_ / nColumns_;
59 double dy = 0.5 * dx *
tan(30._deg);
63 for (
unsigned int ir = 0; ir < nCellsRow_.size(); ++ir) {
64 int nx = 1 - nCellsRow_[ir];
65 double ypos = dy * ny;
66 for (
int ic = 0; ic < nCellsRow_[ir]; ++ic) {
70 name = childNames_[detectorType_[2 * ir]];
71 irot = angleEdges_[2 * ir];
72 }
else if (ic + 1 == nCellsRow_[ir]) {
73 name = childNames_[detectorType_[2 * ir + 1]];
74 irot = angleEdges_[2 * ir + 1];
84 <<
"DDHGCalWaferAlgo: Creating new rotation " 85 <<
DDName(rotstr, idNameSpace_) <<
"\t90, " << irot
86 <<
", 90, " << (irot + 90) <<
", 0, 0";
88 rot =
DDrot(
DDName(rotstr, idNameSpace_), 90._deg, phi, 90._deg,
92 double xpos = dx * nx;
95 int copy = cellType_ * 1000 + kount;
100 <<
"DDHGCalWafer: " <<
DDName(
name, idNameSpace_) <<
" number " 101 << copy <<
" positioned in " << parentName_ <<
" at " << tran
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
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 position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string ©no, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
void execute(DDCompactView &cpv) override