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"]);
87 dphi_ = (2._pi) / tagSector_.size();
89 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalPassive: " << tagLayer_.size() <<
" Modules with base name " 90 <<
parent().name() <<
" made of " << material_ <<
" T " << thick_ <<
" Sectors " 91 << tagSector_.size() <<
" Parts " << parts_ <<
" phi0 " <<
convertRadToDeg(phi0_);
92 for (
unsigned int i = 0;
i < tagLayer_.size(); ++
i)
93 edm::LogVerbatim(
"HGCalGeom") <<
"Layer " <<
i <<
" Tag " << tagLayer_[
i] <<
" T " << moduleThick_;
94 for (
unsigned int i = 0;
i < tagSector_.size(); ++
i)
98 layerNames_ = vsArgs[
"LayerNames"];
99 materials_ = vsArgs[
"LayerMaterials"];
100 layerThick_ = vArgs[
"LayerThickness"];
102 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalPassive: " << layerNames_.size() <<
" types of volumes";
103 for (
unsigned int i = 0;
i < layerNames_.size(); ++
i)
104 edm::LogVerbatim(
"HGCalGeom") <<
"Volume [" <<
i <<
"] " << layerNames_[
i] <<
" of thickness " << layerThick_[
i]
105 <<
" filled with " << materials_[
i];
109 std::ostringstream st1;
110 for (
unsigned int i = 0;
i < layerType_.size(); ++
i)
111 st1 <<
" [" <<
i <<
"] " << layerType_[
i];
112 edm::LogVerbatim(
"HGCalGeom") <<
"There are " << layerType_.size() <<
" blocks" << st1.str();
115 shiftTop_ = nArgs[
"ShiftTop"];
116 shiftBot_ = nArgs[
"ShiftBottom"];
118 edm::LogVerbatim(
"HGCalGeom") <<
"Shifts st the top " << shiftTop_ <<
" and at the bottom " << shiftBot_;
120 slopeB_ = vArgs[
"SlopeBottom"];
121 zFrontB_ = vArgs[
"ZFrontBottom"];
122 rMinFront_ = vArgs[
"RMinFront"];
123 slopeT_ = vArgs[
"SlopeTop"];
124 zFrontT_ = vArgs[
"ZFrontTop"];
125 rMaxFront_ = vArgs[
"RMaxFront"];
127 for (
unsigned int i = 0;
i < slopeB_.size(); ++
i)
128 edm::LogVerbatim(
"HGCalGeom") <<
"Bottom Block [" <<
i <<
"] Zmin " << zFrontB_[
i] <<
" Rmin " << rMinFront_[
i]
129 <<
" Slope " << slopeB_[
i];
130 for (
unsigned int i = 0;
i < slopeT_.size(); ++
i)
131 edm::LogVerbatim(
"HGCalGeom") <<
"Top Block [" <<
i <<
"] Zmin " << zFrontT_[
i] <<
" Rmax " << rMaxFront_[
i]
132 <<
" Slope " << slopeT_[
i];
143 double zim(zMinBlock_);
145 for (
unsigned int j = 0;
j < tagLayer_.size(); ++
j) {
147 double zo = zim + moduleThick_;
150 for (
unsigned int k = 0;
k < tagSector_.size(); ++
k) {
152 double phi1 = phi0_ +
k * dphi_;
153 double dphi0 = dphi_ / parts_;
155 int nsec = 2 * parts_ + 2;
156 std::vector<double> xM(nsec, 0), yM(nsec, 0);
157 for (
int n = 0;
n <= parts_; ++
n) {
158 double phi0 = phi1 +
n * dphi0;
160 xM[0] = rinB *
cos(phi0);
161 yM[0] = rinB *
sin(phi0);
163 xM[nsec -
n] = rinB *
cos(phi0);
164 yM[nsec -
n] = rinB *
sin(phi0);
166 xM[
n + 1] = routF *
cos(phi0);
167 yM[
n + 1] = routF *
sin(phi0);
169 std::vector<double>
zw = {-0.5 * thick_, 0.5 * thick_};
170 std::vector<double> zx(2, 0), zy(2, 0),
scale(2, 1.0);
176 double phi2 = phi1 + dphi_;
177 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalPassive: " << solid.
name() <<
" extruded polygon made of " << matName
178 <<
" z|x|y|s (0) " <<
zw[0] <<
":" << zx[0] <<
":" << zy[0] <<
":" <<
scale[0]
179 <<
" z|x|y|s (1) " <<
zw[1] <<
":" << zx[1] <<
":" << zy[1] <<
":" <<
scale[1]
180 <<
" and " << xM.size() <<
" edges with " << parts_ <<
" parts between " 182 for (
unsigned int kk = 0;
kk < xM.size(); ++
kk)
187 std::vector<DDLogicalPart> glogs(materials_.size());
188 std::vector<int> copyNumber(materials_.size(), 1);
189 double zi(-0.5 * thick_), thickTot(0.0);
190 for (
unsigned int l = 0;
l < layerType_.size();
l++) {
191 unsigned int i = layerType_[
l];
192 if (copyNumber[
i] == 1) {
193 zw[0] = -0.5 * layerThick_[
i];
194 zw[1] = 0.5 * layerThick_[
i];
202 <<
" extruded polygon made of " << matN <<
" z|x|y|s (0) " <<
zw[0] <<
":" 203 << zx[0] <<
":" << zy[0] <<
":" <<
scale[0] <<
" z|x|y|s (1) " <<
zw[1] <<
":" 204 << zx[1] <<
":" << zy[1] <<
":" <<
scale[1] <<
" and " << xM.size() <<
" edges";
205 for (
unsigned int kk = 0;
kk < xM.size(); ++
kk)
213 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalPassive: " << glogs[
i].name() <<
" number " << copyNumber[
i]
214 <<
" positioned in " << glogM.
name() <<
" at " << tran0 <<
" with no rotation";
217 zi += layerThick_[
i];
218 thickTot += layerThick_[
i];
220 if ((
std::abs(thickTot - thick_) >= tol) && (!layerType_.empty())) {
221 if (thickTot > thick_) {
222 edm::LogError(
"HGCalGeom") <<
"Thickness of the partition " << thick_ <<
" is smaller than " << thickTot
223 <<
": thickness of all its components **** ERROR ****";
225 edm::LogWarning(
"HGCalGeom") <<
"Thickness of the partition " << thick_ <<
" does not match with " << thickTot
226 <<
" 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