38 static constexpr
double tol1 = 0.01 * dd4hep::mm;
48 <<
" facings: " << facingTypes_ <<
" partials: " << partialTypes_
49 <<
" Orientations: " << orientationTypes_ <<
"; number of cells along phi "
57 <<
"Absober:Sensitive mode " << absorbMode_ <<
":" <<
sensitiveMode_;
63 alpha_ = (1._pi) / sectors_;
70 slopeB_ =
args.value<std::vector<double>>(
"SlopeBottom");
71 zFrontB_ =
args.value<std::vector<double>>(
"ZFrontBottom");
73 slopeT_ =
args.value<std::vector<double>>(
"SlopeTop");
77 for (
unsigned int i = 0;
i <
slopeB_.size(); ++
i)
80 for (
unsigned int i = 0;
i < slopeT_.size(); ++
i)
85 waferFull_ =
args.value<std::vector<std::string>>(
"WaferNamesFull");
86 waferPart_ =
args.value<std::vector<std::string>>(
"WaferNamesPartial");
89 <<
" partial modules\nDDHGCalMixLayer:Full Modules:";
90 unsigned int i1max =
static_cast<unsigned int>(
waferFull_.size());
91 for (
unsigned int i1 = 0; i1 < i1max; i1 += 2) {
92 std::ostringstream st1;
93 unsigned int i2 =
std::min((i1 + 2), i1max);
94 for (
unsigned int i = i1;
i < i2; ++
i)
99 i1max =
static_cast<unsigned int>(waferPart_.size());
100 for (
unsigned int i1 = 0; i1 < i1max; i1 += 2) {
101 std::ostringstream st1;
102 unsigned int i2 =
std::min((i1 + 2), i1max);
103 for (
unsigned int i = i1;
i < i2; ++
i)
104 st1 <<
" [" <<
i <<
"] " << waferPart_[
i];
109 materials_ =
args.value<std::vector<std::string>>(
"MaterialNames");
110 names_ =
args.value<std::vector<std::string>>(
"VolumeNames");
111 thick_ =
args.value<std::vector<double>>(
"Thickness");
115 for (
unsigned int i = 0;
i < names_.size(); ++
i)
116 edm::LogVerbatim(
"HGCalGeom") <<
"Volume [" <<
i <<
"] " << names_[
i] <<
" of thickness "
124 for (
unsigned int i = 0;
i <
layers_.size(); ++
i)
126 <<
" with " <<
layers_[
i] <<
" layers";
132 for (
unsigned int i = 0;
i < layerTypes_.size(); ++
i)
137 if (layerSense_[
i] > 0) {
141 edm::LogVerbatim(
"HGCalGeom") <<
"First copy number for layer type " <<
i <<
":" << ii <<
" with "
157 namesTop_ =
args.value<std::vector<std::string>>(
"TopVolumeNames");
164 edm::LogVerbatim(
"HGCalGeom") <<
"Volume [" <<
i <<
"] " << namesTop_[
i] <<
" of thickness "
167 edm::LogVerbatim(
"HGCalGeom") <<
"There are " << layerTypeTop_.size() <<
" layers in the top part";
168 for (
unsigned int i = 0;
i < layerTypeTop_.size(); ++
i)
169 edm::LogVerbatim(
"HGCalGeom") <<
"Layer [" <<
i <<
"] with material type " << layerTypeTop_[
i];
176 << waferLayerStart_.size() <<
" layers";
177 for (
unsigned int k = 0;
k < waferLayerStart_.size(); ++
k)
198 edm::LogVerbatim(
"HGCalGeom") <<
"TileProperties with " << tileIndex_.size() <<
" entries in "
199 << tileLayerStart_.size() <<
" layers";
200 for (
unsigned int k = 0;
k < tileLayerStart_.size(); ++
k)
202 for (
unsigned int k = 0;
k < tileIndex_.size(); ++
k)
212 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalMixLayer: NameSpace " << ns.name();
220 for (
unsigned int i = 0;
i < layers_.size();
i++) {
221 double zo = zi + layerThick_[
i];
223 int laymax = laymin + layers_[
i];
226 for (
int ly = laymin; ly < laymax; ++ly) {
228 int copy = copyNumber_[
ii];
229 double hthick = 0.5 * thick_[
ii];
232 thickTot += thick_[
ii];
236 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalMixLayer: Layer " << ly <<
":" << ii <<
" Front "
242 dd4hep::Material matter = ns.material(
materials_[ii]);
245 if (layerSense_[ly] < 1) {
246 std::vector<double> pgonZ, pgonRin, pgonRout;
261 for (
unsigned int isec = 0; isec < pgonZ.size(); ++isec) {
263 if (layerSense_[ly] == 0 || absorbMode_ == 0)
264 pgonRout[isec] = rmax;
266 pgonRout[isec] = pgonRout[isec] * cosAlpha_ - tol1;
269 dd4hep::Solid solid =
dd4hep::Polyhedra(sectors_, -alpha_, 2._pi, pgonZ, pgonRin, pgonRout);
270 ns.addSolidNS(ns.prepend(name), solid);
272 ns.addVolumeNS(glog);
274 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalMixLayer: " << solid.name() <<
" polyhedra of " << sectors_
276 <<
convertRadToDeg(-alpha_ + 2._pi) <<
" with " << pgonZ.size() <<
" sections";
277 for (
unsigned int k = 0;
k < pgonZ.size(); ++
k)
286 dd4hep::Solid solid = dd4hep::Tube(rins, routs, hthick, 0.0, 2._pi);
287 ns.addSolidNS(ns.prepend(name), solid);
289 ns.addVolumeNS(glog);
292 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalMixLayer: " << solid.name() <<
" Tubs made of " << matter.name()
295 <<
cms::convert2mm(hthick) <<
", 0.0, 360.0 and positioned in: " << glog.name()
296 <<
" number " <<
copy;
298 positionMix(ctxt,
e, glog, name, copy, thick_[ii], matter);
302 mother.placeVolume(glog, copy,
r1);
305 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalMixLayer: " << glog.name() <<
" number " << copy <<
" positioned in "
306 << mother.name() <<
" at (0,0," <<
cms::convert2mm(zz) <<
") with no rotation";
313 if (thickTot > layerThick_[i]) {
316 <<
": thickness of all its components **** ERROR ****";
319 <<
" does not match with " <<
cms::convert2mm(thickTot) <<
" of the components";
327 for (std::unordered_set<int>::const_iterator itr =
copies_.begin(); itr !=
copies_.end(); ++itr, ++
k) {
331 edm::LogVerbatim(
"HGCalGeom") <<
"<<== End of DDHGCalMixLayer construction...";
std::vector< int > copyNumberTop_
Log< level::Info, true > LogVerbatim
std::vector< double > tileRMin_
static constexpr double tol2_
std::vector< int > layerTypeTop_
std::vector< std::string > namesTop_
std::vector< std::string > materialTop_
int32_t waferU(const int32_t index)
int32_t waferLayer(const int32_t index)
constexpr NumType convertRadToDeg(NumType radians)
constexpr NumType convert2mm(NumType length)
std::string to_string(const V &value)
std::vector< double > tileRMax_
std::vector< double > layerThick_
std::vector< std::string > waferFull_
std::vector< int > waferLayerStart_
Log< level::Error, false > LogError
std::vector< int > layerSense_
std::vector< int > copyNumber_
int32_t waferOrient(const int32_t property)
std::vector< double > slopeB_
std::vector< int > waferIndex_
std::vector< double > rMinFront_
std::vector< double > zFrontB_
std::vector< int > tilePhis_
std::vector< int > layers_
std::vector< int > tileLayerStart_
Cos< T >::type cos(const T &t)
std::vector< std::string > waferPart_
std::vector< std::string > materials_
Abs< T >::type abs(const T &t)
int32_t waferThick(const int32_t property)
std::vector< int > layerType_
std::vector< int > waferProperty_
std::vector< double > rMaxFront_
void positionMix(cms::DDParsingContext &ctxt, xml_h e, const dd4hep::Volume &glog, const std::string &nameM, int copyM, double thick, const dd4hep::Material &matter)
std::tuple< int32_t, int32_t, int32_t > tileUnpack(int32_t index)
std::vector< std::string > names_
std::vector< double > thick_
std::vector< double > slopeT_
int32_t waferPartial(const int32_t property)
std::vector< double > zFrontT_
std::vector< int > layerTypes_
int32_t waferV(const int32_t index)
std::unordered_set< int > copies_
Log< level::Warning, false > LogWarning
std::vector< double > layerThickTop_
std::vector< int > tileIndex_