20 using namespace angle_units::operators;
61 waferSize_ = nArgs[
"WaferSize"];
62 cellType_ = (int)(nArgs[
"CellType"]);
63 nColumns_ = (int)(nArgs[
"NColumns"]);
64 nBottomY_ = (int)(nArgs[
"NBottomY"]);
65 childNames_ = vsArgs[
"ChildNames"];
68 detectorType_ =
dbl_to_int(vArgs[
"DetectorType"]);
70 parentName_ =
parent().name();
72 edm::LogVerbatim(
"HGCalGeom") << childNames_.size() <<
" children: " << childNames_[0] <<
"; " << childNames_[1]
73 <<
" in namespace " << idNameSpace_ <<
" positioned in " << nCellsRow_.size()
74 <<
" rows and " << nColumns_ <<
" columns with lowest column at " << nBottomY_
75 <<
" in mother " << parentName_ <<
" of size " << waferSize_;
76 for (
unsigned int k = 0;
k < nCellsRow_.size(); ++
k)
77 edm::LogVerbatim(
"HGCalGeom") <<
"[" <<
k <<
"] Ncells " << nCellsRow_[
k] <<
" Edge rotations "
78 << angleEdges_[2 *
k] <<
":" << angleEdges_[2 *
k + 1] <<
" Type of edge cells "
79 << detectorType_[2 *
k] <<
":" << detectorType_[2 *
k + 1];
87 double dx = 0.5 * waferSize_ / nColumns_;
88 double dy = 0.5 * dx *
tan(30._deg);
92 for (
unsigned int ir = 0; ir < nCellsRow_.size(); ++ir) {
93 int nx = 1 - nCellsRow_[ir];
94 double ypos = dy * ny;
95 for (
int ic = 0; ic < nCellsRow_[ir]; ++ic) {
99 name = childNames_[detectorType_[2 * ir]];
100 irot = angleEdges_[2 * ir];
101 }
else if (ic + 1 == nCellsRow_[ir]) {
102 name = childNames_[detectorType_[2 * ir + 1]];
103 irot = angleEdges_[2 * ir + 1];
112 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalWaferAlgo: Creating new rotation " <<
DDName(rotstr, idNameSpace_)
113 <<
"\t90, " << irot <<
", 90, " << (irot + 90) <<
", 0, 0";
115 rot =
DDrot(
DDName(rotstr, idNameSpace_), 90._deg, phi, 90._deg, (90._deg + phi), 0, 0);
118 double xpos = dx * nx;
126 <<
" positioned in " << parentName_ <<
" at " << tran <<
" with " <<
rot;
Log< level::Info, true > LogVerbatim
static AlgebraicMatrix initialize()
constexpr double convertDegToRad(NumType degrees)
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=nullptr)
DDName is used to identify DDD entities uniquely.
static std::string & ns()
std::vector< int > detectorType_
Compact representation of the geometrical detector hierarchy.
Represents a uniquely identifyable rotation matrix.
std::vector< std::string > childNames_
std::vector< int > nCellsRow_
Tan< T >::type tan(const T &t)
std::string formatAsDegrees(double radianVal)
static int32_t packCellType6(int type, int cell)
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
std::vector< int > angleEdges_
#define DEFINE_EDM_PLUGIN(factory, type, name)
void execute(DDCompactView &cpv) override
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation