71 thick_ = nArgs[
"ModuleThickness"];
93 std::ostringstream st1;
94 for (
unsigned int i = 0;
i <
layers_.size(); ++
i)
115 static constexpr
double tol = 0.00001;
116 static const double sqrt3 =
std::sqrt(3.0);
118 double RM2 = rM / sqrt3;
120 double r = 0.5 *
R * sqrt3;
122 double R2 =
r2 / sqrt3;
125 std::vector<double> xM = {rM, 0, -rM, -rM, 0, rM};
126 std::vector<double> yM = {RM2, 2 * RM2, RM2, -RM2, -2 * RM2, -RM2};
128 std::vector<double> zx(2, 0), zy(2, 0),
scale(2, 1.0);
135 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalWaferF: " << solid.
name() <<
" extruded polygon made of " << matName
136 <<
" z|x|y|s (0) " <<
zw[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
137 <<
" z|x|y|s (1) " <<
zw[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
138 <<
" and " << xM.size() <<
" edges";
139 for (
unsigned int k = 0;
k < xM.size(); ++
k)
144 std::vector<double> xL = {
r2, 0, -
r2, -
r2, 0,
r2};
145 std::vector<double> yL = {R2, 2 * R2, R2, -R2, -2 * R2, -R2};
146 std::vector<DDLogicalPart> glogs(
materials_.size());
147 double zi(-0.5 *
thick_), thickTot(0.0);
148 for (
unsigned int l = 0;
l <
layers_.size();
l++) {
163 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalWaferF: " << solid.
name() <<
" extruded polygon made of " << matN
164 <<
" z|x|y|s (0) " <<
zw[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
165 <<
" z|x|y|s (1) " <<
zw[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
166 <<
" and " << xL.size() <<
" edges";
167 for (
unsigned int k = 0;
k < xL.size(); ++
k)
176 <<
" positioned in " << glogM.
name() <<
" at " << tran0 <<
" with no rotation";
183 double y0 = (
cellType_ >= 3) ? 0.5 : 0.0;
184 double x0 = (
cellType_ >= 3) ? 0.5 : 1.0;
188 for (
int u = 0; u < 2 *
nCells_; ++u) {
191 double yp = (u - 0.5 *
v - n2 + y0) * 2 *
r;
192 double xp = (1.5 * (
v -
nCells_) + x0) *
R;
194 if ((u == 0) && (
v == 0))
196 else if ((u == 0) && (
v ==
nCells_ - voff))
204 else if ((u == (
nCells_ - uoff)) && (
v == 0))
208 else if ((
v - u) == (
nCells_ - voff))
212 else if (u == (2 *
nCells_ - 1))
214 else if ((u -
v) == (
nCells_ - uoff))
225 <<
"DDHGCalWaferF: " <<
cellNames_[cell] <<
" number " <<
copy <<
" positioned in " << glogs[
i].name()
226 <<
" at " << tran <<
" with no rotation";
235 edm::LogError(
"HGCalGeom") <<
"Thickness of the partition " <<
thick_ <<
" is smaller than " << thickTot
236 <<
": thickness of all its components **** ERROR ****";
238 edm::LogWarning(
"HGCalGeom") <<
"Thickness of the partition " <<
thick_ <<
" does not match with " << thickTot
239 <<
" of the components";
Log< level::Info, true > LogVerbatim
static int32_t packCellTypeUV(int type, int u, int v)
void execute(DDCompactView &cpv) override
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string ©no, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
DDMaterial is used to define and access material information.
std::vector< int > layerType_
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.
~DDHGCalWaferF() override
static std::string & ns()
Log< level::Error, false > LogError
Compact representation of the geometrical detector hierarchy.
A DDSolid represents the shape of a part.
Represents a uniquely identifyable rotation matrix.
U second(std::pair< T, U > const &p)
std::vector< double > layerThick_
std::vector< int > layers_
std::vector< std::string > materials_
std::vector< std::string > cellNames_
Abs< T >::type abs(const T &t)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
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 > copyNumber_
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 > 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