42 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 " << thickness[
i]
60 edm::LogVerbatim(
"HGCalGeom") <<
"Block [" <<
i <<
"] of thickness " << layerThick[
i] <<
" Rmid " << rMixLayer[
i]
78 if (layerSense[
i] > 0) {
82 edm::LogVerbatim(
"HGCalGeom") <<
"First copy number for layer type " <<
i <<
":" << ii <<
" with " 96 namesTop =
args.value<std::vector<std::string>>(
"TopVolumeNames");
105 edm::LogVerbatim(
"HGCalGeom") <<
"Volume [" <<
i <<
"] " << namesTop[
i] <<
" of thickness " << layerThickTop[
i]
107 edm::LogVerbatim(
"HGCalGeom") <<
"There are " << layerTypeTop.size() <<
" layers in the top part";
108 for (
unsigned int i = 0;
i < layerTypeTop.size(); ++
i)
109 edm::LogVerbatim(
"HGCalGeom") <<
"Layer [" <<
i <<
"] with material type " << layerTypeTop[
i];
112 namesBot =
args.value<std::vector<std::string>>(
"BottomVolumeNames");
122 edm::LogVerbatim(
"HGCalGeom") <<
"Volume [" <<
i <<
"] " << namesBot[
i] <<
" of thickness " << layerThickBot[
i]
124 edm::LogVerbatim(
"HGCalGeom") <<
"There are " << layerTypeBot.size() <<
" layers in the bottom part";
125 for (
unsigned int i = 0;
i < layerTypeBot.size(); ++
i)
126 edm::LogVerbatim(
"HGCalGeom") <<
"Layer [" <<
i <<
"] with material type " << layerTypeBot[
i]
127 <<
" sensitive class " << layerSenseBot[
i];
139 alpha = (1._pi) / sectors;
143 << rad100to200.size() <<
" parameters; zmin " << zMinRadPar <<
" cutoff " 144 << choiceType <<
":" << nCutRadPar <<
":" << fracAreaMin <<
" wafer width " 145 << waferSize <<
" separations " << waferSepar <<
" sectors " << sectors <<
":" 147 for (
unsigned int k = 0;
k < rad100to200.size(); ++
k)
148 edm::LogVerbatim(
"HGCalGeom") <<
"[" <<
k <<
"] 100-200 " << rad100to200[
k] <<
" 200-300 " << rad200to300[
k];
150 slopeB =
args.value<std::vector<double>>(
"SlopeBottom");
151 zFrontB =
args.value<std::vector<double>>(
"ZFrontBottom");
153 slopeT =
args.value<std::vector<double>>(
"SlopeTop");
154 zFrontT =
args.value<std::vector<double>>(
"ZFrontTop");
157 for (
unsigned int i = 0;
i <
slopeB.size(); ++
i)
158 edm::LogVerbatim(
"HGCalGeom") <<
"Block [" <<
i <<
"] Zmin " << zFrontB[
i] <<
" Rmin " << rMinFront[
i]
160 for (
unsigned int i = 0;
i < slopeT.size(); ++
i)
161 edm::LogVerbatim(
"HGCalGeom") <<
"Block [" <<
i <<
"] Zmin " << zFrontT[
i] <<
" Rmax " << rMaxFront[
i]
162 <<
" Slope " << slopeT[
i];
166 waferType = std::make_unique<HGCalWaferType>(
176 const double tol(0.01);
177 for (
unsigned int i = 0;
i < layerNumbers.size();
i++) {
178 double zo = zi + layerThick[
i];
180 int laymax = laymin + layerNumbers[
i];
183 for (
int ly = laymin; ly < laymax; ++ly) {
185 int copy = copyNumber[
ii];
186 double hthick = 0.5 * thickness[
ii];
189 thickTot += thickness[
ii];
194 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalHEAlgo: Layer " << ly <<
":" << ii <<
" Front " << zi <<
", " << routF
195 <<
" Back " << zo <<
", " << rinB <<
" superlayer thickness " << layerThick[
i];
201 if (layerSense[ly] < 1) {
202 std::vector<double> pgonZ, pgonRin, pgonRout;
203 if (layerSense[ly] == 0 || absorbMode == 0) {
206 pgonZ.emplace_back(-hthick);
207 pgonZ.emplace_back(hthick);
208 pgonRin.emplace_back(rinB);
209 pgonRin.emplace_back(rinB);
210 pgonRout.emplace_back(rmax);
211 pgonRout.emplace_back(rmax);
225 for (
unsigned int isec = 0; isec < pgonZ.size(); ++isec) {
227 pgonRout[isec] = pgonRout[isec] * cosAlpha - tol;
232 ns.addSolidNS(ns.prepend(name), solid);
234 ns.addVolumeNS(glog);
236 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalHEAlgo: " << solid.name() <<
" polyhedra of " << sectors
238 <<
convertRadToDeg(-alpha + 2._pi) <<
" with " << pgonZ.size() <<
" sections";
239 for (
unsigned int k = 0;
k < pgonZ.size(); ++
k)
241 <<
"[" <<
k <<
"] z " << pgonZ[
k] <<
" R " << pgonRin[
k] <<
":" << pgonRout[
k];
245 ns.addSolidNS(ns.prepend(name), solid);
247 ns.addVolumeNS(glog);
250 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalHEAlgo: " << solid.name() <<
" Tubs made of " << matter.name()
251 <<
" of dimensions " << rinB <<
", " << routF <<
", " << hthick
252 <<
", 0.0, 360.0 and positioned in: " << glog.name() <<
" number " <<
copy;
254 positionMix(ctxt,
e, glog, name, copy, thickness[ii], matter, rinB, rMixLayer[
i], routF, zz);
257 dd4hep::Position
r1(0, 0, zz);
258 mother.placeVolume(glog, copy,
r1);
261 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalHEAlgo: " << glog.name() <<
" number " << copy <<
" positioned in " 262 << mother.name() <<
" at " <<
r1 <<
" with no rotation";
268 if (
std::abs(thickTot - layerThick[
i]) < 0.00001) {
269 }
else if (thickTot > layerThick[i]) {
270 edm::LogError(
"HGCalGeom") <<
"Thickness of the partition " << layerThick[
i] <<
" is smaller than " << thickTot
271 <<
": thickness of all its " 272 <<
"components **** ERROR ****";
273 }
else if (thickTot < layerThick[i]) {
274 edm::LogWarning(
"HGCalGeom") <<
"Thickness of the partition " << layerThick[
i] <<
" does not match with " 275 << thickTot <<
" of the components";
282 for (std::unordered_set<int>::const_iterator itr =
copies.begin(); itr !=
copies.end(); ++itr, ++
k) {
286 edm::LogVerbatim(
"HGCalGeom") <<
"<<== End of DDHGCalHEAlgo construction...";
std::vector< double > slopeT
std::vector< int > layerCenter
std::vector< double > rad200to300
std::vector< double > rMaxFront
std::vector< int > layerNumbers
std::vector< double > slopeB
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::vector< double > zFrontB
std::vector< double > rMinFront
constexpr NumType convertRadToDeg(NumType radians)
std::vector< int > layerSenseBot
std::vector< std::string > namesTop
std::vector< int > layerSense
std::vector< std::string > materialsTop
std::vector< std::string > volumeNames
constexpr long double piRadians(M_PIl)
std::vector< int > copyNumber
Cos< T >::type cos(const T &t)
std::vector< double > rad100to200
Abs< T >::type abs(const T &t)
std::vector< double > layerThick
std::vector< std::string > waferNames
std::unordered_set< int > copies
std::vector< double > rMixLayer
std::unique_ptr< HGCalWaferType > waferType
std::vector< int > copyNumberBot
std::vector< std::string > namesBot
std::vector< double > thickness
std::vector< int > layerTypeTop
std::vector< int > layerTypeBot
std::vector< int > layerType
std::vector< int > copyNumberTop
std::vector< std::string > materials
std::vector< double > layerThickTop
std::vector< double > layerThickBot
std::vector< std::string > materialsBot
std::vector< double > zFrontT