17 #include "DD4hep/DetFactoryHelper.h" 150 nsectors = args.
value<
int>(
"NSector");
151 nsectortot = args.
value<
int>(
"NSectorTot");
152 nhalf = args.
value<
int>(
"NHalf");
153 rinner = args.
value<
double>(
"RIn");
154 router = args.
value<
double>(
"ROut");
155 rzones = args.
value<
int>(
"RZones");
159 theta = args.
value<std::vector<double> >(
"Theta");
160 rmax = args.
value<std::vector<double> >(
"RMax");
161 zoff = args.
value<std::vector<double> >(
"ZOff");
162 for (
int i = 0;
i < rzones;
i++) {
163 ttheta.emplace_back(
tan(theta[
i]));
166 rmax[2] = (zoff[3] - zoff[2]) / ttheta[2];
169 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: General material " << genMaterial <<
"\tSectors " << nsectors
170 <<
", " << nsectortot <<
"\tHalves " << nhalf <<
"\tRotation matrix " << rotns <<
":" 171 << rotHalf <<
"\n\t\t" << rinner <<
"\t" << router <<
"\t" << rzones;
172 for (
int i = 0;
i < rzones;
i++)
173 edm::LogVerbatim(
"HCalGeom") <<
"\tTheta[" <<
i <<
"] = " << theta[
i] <<
"\trmax[" <<
i <<
"] = " << rmax[
i]
174 <<
"\tzoff[" <<
i <<
"] = " << zoff[
i];
178 nLayers = args.
value<
int>(
"NLayers");
182 layerId = args.
value<std::vector<int> >(
"Id");
183 layerLabel = args.
value<std::vector<std::string> >(
"LayerLabel");
184 layerMat = args.
value<std::vector<std::string> >(
"LayerMat");
185 layerWidth = args.
value<std::vector<double> >(
"LayerWidth");
186 layerD1 = args.
value<std::vector<double> >(
"D1");
187 layerD2 = args.
value<std::vector<double> >(
"D2");
188 layerAlpha = args.
value<std::vector<double> >(
"Alpha2");
189 layerT1 = args.
value<std::vector<double> >(
"T1");
190 layerT2 = args.
value<std::vector<double> >(
"T2");
191 layerAbsorb = args.
value<std::vector<int> >(
"AbsL");
192 layerGap = args.
value<std::vector<double> >(
"Gap");
195 edm::LogVerbatim(
"HCalGeom") << layerLabel[
i] <<
"\t" << layerId[
i] <<
"\t" << layerMat[
i] <<
"\t" 196 << layerWidth[
i] <<
"\t" << layerD1[
i] <<
"\t" << layerD2[
i] <<
"\t" << layerAlpha[
i]
197 <<
"\t" << layerT1[
i] <<
"\t" << layerT2[
i] <<
"\t" << layerAbsorb[
i] <<
"\t" 203 absorbName = args.
value<std::vector<std::string> >(
"AbsorbName");
204 absorbMat = args.
value<std::vector<std::string> >(
"AbsorbMat");
205 absorbD = args.
value<std::vector<double> >(
"AbsorbD");
206 absorbT = args.
value<std::vector<double> >(
"AbsorbT");
207 nAbsorber = absorbName.size();
209 for (
int i = 0;
i < nAbsorber;
i++)
210 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << absorbName[
i] <<
" Material " << absorbMat[
i] <<
" d " 211 << absorbD[
i] <<
" t " << absorbT[
i];
214 middleD = args.
value<
double>(
"MiddleD");
215 middleW = args.
value<
double>(
"MiddleW");
217 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: Middle material " << middleMat <<
" d " << middleD <<
" w " 220 midName = args.
value<std::vector<std::string> >(
"MidAbsName");
221 midMat = args.
value<std::vector<std::string> >(
"MidAbsMat");
222 midW = args.
value<std::vector<double> >(
"MidAbsW");
223 midT = args.
value<std::vector<double> >(
"MidAbsT");
224 nMidAbs = midName.size();
226 for (
int i = 0;
i < nMidAbs;
i++)
227 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << midName[
i] <<
" Material " << midMat[
i] <<
" W " 228 << midW[
i] <<
" T " << midT[
i];
232 sideMat = args.
value<std::vector<std::string> >(
"SideMat");
233 sideD = args.
value<std::vector<double> >(
"SideD");
234 sideT = args.
value<std::vector<double> >(
"SideT");
236 for (
unsigned int i = 0;
i < sideMat.size();
i++)
237 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: Side material " << sideMat[
i] <<
" d " << sideD[
i] <<
" t " 240 sideAbsName = args.
value<std::vector<std::string> >(
"SideAbsName");
241 sideAbsMat = args.
value<std::vector<std::string> >(
"SideAbsMat");
242 sideAbsW = args.
value<std::vector<double> >(
"SideAbsW");
243 nSideAbs = sideAbsName.size();
245 for (
int i = 0;
i < nSideAbs;
i++)
246 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << sideAbsName[
i] <<
" Material " << sideAbsMat[
i] <<
" W " 258 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: Detector (" << nLayers <<
") Rotation matrix " << rotns <<
":" 259 << detRot <<
"\n\t\t" << detMat <<
"\t" << detMatPl <<
"\t" << detMatSc;
261 detType = args.
value<std::vector<int> >(
"DetType");
262 detdP1 = args.
value<std::vector<double> >(
"DetdP1");
263 detdP2 = args.
value<std::vector<double> >(
"DetdP2");
264 detT11 = args.
value<std::vector<double> >(
"DetT11");
265 detT12 = args.
value<std::vector<double> >(
"DetT12");
266 detTsc = args.
value<std::vector<double> >(
"DetTsc");
267 detT21 = args.
value<std::vector<double> >(
"DetT21");
268 detT22 = args.
value<std::vector<double> >(
"DetT22");
269 detWidth1 = args.
value<std::vector<double> >(
"DetWidth1");
270 detWidth2 = args.
value<std::vector<double> >(
"DetWidth2");
271 detPosY = args.
value<std::vector<int> >(
"DetPosY");
274 edm::LogVerbatim(
"HCalGeom") <<
i + 1 <<
"\t" << detType[
i] <<
"\t" << detdP1[
i] <<
", " << detdP2[
i] <<
"\t" 275 << detT11[
i] <<
", " << detT12[
i] <<
"\t" << detTsc[
i] <<
"\t" << detT21[
i] <<
", " 276 << detT22[
i] <<
"\t" << detWidth1[
i] <<
"\t" << detWidth2[
i] <<
"\t" << detPosY[
i];
281 idNameSpace = ns.
name();
282 idOffset = args.
value<
int>(
"IdOffset");
285 <<
" NameSpace " << idNameSpace <<
" Offset " << idOffset;
287 <<
"DDHCalBarrelAlgo: General volume...";
290 double alpha = (1._pi) / nsectors;
291 double dphi = nsectortot * (2._pi) / nsectors;
297 int nf = ntot - nsec;
301 double zmax = zoff[3];
302 double zstep5 = zoff[4];
303 double zstep4 = (zoff[1] + rmax[1] * ttheta[1]);
304 if ((zoff[2] + rmax[1] * ttheta[2]) > zstep4)
305 zstep4 = (zoff[2] + rmax[1] * ttheta[2]);
306 double zstep3 = (zoff[1] + rmax[0] * ttheta[1]);
307 double zstep2 = (zoff[0] + rmax[0] * ttheta[0]);
308 double zstep1 = (zoff[0] + rinner * ttheta[0]);
309 double rout = router;
310 double rout1 = rmax[3];
312 double rmid1 = rmax[0];
313 double rmid2 = rmax[1];
314 double rmid3 = (zoff[4] - zoff[2]) / ttheta[2];
315 double rmid4 = rmax[2];
317 std::vector<double> pgonZ = {-
zmax,
333 std::vector<double> pgonRmin = {
334 rmid4, rmid3, rmid3, rmid2, rmid1, rmid1, rin, rin, rin, rmid1, rmid1, rmid2, rmid3, rmid3, rmid4};
336 std::vector<double> pgonRmax = {
337 rout1, rout1, rout, rout, rout, rout, rout, rout, rout, rout, rout, rout, rout, rout1, rout1};
339 std::vector<double> pgonZHalf = {0, zstep1, zstep2, zstep3, zstep4, zstep5, zstep5, zmax};
341 std::vector<double> pgonRminHalf = {rin, rin, rmid1, rmid1, rmid2, rmid3, rmid3, rmid4};
343 std::vector<double> pgonRmaxHalf = {rout, rout, rout, rout, rout, rout, rout1, rout1};
350 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << solid.name() <<
" Polyhedra made of " << genMaterial
351 <<
" with " << nsectortot <<
" sectors from " <<
convertRadToDeg(-alpha) <<
" to " 352 <<
convertRadToDeg(-alpha + dphi) <<
" and with " << nsec <<
" sections ";
353 for (
unsigned int i = 0;
i < pgonZ.size();
i++)
355 <<
"\tZ = " << pgonZ[
i] <<
"\tRmin = " << pgonRmin[
i]
356 <<
"\tRmax = " << pgonRmax[
i];
361 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << solid.name() <<
" Polyhedra made of " << genMaterial
362 <<
" with " << nsectortot <<
" sectors from " <<
convertRadToDeg(-alpha) <<
" to " 363 <<
convertRadToDeg(-alpha + dphi) <<
" and with " << nsec <<
" sections ";
364 for (
unsigned int i = 0;
i < pgonZHalf.size();
i++)
366 <<
"\tZ = " << pgonZHalf[
i] <<
"\tRmin = " << pgonRminHalf[
i]
367 <<
"\tRmax = " << pgonRmaxHalf[
i];
374 parentName.placeVolume(genlogic, 1);
376 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << genlogic.name() <<
" number 1 positioned in " 377 << parentName.name() <<
" at (0, 0, 0) with no rotation";
380 name = idName +
"Half";
384 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << solid.name() <<
" Polyhedra made of " << genMaterial
385 <<
" with " << nsectortot <<
" sectors from " <<
convertRadToDeg(-alpha) <<
" to " 386 <<
convertRadToDeg(-alpha + dphi) <<
" and with " << nf <<
" sections ";
387 for (
unsigned int i = 0;
i < pgonZHalf.size();
i++)
389 <<
"\tZ = " << pgonZHalf[
i] <<
"\tRmin = " << pgonRminHalf[
i]
390 <<
"\tRmax = " << pgonRmaxHalf[
i];
393 genlogic.placeVolume(genlogich, 1);
395 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << genlogich.name() <<
" number 1 positioned in " 396 << genlogic.name() <<
" at (0, 0, 0) with no rotation";
399 dd4hep::Rotation3D
rot = getRotation(rotHalf, rotns, ns);
400 genlogic.placeVolume(genlogich, 2, rot);
402 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << genlogich.name() <<
" number 2 positioned in " 403 << genlogic.name() <<
" at (0, 0, 0) with " <<
rot;
408 name = idName +
"Module";
412 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << solid.name() <<
" Polyhedra made of " << matter.name()
415 for (
unsigned int i = 0;
i < pgonZHalf.size();
i++)
416 edm::LogVerbatim(
"HCalGeom") <<
"\t\tZ = " << pgonZHalf[
i] <<
"\tRmin = " << pgonRminHalf[
i]
417 <<
"\tRmax = " << pgonRmaxHalf[
i];
420 for (
int ii = 0;
ii < nsectortot;
ii++) {
424 rotation = dd4hep::RotationZ(phi);
430 genlogich.placeVolume(seclogic,
ii + 1, rotation);
432 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << seclogic.name() <<
" number " <<
ii + 1
433 <<
" positioned in " << genlogich.name() <<
" at (0, 0, 0) with " <<
rotation;
439 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: Layers (" << nLayers <<
") ...";
445 double width = layerWidth[
i];
446 double rout = rin +
width;
449 for (
int j = 0;
j < rzones - 1;
j++) {
455 double zout = zoff[
in] + rin * ttheta[
in];
460 std::vector<double> pgonZ, pgonRmin, pgonRmax;
462 pgonZ.emplace_back(0);
463 pgonRmin.emplace_back(rin);
464 pgonRmax.emplace_back(rout);
466 pgonZ.emplace_back(zout);
467 pgonRmin.emplace_back(rin);
468 pgonRmax.emplace_back(rout);
472 pgonZ.emplace_back(zoff[in] + rout * ttheta[in]);
473 pgonRmin.emplace_back(pgonRmax[1]);
474 pgonRmax.emplace_back(pgonRmax[1]);
480 pgonZ[1] = (zoff[
out] + rmax[
out] * ttheta[
out]);
481 pgonZ.emplace_back(pgonZ[1]);
482 pgonRmin.emplace_back(pgonRmin[1]);
483 pgonRmax.emplace_back(rmax[in]);
485 pgonZ.emplace_back(zoff[in] + rmax[in] * ttheta[in]);
486 pgonRmin.emplace_back(pgonRmin[2]);
487 pgonRmax.emplace_back(pgonRmax[2]);
491 pgonZ.emplace_back(zoff[in] + rmax[in] * ttheta[in]);
492 pgonRmin.emplace_back(rmax[in]);
493 pgonRmax.emplace_back(pgonRmax[1]);
496 pgonZ.emplace_back(zoff[
out] + rmax[in] * ttheta[
out]);
497 pgonRmin.emplace_back(pgonRmin[2]);
498 pgonRmax.emplace_back(pgonRmax[2]);
502 pgonZ.emplace_back(zoff[
out] + rout * ttheta[
out]);
503 pgonRmin.emplace_back(rout);
504 pgonRmax.emplace_back(rout);
511 double alpha1 =
alpha;
512 if (layerGap[i] > 1.e-6) {
513 double rmid = 0.5 * (rin + rout);
514 double width = rmid *
tan(alpha) - layerGap[
i];
515 alpha1 = atan(width / rmid);
524 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << solid.name() <<
" (Layer " << i <<
") Polyhedra made of " 525 << matter.name() <<
" with 1 sector from " <<
convertRadToDeg(-alpha1) <<
" to " 527 for (
unsigned int k = 0;
k < pgonZ.size();
k++)
528 edm::LogVerbatim(
"HCalGeom") <<
"\t\t" << pgonZ[
k] <<
"\t" << pgonRmin[
k] <<
"\t" << pgonRmax[
k];
531 seclogic.placeVolume(glog, layerId[i]);
533 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << glog.name() <<
" number " << layerId[
i]
534 <<
" positioned in " << seclogic.name() <<
" at (0,0,0) with no rotation";
536 constructInsideLayers(glog,
565 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: \t\tInside layer " <<
id <<
"...";
570 dd4hep::Rotation3D
rot = getRotation(detRot, rotns, ns);
578 double rsi,
dx,
dy,
dz, x, y;
584 for (i = 0; i < rzones - 1; i++) {
589 dy = 0.5 * rsi * (
tan(alpha1) -
tan(alpha2));
590 dz = 0.5 * (zoff[
in] + rsi * ttheta[
in]);
592 y = 0.5 * rsi * (
tan(alpha1) +
tan(alpha2));
593 dd4hep::Position r11(x, y, dz);
594 dd4hep::Position r12(x, -y, dz);
598 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << solid.name() <<
" Box made of " << matter.name()
599 <<
" of dimensions " << dx <<
", " << dy <<
", " <<
dz;
604 mother = constructSideLayer(laylog, name, nAbs, rin, alpha1, ns);
608 mother.placeVolume(glog, idOffset + 1, r11);
609 mother.placeVolume(glog, idOffset + 2, dd4hep::Transform3D(rot, r12));
611 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << glog.name() <<
" Number " << idOffset + 1
612 <<
" positioned in " << mother.name() <<
" at " << r11 <<
" with no rotation\n" 613 <<
"DDHCalBarrelAlgo: " << glog.name() <<
" Number " << idOffset + 2
614 <<
" positioned in " << mother.name() <<
" at " << r12 <<
" with " <<
rot;
617 constructInsideDetectors(glog, nam0 +
"1",
id, dx, dy, dz, 1, ns);
623 for (i = 0; i < rzones - 1; i++) {
628 dy = 0.5 * rsi *
tan(alpha2);
629 dz = 0.5 * (zoff[
in] + rsi * ttheta[
in]);
631 dd4hep::Position r21(x, dy, dz);
632 dd4hep::Position r22(x, -dy, dz);
636 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << solid.name() <<
" Box made of " << matter.name()
637 <<
" of dimensions " << dx <<
", " << dy <<
", " <<
dz;
642 mother = constructMidLayer(laylog, name, rin, alpha1, ns);
646 mother.placeVolume(glog, idOffset + 3, r21);
647 mother.placeVolume(glog, idOffset + 4, dd4hep::Transform3D(rot, r22));
649 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << glog.name() <<
" Number " << idOffset + 3
650 <<
" positioned in " << mother.name() <<
" at " << r21
651 <<
" with no rotation\nDDHCalBarrelAlgo: " << glog.name() <<
" Number " << idOffset + 4
652 <<
" positioned in " << mother.name() <<
" at " << r22 <<
" with " <<
rot;
655 constructInsideDetectors(glog, nam0 +
"2",
id, dx, dy, dz, 2, ns);
661 int k =
abs(nAbs) - 1;
663 double rsi = rin + sideD[
k];
665 for (
int i = 0;
i < rzones - 1;
i++) {
669 std::vector<double> pgonZ, pgonRmin, pgonRmax;
671 pgonZ.emplace_back(0.0);
672 pgonRmin.emplace_back(rsi);
673 pgonRmax.emplace_back(rsi + sideT[k]);
675 pgonZ.emplace_back(zoff[in] + rsi * ttheta[in]);
676 pgonRmin.emplace_back(rsi);
677 pgonRmax.emplace_back(pgonRmax[0]);
679 pgonZ.emplace_back(zoff[in] + pgonRmax[0] * ttheta[in]);
680 pgonRmin.emplace_back(pgonRmax[1]);
681 pgonRmax.emplace_back(pgonRmax[1]);
686 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << solid.name() <<
" Polyhedra made of " << sideMat[
k]
688 <<
convertRadToDeg(alpha) <<
" and with " << pgonZ.size() <<
" sections";
689 for (
unsigned int ii = 0;
ii < pgonZ.size();
ii++)
691 <<
"\tRmax = " << pgonRmax[
ii];
694 laylog.placeVolume(glog, 1);
696 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << glog.name() <<
" Number 1 positioned in " << laylog.name()
697 <<
" at (0,0,0) with no rotation";
701 double rmid = pgonRmax[0];
702 for (
int i = 0;
i < nSideAbs;
i++) {
703 double alpha1 = atan(sideAbsW[
i] / rmid);
710 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << solid.name() <<
" Polyhedra made of " << sideAbsMat[
i]
712 <<
convertRadToDeg(alpha1) <<
" and with " << pgonZ.size() <<
" sections";
713 for (
unsigned int ii = 0;
ii < pgonZ.size();
ii++)
715 <<
"\tRmax = " << pgonRmax[
ii];
718 mother.placeVolume(
log, 1);
720 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " <<
log.name() <<
" Number 1 positioned in " 721 << mother.name() <<
" at (0,0,0) with no rotation";
735 for (
int k = 0;
k < nAbsorber;
k++) {
737 double rsi = rin + absorbD[
k];
739 for (
int i = 0;
i < rzones - 1;
i++) {
743 std::vector<double> pgonZ, pgonRmin, pgonRmax;
745 pgonZ.emplace_back(0.0);
746 pgonRmin.emplace_back(rsi);
747 pgonRmax.emplace_back(rsi + absorbT[
k]);
749 pgonZ.emplace_back(zoff[in] + rsi * ttheta[in]);
750 pgonRmin.emplace_back(rsi);
751 pgonRmax.emplace_back(pgonRmax[0]);
753 pgonZ.emplace_back(zoff[in] + pgonRmax[0] * ttheta[in]);
754 pgonRmin.emplace_back(pgonRmax[1]);
755 pgonRmax.emplace_back(pgonRmax[1]);
760 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << solid.name() <<
" Polyhedra made of " << matter.name()
762 <<
convertRadToDeg(alpha) <<
" and with " << pgonZ.size() <<
" sections";
763 for (
unsigned int ii = 0;
ii < pgonZ.size();
ii++)
765 <<
"\tRmax = " << pgonRmax[
ii];
768 laylog.placeVolume(log, 1);
770 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << log.name() <<
" Number 1 positioned in " << laylog.name()
771 <<
" at (0,0,0) with no rotation";
774 double rmin = pgonRmin[0];
775 double rmax = pgonRmax[0];
777 for (
int i = 0;
i < 1;
i++) {
778 double alpha1 = atan(midW[
i] / rmin);
784 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << solid.name() <<
" Polyhedra made of " 785 << matter1.name() <<
" with 1 sector from " <<
convertRadToDeg(-alpha1) <<
" to " 786 <<
convertRadToDeg(alpha1) <<
" and with " << pgonZ.size() <<
" sections";
787 for (
unsigned int ii = 0;
ii < pgonZ.size();
ii++)
789 <<
"\tRmax = " << pgonRmax[
ii];
792 mother.placeVolume(log, 1);
794 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << log.name() <<
" Number 1 positioned in " 795 << mother.name() <<
" at (0,0,0) with no rotation";
801 double rmid = rmin + middleD;
806 pgonZ[1] = zoff[
in] + rmid * ttheta[
in];
809 pgonZ[2] = zoff[
in] + rmax * ttheta[
in];
810 double alpha1 = atan(middleW / rmin);
815 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << solid.name() <<
" Polyhedra made of " << matter1.name()
817 <<
convertRadToDeg(alpha1) <<
" and with " << pgonZ.size() <<
" sections";
818 for (
unsigned int ii = 0;
ii < pgonZ.size();
ii++)
820 <<
"\tRmax = " << pgonRmax[
ii];
823 mother.placeVolume(glog, 1);
825 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << glog.name() <<
" Number 1 positioned in " 826 << mother.name() <<
" at (0,0,0) with no rotation";
829 for (
int i = 1;
i < nMidAbs;
i++) {
830 namek = name + midName[
i];
831 rmid = rmin + midT[
i];
836 pgonZ[1] = zoff[
in] + rmin * ttheta[
in];
839 pgonZ[2] = zoff[
in] + rmid * ttheta[
in];
840 alpha1 = atan(midW[
i] / rmin);
845 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << solid.name() <<
" Polyhedra made of " 846 << matter2.name() <<
" with 1 sector from " <<
convertRadToDeg(-alpha1) <<
" to " 847 <<
convertRadToDeg(alpha1) <<
" and with " << pgonZ.size() <<
" sections";
848 for (
unsigned int ii = 0;
ii < pgonZ.size();
ii++)
850 <<
"\tRmax = " << pgonRmax[
ii];
853 mother.placeVolume(log, i);
855 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << log.name() <<
" Number " << i <<
" positioned in " 856 << mother.name() <<
" at (0,0,0) with no rotation";
874 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: \t\tInside detector " <<
id <<
"...";
886 double dx1, dx2, shiftX;
889 wid = 0.5 * detWidth1[
id];
890 dx1 = 0.5 * detT11[
id];
891 dx2 = 0.5 * detT21[
id];
896 wid = 0.5 * detWidth2[
id];
897 dx1 = 0.5 * detT12[
id];
898 dx2 = 0.5 * detT22[
id];
902 solid = dd4hep::Box(ns.
prepend(plname +
"1"), dx1, wid,
dz);
905 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << solid.name() <<
" Box made of " << plmatter.name()
906 <<
" of dimensions " << dx1 <<
", " << wid <<
", " <<
dz;
909 double x = shiftX + dx1 -
dx;
910 detector.placeVolume(glog, 1, dd4hep::Position(x, y, 0));
912 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << glog.name() <<
" Number 1 positioned in " << detector.name()
913 <<
" at (" << x <<
"," << y <<
",0) with no rotation";
915 solid = dd4hep::Box(ns.
prepend(scname), 0.5 * detTsc[
id], wid,
dz);
918 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << solid.name() <<
" Box made of " << scmatter.name()
919 <<
" of dimensions " << 0.5 * detTsc[
id] <<
", " << wid <<
", " <<
dz;
922 x += dx1 + 0.5 * detTsc[
id];
923 int copyNo =
id * 10 + detType[
id];
924 detector.placeVolume(glog, copyNo, dd4hep::Position(x, y, 0));
926 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << glog.name() <<
" Number " << copyNo <<
" positioned in " 927 << detector.name() <<
" at (" << x <<
"," << y <<
",0) with no rotation";
929 solid = dd4hep::Box(ns.
prepend(plname +
"2"), dx2, wid,
dz);
932 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << solid.name() <<
" Box made of " << plmatter.name()
933 <<
" of dimensions " << dx2 <<
", " << wid <<
", " <<
dz;
936 x += 0.5 * detTsc[
id] + dx2;
937 detector.placeVolume(glog, 1, dd4hep::Position(x, y, 0));
939 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << glog.name() <<
" Number 1 positioned in " << detector.name()
940 <<
" at (" << x <<
"," << y <<
",0) with no rotation";
956 dd4hep::SensitiveDetector& ) {
959 edm::LogVerbatim(
"HCalGeom") <<
"<<== End of DDHCalBarrelAlgo construction";
std::vector< double > rmax
dd4hep::Volume constructMidLayer(dd4hep::Volume laylog, const std::string &nm, double rin, double alpha, cms::DDNamespace &ns)
dd4hep::Volume volume(const std::string &name, bool exc=true) const
std::vector< double > sideAbsW
dd4hep::Rotation3D getRotation(std::string &rotation, std::string &rotns, cms::DDNamespace &ns)
std::vector< int > detPosY
void constructInsideDetectors(dd4hep::Volume &detector, const std::string &name, int id, double dx, double dy, double dz, int type, cms::DDNamespace &ns)
std::vector< double > detWidth1
std::vector< double > detdP2
constexpr NumType convertRadToDeg(NumType radians)
T value(const std::string &name) const
HcalBarrelAlgo(cms::DDParsingContext &ctxt, xml_h &e)
std::vector< double > absorbD
std::vector< std::string > sideAbsMat
std::string_view name() const
std::vector< double > detT11
void constructInsideLayers(dd4hep::Volume &laylog, const std::string &nm, int id, int nAbs, double rin, double d1, double alpha1, double d2, double alpha2, double t1, double t2, cms::DDNamespace &ns)
std::vector< double > layerT1
std::vector< std::string > absorbMat
std::vector< std::string > midMat
std::vector< double > detT12
static constexpr long s_executed
std::vector< std::string > midName
std::vector< double > layerAlpha
std::vector< std::string > sideAbsName
std::vector< double > sideD
std::vector< double > absorbT
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
dd4hep::Material material(const std::string &name) const
std::vector< double > detWidth2
std::vector< double > zoff
std::string prepend(const std::string &) const
std::vector< int > detType
dd4hep::Volume constructSideLayer(dd4hep::Volume &laylog, const std::string &nm, int nAbs, double rin, double alpha, cms::DDNamespace &ns)
std::vector< double > detT22
std::vector< double > theta
std::vector< double > detT21
std::vector< int > layerAbsorb
std::vector< double > layerD1
std::vector< std::string > absorbName
static long algorithm(dd4hep::Detector &, cms::DDParsingContext &ctxt, xml_h e, dd4hep::SensitiveDetector &)
std::vector< double > layerT2
std::vector< double > sideT
const dd4hep::Rotation3D & rotation(const std::string &name) const
std::vector< double > detdP1
std::vector< std::string > layerMat
std::vector< double > layerGap
std::vector< double > midT
std::vector< double > layerWidth
alpha
zGenParticlesMatch = cms.InputTag(""),
std::vector< double > midW
#define DECLARE_DDCMS_DETELEMENT(name, func)
std::vector< std::string > layerLabel
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
std::vector< double > detTsc
std::string parentName() const
Access value of rParent child node.
std::vector< double > layerD2
std::vector< std::string > sideMat
std::vector< double > ttheta
std::vector< int > layerId