77 material_ = sArgs[
"ModuleMaterial"];
78 thick_ = nArgs[
"Thickness"];
79 zMinBlock_ = nArgs[
"zMinBlock"];
80 moduleThick_ = nArgs[
"ModuleThick"];
81 tagLayer_ = vsArgs[
"TagLayer"];
82 tagSector_ = vsArgs[
"TagSector"];
83 parts_ =
static_cast<int>(nArgs[
"Parts"]);
85 dphi_ = (2._pi) / tagSector_.size();
87 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalPassive: " << tagLayer_.size() <<
" Modules with base name " 88 <<
parent().name() <<
" made of " << material_ <<
" T " << thick_ <<
" Sectors " 89 << tagSector_.size() <<
" Parts " << parts_ <<
" phi0 " <<
convertRadToDeg(phi0_);
90 for (
unsigned int i = 0;
i < tagLayer_.size(); ++
i)
91 edm::LogVerbatim(
"HGCalGeom") <<
"Layer " <<
i <<
" Tag " << tagLayer_[
i] <<
" T " << moduleThick_;
92 for (
unsigned int i = 0;
i < tagSector_.size(); ++
i)
96 layerNames_ = vsArgs[
"LayerNames"];
97 materials_ = vsArgs[
"LayerMaterials"];
98 layerThick_ = vArgs[
"LayerThickness"];
100 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalPassive: " << layerNames_.size() <<
" types of volumes";
101 for (
unsigned int i = 0;
i < layerNames_.size(); ++
i)
102 edm::LogVerbatim(
"HGCalGeom") <<
"Volume [" <<
i <<
"] " << layerNames_[
i] <<
" of thickness " << layerThick_[
i]
103 <<
" filled with " << materials_[
i];
107 std::ostringstream st1;
108 for (
unsigned int i = 0;
i < layerType_.size(); ++
i)
109 st1 <<
" [" <<
i <<
"] " << layerType_[
i];
110 edm::LogVerbatim(
"HGCalGeom") <<
"There are " << layerType_.size() <<
" blocks" << st1.str();
113 shiftTop_ = nArgs[
"ShiftTop"];
114 shiftBot_ = nArgs[
"ShiftBottom"];
116 edm::LogVerbatim(
"HGCalGeom") <<
"Shifts st the top " << shiftTop_ <<
" and at the bottom " << shiftBot_;
118 slopeB_ = vArgs[
"SlopeBottom"];
119 zFrontB_ = vArgs[
"ZFrontBottom"];
120 rMinFront_ = vArgs[
"RMinFront"];
121 slopeT_ = vArgs[
"SlopeTop"];
122 zFrontT_ = vArgs[
"ZFrontTop"];
123 rMaxFront_ = vArgs[
"RMaxFront"];
125 for (
unsigned int i = 0;
i < slopeB_.size(); ++
i)
126 edm::LogVerbatim(
"HGCalGeom") <<
"Bottom Block [" <<
i <<
"] Zmin " << zFrontB_[
i] <<
" Rmin " << rMinFront_[
i]
127 <<
" Slope " << slopeB_[
i];
128 for (
unsigned int i = 0;
i < slopeT_.size(); ++
i)
129 edm::LogVerbatim(
"HGCalGeom") <<
"Top Block [" <<
i <<
"] Zmin " << zFrontT_[
i] <<
" Rmax " << rMaxFront_[
i]
130 <<
" Slope " << slopeT_[
i];
141 double zim(zMinBlock_);
143 for (
unsigned int j = 0;
j < tagLayer_.size(); ++
j) {
145 double zo = zim + moduleThick_;
148 for (
unsigned int k = 0;
k < tagSector_.size(); ++
k) {
150 double phi1 = phi0_ +
k * dphi_;
151 double phi2 = phi1 + dphi_;
152 double phi0 = phi1 + 0.5 * dphi_;
154 std::vector<double> xM, yM;
156 xM = {rinB *
cos(phi1), routF *
cos(phi1), routF *
cos(phi2), rinB *
cos(phi2)};
157 yM = {rinB *
sin(phi1), routF *
sin(phi1), routF *
sin(phi2), rinB *
sin(phi2)};
160 std::vector<double> xTmp = {rinB *
cos(phi1),
166 std::vector<double> yTmp = {rinB *
sin(phi1),
175 std::vector<double>
zw = {-0.5 * thick_, 0.5 * thick_};
176 std::vector<double> zx(2, 0), zy(2, 0),
scale(2, 1.0);
182 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalPassive: " << solid.
name() <<
" extruded polygon made of " << matName
183 <<
" z|x|y|s (0) " <<
zw[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
184 <<
" z|x|y|s (1) " <<
zw[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
185 <<
" and " << xM.size() <<
" edges";
186 for (
unsigned int kk = 0;
kk < xM.size(); ++
kk)
191 std::vector<DDLogicalPart> glogs(materials_.size());
192 std::vector<int> copyNumber(materials_.size(), 1);
193 double zi(-0.5 * thick_), thickTot(0.0);
194 for (
unsigned int l = 0;
l < layerType_.size();
l++) {
195 unsigned int i = layerType_[
l];
196 if (copyNumber[
i] == 1) {
197 zw[0] = -0.5 * layerThick_[
i];
198 zw[1] = 0.5 * layerThick_[
i];
206 <<
" extruded polygon made of " << matN <<
" z|x|y|s (0) " <<
zw[0] <<
":" 207 << zx[0] <<
":" << zy[0] <<
":" <<
scale[0] <<
" z|x|y|s (1) " <<
zw[1] <<
":" 208 << zx[1] <<
":" << zy[1] <<
":" <<
scale[1] <<
" and " << xM.size() <<
" edges";
209 for (
unsigned int kk = 0;
kk < xM.size(); ++
kk)
217 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalPassive: " << glogs[
i].name() <<
" number " << copyNumber[
i]
218 <<
" positioned in " << glogM.
name() <<
" at " << tran0 <<
" with no rotation";
221 zi += layerThick_[
i];
222 thickTot += layerThick_[
i];
224 if ((
std::abs(thickTot - thick_) >= tol) && (!layerType_.empty())) {
225 if (thickTot > thick_) {
226 edm::LogError(
"HGCalGeom") <<
"Thickness of the partition " << thick_ <<
" is smaller than " << thickTot
227 <<
": thickness of all its components **** ERROR ****";
229 edm::LogWarning(
"HGCalGeom") <<
"Thickness of the partition " << thick_ <<
" does not match with " << thickTot
230 <<
" of the components";
Log< level::Info, true > LogVerbatim
static AlgebraicMatrix initialize()
constexpr double convertDegToRad(NumType degrees)
std::vector< double > rMaxFront_
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< std::string > tagSector_
constexpr NumType convertRadToDeg(NumType radians)
Sin< T >::type sin(const T &t)
std::vector< std::string > tagLayer_
std::vector< std::string > layerNames_
DDName is used to identify DDD entities uniquely.
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< std::string > materials_
std::vector< double > zFrontB_
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
std::vector< double > rMinFront_
std::vector< double > layerThick_
std::vector< int > layerType_
std::vector< double > zFrontT_
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
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< double > slopeB_
std::vector< double > slopeT_
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
void execute(DDCompactView &cpv) override