!!!!!!!!!!!!!!!!Should be zero. And removed as soon as
160 theta =
args.value<std::vector<double> >(
"Theta");
161 rmax =
args.value<std::vector<double> >(
"RMax");
162 zoff =
args.value<std::vector<double> >(
"ZOff");
167 rmax[2] = (zoff[3] - zoff[2]) /
ttheta[2];
171 <<
", " << nsectortot <<
"\tHalves " << nhalf <<
"\tRotation matrix " << rotns <<
":"
187 layerMat =
args.value<std::vector<std::string> >(
"LayerMat");
208 absorbMat =
args.value<std::vector<std::string> >(
"AbsorbMat");
209 absorbD =
args.value<std::vector<double> >(
"AbsorbD");
210 absorbT =
args.value<std::vector<double> >(
"AbsorbT");
224 midName =
args.value<std::vector<std::string> >(
"MidAbsName");
225 midMat =
args.value<std::vector<std::string> >(
"MidAbsMat");
226 midW =
args.value<std::vector<double> >(
"MidAbsW");
227 midT =
args.value<std::vector<double> >(
"MidAbsT");
236 sideMat =
args.value<std::vector<std::string> >(
"SideMat");
237 sideD =
args.value<std::vector<double> >(
"SideD");
238 sideT =
args.value<std::vector<double> >(
"SideT");
240 for (
unsigned int i = 0;
i <
sideMat.size();
i++)
246 sideAbsW =
args.value<std::vector<double> >(
"SideAbsW");
262 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: Detector (" << nLayers <<
") Rotation matrix " << rotns <<
":"
263 << detRot <<
"\n\t\t" <<
detMat <<
"\t" << detMatPl <<
"\t" <<
detMatSc;
265 detType =
args.value<std::vector<int> >(
"DetType");
266 detdP1 =
args.value<std::vector<double> >(
"DetdP1");
267 detdP2 =
args.value<std::vector<double> >(
"DetdP2");
268 detT11 =
args.value<std::vector<double> >(
"DetT11");
269 detT12 =
args.value<std::vector<double> >(
"DetT12");
270 detTsc =
args.value<std::vector<double> >(
"DetTsc");
271 detT21 =
args.value<std::vector<double> >(
"DetT21");
272 detT22 =
args.value<std::vector<double> >(
"DetT22");
275 detPosY =
args.value<std::vector<int> >(
"DetPosY");
292 <<
" NameSpace " << idNameSpace <<
" Offset " <<
idOffset;
294 <<
"DDHCalBarrelAlgo: General volume...";
297 double alpha = (1._pi) / nsectors;
298 double dphi = nsectortot * (2._pi) / nsectors;
304 int nf =
ntot - nsec;
308 double zmax = zoff[3];
309 double zstep5 = zoff[4];
310 double zstep4 = (zoff[1] + rmax[1] *
ttheta[1]);
311 if ((zoff[2] + rmax[1] *
ttheta[2]) > zstep4)
312 zstep4 = (zoff[2] + rmax[1] * ttheta[2]);
313 double zstep3 = (zoff[1] + rmax[0] * ttheta[1]);
314 double zstep2 = (zoff[0] + rmax[0] * ttheta[0]);
315 double zstep1 = (zoff[0] + rinner * ttheta[0]);
317 double rout1 = rmax[3];
319 double rmid1 = rmax[0];
320 double rmid2 = rmax[1];
321 double rmid3 = (zoff[4] - zoff[2]) / ttheta[2];
322 double rmid4 = rmax[2];
324 std::vector<double> pgonZ = {-zmax,
340 std::vector<double> pgonRmin = {
341 rmid4, rmid3, rmid3, rmid2, rmid1, rmid1, rin, rin, rin, rmid1, rmid1, rmid2, rmid3, rmid3, rmid4};
343 std::vector<double> pgonRmax = {
344 rout1, rout1, rout, rout, rout, rout, rout, rout, rout, rout, rout, rout, rout, rout1, rout1};
346 std::vector<double> pgonZHalf = {0, zstep1, zstep2, zstep3, zstep4, zstep5, zstep5, zmax};
348 std::vector<double> pgonRminHalf = {rin, rin, rmid1, rmid1, rmid2, rmid3, rmid3, rmid4};
350 std::vector<double> pgonRmaxHalf = {rout, rout, rout, rout, rout, rout, rout1, rout1};
358 <<
" with " << nsectortot <<
" sectors from " <<
convertRadToDeg(-alpha) <<
" to "
359 <<
convertRadToDeg(-alpha + dphi) <<
" and with " << nsec <<
" sections ";
360 for (
unsigned int i = 0;
i < pgonZ.size();
i++)
370 <<
" with " << nsectortot <<
" sectors from " <<
convertRadToDeg(-alpha) <<
" to "
371 <<
convertRadToDeg(-alpha + dphi) <<
" and with " << nsec <<
" sections ";
372 for (
unsigned int i = 0;
i < pgonZHalf.size();
i++)
379 dd4hep::Material matter = ns.material(
genMaterial);
382 parentName.placeVolume(genlogic, 1);
384 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << genlogic.name() <<
" number 1 positioned in "
385 << parentName.name() <<
" at (0, 0, 0) with no rotation";
393 <<
" with " << nsectortot <<
" sectors from " <<
convertRadToDeg(-alpha) <<
" to "
394 <<
convertRadToDeg(-alpha + dphi) <<
" and with " << nf <<
" sections ";
395 for (
unsigned int i = 0;
i < pgonZHalf.size();
i++)
401 genlogic.placeVolume(genlogich, 1);
403 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << genlogich.name() <<
" number 1 positioned in "
404 << genlogic.name() <<
" at (0, 0, 0) with no rotation";
408 genlogic.placeVolume(genlogich, 2, rot);
410 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << genlogich.name() <<
" number 2 positioned in "
411 << genlogic.name() <<
" at (0, 0, 0) with " <<
rot;
420 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << solid.name() <<
" Polyhedra made of " << matter.name()
423 for (
unsigned int i = 0;
i < pgonZHalf.size();
i++)
433 rotation = dd4hep::RotationZ(phi);
439 genlogich.placeVolume(seclogic,
ii + 1, rotation);
441 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << seclogic.name() <<
" number " <<
ii + 1
442 <<
" positioned in " << genlogich.name() <<
" at (0, 0, 0) with " <<
rotation;
448 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: Layers (" << nLayers <<
") ...";
453 dd4hep::Material matter = ns.material(layerMat[
i]);
454 double width = layerWidth[
i];
455 double rout = rin + width;
458 for (
int j = 0;
j < rzones - 1;
j++) {
464 double zout = zoff[
in] + rin * ttheta[
in];
469 std::vector<double> pgonZ, pgonRmin, pgonRmax;
471 pgonZ.emplace_back(0);
472 pgonRmin.emplace_back(rin);
473 pgonRmax.emplace_back(rout);
475 pgonZ.emplace_back(zout);
476 pgonRmin.emplace_back(rin);
477 pgonRmax.emplace_back(rout);
481 pgonZ.emplace_back(zoff[in] + rout * ttheta[in]);
482 pgonRmin.emplace_back(pgonRmax[1]);
483 pgonRmax.emplace_back(pgonRmax[1]);
489 pgonZ[1] = (zoff[
out] + rmax[
out] * ttheta[
out]);
490 pgonZ.emplace_back(pgonZ[1]);
491 pgonRmin.emplace_back(pgonRmin[1]);
492 pgonRmax.emplace_back(rmax[in]);
494 pgonZ.emplace_back(zoff[in] + rmax[in] * ttheta[in]);
495 pgonRmin.emplace_back(pgonRmin[2]);
496 pgonRmax.emplace_back(pgonRmax[2]);
500 pgonZ.emplace_back(zoff[in] + rmax[in] * ttheta[in]);
501 pgonRmin.emplace_back(rmax[in]);
502 pgonRmax.emplace_back(pgonRmax[1]);
505 pgonZ.emplace_back(zoff[
out] + rmax[in] * ttheta[
out]);
506 pgonRmin.emplace_back(pgonRmin[2]);
507 pgonRmax.emplace_back(pgonRmax[2]);
511 pgonZ.emplace_back(zoff[out] + rout * ttheta[out]);
512 pgonRmin.emplace_back(rout);
513 pgonRmax.emplace_back(rout);
520 double alpha1 =
alpha;
521 if (layerGap[i] > 1.
e-6) {
522 double rmid = 0.5 * (rin + rout);
523 double width = rmid *
tan(alpha) - layerGap[
i];
524 alpha1 = atan(width / rmid);
531 solid =
dd4hep::Polyhedra(ns.prepend(name), 1, -alpha1, 2 * alpha1, pgonZ, pgonRmin, pgonRmax);
534 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalBarrelAlgo: " << solid.name() <<
" (Layer " << i <<
") Polyhedra made of "
535 << matter.name() <<
" with 1 sector from " <<
convertRadToDeg(-alpha1) <<
" to "
537 for (
unsigned int k = 0;
k < pgonZ.size();
k++)
542 seclogic.placeVolume(glog,
layerId[i]);
545 <<
" positioned in " << seclogic.name() <<
" at (0,0,0) with no rotation";
std::vector< double > rmax
Log< level::Info, true > LogVerbatim
std::vector< double > sideAbsW
dd4hep::Rotation3D getRotation(std::string &rotation, std::string &rotns, cms::DDNamespace &ns)
std::vector< int > detPosY
std::vector< double > detWidth1
std::vector< double > detdP2
constexpr NumType convertRadToDeg(NumType radians)
constexpr NumType convert2mm(NumType length)
std::vector< double > absorbD
std::vector< std::string > sideAbsMat
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
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)
std::vector< double > detWidth2
std::vector< double > zoff
std::vector< int > detType
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
std::vector< double > layerT2
std::vector< double > sideT
std::vector< double > detdP1
std::vector< std::string > layerMat
std::vector< double > layerGap
std::vector< double > midT
std::vector< double > layerWidth
std::vector< double > midW
std::vector< std::string > layerLabel
std::vector< double > detTsc
std::vector< double > layerD2
std::vector< std::string > sideMat
std::vector< double > ttheta
std::vector< int > layerId