48 std::vector<std::string>
tag_;
65 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalWaferFullRotated: Creating an instance";
75 thick_ = nArgs[
"ModuleThickness"];
87 tag_ = vsArgs[
"WaferPlacementIndex"];
103 std::ostringstream st1;
104 for (
unsigned int i = 0;
i <
layers_.size(); ++
i)
108 nCells_ =
static_cast<int>(nArgs[
"NCells"]);
110 cellType_ =
static_cast<int>(nArgs[
"CellType"]);
120 std::ostringstream st2;
132 edm::LogVerbatim(
"HGCalGeom") <<
"==>> Executing DDHGCalWaferFullRotated...";
135 static constexpr
double tol = 0.00001;
136 static const double sqrt3 =
std::sqrt(3.0);
138 double RM2 = rM / sqrt3;
141 for (
unsigned int k = 0;
k <
tag_.size(); ++
k) {
143 std::vector<double> xM = {rM, 0, -rM, -rM, 0, rM};
144 std::vector<double> yM = {RM2, 2 * RM2, RM2, -RM2, -2 * RM2, -RM2};
146 std::vector<double> zx(2, 0), zy(2, 0),
scale(2, 1.0);
154 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalWaferFullRotated: " << solid.
name() <<
" extruded polygon made of " 155 << matName <<
" z|x|y|s (0) " <<
zw[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" 156 <<
scale[0] <<
" z|x|y|s (1) " <<
zw[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" 157 <<
scale[1] <<
" and " << xM.size() <<
" edges";
158 for (
unsigned int kk = 0;
kk < xM.size(); ++
kk)
163 std::vector<DDLogicalPart> glogs(
materials_.size());
167 double zi(-0.5 *
thick_), thickTot(0.0);
168 for (
unsigned int l = 0;
l <
layers_.size();
l++) {
171 double R2 =
r2 / sqrt3;
172 std::vector<double> xL = {
r2, 0, -
r2, -
r2, 0,
r2};
173 std::vector<double> yL = {R2, 2 * R2, R2, -R2, -2 * R2, -R2};
184 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalWaferFullRotated: Layer " <<
l <<
": " <<
i <<
": " << layerName <<
" " 192 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalWaferFullRotated: " << solid.
name() <<
" extruded polygon made of " 193 << matN <<
" z|x|y|s (0) " <<
zw[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" 194 <<
scale[0] <<
" z|x|y|s (1) " <<
zw[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" 195 <<
scale[1] <<
" and " << xL.size() <<
" edges";
196 for (
unsigned int kk = 0;
kk < xL.size(); ++
kk)
205 <<
" positioned in " << glogM.
name() <<
" at " << tran0 <<
" with no rotation";
211 for (
int u = 0; u < 2 *
nCells_; ++u) {
216 double yp = xy1.second;
217 double xp = xy1.first;
226 <<
"DDHGCalWaferFullRotated: " <<
cellNames_[cell] <<
" number " <<
copy <<
" positioned in " 227 << glogs[
i].name() <<
" at " << tran <<
" with no rotation";
236 edm::LogError(
"HGCalGeom") <<
"Thickness of the partition " <<
thick_ <<
" is smaller than " << thickTot
237 <<
": thickness of all its components **** ERROR ****";
239 edm::LogWarning(
"HGCalGeom") <<
"Thickness of the partition " <<
thick_ <<
" does not match with " << thickTot
240 <<
" of the components";
Log< level::Info, true > LogVerbatim
void execute(DDCompactView &cpv) override
static int32_t cellPlacementIndex(int32_t iz, int32_t frontBack, int32_t orient)
static int32_t packCellTypeUV(int type, int u, int v)
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string ©no, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
std::vector< double > layerSizeOff_
DDMaterial is used to define and access material information.
~DDHGCalWaferFullRotated() override=default
std::vector< int > cellOffset_
std::vector< int > copyNumber_
DDName is used to identify DDD entities uniquely.
static std::string & ns()
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
Log< level::Error, false > LogError
std::pair< int32_t, int32_t > cellUV2Cell(int32_t u, int32_t v, int32_t placementIndex, int32_t type)
Compact representation of the geometrical detector hierarchy.
A DDSolid represents the shape of a part.
std::vector< int > layers_
Represents a uniquely identifyable rotation matrix.
U second(std::pair< T, U > const &p)
std::vector< int > layerType_
std::vector< int > orient_
Abs< T >::type abs(const T &t)
std::vector< double > layerThick_
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
static int32_t waferFrontBack(int32_t index)
std::vector< std::string > cellNames_
std::vector< std::string > tag_
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
DDHGCalWaferFullRotated()
std::pair< double, double > cellUV2XY1(int32_t u, int32_t v, int32_t placementIndex, int32_t type)
static DDSolid extrudedpolygon(const DDName &name, const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &z, const std::vector< double > &zx, const std::vector< double > &zy, const std::vector< double > &zscale)
std::vector< std::string > materials_
std::vector< std::string > layerNames_
auto zw(V v) -> Vec2< typename std::remove_reference< decltype(v[0])>::type >
#define DEFINE_EDM_PLUGIN(factory, type, name)
Log< level::Warning, false > LogWarning
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation