44 materials_ =
args.value<std::vector<std::string>>(
"MaterialNames");
50 for (
unsigned int i = 0;
i < volumeNames_.size(); ++
i)
51 edm::LogVerbatim(
"HGCalGeom") <<
"Volume [" <<
i <<
"] " << volumeNames_[
i] <<
" of thickness "
72 <<
"Absober:Sensitive mode " << absorbMode_ <<
":" <<
sensitiveMode_;
79 if (firstLayer_ > 0) {
81 if (layerSense_[
i] > 0) {
85 edm::LogVerbatim(
"HGCalGeom") <<
"First copy number for layer type " <<
i <<
":" << ii <<
" with "
99 namesTop_ =
args.value<std::vector<std::string>>(
"TopVolumeNames");
106 edm::LogVerbatim(
"HGCalGeom") <<
"Volume [" <<
i <<
"] " << namesTop_[
i] <<
" of thickness "
109 edm::LogVerbatim(
"HGCalGeom") <<
"There are " << layerTypeTop_.size() <<
" layers in the top part";
110 for (
unsigned int i = 0;
i < layerTypeTop_.size(); ++
i)
111 edm::LogVerbatim(
"HGCalGeom") <<
"Layer [" <<
i <<
"] with material type " << layerTypeTop_[
i];
114 namesBot_ =
args.value<std::vector<std::string>>(
"BottomVolumeNames");
121 <<
" types of volumes in the bottom part";
123 edm::LogVerbatim(
"HGCalGeom") <<
"Volume [" <<
i <<
"] " << namesBot_[
i] <<
" of thickness "
126 edm::LogVerbatim(
"HGCalGeom") <<
"There are " << layerTypeBot_.size() <<
" layers in the bottom part";
127 for (
unsigned int i = 0;
i < layerTypeBot_.size(); ++
i)
128 edm::LogVerbatim(
"HGCalGeom") <<
"Layer [" <<
i <<
"] with material type " << layerTypeBot_[
i]
129 <<
" sensitive class " << layerSenseBot_[
i];
141 alpha_ = (1._pi) / sectors_;
145 <<
" radius for wafer type separation uses " << rad100to200_.size()
146 <<
" parameters; zmin " <<
cms::convert2mm(zMinRadPar_) <<
" cutoff " << choiceType_
147 <<
":" << nCutRadPar_ <<
":" << fracAreaMin_ <<
" wafer width "
150 for (
unsigned int k = 0;
k < rad100to200_.size(); ++
k)
151 edm::LogVerbatim(
"HGCalGeom") <<
"[" <<
k <<
"] 100-200 " << rad100to200_[
k] <<
" 200-300 " << rad200to300_[
k];
153 slopeB_ =
args.value<std::vector<double>>(
"SlopeBottom");
154 zFrontB_ =
args.value<std::vector<double>>(
"ZFrontBottom");
156 slopeT_ =
args.value<std::vector<double>>(
"SlopeTop");
157 zFrontT_ =
args.value<std::vector<double>>(
"ZFrontTop");
160 for (
unsigned int i = 0;
i <
slopeB_.size(); ++
i)
163 for (
unsigned int i = 0;
i < slopeT_.size(); ++
i)
184 for (
unsigned int i = 0;
i < layerNumbers_.size();
i++) {
185 double zo = zi + layerThick_[
i];
187 int laymax = laymin + layerNumbers_[
i];
190 for (
int ly = laymin; ly < laymax; ++ly) {
192 int copy = copyNumber_[
ii];
193 double hthick = 0.5 * thickness_[
ii];
196 thickTot += thickness_[
ii];
207 dd4hep::Material matter = ns.material(
materials_[ii]);
210 if (layerSense_[ly] < 1) {
211 std::vector<double> pgonZ, pgonRin, pgonRout;
212 if (layerSense_[ly] == 0 || absorbMode_ == 0) {
216 pgonZ.emplace_back(-hthick);
217 pgonZ.emplace_back(hthick);
218 pgonRin.emplace_back(rinB);
219 pgonRin.emplace_back(rinB);
220 pgonRout.emplace_back(rmax);
221 pgonRout.emplace_back(rmax);
235 for (
unsigned int isec = 0; isec < pgonZ.size(); ++isec) {
237 pgonRout[isec] = pgonRout[isec] * cosAlpha_ -
tol1_;
241 dd4hep::Solid solid =
dd4hep::Polyhedra(sectors_, -alpha_, 2._pi, pgonZ, pgonRin, pgonRout);
242 ns.addSolidNS(ns.prepend(name), solid);
244 ns.addVolumeNS(glog);
246 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalHEAlgo: " << solid.name() <<
" polyhedra of " << sectors_
248 <<
convertRadToDeg(-alpha_ + 2._pi) <<
" with " << pgonZ.size() <<
" sections";
249 for (
unsigned int k = 0;
k < pgonZ.size(); ++
k)
258 dd4hep::Solid solid = dd4hep::Tube(rins, routs, hthick, 0.0, 2._pi);
259 ns.addSolidNS(ns.prepend(name), solid);
261 ns.addVolumeNS(glog);
264 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalHEAlgo: " << solid.name() <<
" Tubs made of " << matter.name()
267 <<
cms::convert2mm(hthick) <<
", 0.0, 360.0 and positioned in: " << glog.name()
268 <<
" number " <<
copy;
270 positionMix(ctxt,
e, glog, name, copy, thickness_[ii], matter, rins, rMixLayer_[
i], routs, zz);
274 mother.placeVolume(glog, copy,
r1);
277 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalHEAlgo: " << glog.name() <<
" number " << copy <<
" positioned in "
278 << mother.name() <<
" at (0,0," <<
cms::convert2mm(zz) <<
") with no rotation";
285 if (thickTot > layerThick_[i]) {
288 <<
": thickness of all its components **** ERROR ****";
291 <<
" does not match with " <<
cms::convert2mm(thickTot) <<
" of the components";
299 for (std::unordered_set<int>::const_iterator itr =
copies_.begin(); itr !=
copies_.end(); ++itr, ++
k) {
303 edm::LogVerbatim(
"HGCalGeom") <<
"<<== End of DDHGCalHEAlgo construction...";
std::vector< int > layerNumbers_
Log< level::Info, true > LogVerbatim
std::vector< double > rad100to200_
void positionMix(cms::DDParsingContext &ctxt, xml_h e, const dd4hep::Volume &glog, const std::string &nameM, int copyM, double thick, const dd4hep::Material &matter, double rin, double rmid, double rout, double zz)
std::unordered_set< int > copies_
std::vector< double > slopeT_
std::vector< std::string > volumeNames_
std::vector< double > rMixLayer_
std::vector< double > thickness_
constexpr NumType convertRadToDeg(NumType radians)
constexpr NumType convert2mm(NumType length)
static constexpr double tol2_
std::vector< int > copyNumberTop_
std::string to_string(const V &value)
std::vector< double > layerThick_
std::vector< double > rMaxFront_
std::vector< int > layerSense_
std::vector< int > layerTypeTop_
Log< level::Error, false > LogError
std::vector< double > zFrontT_
std::vector< std::string > namesBot_
std::vector< std::string > materialsTop_
std::vector< double > zFrontB_
std::vector< std::string > waferNames_
std::vector< std::string > materialsBot_
std::vector< double > layerThickTop_
std::vector< int > layerSenseBot_
std::vector< double > slopeB_
std::unique_ptr< HGCalWaferType > waferType_
std::vector< double > rMinFront_
std::vector< int > layerType_
static constexpr double tol1_
Cos< T >::type cos(const T &t)
std::vector< int > copyNumber_
Abs< T >::type abs(const T &t)
std::vector< int > layerTypeBot_
std::vector< std::string > namesTop_
std::vector< std::string > materials_
std::vector< double > rad200to300_
std::vector< int > copyNumberBot_
Log< level::Warning, false > LogWarning
std::vector< double > layerThickBot_
std::vector< int > layerCenter_