CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
HcalBarrelAlgo Struct Reference

Public Member Functions

void constructInsideDetectors (dd4hep::Volume &detector, const std::string &name, int id, double dx, double dy, double dz, int type, cms::DDNamespace &ns)
 
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)
 
dd4hep::Volume constructMidLayer (dd4hep::Volume laylog, const std::string &nm, double rin, double alpha, cms::DDNamespace &ns)
 
dd4hep::Volume constructSideLayer (dd4hep::Volume &laylog, const std::string &nm, int nAbs, double rin, double alpha, cms::DDNamespace &ns)
 
dd4hep::Rotation3D getRotation (std::string &rotation, std::string &rotns, cms::DDNamespace &ns)
 
 HcalBarrelAlgo ()=delete
 
 HcalBarrelAlgo (cms::DDParsingContext &ctxt, xml_h &e)
 

Public Attributes

std::vector< double > absorbD
 
std::vector< std::string > absorbMat
 
std::vector< std::string > absorbName
 
std::vector< double > absorbT
 
std::vector< double > detdP1
 
std::vector< double > detdP2
 
std::string detMat
 
std::string detMatPl
 
std::string detMatSc
 
std::vector< int > detPosY
 
std::string detRot
 
std::vector< double > detT11
 
std::vector< double > detT12
 
std::vector< double > detT21
 
std::vector< double > detT22
 
std::vector< double > detTsc
 
std::vector< int > detType
 
std::vector< double > detWidth1
 
std::vector< double > detWidth2
 
std::string genMaterial
 
std::string idName
 
std::string idNameSpace
 
int idOffset
 
std::vector< int > layerAbsorb
 
std::vector< double > layerAlpha
 
std::vector< double > layerD1
 
std::vector< double > layerD2
 
std::vector< double > layerGap
 
std::vector< int > layerId
 
std::vector< std::string > layerLabel
 
std::vector< std::string > layerMat
 
std::vector< double > layerT1
 
std::vector< double > layerT2
 
std::vector< double > layerWidth
 
double middleD
 
std::string middleMat
 
double middleW
 
std::vector< std::string > midMat
 
std::vector< std::string > midName
 
std::vector< double > midT
 
std::vector< double > midW
 
int nAbsorber
 
int nhalf
 
int nLayers
 
int nMidAbs
 
int nsectors
 
int nsectortot
 
int nSideAbs
 
double rinner
 
std::vector< double > rmax
 
std::string rotHalf
 
std::string rotns
 
double router
 
int rzones
 
std::vector< std::string > sideAbsMat
 
std::vector< std::string > sideAbsName
 
std::vector< double > sideAbsW
 
std::vector< double > sideD
 
std::vector< std::string > sideMat
 
std::vector< double > sideT
 
std::vector< double > theta
 
std::vector< double > ttheta
 
std::vector< double > zoff
 

Detailed Description

Definition at line 22 of file DDHCalBarrelAlgo.cc.

Constructor & Destructor Documentation

HcalBarrelAlgo::HcalBarrelAlgo ( )
delete
HcalBarrelAlgo::HcalBarrelAlgo ( cms::DDParsingContext ctxt,
xml_h &  e 
)
inline

!!!!!!!!!!!!!!!!Should be zero. And removed as soon as

Definition at line 142 of file DDHCalBarrelAlgo.cc.

References zMuMuMuonUserData::alpha, writedatasetfile::args, angle_units::operators::convertRadToDeg(), mps_fire::i, cuy::ii, recoMuon::in, dqmiolumiharvest::j, dqmdumpme::k, cms::DDNamespace::material(), g4SimHits_cfi::Material, Skims_PA_cff::name, cms::DDNamespace::name(), ticl::constants::nLayers, MillePedeFileConverter_cfg::out, cms::DDAlgoArguments::parentName(), HGCalGeometryMode::Polyhedra, cms::DDNamespace::prepend(), makeMuonMisalignmentScenario::rot, idealTransformation::rotation, AlCaHLTBitMon_QueryRunRegistry::string, funct::tan(), cms::DDAlgoArguments::value(), cms::DDNamespace::volume(), ApeEstimator_cff::width, and SiStripMonitorCluster_cfi::zmax.

142  {
143  cms::DDNamespace ns(ctxt, e, true);
144  cms::DDAlgoArguments args(ctxt, e);
145 #ifdef EDM_ML_DEBUG
146  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: Creating an instance";
147 #endif
148 
149  genMaterial = args.value<std::string>("MaterialName");
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");
156  rotHalf = args.value<std::string>("RotHalf");
157  rotns = args.value<std::string>("RotNameSpace");
158 
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])); //*deg already done in XML
164  }
165  if (rzones > 3)
166  rmax[2] = (zoff[3] - zoff[2]) / ttheta[2];
167 
168 #ifdef EDM_ML_DEBUG
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];
175 #endif
176  //Layers
178  nLayers = args.value<int>("NLayers");
179 #ifdef EDM_ML_DEBUG
180  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: Layer\t" << nLayers;
181 #endif
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");
193 #ifdef EDM_ML_DEBUG
194  for (int i = 0; i < nLayers; i++)
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"
198  << layerGap[i];
199 #endif
200 
202  //Absorber Layers and middle part
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();
208 #ifdef EDM_ML_DEBUG
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];
212 #endif
213  middleMat = args.value<std::string>("MiddleMat");
214  middleD = args.value<double>("MiddleD");
215  middleW = args.value<double>("MiddleW");
216 #ifdef EDM_ML_DEBUG
217  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: Middle material " << middleMat << " d " << middleD << " w "
218  << middleW;
219 #endif
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();
225 #ifdef EDM_ML_DEBUG
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];
229 #endif
230 
231  //Absorber layers in the side part
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");
235 #ifdef EDM_ML_DEBUG
236  for (unsigned int i = 0; i < sideMat.size(); i++)
237  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: Side material " << sideMat[i] << " d " << sideD[i] << " t "
238  << sideT[i];
239 #endif
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();
244 #ifdef EDM_ML_DEBUG
245  for (int i = 0; i < nSideAbs; i++)
246  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << sideAbsName[i] << " Material " << sideAbsMat[i] << " W "
247  << sideAbsW[i];
248 #endif
249 
251  // Detectors
252 
253  detMat = args.value<std::string>("DetMat");
254  detRot = args.value<std::string>("DetRot");
255  detMatPl = args.value<std::string>("DetMatPl");
256  detMatSc = args.value<std::string>("DetMatSc");
257 #ifdef EDM_ML_DEBUG
258  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: Detector (" << nLayers << ") Rotation matrix " << rotns << ":"
259  << detRot << "\n\t\t" << detMat << "\t" << detMatPl << "\t" << detMatSc;
260 #endif
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");
272 #ifdef EDM_ML_DEBUG
273  for (int i = 0; i < nLayers; i++)
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];
277 #endif
278 
279  // idName = parentName.name();
280  idName = args.value<std::string>("MotherName");
281  idNameSpace = ns.name();
282  idOffset = args.value<int>("IdOffset");
283 #ifdef EDM_ML_DEBUG
284  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: Parent " << args.parentName() << " idName " << idName
285  << " NameSpace " << idNameSpace << " Offset " << idOffset;
286  edm::LogVerbatim("HCalGeom") << "==>> Constructing DDHCalBarrelAlgo...\n"
287  << "DDHCalBarrelAlgo: General volume...";
288 #endif
289 
290  double alpha = (1._pi) / nsectors;
291  double dphi = nsectortot * (2._pi) / nsectors;
292  int nsec, ntot(15);
293  if (nhalf == 1)
294  nsec = 8;
295  else
296  nsec = 15;
297  int nf = ntot - nsec;
298 
299  //Calculate zmin... see HCalBarrel.hh picture. For polyhedra
300  //Rmin and Rmax are distances to vertex
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];
311  double rin = rinner;
312  double rmid1 = rmax[0];
313  double rmid2 = rmax[1];
314  double rmid3 = (zoff[4] - zoff[2]) / ttheta[2];
315  double rmid4 = rmax[2];
316 
317  std::vector<double> pgonZ = {-zmax,
318  -zstep5,
319  -zstep5,
320  -zstep4,
321  -zstep3,
322  -zstep2,
323  -zstep1,
324  0,
325  zstep1,
326  zstep2,
327  zstep3,
328  zstep4,
329  zstep5,
330  zstep5,
331  zmax};
332 
333  std::vector<double> pgonRmin = {
334  rmid4, rmid3, rmid3, rmid2, rmid1, rmid1, rin, rin, rin, rmid1, rmid1, rmid2, rmid3, rmid3, rmid4};
335 
336  std::vector<double> pgonRmax = {
337  rout1, rout1, rout, rout, rout, rout, rout, rout, rout, rout, rout, rout, rout, rout1, rout1};
338 
339  std::vector<double> pgonZHalf = {0, zstep1, zstep2, zstep3, zstep4, zstep5, zstep5, zmax};
340 
341  std::vector<double> pgonRminHalf = {rin, rin, rmid1, rmid1, rmid2, rmid3, rmid3, rmid4};
342 
343  std::vector<double> pgonRmaxHalf = {rout, rout, rout, rout, rout, rout, rout1, rout1};
344 
345  std::string name("Null");
346  dd4hep::Solid solid;
347  if (nf == 0) {
348  solid = dd4hep::Polyhedra(ns.prepend(idName), nsectortot, -alpha, dphi, pgonZ, pgonRmin, pgonRmax);
349 #ifdef EDM_ML_DEBUG
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++)
354  edm::LogVerbatim("HCalGeom") << "\t"
355  << "\tZ = " << pgonZ[i] << "\tRmin = " << pgonRmin[i]
356  << "\tRmax = " << pgonRmax[i];
357 #endif
358  } else {
359  solid = dd4hep::Polyhedra(ns.prepend(idName), nsectortot, -alpha, dphi, pgonZHalf, pgonRminHalf, pgonRmaxHalf);
360 #ifdef EDM_ML_DEBUG
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++)
365  edm::LogVerbatim("HCalGeom") << "\t"
366  << "\tZ = " << pgonZHalf[i] << "\tRmin = " << pgonRminHalf[i]
367  << "\tRmax = " << pgonRmaxHalf[i];
368 #endif
369  }
370 
371  dd4hep::Material matter = ns.material(genMaterial);
372  dd4hep::Volume genlogic(solid.name(), solid, matter);
373  dd4hep::Volume parentName = ns.volume(args.parentName());
374  parentName.placeVolume(genlogic, 1);
375 #ifdef EDM_ML_DEBUG
376  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << genlogic.name() << " number 1 positioned in "
377  << parentName.name() << " at (0, 0, 0) with no rotation";
378 #endif
379  //Forward and backwards halfs
380  name = idName + "Half";
381  nf = (ntot + 1) / 2;
382  solid = dd4hep::Polyhedra(ns.prepend(name), nsectortot, -alpha, dphi, pgonZHalf, pgonRminHalf, pgonRmaxHalf);
383 #ifdef EDM_ML_DEBUG
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++)
388  edm::LogVerbatim("HCalGeom") << "\t"
389  << "\tZ = " << pgonZHalf[i] << "\tRmin = " << pgonRminHalf[i]
390  << "\tRmax = " << pgonRmaxHalf[i];
391 #endif
392  dd4hep::Volume genlogich(solid.name(), solid, matter);
393  genlogic.placeVolume(genlogich, 1);
394 #ifdef EDM_ML_DEBUG
395  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << genlogich.name() << " number 1 positioned in "
396  << genlogic.name() << " at (0, 0, 0) with no rotation";
397 #endif
398  if (nhalf != 1) {
399  dd4hep::Rotation3D rot = getRotation(rotHalf, rotns, ns);
400  genlogic.placeVolume(genlogich, 2, rot);
401 #ifdef EDM_ML_DEBUG
402  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << genlogich.name() << " number 2 positioned in "
403  << genlogic.name() << " at (0, 0, 0) with " << rot;
404 #endif
405  } //end if (getNhalf...
406 
407  //Construct sector (from -alpha to +alpha)
408  name = idName + "Module";
409  solid = dd4hep::Polyhedra(ns.prepend(name), 1, -alpha, 2 * alpha, pgonZHalf, pgonRminHalf, pgonRmaxHalf);
410  dd4hep::Volume seclogic(solid.name(), solid, matter);
411 #ifdef EDM_ML_DEBUG
412  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " Polyhedra made of " << matter.name()
413  << " with 1 sector from " << convertRadToDeg(-alpha) << " to "
414  << convertRadToDeg(alpha) << " and with " << nf << " sections";
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];
418 #endif
419 
420  for (int ii = 0; ii < nsectortot; ii++) {
421  double phi = ii * 2 * alpha;
422  dd4hep::Rotation3D rotation;
423  if (phi != 0) {
424  rotation = dd4hep::RotationZ(phi);
425 #ifdef EDM_ML_DEBUG
426  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: Creating a new "
427  << "rotation around Z " << convertRadToDeg(phi);
428 #endif
429  } //if phideg!=0
430  genlogich.placeVolume(seclogic, ii + 1, rotation);
431 #ifdef EDM_ML_DEBUG
432  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << seclogic.name() << " number " << ii + 1
433  << " positioned in " << genlogich.name() << " at (0, 0, 0) with " << rotation;
434 #endif
435  }
436 
437  //Construct the things inside the sector
438 #ifdef EDM_ML_DEBUG
439  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: Layers (" << nLayers << ") ...";
440 #endif
441  rin = rinner;
442  for (int i = 0; i < nLayers; i++) {
443  std::string name = idName + layerLabel[i];
444  dd4hep::Material matter = ns.material(layerMat[i]);
445  double width = layerWidth[i];
446  double rout = rin + width;
447 
448  int in = 0, out = 0;
449  for (int j = 0; j < rzones - 1; j++) {
450  if (rin >= rmax[j])
451  in = j + 1;
452  if (rout > rmax[j])
453  out = j + 1;
454  }
455  double zout = zoff[in] + rin * ttheta[in];
456 
458  //vertical walls are allowed in SolidPolyhedra
459  int nsec = 2;
460  std::vector<double> pgonZ, pgonRmin, pgonRmax;
461  // index 0
462  pgonZ.emplace_back(0);
463  pgonRmin.emplace_back(rin);
464  pgonRmax.emplace_back(rout);
465  // index 1
466  pgonZ.emplace_back(zout);
467  pgonRmin.emplace_back(rin);
468  pgonRmax.emplace_back(rout);
469  if (in == out) {
470  if (in <= 3) {
471  //index 2
472  pgonZ.emplace_back(zoff[in] + rout * ttheta[in]);
473  pgonRmin.emplace_back(pgonRmax[1]);
474  pgonRmax.emplace_back(pgonRmax[1]);
475  nsec++;
476  }
477  } else {
478  if (in == 3) {
479  //redo index 1, add index 2
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]);
484  //index 3
485  pgonZ.emplace_back(zoff[in] + rmax[in] * ttheta[in]);
486  pgonRmin.emplace_back(pgonRmin[2]);
487  pgonRmax.emplace_back(pgonRmax[2]);
488  nsec += 2;
489  } else {
490  //index 2
491  pgonZ.emplace_back(zoff[in] + rmax[in] * ttheta[in]);
492  pgonRmin.emplace_back(rmax[in]);
493  pgonRmax.emplace_back(pgonRmax[1]);
494  nsec++;
495  if (in == 0) {
496  pgonZ.emplace_back(zoff[out] + rmax[in] * ttheta[out]);
497  pgonRmin.emplace_back(pgonRmin[2]);
498  pgonRmax.emplace_back(pgonRmax[2]);
499  nsec++;
500  }
501  if (in <= 1) {
502  pgonZ.emplace_back(zoff[out] + rout * ttheta[out]);
503  pgonRmin.emplace_back(rout);
504  pgonRmax.emplace_back(rout);
505  nsec++;
506  }
507  }
508  }
509  //Solid & volume
510  dd4hep::Solid solid;
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);
516 #ifdef EDM_ML_DEBUG
517  edm::LogVerbatim("HCalGeom") << "\tAlpha_1 modified from " << convertRadToDeg(alpha) << " to "
518  << convertRadToDeg(alpha1) << " Rmid " << rmid << " Reduced width " << width;
519 #endif
520  }
521  solid = dd4hep::Polyhedra(ns.prepend(name), 1, -alpha1, 2 * alpha1, pgonZ, pgonRmin, pgonRmax);
522  dd4hep::Volume glog(solid.name(), solid, matter);
523 #ifdef EDM_ML_DEBUG
524  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " (Layer " << i << ") Polyhedra made of "
525  << matter.name() << " with 1 sector from " << convertRadToDeg(-alpha1) << " to "
526  << convertRadToDeg(alpha1) << " and with " << nsec << " sections";
527  for (unsigned int k = 0; k < pgonZ.size(); k++)
528  edm::LogVerbatim("HCalGeom") << "\t\t" << pgonZ[k] << "\t" << pgonRmin[k] << "\t" << pgonRmax[k];
529 #endif
530 
531  seclogic.placeVolume(glog, layerId[i]);
532 #ifdef EDM_ML_DEBUG
533  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << glog.name() << " number " << layerId[i]
534  << " positioned in " << seclogic.name() << " at (0,0,0) with no rotation";
535 #endif
537  layerLabel[i],
538  layerId[i],
539  layerAbsorb[i],
540  rin,
541  layerD1[i],
542  alpha1,
543  layerD2[i],
544  layerAlpha[i],
545  layerT1[i],
546  layerT2[i],
547  ns);
548  rin = rout;
549  }
550  }
std::vector< double > rmax
std::string rotHalf
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::string detRot
std::string detMatPl
std::string rotns
std::vector< double > detdP2
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
std::string detMat
std::string genMaterial
std::string middleMat
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::string detMatSc
std::vector< double > absorbT
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
std::vector< double > detWidth2
std::vector< double > zoff
std::vector< int > detType
std::vector< double > detT22
std::string idNameSpace
std::string idName
dd4hep::Volume Volume
ii
Definition: cuy.py:590
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

Member Function Documentation

void HcalBarrelAlgo::constructInsideDetectors ( dd4hep::Volume &  detector,
const std::string &  name,
int  id,
double  dx,
double  dy,
double  dz,
int  type,
cms::DDNamespace ns 
)
inline

Definition at line 865 of file DDHCalBarrelAlgo.cc.

References DDSplit(), PVValHelper::dx, PVValHelper::dz, dqmdumpme::first, triggerObjects_cff::id, cms::DDNamespace::material(), g4SimHits_cfi::Material, Skims_PA_cff::name, cms::DDNamespace::prepend(), and AlCaHLTBitMon_QueryRunRegistry::string.

872  {
873 #ifdef EDM_ML_DEBUG
874  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: \t\tInside detector " << id << "...";
875 #endif
876 
877  dd4hep::Material plmatter = ns.material(detMatPl);
878  dd4hep::Material scmatter = ns.material(detMatSc);
879  std::string plname = DDSplit(detector.name()).first + "Plastic_";
880  std::string scname = idName + "Scintillator" + name;
881 
882  id--;
883  dd4hep::Solid solid;
884  dd4hep::Volume glog;
885  double wid, y = 0;
886  double dx1, dx2, shiftX;
887 
888  if (type == 1) {
889  wid = 0.5 * detWidth1[id];
890  dx1 = 0.5 * detT11[id];
891  dx2 = 0.5 * detT21[id];
892  shiftX = detdP1[id];
893  if (detPosY[id] > 0)
894  y = -dy + wid;
895  } else {
896  wid = 0.5 * detWidth2[id];
897  dx1 = 0.5 * detT12[id];
898  dx2 = 0.5 * detT22[id];
899  shiftX = detdP2[id];
900  }
901 
902  solid = dd4hep::Box(ns.prepend(plname + "1"), dx1, wid, dz);
903  glog = dd4hep::Volume(solid.name(), solid, plmatter);
904 #ifdef EDM_ML_DEBUG
905  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " Box made of " << plmatter.name()
906  << " of dimensions " << dx1 << ", " << wid << ", " << dz;
907 #endif
908 
909  double x = shiftX + dx1 - dx;
910  detector.placeVolume(glog, 1, dd4hep::Position(x, y, 0));
911 #ifdef EDM_ML_DEBUG
912  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << glog.name() << " Number 1 positioned in " << detector.name()
913  << " at (" << x << "," << y << ",0) with no rotation";
914 #endif
915  solid = dd4hep::Box(ns.prepend(scname), 0.5 * detTsc[id], wid, dz);
916  glog = dd4hep::Volume(solid.name(), solid, scmatter);
917 #ifdef EDM_ML_DEBUG
918  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " Box made of " << scmatter.name()
919  << " of dimensions " << 0.5 * detTsc[id] << ", " << wid << ", " << dz;
920 #endif
921 
922  x += dx1 + 0.5 * detTsc[id];
923  int copyNo = id * 10 + detType[id];
924  detector.placeVolume(glog, copyNo, dd4hep::Position(x, y, 0));
925 #ifdef EDM_ML_DEBUG
926  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << glog.name() << " Number " << copyNo << " positioned in "
927  << detector.name() << " at (" << x << "," << y << ",0) with no rotation";
928 #endif
929  solid = dd4hep::Box(ns.prepend(plname + "2"), dx2, wid, dz);
930  glog = dd4hep::Volume(solid.name(), solid, plmatter);
931 #ifdef EDM_ML_DEBUG
932  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " Box made of " << plmatter.name()
933  << " of dimensions " << dx2 << ", " << wid << ", " << dz;
934 #endif
935 
936  x += 0.5 * detTsc[id] + dx2;
937  detector.placeVolume(glog, 1, dd4hep::Position(x, y, 0));
938 #ifdef EDM_ML_DEBUG
939  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << glog.name() << " Number 1 positioned in " << detector.name()
940  << " at (" << x << "," << y << ",0) with no rotation";
941 #endif
942  }
type
Definition: HCALResponse.h:21
std::vector< int > detPosY
std::vector< double > detWidth1
std::string detMatPl
std::vector< double > detdP2
std::vector< double > detT11
std::vector< double > detT12
std::string detMatSc
dd4hep::Material material(const std::string &name) const
Definition: DDNamespace.cc:121
std::vector< double > detWidth2
std::string prepend(const std::string &) const
Definition: DDNamespace.cc:66
std::vector< int > detType
std::vector< double > detT22
std::string idName
dd4hep::Volume Volume
std::vector< double > detT21
std::vector< double > detdP1
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
std::vector< double > detTsc
void HcalBarrelAlgo::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 
)
inline

Definition at line 552 of file DDHCalBarrelAlgo.cc.

References PVValHelper::dx, PVValHelper::dy, PVValHelper::dz, mps_fire::i, recoMuon::in, cms::DDNamespace::material(), g4SimHits_cfi::Material, Skims_PA_cff::name, cms::DDNamespace::prepend(), makeMuonMisalignmentScenario::rot, AlCaHLTBitMon_QueryRunRegistry::string, RandomServiceHelper::t1, RandomServiceHelper::t2, and funct::tan().

563  {
564 #ifdef EDM_ML_DEBUG
565  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: \t\tInside layer " << id << "...";
566 #endif
567 
569  //Pointers to the Rotation Matrices and to the Materials
570  dd4hep::Rotation3D rot = getRotation(detRot, rotns, ns);
571 
572  std::string nam0 = nm + "In";
573  std::string name = idName + nam0;
574  dd4hep::Material matter = ns.material(detMat);
575 
576  dd4hep::Solid solid;
577  dd4hep::Volume glog, mother;
578  double rsi, dx, dy, dz, x, y;
579  int i, in;
580  //Two lower volumes
581  if (alpha1 > 0) {
582  rsi = rin + d1;
583  in = 0;
584  for (i = 0; i < rzones - 1; i++) {
585  if (rsi >= rmax[i])
586  in = i + 1;
587  }
588  dx = 0.5 * t1;
589  dy = 0.5 * rsi * (tan(alpha1) - tan(alpha2));
590  dz = 0.5 * (zoff[in] + rsi * ttheta[in]);
591  x = rsi + dx;
592  y = 0.5 * rsi * (tan(alpha1) + tan(alpha2));
593  dd4hep::Position r11(x, y, dz);
594  dd4hep::Position r12(x, -y, dz);
595 
596  solid = dd4hep::Box(ns.prepend(name + "1"), dx, dy, dz);
597 #ifdef EDM_ML_DEBUG
598  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " Box made of " << matter.name()
599  << " of dimensions " << dx << ", " << dy << ", " << dz;
600 #endif
601  glog = dd4hep::Volume(solid.name(), solid, matter);
602 
603  if (nAbs != 0) {
604  mother = constructSideLayer(laylog, name, nAbs, rin, alpha1, ns);
605  } else {
606  mother = laylog;
607  }
608  mother.placeVolume(glog, idOffset + 1, r11);
609  mother.placeVolume(glog, idOffset + 2, dd4hep::Transform3D(rot, r12));
610 #ifdef EDM_ML_DEBUG
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;
615 #endif
616  //Constructin the plastics and scintillators inside
617  constructInsideDetectors(glog, nam0 + "1", id, dx, dy, dz, 1, ns);
618  }
619 
620  //Upper volume
621  rsi = rin + d2;
622  in = 0;
623  for (i = 0; i < rzones - 1; i++) {
624  if (rsi >= rmax[i])
625  in = i + 1;
626  }
627  dx = 0.5 * t2;
628  dy = 0.5 * rsi * tan(alpha2);
629  dz = 0.5 * (zoff[in] + rsi * ttheta[in]);
630  x = rsi + dx;
631  dd4hep::Position r21(x, dy, dz);
632  dd4hep::Position r22(x, -dy, dz);
633 
634  solid = dd4hep::Box(ns.prepend(name + "2"), dx, dy, dz);
635 #ifdef EDM_ML_DEBUG
636  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " Box made of " << matter.name()
637  << " of dimensions " << dx << ", " << dy << ", " << dz;
638 #endif
639  glog = dd4hep::Volume(solid.name(), solid, matter);
640 
641  if (nAbs < 0) {
642  mother = constructMidLayer(laylog, name, rin, alpha1, ns);
643  } else {
644  mother = laylog;
645  }
646  mother.placeVolume(glog, idOffset + 3, r21);
647  mother.placeVolume(glog, idOffset + 4, dd4hep::Transform3D(rot, r22));
648 #ifdef EDM_ML_DEBUG
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;
653 #endif
654  //Constructin the plastics and scintillators inside
655  constructInsideDetectors(glog, nam0 + "2", id, dx, dy, dz, 2, ns);
656  }
std::vector< double > rmax
dd4hep::Volume constructMidLayer(dd4hep::Volume laylog, const std::string &nm, double rin, double alpha, cms::DDNamespace &ns)
dd4hep::Rotation3D getRotation(std::string &rotation, std::string &rotns, cms::DDNamespace &ns)
void constructInsideDetectors(dd4hep::Volume &detector, const std::string &name, int id, double dx, double dy, double dz, int type, cms::DDNamespace &ns)
std::string detRot
std::string rotns
std::string detMat
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
dd4hep::Material material(const std::string &name) const
Definition: DDNamespace.cc:121
std::vector< double > zoff
std::string prepend(const std::string &) const
Definition: DDNamespace.cc:66
dd4hep::Volume constructSideLayer(dd4hep::Volume &laylog, const std::string &nm, int nAbs, double rin, double alpha, cms::DDNamespace &ns)
std::string idName
dd4hep::Volume Volume
std::vector< double > ttheta
dd4hep::Volume HcalBarrelAlgo::constructMidLayer ( dd4hep::Volume  laylog,
const std::string &  nm,
double  rin,
double  alpha,
cms::DDNamespace ns 
)
inline

Definition at line 730 of file DDHCalBarrelAlgo.cc.

References zMuMuMuonUserData::alpha, angle_units::operators::convertRadToDeg(), mps_fire::i, cuy::ii, recoMuon::in, dqmdumpme::k, dqm-mbProfile::log, cms::DDNamespace::material(), g4SimHits_cfi::Material, Skims_PA_cff::name, HGCalGeometryMode::Polyhedra, cms::DDNamespace::prepend(), and AlCaHLTBitMon_QueryRunRegistry::string.

731  {
732  dd4hep::Solid solid;
733  dd4hep::Volume log, glog;
734  std::string name = nm + "Mid";
735  for (int k = 0; k < nAbsorber; k++) {
736  std::string namek = name + absorbName[k];
737  double rsi = rin + absorbD[k];
738  int in = 0;
739  for (int i = 0; i < rzones - 1; i++) {
740  if (rsi >= rmax[i])
741  in = i + 1;
742  }
743  std::vector<double> pgonZ, pgonRmin, pgonRmax;
744  // index 0
745  pgonZ.emplace_back(0.0);
746  pgonRmin.emplace_back(rsi);
747  pgonRmax.emplace_back(rsi + absorbT[k]);
748  // index 1
749  pgonZ.emplace_back(zoff[in] + rsi * ttheta[in]);
750  pgonRmin.emplace_back(rsi);
751  pgonRmax.emplace_back(pgonRmax[0]);
752  // index 2
753  pgonZ.emplace_back(zoff[in] + pgonRmax[0] * ttheta[in]);
754  pgonRmin.emplace_back(pgonRmax[1]);
755  pgonRmax.emplace_back(pgonRmax[1]);
756  solid = dd4hep::Polyhedra(ns.prepend(namek), 1, -alpha, 2 * alpha, pgonZ, pgonRmin, pgonRmax);
757  dd4hep::Material matter = ns.material(absorbMat[k]);
758  log = dd4hep::Volume(solid.name(), solid, matter);
759 #ifdef EDM_ML_DEBUG
760  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " Polyhedra made of " << matter.name()
761  << " with 1 sector from " << convertRadToDeg(-alpha) << " to "
762  << convertRadToDeg(alpha) << " and with " << pgonZ.size() << " sections";
763  for (unsigned int ii = 0; ii < pgonZ.size(); ii++)
764  edm::LogVerbatim("HCalGeom") << "\t\tZ = " << pgonZ[ii] << "\tRmin = " << pgonRmin[ii]
765  << "\tRmax = " << pgonRmax[ii];
766 #endif
767 
768  laylog.placeVolume(log, 1);
769 #ifdef EDM_ML_DEBUG
770  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << log.name() << " Number 1 positioned in " << laylog.name()
771  << " at (0,0,0) with no rotation";
772 #endif
773  if (k == 0) {
774  double rmin = pgonRmin[0];
775  double rmax = pgonRmax[0];
776  dd4hep::Volume mother = log;
777  for (int i = 0; i < 1; i++) {
778  double alpha1 = atan(midW[i] / rmin);
779  std::string namek = name + midName[i];
780  solid = dd4hep::Polyhedra(ns.prepend(namek), 1, -alpha1, 2 * alpha1, pgonZ, pgonRmin, pgonRmax);
781  dd4hep::Material matter1 = ns.material(midMat[i]);
782  log = dd4hep::Volume(solid.name(), solid, matter1);
783 #ifdef EDM_ML_DEBUG
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++)
788  edm::LogVerbatim("HCalGeom") << "\t\tZ = " << pgonZ[ii] << "\tRmin = " << pgonRmin[ii]
789  << "\tRmax = " << pgonRmax[ii];
790 #endif
791 
792  mother.placeVolume(log, 1);
793 #ifdef EDM_ML_DEBUG
794  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << log.name() << " Number 1 positioned in "
795  << mother.name() << " at (0,0,0) with no rotation";
796 #endif
797  mother = log;
798  }
799 
800  // Now the layer with detectors
801  double rmid = rmin + middleD;
802  pgonRmin[0] = rmid;
803  pgonRmax[0] = rmax;
804  pgonRmin[1] = rmid;
805  pgonRmax[1] = rmax;
806  pgonZ[1] = zoff[in] + rmid * ttheta[in];
807  pgonRmin[2] = rmax;
808  pgonRmax[2] = rmax;
809  pgonZ[2] = zoff[in] + rmax * ttheta[in];
810  double alpha1 = atan(middleW / rmin);
811  solid = dd4hep::Polyhedra(ns.prepend(name), 1, -alpha1, 2 * alpha1, pgonZ, pgonRmin, pgonRmax);
812  dd4hep::Material matter1 = ns.material(middleMat);
813  glog = dd4hep::Volume(solid.name(), solid, matter1);
814 #ifdef EDM_ML_DEBUG
815  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " Polyhedra made of " << matter1.name()
816  << " with 1 sector from " << convertRadToDeg(-alpha1) << " to "
817  << convertRadToDeg(alpha1) << " and with " << pgonZ.size() << " sections";
818  for (unsigned int ii = 0; ii < pgonZ.size(); ii++)
819  edm::LogVerbatim("HCalGeom") << "\t\tZ = " << pgonZ[ii] << "\tRmin = " << pgonRmin[ii]
820  << "\tRmax = " << pgonRmax[ii];
821 #endif
822 
823  mother.placeVolume(glog, 1);
824 #ifdef EDM_ML_DEBUG
825  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << glog.name() << " Number 1 positioned in "
826  << mother.name() << " at (0,0,0) with no rotation";
827 #endif
828  // Now the remaining absorber layers
829  for (int i = 1; i < nMidAbs; i++) {
830  namek = name + midName[i];
831  rmid = rmin + midT[i];
832  pgonRmin[0] = rmin;
833  pgonRmax[0] = rmid;
834  pgonRmin[1] = rmin;
835  pgonRmax[1] = rmid;
836  pgonZ[1] = zoff[in] + rmin * ttheta[in];
837  pgonRmin[2] = rmid;
838  pgonRmax[2] = rmid;
839  pgonZ[2] = zoff[in] + rmid * ttheta[in];
840  alpha1 = atan(midW[i] / rmin);
841  solid = dd4hep::Polyhedra(ns.prepend(namek), 1, -alpha1, 2 * alpha1, pgonZ, pgonRmin, pgonRmax);
842  dd4hep::Material matter2 = ns.material(midMat[i]);
843  log = dd4hep::Volume(solid.name(), solid, matter2);
844 #ifdef EDM_ML_DEBUG
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++)
849  edm::LogVerbatim("HCalGeom") << "\t\tZ = " << pgonZ[ii] << "\tRmin = " << pgonRmin[ii]
850  << "\tRmax = " << pgonRmax[ii];
851 #endif
852 
853  mother.placeVolume(log, i);
854 #ifdef EDM_ML_DEBUG
855  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << log.name() << " Number " << i << " positioned in "
856  << mother.name() << " at (0,0,0) with no rotation";
857 #endif
858  mother = log;
859  }
860  }
861  }
862  return glog;
863  }
std::vector< double > rmax
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
std::string middleMat
std::vector< double > absorbD
std::vector< std::string > absorbMat
std::vector< std::string > midMat
std::vector< std::string > midName
std::vector< double > absorbT
dd4hep::Material material(const std::string &name) const
Definition: DDNamespace.cc:121
std::vector< double > zoff
std::string prepend(const std::string &) const
Definition: DDNamespace.cc:66
dd4hep::Volume Volume
ii
Definition: cuy.py:590
std::vector< std::string > absorbName
std::vector< double > midT
alpha
zGenParticlesMatch = cms.InputTag(""),
std::vector< double > midW
std::vector< double > ttheta
dd4hep::Volume HcalBarrelAlgo::constructSideLayer ( dd4hep::Volume &  laylog,
const std::string &  nm,
int  nAbs,
double  rin,
double  alpha,
cms::DDNamespace ns 
)
inline

Definition at line 658 of file DDHCalBarrelAlgo.cc.

References funct::abs(), zMuMuMuonUserData::alpha, angle_units::operators::convertRadToDeg(), mps_fire::i, cuy::ii, recoMuon::in, dqmdumpme::k, dqm-mbProfile::log, cms::DDNamespace::material(), g4SimHits_cfi::Material, Skims_PA_cff::name, HGCalGeometryMode::Polyhedra, cms::DDNamespace::prepend(), and AlCaHLTBitMon_QueryRunRegistry::string.

659  {
660  //Extra absorber layer
661  int k = abs(nAbs) - 1;
662  std::string namek = nm + "Side";
663  double rsi = rin + sideD[k];
664  int in = 0;
665  for (int i = 0; i < rzones - 1; i++) {
666  if (rsi >= rmax[i])
667  in = i + 1;
668  }
669  std::vector<double> pgonZ, pgonRmin, pgonRmax;
670  // index 0
671  pgonZ.emplace_back(0.0);
672  pgonRmin.emplace_back(rsi);
673  pgonRmax.emplace_back(rsi + sideT[k]);
674  // index 1
675  pgonZ.emplace_back(zoff[in] + rsi * ttheta[in]);
676  pgonRmin.emplace_back(rsi);
677  pgonRmax.emplace_back(pgonRmax[0]);
678  // index 2
679  pgonZ.emplace_back(zoff[in] + pgonRmax[0] * ttheta[in]);
680  pgonRmin.emplace_back(pgonRmax[1]);
681  pgonRmax.emplace_back(pgonRmax[1]);
682  dd4hep::Solid solid = dd4hep::Polyhedra(ns.prepend(namek), 1, -alpha, 2 * alpha, pgonZ, pgonRmin, pgonRmax);
683  dd4hep::Material matter = ns.material(sideMat[k]);
684  dd4hep::Volume glog(solid.name(), solid, matter);
685 #ifdef EDM_ML_DEBUG
686  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " Polyhedra made of " << sideMat[k]
687  << " with 1 sector from " << convertRadToDeg(-alpha) << " to "
688  << convertRadToDeg(alpha) << " and with " << pgonZ.size() << " sections";
689  for (unsigned int ii = 0; ii < pgonZ.size(); ii++)
690  edm::LogVerbatim("HCalGeom") << "\t\tZ = " << pgonZ[ii] << "\tRmin = " << pgonRmin[ii]
691  << "\tRmax = " << pgonRmax[ii];
692 #endif
693 
694  laylog.placeVolume(glog, 1);
695 #ifdef EDM_ML_DEBUG
696  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << glog.name() << " Number 1 positioned in " << laylog.name()
697  << " at (0,0,0) with no rotation";
698 #endif
699  if (nAbs < 0) {
700  dd4hep::Volume mother = glog;
701  double rmid = pgonRmax[0];
702  for (int i = 0; i < nSideAbs; i++) {
703  double alpha1 = atan(sideAbsW[i] / rmid);
704  if (alpha1 > 0) {
705  std::string name = namek + sideAbsName[i];
706  solid = dd4hep::Polyhedra(ns.prepend(name), 1, -alpha1, 2 * alpha1, pgonZ, pgonRmin, pgonRmax);
707  dd4hep::Material matter = ns.material(sideAbsMat[i]);
708  dd4hep::Volume log(solid.name(), solid, matter);
709 #ifdef EDM_ML_DEBUG
710  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << solid.name() << " Polyhedra made of " << sideAbsMat[i]
711  << " with 1 sector from " << convertRadToDeg(-alpha1) << " to "
712  << convertRadToDeg(alpha1) << " and with " << pgonZ.size() << " sections";
713  for (unsigned int ii = 0; ii < pgonZ.size(); ii++)
714  edm::LogVerbatim("HCalGeom") << "\t\tZ = " << pgonZ[ii] << "\tRmin = " << pgonRmin[ii]
715  << "\tRmax = " << pgonRmax[ii];
716 #endif
717 
718  mother.placeVolume(log, 1);
719 #ifdef EDM_ML_DEBUG
720  edm::LogVerbatim("HCalGeom") << "DDHCalBarrelAlgo: " << log.name() << " Number 1 positioned in "
721  << mother.name() << " at (0,0,0) with no rotation";
722 #endif
723  mother = log;
724  }
725  }
726  }
727  return glog;
728  }
std::vector< double > rmax
std::vector< double > sideAbsW
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
std::vector< std::string > sideAbsMat
std::vector< std::string > sideAbsName
std::vector< double > sideD
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
dd4hep::Material material(const std::string &name) const
Definition: DDNamespace.cc:121
std::vector< double > zoff
std::string prepend(const std::string &) const
Definition: DDNamespace.cc:66
dd4hep::Volume Volume
ii
Definition: cuy.py:590
std::vector< double > sideT
alpha
zGenParticlesMatch = cms.InputTag(""),
std::vector< std::string > sideMat
std::vector< double > ttheta
dd4hep::Rotation3D HcalBarrelAlgo::getRotation ( std::string &  rotation,
std::string &  rotns,
cms::DDNamespace ns 
)
inline

Definition at line 944 of file DDHCalBarrelAlgo.cc.

References NAMESPACE_SEP, makeMuonMisalignmentScenario::rot, idealTransformation::rotation, cms::DDNamespace::rotation(), and AlCaHLTBitMon_QueryRunRegistry::string.

944  {
945  std::string rot = (strchr(rotation.c_str(), NAMESPACE_SEP) == nullptr) ? (rotns + ":" + rotation) : rotation;
946 #ifdef EDM_ML_DEBUG
947  edm::LogVerbatim("HCalGeom") << "getRotation: " << rotation << ":" << rot << ":" << ns.rotation(rot);
948 #endif
949  return ns.rotation(rot);
950  }
std::string rotns
const dd4hep::Rotation3D & rotation(const std::string &name) const
Definition: DDNamespace.cc:130
#define NAMESPACE_SEP
Definition: DDNamespace.h:79

Member Data Documentation

std::vector<double> HcalBarrelAlgo::absorbD

Definition at line 89 of file DDHCalBarrelAlgo.cc.

std::vector<std::string> HcalBarrelAlgo::absorbMat

Definition at line 88 of file DDHCalBarrelAlgo.cc.

std::vector<std::string> HcalBarrelAlgo::absorbName

Definition at line 87 of file DDHCalBarrelAlgo.cc.

std::vector<double> HcalBarrelAlgo::absorbT

Definition at line 90 of file DDHCalBarrelAlgo.cc.

std::vector<double> HcalBarrelAlgo::detdP1

Definition at line 125 of file DDHCalBarrelAlgo.cc.

std::vector<double> HcalBarrelAlgo::detdP2

Definition at line 126 of file DDHCalBarrelAlgo.cc.

std::string HcalBarrelAlgo::detMat

Definition at line 120 of file DDHCalBarrelAlgo.cc.

std::string HcalBarrelAlgo::detMatPl

Definition at line 122 of file DDHCalBarrelAlgo.cc.

std::string HcalBarrelAlgo::detMatSc

Definition at line 123 of file DDHCalBarrelAlgo.cc.

std::vector<int> HcalBarrelAlgo::detPosY

Definition at line 134 of file DDHCalBarrelAlgo.cc.

std::string HcalBarrelAlgo::detRot

Definition at line 121 of file DDHCalBarrelAlgo.cc.

std::vector<double> HcalBarrelAlgo::detT11

Definition at line 127 of file DDHCalBarrelAlgo.cc.

std::vector<double> HcalBarrelAlgo::detT12

Definition at line 128 of file DDHCalBarrelAlgo.cc.

std::vector<double> HcalBarrelAlgo::detT21

Definition at line 130 of file DDHCalBarrelAlgo.cc.

std::vector<double> HcalBarrelAlgo::detT22

Definition at line 131 of file DDHCalBarrelAlgo.cc.

std::vector<double> HcalBarrelAlgo::detTsc

Definition at line 129 of file DDHCalBarrelAlgo.cc.

std::vector<int> HcalBarrelAlgo::detType

Definition at line 124 of file DDHCalBarrelAlgo.cc.

std::vector<double> HcalBarrelAlgo::detWidth1

Definition at line 132 of file DDHCalBarrelAlgo.cc.

std::vector<double> HcalBarrelAlgo::detWidth2

Definition at line 133 of file DDHCalBarrelAlgo.cc.

std::string HcalBarrelAlgo::genMaterial

Definition at line 34 of file DDHCalBarrelAlgo.cc.

std::string HcalBarrelAlgo::idName

Definition at line 136 of file DDHCalBarrelAlgo.cc.

std::string HcalBarrelAlgo::idNameSpace

Definition at line 137 of file DDHCalBarrelAlgo.cc.

int HcalBarrelAlgo::idOffset

Definition at line 138 of file DDHCalBarrelAlgo.cc.

std::vector<int> HcalBarrelAlgo::layerAbsorb

Definition at line 83 of file DDHCalBarrelAlgo.cc.

std::vector<double> HcalBarrelAlgo::layerAlpha

Definition at line 80 of file DDHCalBarrelAlgo.cc.

std::vector<double> HcalBarrelAlgo::layerD1

Definition at line 78 of file DDHCalBarrelAlgo.cc.

std::vector<double> HcalBarrelAlgo::layerD2

Definition at line 79 of file DDHCalBarrelAlgo.cc.

std::vector<double> HcalBarrelAlgo::layerGap

Definition at line 84 of file DDHCalBarrelAlgo.cc.

std::vector<int> HcalBarrelAlgo::layerId

Definition at line 74 of file DDHCalBarrelAlgo.cc.

std::vector<std::string> HcalBarrelAlgo::layerLabel

Definition at line 75 of file DDHCalBarrelAlgo.cc.

std::vector<std::string> HcalBarrelAlgo::layerMat

Definition at line 76 of file DDHCalBarrelAlgo.cc.

std::vector<double> HcalBarrelAlgo::layerT1

Definition at line 81 of file DDHCalBarrelAlgo.cc.

std::vector<double> HcalBarrelAlgo::layerT2

Definition at line 82 of file DDHCalBarrelAlgo.cc.

std::vector<double> HcalBarrelAlgo::layerWidth

Definition at line 77 of file DDHCalBarrelAlgo.cc.

double HcalBarrelAlgo::middleD

Definition at line 92 of file DDHCalBarrelAlgo.cc.

std::string HcalBarrelAlgo::middleMat

Definition at line 91 of file DDHCalBarrelAlgo.cc.

double HcalBarrelAlgo::middleW

Definition at line 93 of file DDHCalBarrelAlgo.cc.

std::vector<std::string> HcalBarrelAlgo::midMat

Definition at line 96 of file DDHCalBarrelAlgo.cc.

std::vector<std::string> HcalBarrelAlgo::midName

Definition at line 95 of file DDHCalBarrelAlgo.cc.

std::vector<double> HcalBarrelAlgo::midT

Definition at line 98 of file DDHCalBarrelAlgo.cc.

std::vector<double> HcalBarrelAlgo::midW

Definition at line 97 of file DDHCalBarrelAlgo.cc.

int HcalBarrelAlgo::nAbsorber

Definition at line 86 of file DDHCalBarrelAlgo.cc.

int HcalBarrelAlgo::nhalf

Definition at line 37 of file DDHCalBarrelAlgo.cc.

int HcalBarrelAlgo::nLayers

Definition at line 73 of file DDHCalBarrelAlgo.cc.

int HcalBarrelAlgo::nMidAbs

Definition at line 94 of file DDHCalBarrelAlgo.cc.

int HcalBarrelAlgo::nsectors

Definition at line 35 of file DDHCalBarrelAlgo.cc.

int HcalBarrelAlgo::nsectortot

Definition at line 36 of file DDHCalBarrelAlgo.cc.

int HcalBarrelAlgo::nSideAbs

Definition at line 103 of file DDHCalBarrelAlgo.cc.

double HcalBarrelAlgo::rinner

Definition at line 38 of file DDHCalBarrelAlgo.cc.

std::vector<double> HcalBarrelAlgo::rmax

Definition at line 41 of file DDHCalBarrelAlgo.cc.

std::string HcalBarrelAlgo::rotHalf

Definition at line 44 of file DDHCalBarrelAlgo.cc.

std::string HcalBarrelAlgo::rotns

Definition at line 45 of file DDHCalBarrelAlgo.cc.

double HcalBarrelAlgo::router

Definition at line 38 of file DDHCalBarrelAlgo.cc.

int HcalBarrelAlgo::rzones

Definition at line 39 of file DDHCalBarrelAlgo.cc.

std::vector<std::string> HcalBarrelAlgo::sideAbsMat

Definition at line 105 of file DDHCalBarrelAlgo.cc.

std::vector<std::string> HcalBarrelAlgo::sideAbsName

Definition at line 104 of file DDHCalBarrelAlgo.cc.

std::vector<double> HcalBarrelAlgo::sideAbsW

Definition at line 106 of file DDHCalBarrelAlgo.cc.

std::vector<double> HcalBarrelAlgo::sideD

Definition at line 101 of file DDHCalBarrelAlgo.cc.

std::vector<std::string> HcalBarrelAlgo::sideMat

Definition at line 100 of file DDHCalBarrelAlgo.cc.

std::vector<double> HcalBarrelAlgo::sideT

Definition at line 102 of file DDHCalBarrelAlgo.cc.

std::vector<double> HcalBarrelAlgo::theta

Definition at line 40 of file DDHCalBarrelAlgo.cc.

Referenced by Tau.Tau::zImpact().

std::vector<double> HcalBarrelAlgo::ttheta

Definition at line 43 of file DDHCalBarrelAlgo.cc.

std::vector<double> HcalBarrelAlgo::zoff

Definition at line 42 of file DDHCalBarrelAlgo.cc.