!!!!!!!!!!!!!!!!Should be zero. And removed as soon as
159 theta =
args.value<std::vector<double> >(
"Theta");
160 rmax =
args.value<std::vector<double> >(
"RMax");
161 zoff =
args.value<std::vector<double> >(
"ZOff");
166 rmax[2] = (zoff[3] - zoff[2]) /
ttheta[2];
170 <<
", " << nsectortot <<
"\tHalves " << nhalf <<
"\tRotation matrix " << rotns <<
":" 171 << rotHalf <<
"\n\t\t" << rinner <<
"\t" << router <<
"\t" <<
rzones;
173 edm::LogVerbatim(
"HCalGeom") <<
"\tTheta[" <<
i <<
"] = " << theta[
i] <<
"\trmax[" <<
i <<
"] = " << rmax[
i]
174 <<
"\tzoff[" <<
i <<
"] = " << zoff[
i];
184 layerMat =
args.value<std::vector<std::string> >(
"LayerMat");
196 << layerWidth[
i] <<
"\t" << layerD1[
i] <<
"\t" << layerD2[
i] <<
"\t" << layerAlpha[
i]
197 <<
"\t" << layerT1[
i] <<
"\t" << layerT2[
i] <<
"\t" << layerAbsorb[
i] <<
"\t" 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");
211 << absorbD[
i] <<
" t " << absorbT[
i];
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");
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++)
242 sideAbsW =
args.value<std::vector<double> >(
"SideAbsW");
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");
271 detPosY =
args.value<std::vector<int> >(
"DetPosY");
275 << detT11[
i] <<
", " << detT12[
i] <<
"\t" << detTsc[
i] <<
"\t" << detT21[
i] <<
", " 276 << detT22[
i] <<
"\t" << detWidth1[
i] <<
"\t" << detWidth2[
i] <<
"\t" << detPosY[
i];
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]);
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};
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];
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";
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";
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;
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];
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);
521 solid =
dd4hep::Polyhedra(ns.prepend(name), 1, -alpha1, 2 * alpha1, pgonZ, pgonRmin, pgonRmax);
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]);
534 <<
" positioned in " << seclogic.name() <<
" at (0,0,0) with no rotation";
std::vector< double > rmax
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)
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
alpha
zGenParticlesMatch = cms.InputTag(""),
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