CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Public Attributes
HCalEndcapModuleAlgo Struct Reference

Classes

struct  HcalEndcapPar
 

Public Member Functions

void constructInsideModule (cms::DDParsingContext &ctxt, xml_h e, dd4hep::Volume &module)
 
void constructInsideModule0 (cms::DDParsingContext &ctxt, xml_h e, dd4hep::Volume &module)
 
void constructScintLayer (dd4hep::Volume &detector, double dz, HCalEndcapModuleAlgo::HcalEndcapPar parm, const std::string &nm, int id, cms::DDNamespace &ns)
 
dd4hep::Rotation3D getRotation (const std::string &rotstr, cms::DDNamespace &ns)
 
double getRout (double z) const
 
double getTrim (unsigned int j) const
 
 HCalEndcapModuleAlgo ()=delete
 
 HCalEndcapModuleAlgo (cms::DDParsingContext &ctxt, xml_h e)
 
HcalEndcapPar parameterLayer (unsigned int iphi, double rinF, double routF, double rinB, double routB, double zi, double zo)
 
HcalEndcapPar parameterLayer0 (unsigned int iphi)
 

Public Attributes

std::string absorberMat
 
double dzStep
 
std::string genMaterial
 
std::string idName
 
int idOffset
 
std::vector< std::string > layerName
 
std::vector< int > layerNumber
 
double layerThick
 
int layerType
 
std::string modName
 
int modNumber
 
int modType
 
double moduleThick
 
std::vector< std::string > phiName
 
std::string plasticMat
 
double rMaxBack
 
double rMaxFront
 
std::string rotstr
 
std::string scintMat
 
double scintThick
 
int sectors
 
double slopeBot
 
double slopeTop
 
double slopeTopF
 
double tolAbs
 
double trimLeft
 
double trimRight
 
double z1Beam
 
double ziDip
 
double zMaxBlock
 
double zMinBlock
 

Detailed Description

Definition at line 22 of file DDHCalEndcapModuleAlgo.cc.

Constructor & Destructor Documentation

◆ HCalEndcapModuleAlgo() [1/2]

HCalEndcapModuleAlgo::HCalEndcapModuleAlgo ( )
delete

◆ HCalEndcapModuleAlgo() [2/2]

HCalEndcapModuleAlgo::HCalEndcapModuleAlgo ( cms::DDParsingContext ctxt,
xml_h  e 
)
inline

Definition at line 86 of file DDHCalEndcapModuleAlgo.cc.

References writedatasetfile::args, cms::convert2mm(), MillePedeFileConverter_cfg::e, mps_fire::i, versionedElectronIDProducer_cfi::idName, cms::DDNamespace::name(), volumeBasedMagneticField_160812_cfi::sectors, AlCaHLTBitMon_QueryRunRegistry::string, and cms::DDNamespace::volume().

86  {
87  cms::DDNamespace ns(ctxt, e, true);
89 
90  genMaterial = args.value<std::string>("MaterialName");
91  absorberMat = args.value<std::string>("AbsorberMat");
92  plasticMat = args.value<std::string>("PlasticMat");
93  scintMat = args.value<std::string>("ScintMat");
94  rotstr = args.value<std::string>("Rotation");
95  sectors = args.value<int>("Sectors");
96 #ifdef EDM_ML_DEBUG
97  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: General material " << genMaterial << "\tAbsorber "
98  << absorberMat << "\tPlastic " << plasticMat << "\tScintillator " << scintMat
99  << "\tRotation " << rotstr << "\tSectors " << sectors;
100 #endif
101  zMinBlock = args.value<double>("ZMinBlock");
102  zMaxBlock = args.value<double>("ZMaxBlock");
103  z1Beam = args.value<double>("Z1Beam");
104  ziDip = args.value<double>("ZiDip");
105  dzStep = args.value<double>("DzStep");
106  moduleThick = args.value<double>("ModuleThick");
107  layerThick = args.value<double>("LayerThick");
108  scintThick = args.value<double>("ScintThick");
109 #ifdef EDM_ML_DEBUG
110  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: Zmin " << cms::convert2mm(zMinBlock) << "\tZmax "
111  << cms::convert2mm(zMaxBlock) << "\tZ1Beam " << cms::convert2mm(z1Beam) << "\tZiDip "
112  << cms::convert2mm(ziDip) << "\tDzStep " << cms::convert2mm(dzStep) << "\tModuleThick "
113  << cms::convert2mm(moduleThick) << "\tLayerThick " << cms::convert2mm(layerThick)
114  << "\tScintThick " << cms::convert2mm(scintThick);
115 #endif
116  rMaxFront = args.value<double>("RMaxFront");
117  rMaxBack = args.value<double>("RMaxBack");
118  trimLeft = args.value<double>("TrimLeft");
119  trimRight = args.value<double>("TrimRight");
120  tolAbs = args.value<double>("TolAbs");
121 #ifdef EDM_ML_DEBUG
122  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: RMaxFront " << cms::convert2mm(rMaxFront) << "\tRmaxBack "
123  << cms::convert2mm(rMaxBack) << "\tTrims " << cms::convert2mm(trimLeft) << ":"
124  << cms::convert2mm(trimRight) << "\tTolAbs " << cms::convert2mm(tolAbs);
125 #endif
126  slopeBot = args.value<double>("SlopeBottom");
127  slopeTop = args.value<double>("SlopeTop");
128  slopeTopF = args.value<double>("SlopeTopFront");
129  modType = args.value<int>("ModType");
130  modNumber = args.value<int>("ModNumber");
131  layerType = args.value<int>("LayerType");
132 #ifdef EDM_ML_DEBUG
133  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: slopeBot " << slopeBot << "\tslopeTop " << slopeTop
134  << "\tslopeTopF " << slopeTopF << "\tmodType " << modType << "\tmodNumber "
135  << modNumber << "\tlayerType " << layerType;
136 #endif
137  layerNumber = args.value<std::vector<int> >("LayerNumber");
138 #ifdef EDM_ML_DEBUG
139  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << layerNumber.size() << " layer Numbers";
140  for (unsigned int i = 0; i < layerNumber.size(); ++i)
141  edm::LogVerbatim("HCalGeom") << "LayerNumber[" << i << "] = " << layerNumber[i];
142 #endif
143  phiName = args.value<std::vector<std::string> >("PhiName");
144 #ifdef EDM_ML_DEBUG
145  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << phiName.size() << " phi sectors";
146  for (unsigned int i = 0; i < phiName.size(); ++i)
147  edm::LogVerbatim("HCalGeom") << "PhiName[" << i << "] = " << phiName[i];
148 #endif
149  layerName = args.value<std::vector<std::string> >("LayerName");
150 #ifdef EDM_ML_DEBUG
151  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << layerName.size() << " layers";
152  for (unsigned int i = 0; i < layerName.size(); ++i)
153  edm::LogVerbatim("HCalGeom") << "LayerName[" << i << "] = " << layerName[i];
154 #endif
155  idName = args.value<std::string>("MotherName");
156  idOffset = args.value<int>("IdOffset");
157  modName = args.value<std::string>("ModName");
158 #ifdef EDM_ML_DEBUG
159  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: Parent " << args.parentName() << " " << modName
160  << " idName " << idName << " NameSpace " << ns.name() << " Offset " << idOffset;
161 #endif
162 
163 #ifdef EDM_ML_DEBUG
164  edm::LogVerbatim("HCalGeom") << "==>> Constructing DDHCalEndcapModuleAlgo...";
165 #endif
166 
167  dd4hep::Volume mother = ns.volume(args.parentName());
168  if (modType == 0)
169  constructInsideModule0(ctxt, e, mother);
170  else
171  constructInsideModule(ctxt, e, mother);
172 #ifdef EDM_ML_DEBUG
173  edm::LogVerbatim("HCalGeom") << "<<== End of DDHCalEndcapModuleAlgo construction ...";
174 #endif
175  }
Log< level::Info, true > LogVerbatim
void constructInsideModule0(cms::DDParsingContext &ctxt, xml_h e, dd4hep::Volume &module)
constexpr NumType convert2mm(NumType length)
Definition: DDutils.h:7
dd4hep::Volume Volume
std::vector< std::string > layerName
std::vector< int > layerNumber
std::vector< std::string > phiName
void constructInsideModule(cms::DDParsingContext &ctxt, xml_h e, dd4hep::Volume &module)

Member Function Documentation

◆ constructInsideModule()

void HCalEndcapModuleAlgo::constructInsideModule ( cms::DDParsingContext ctxt,
xml_h  e,
dd4hep::Volume &  module 
)
inline

Definition at line 305 of file DDHCalEndcapModuleAlgo.cc.

References HCalEndcapModuleAlgo::HcalEndcapPar::alp, simBeamSpotPI::alpha, HCalEndcapModuleAlgo::HcalEndcapPar::bl1, HCalEndcapModuleAlgo::HcalEndcapPar::bl2, cms::convert2mm(), angle_units::operators::convertRadToDeg(), MillePedeFileConverter_cfg::e, mps_fire::i, versionedElectronIDProducer_cfi::idName, hcalRecHitTable_cff::iphi, cms::DDNamespace::material(), g4SimHits_cfi::Material, Skims_PA_cff::name, HCalEndcapModuleAlgo::HcalEndcapPar::phi, PixelTestBeamValidation_cfi::Position, cms::DDNamespace::prepend(), diffTwoXMLs::r2, makeMuonMisalignmentScenario::rot, volumeBasedMagneticField_160812_cfi::sectors, AlCaHLTBitMon_QueryRunRegistry::string, funct::tan(), HCalEndcapModuleAlgo::HcalEndcapPar::theta, HCalEndcapModuleAlgo::HcalEndcapPar::tl1, HCalEndcapModuleAlgo::HcalEndcapPar::tl2, HCalEndcapModuleAlgo::HcalEndcapPar::xpos, HCalEndcapModuleAlgo::HcalEndcapPar::yh1, HCalEndcapModuleAlgo::HcalEndcapPar::yh2, HCalEndcapModuleAlgo::HcalEndcapPar::ypos, and HCalEndcapModuleAlgo::HcalEndcapPar::zpos.

305  {
306  cms::DDNamespace ns(ctxt, e, true);
307 #ifdef EDM_ML_DEBUG
308  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: \t\tInside module";
309 #endif
310  //Pointers to the Rotation Matrices and to the Materials
312  dd4hep::Material matter = ns.material(genMaterial);
313  dd4hep::Material matplastic = ns.material(plasticMat);
314  dd4hep::Rotation3D rot = getRotation(rotstr, ns);
315 
316  double alpha = (1._pi) / sectors;
317  double zi = zMinBlock;
318 
319  for (unsigned int i = 0; i < layerName.size(); i++) {
321  dd4hep::Solid solid;
322  dd4hep::Volume glog, plog;
323  int layer = layerNumber[i];
324  double zo = zi + 0.5 * dzStep;
325 
326  for (unsigned int iphi = 0; iphi < phiName.size(); iphi++) {
327  double ziAir = zo - moduleThick;
328  double rinF, rinB;
329  if (modNumber == 0) {
330  rinF = ziAir * slopeTopF;
331  rinB = zo * slopeTopF;
332  } else {
333  rinF = ziAir * slopeBot;
334  rinB = zo * slopeBot;
335  }
336  double routF = getRout(ziAir);
337  double routB = getRout(zo);
338 #ifdef EDM_ML_DEBUG
339  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: Layer " << i << " Phi " << iphi << " Front "
340  << cms::convert2mm(ziAir) << ", " << cms::convert2mm(rinF) << ", "
341  << cms::convert2mm(routF) << " Back " << cms::convert2mm(zo) << ", "
342  << cms::convert2mm(rinB) << ", " << cms::convert2mm(routB);
343 #endif
344  HCalEndcapModuleAlgo::HcalEndcapPar parm = parameterLayer(iphi, rinF, routF, rinB, routB, ziAir, zo);
345 
346  name = idName + modName + layerName[i] + phiName[iphi] + "Air";
347  solid = dd4hep::Trap(ns.prepend(name),
348  0.5 * moduleThick,
349  parm.theta,
350  parm.phi,
351  parm.yh1,
352  parm.bl1,
353  parm.tl1,
354  parm.alp,
355  parm.yh2,
356  parm.bl2,
357  parm.tl2,
358  parm.alp);
359 #ifdef EDM_ML_DEBUG
360  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << solid.name() << " Trap made of " << matter.name()
361  << " of dimensions " << cms::convert2mm(0.5 * moduleThick) << ", "
362  << convertRadToDeg(parm.theta) << ", " << convertRadToDeg(parm.phi) << ", "
363  << cms::convert2mm(parm.yh1) << ", " << cms::convert2mm(parm.bl1) << ", "
364  << cms::convert2mm(parm.tl1) << ", " << convertRadToDeg(parm.alp) << ", "
365  << cms::convert2mm(parm.yh2) << ", " << cms::convert2mm(parm.bl2) << ", "
366  << cms::convert2mm(parm.tl2) << ", " << convertRadToDeg(parm.alp);
367 #endif
368  glog = dd4hep::Volume(solid.name(), solid, matter);
369 
370  dd4hep::Position r1(parm.xpos, parm.ypos, parm.zpos);
371  module.placeVolume(glog, layer + 1, dd4hep::Transform3D(rot, r1));
372 #ifdef EDM_ML_DEBUG
373  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << glog.name() << " number " << (layer + 1)
374  << " positioned in " << module.name() << " at (" << cms::convert2mm(parm.xpos)
375  << ", " << cms::convert2mm(parm.ypos) << ", " << cms::convert2mm(parm.zpos)
376  << ") with rotation: " << rot;
377 #endif
378  //Now the plastic with scintillators
379  parm.yh1 = 0.5 * (routF - rinB) - getTrim(iphi);
380  parm.bl1 = 0.5 * rinB * tan(alpha) - getTrim(iphi);
381  parm.tl1 = 0.5 * routF * tan(alpha) - getTrim(iphi);
383  solid = dd4hep::Trap(ns.prepend(name),
384  0.5 * layerThick,
385  0,
386  0,
387  parm.yh1,
388  parm.bl1,
389  parm.tl1,
390  parm.alp,
391  parm.yh1,
392  parm.bl1,
393  parm.tl1,
394  parm.alp);
395 #ifdef EDM_ML_DEBUG
396  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << solid.name() << " Trap made of "
397  << matplastic.name() << " of dimensions " << cms::convert2mm(0.5 * layerThick)
398  << ", 0, 0, " << cms::convert2mm(parm.yh1) << ", " << cms::convert2mm(parm.bl1)
399  << ", " << cms::convert2mm(parm.tl1) << ", " << convertRadToDeg(parm.alp) << ", "
400  << cms::convert2mm(parm.yh1) << ", " << cms::convert2mm(parm.bl1) << ", "
401  << cms::convert2mm(parm.tl1) << ", " << convertRadToDeg(parm.alp);
402 #endif
403  plog = dd4hep::Volume(solid.name(), solid, matplastic);
404 
405  double ypos = 0.5 * (routF + rinB) - parm.xpos;
406  dd4hep::Position r2(0., ypos, 0.);
407  glog.placeVolume(plog, idOffset + layer + 1, r2);
408 #ifdef EDM_ML_DEBUG
409  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << plog.name() << " number "
410  << (idOffset + layer + 1) << " positioned in " << glog.name() << " at (0, "
411  << cms::convert2mm(ypos) << ", 0) with no rotation";
412 #endif
413  //Constructin the scintillators inside
414  int copyNo = layer * 10 + layerType;
416  constructScintLayer(plog, scintThick, parm, name, copyNo, ns);
417  zo += 0.5 * dzStep;
418  } // End of loop over phi indices
419  zi = zo - 0.5 * dzStep;
420  } // End of loop on layers
421  }
Log< level::Info, true > LogVerbatim
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
constexpr NumType convert2mm(NumType length)
Definition: DDutils.h:7
void constructScintLayer(dd4hep::Volume &detector, double dz, HCalEndcapModuleAlgo::HcalEndcapPar parm, const std::string &nm, int id, cms::DDNamespace &ns)
double getRout(double z) const
double getTrim(unsigned int j) const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
dd4hep::Volume Volume
std::vector< std::string > layerName
std::vector< int > layerNumber
dd4hep::Rotation3D getRotation(const std::string &rotstr, cms::DDNamespace &ns)
std::vector< std::string > phiName
HcalEndcapPar parameterLayer(unsigned int iphi, double rinF, double routF, double rinB, double routB, double zi, double zo)

◆ constructInsideModule0()

void HCalEndcapModuleAlgo::constructInsideModule0 ( cms::DDParsingContext ctxt,
xml_h  e,
dd4hep::Volume &  module 
)
inline

Definition at line 177 of file DDHCalEndcapModuleAlgo.cc.

References HCalEndcapModuleAlgo::HcalEndcapPar::alp, HCalEndcapModuleAlgo::HcalEndcapPar::bl1, HCalEndcapModuleAlgo::HcalEndcapPar::bl2, cms::convert2mm(), angle_units::operators::convertRadToDeg(), MillePedeFileConverter_cfg::e, versionedElectronIDProducer_cfi::idName, hcalRecHitTable_cff::iphi, cms::DDNamespace::material(), g4SimHits_cfi::Material, Skims_PA_cff::name, HCalEndcapModuleAlgo::HcalEndcapPar::phi, PixelTestBeamValidation_cfi::Position, cms::DDNamespace::prepend(), diffTwoXMLs::r2, makeMuonMisalignmentScenario::rot, AlCaHLTBitMon_QueryRunRegistry::string, HCalEndcapModuleAlgo::HcalEndcapPar::theta, HCalEndcapModuleAlgo::HcalEndcapPar::tl1, HCalEndcapModuleAlgo::HcalEndcapPar::tl2, HCalEndcapModuleAlgo::HcalEndcapPar::xpos, HCalEndcapModuleAlgo::HcalEndcapPar::yh1, HCalEndcapModuleAlgo::HcalEndcapPar::yh2, HCalEndcapModuleAlgo::HcalEndcapPar::ypos, and HCalEndcapModuleAlgo::HcalEndcapPar::zpos.

177  {
178  cms::DDNamespace ns(ctxt, e, true);
179 
180 #ifdef EDM_ML_DEBUG
181  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: \t\tInside module0";
182 #endif
183  //Pointers to the Materials
185  dd4hep::Material matabsorbr = ns.material(absorberMat);
186  dd4hep::Material matplastic = ns.material(plasticMat);
187  dd4hep::Rotation3D rot = getRotation(rotstr, ns);
188 
189  int layer = layerNumber[0];
190  int layer0 = layerNumber[1];
192  dd4hep::Solid solid;
193  dd4hep::Volume glog;
194  for (unsigned int iphi = 0; iphi < phiName.size(); iphi++) {
196  name = idName + modName + layerName[0] + phiName[iphi];
197  solid = dd4hep::Trap(ns.prepend(name),
198  0.5 * layerThick,
199  0,
200  0,
201  parm.yh1,
202  parm.bl1,
203  parm.tl1,
204  parm.alp,
205  parm.yh2,
206  parm.bl1,
207  parm.tl2,
208  parm.alp);
209 #ifdef EDM_ML_DEBUG
210  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << solid.name() << " Trap made of " << plasticMat
211  << " of dimensions " << cms::convert2mm(0.5 * layerThick) << ", 0, 0, "
212  << cms::convert2mm(parm.yh1) << ", " << cms::convert2mm(parm.bl1) << ", "
213  << cms::convert2mm(parm.tl1) << ", " << convertRadToDeg(parm.alp) << ", "
214  << cms::convert2mm(parm.yh2) << ", " << cms::convert2mm(parm.bl2) << ", "
215  << cms::convert2mm(parm.tl2) << ", " << convertRadToDeg(parm.alp);
216 #endif
217  glog = dd4hep::Volume(solid.name(), solid, matplastic);
218 
219  dd4hep::Position r1(parm.xpos, parm.ypos, parm.zpos);
220  module.placeVolume(glog, idOffset + layer + 1, dd4hep::Transform3D(rot, r1));
221 #ifdef EDM_ML_DEBUG
222  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << glog.name() << " number " << (idOffset + layer + 1)
223  << " positioned in " << module.name() << " at (" << cms::convert2mm(parm.xpos)
224  << ", " << cms::convert2mm(parm.ypos) << ", " << cms::convert2mm(parm.zpos)
225  << ") with rotation: " << rot;
226 #endif
227  //Now construct the layer of scintillator inside this
228  int copyNo = layer0 * 10 + layerType;
229  name = modName + layerName[0] + phiName[iphi];
230  constructScintLayer(glog, scintThick, parm, name, copyNo, ns);
231  }
232 
233  //Now the absorber layer
234  double zi = zMinBlock + layerThick;
235  double zo = zi + 0.5 * dzStep;
236  double rinF, routF, rinB, routB;
237  if (modNumber == 0) {
238  rinF = zi * slopeTopF;
239  routF = (zi - z1Beam) * slopeTop;
240  rinB = zo * slopeTopF;
241  routB = (zo - z1Beam) * slopeTop;
242  } else if (modNumber > 0) {
243  rinF = zi * slopeBot;
244  routF = zi * slopeTopF;
245  rinB = zo * slopeBot;
246  routB = zo * slopeTopF;
247  } else {
248  rinF = zi * slopeBot;
249  routF = (zi - z1Beam) * slopeTop;
250  rinB = zo * slopeBot;
251  routB = (zo - z1Beam) * slopeTop;
252  }
253 #ifdef EDM_ML_DEBUG
254  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: Front " << cms::convert2mm(zi) << ", "
255  << cms::convert2mm(rinF) << ", " << cms::convert2mm(routF) << " Back "
256  << cms::convert2mm(zo) << ", " << cms::convert2mm(rinB) << ", "
257  << cms::convert2mm(routB);
258 #endif
259  HCalEndcapModuleAlgo::HcalEndcapPar parm = parameterLayer(0, rinF, routF, rinB, routB, zi, zo);
260 #ifdef EDM_ML_DEBUG
261  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: Trim " << cms::convert2mm(tolAbs) << " Param "
262  << cms::convert2mm(parm.yh1) << ", " << cms::convert2mm(parm.bl1) << ", "
263  << cms::convert2mm(parm.tl1) << ", " << cms::convert2mm(parm.yh2) << ", "
264  << cms::convert2mm(parm.bl2) << ", " << cms::convert2mm(parm.tl2);
265 #endif
266  parm.bl1 -= tolAbs;
267  parm.tl1 -= tolAbs;
268  parm.bl2 -= tolAbs;
269  parm.tl2 -= tolAbs;
270 
271  name = idName + modName + layerName[0] + "Absorber";
272  solid = dd4hep::Trap(ns.prepend(name),
273  0.5 * moduleThick,
274  parm.theta,
275  parm.phi,
276  parm.yh1,
277  parm.bl1,
278  parm.tl1,
279  parm.alp,
280  parm.yh2,
281  parm.bl2,
282  parm.tl2,
283  parm.alp);
284 #ifdef EDM_ML_DEBUG
285  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << solid.name() << " Trap made of " << matabsorbr.name()
286  << " of dimensions " << cms::convert2mm(0.5 * moduleThick) << ", "
287  << convertRadToDeg(parm.theta) << ", " << convertRadToDeg(parm.phi) << ", "
288  << cms::convert2mm(parm.yh1) << ", " << cms::convert2mm(parm.bl1) << ", "
289  << cms::convert2mm(parm.tl1) << ", " << convertRadToDeg(parm.alp) << ", "
290  << cms::convert2mm(parm.yh2) << ", " << cms::convert2mm(parm.bl2) << ", "
291  << cms::convert2mm(parm.tl2) << ", " << convertRadToDeg(parm.alp);
292 #endif
293  glog = dd4hep::Volume(solid.name(), solid, matabsorbr);
294 
295  dd4hep::Position r2(parm.xpos, parm.ypos, parm.zpos);
296  module.placeVolume(glog, idOffset + layer + 1, dd4hep::Transform3D(rot, r2));
297 #ifdef EDM_ML_DEBUG
298  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << glog.name() << " number 1 positioned in "
299  << module.name() << " at (" << cms::convert2mm(parm.xpos) << ", "
300  << cms::convert2mm(parm.ypos) << ", " << cms::convert2mm(parm.zpos)
301  << ") with rotation: " << rot;
302 #endif
303  }
Log< level::Info, true > LogVerbatim
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
constexpr NumType convert2mm(NumType length)
Definition: DDutils.h:7
void constructScintLayer(dd4hep::Volume &detector, double dz, HCalEndcapModuleAlgo::HcalEndcapPar parm, const std::string &nm, int id, cms::DDNamespace &ns)
HcalEndcapPar parameterLayer0(unsigned int iphi)
dd4hep::Volume Volume
std::vector< std::string > layerName
std::vector< int > layerNumber
dd4hep::Rotation3D getRotation(const std::string &rotstr, cms::DDNamespace &ns)
std::vector< std::string > phiName
HcalEndcapPar parameterLayer(unsigned int iphi, double rinF, double routF, double rinB, double routB, double zi, double zo)

◆ constructScintLayer()

void HCalEndcapModuleAlgo::constructScintLayer ( dd4hep::Volume &  detector,
double  dz,
HCalEndcapModuleAlgo::HcalEndcapPar  parm,
const std::string &  nm,
int  id,
cms::DDNamespace ns 
)
inline

Definition at line 533 of file DDHCalEndcapModuleAlgo.cc.

References HCalEndcapModuleAlgo::HcalEndcapPar::alp, HCalEndcapModuleAlgo::HcalEndcapPar::bl1, cms::convert2mm(), angle_units::operators::convertRadToDeg(), hgcalTestNeighbor_cfi::detector, PVValHelper::dz, versionedElectronIDProducer_cfi::idName, cms::DDNamespace::material(), g4SimHits_cfi::Material, Skims_PA_cff::name, cms::DDNamespace::prepend(), AlCaHLTBitMon_QueryRunRegistry::string, HCalEndcapModuleAlgo::HcalEndcapPar::tl1, and HCalEndcapModuleAlgo::HcalEndcapPar::yh1.

538  {
539  dd4hep::Material matter = ns.material(scintMat);
540  std::string name = idName + "Scintillator" + nm;
541 
542  dd4hep::Solid solid = dd4hep::Trap(
543  ns.prepend(name), 0.5 * dz, 0, 0, parm.yh1, parm.bl1, parm.tl1, parm.alp, parm.yh1, parm.bl1, parm.tl1, parm.alp);
544 #ifdef EDM_ML_DEBUG
545  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << solid.name() << " Trap made of " << scintMat
546  << " of dimensions " << cms::convert2mm(0.5 * dz) << ", 0, 0, "
547  << cms::convert2mm(parm.yh1) << ", " << cms::convert2mm(parm.bl1) << ", "
548  << cms::convert2mm(parm.tl1) << ", " << convertRadToDeg(parm.alp) << ", "
549  << cms::convert2mm(parm.yh1) << ", " << cms::convert2mm(parm.bl1) << ", "
550  << cms::convert2mm(parm.tl1) << ", " << convertRadToDeg(parm.alp);
551 #endif
552  dd4hep::Volume glog(solid.name(), solid, matter);
553 
554  detector.placeVolume(glog, id);
555 #ifdef EDM_ML_DEBUG
556  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << glog.name() << " number " << id << " positioned in "
557  << detector.name() << " at (0,0,0) with no rotation";
558 #endif
559  }
Log< level::Info, true > LogVerbatim
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
constexpr NumType convert2mm(NumType length)
Definition: DDutils.h:7
dd4hep::Material material(const std::string &name) const
Definition: DDNamespace.cc:166
dd4hep::Volume Volume
std::string prepend(const std::string &) const
Definition: DDNamespace.cc:99

◆ getRotation()

dd4hep::Rotation3D HCalEndcapModuleAlgo::getRotation ( const std::string &  rotstr,
cms::DDNamespace ns 
)
inline

Definition at line 580 of file DDHCalEndcapModuleAlgo.cc.

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

580  {
581  std::string rot = (strchr(rotstr.c_str(), NAMESPACE_SEP) == nullptr) ? ("rotations:" + rotstr) : rotstr;
582 #ifdef EDM_ML_DEBUG
583  edm::LogVerbatim("HCalGeom") << "getRotation: " << rotstr << ":" << rot << ":" << ns.rotation(rot);
584 #endif
585  return ns.rotation(rot);
586  }
Log< level::Info, true > LogVerbatim
const dd4hep::Rotation3D & rotation(const std::string &name) const
Definition: DDNamespace.cc:182
#define NAMESPACE_SEP
Definition: DDNamespace.h:92

◆ getRout()

double HCalEndcapModuleAlgo::getRout ( double  z) const
inline

Definition at line 568 of file DDHCalEndcapModuleAlgo.cc.

568  {
569  double r = (modNumber >= 0) ? ((z - z1Beam) * slopeTop) : z * slopeTopF;
570  if (z > ziDip) {
571  if (r > rMaxBack)
572  r = rMaxBack;
573  } else {
574  if (r > rMaxFront)
575  r = rMaxFront;
576  }
577  return r;
578  }

◆ getTrim()

double HCalEndcapModuleAlgo::getTrim ( unsigned int  j) const
inline

Definition at line 561 of file DDHCalEndcapModuleAlgo.cc.

References dqmiolumiharvest::j.

561  {
562  if (j == 0)
563  return trimLeft;
564  else
565  return trimRight;
566  }

◆ parameterLayer()

HcalEndcapPar HCalEndcapModuleAlgo::parameterLayer ( unsigned int  iphi,
double  rinF,
double  routF,
double  rinB,
double  routB,
double  zi,
double  zo 
)
inline

Definition at line 480 of file DDHCalEndcapModuleAlgo.cc.

References HCalEndcapModuleAlgo::HcalEndcapPar::alp, simBeamSpotPI::alpha, HCalEndcapModuleAlgo::HcalEndcapPar::bl1, HCalEndcapModuleAlgo::HcalEndcapPar::bl2, cms::convert2mm(), angle_units::operators::convertRadToDeg(), PVValHelper::dx, PVValHelper::dy, MillePedeFileConverter_cfg::e, hcalRecHitTable_cff::iphi, HCalEndcapModuleAlgo::HcalEndcapPar::phi, volumeBasedMagneticField_160812_cfi::sectors, mathSSE::sqrt(), funct::tan(), HCalEndcapModuleAlgo::HcalEndcapPar::theta, HCalEndcapModuleAlgo::HcalEndcapPar::tl1, HCalEndcapModuleAlgo::HcalEndcapPar::tl2, HCalEndcapModuleAlgo::HcalEndcapPar::xpos, HCalEndcapModuleAlgo::HcalEndcapPar::yh1, HCalEndcapModuleAlgo::HcalEndcapPar::yh2, HCalEndcapModuleAlgo::HcalEndcapPar::ypos, and HCalEndcapModuleAlgo::HcalEndcapPar::zpos.

481  {
483  //Given rin, rout compute parameters of the trapezoid and
484  //position of the trapezoid for a standrd layer
485  double alpha = (1._pi) / sectors;
486 #ifdef EDM_ML_DEBUG
487  edm::LogVerbatim("HCalGeom") << "Input " << iphi << " Front " << cms::convert2mm(rinF) << " "
488  << cms::convert2mm(routF) << " " << cms::convert2mm(zi) << " Back "
489  << cms::convert2mm(rinB) << " " << cms::convert2mm(routB) << " " << cms::convert2mm(zo)
490  << " Alpha " << convertRadToDeg(alpha);
491 #endif
492  parm.yh1 = 0.5 * (routF - rinB);
493  parm.bl1 = 0.5 * rinB * tan(alpha);
494  parm.tl1 = 0.5 * routF * tan(alpha);
495  parm.yh2 = 0.5 * (routF - rinB);
496  parm.bl2 = 0.5 * rinB * tan(alpha);
497  parm.tl2 = 0.5 * routF * tan(alpha);
498  double dx = 0.25 * (parm.bl2 + parm.tl2 - parm.bl1 - parm.tl1);
499  double dy = 0.5 * (rinB + routF - rinB - routF);
500  parm.xpos = 0.25 * (rinB + routF + rinB + routF);
501  parm.ypos = 0.25 * (parm.bl2 + parm.tl2 + parm.bl1 + parm.tl1);
502  parm.zpos = 0.5 * (zi + zo);
503  parm.alp = atan(0.5 * tan(alpha));
504  if (iphi == 0) {
505  parm.ypos = -parm.ypos;
506  } else {
507  parm.alp = -parm.alp;
508  dx = -dx;
509  }
510  double r = sqrt(dx * dx + dy * dy);
511 #ifdef EDM_ML_DEBUG
512  edm::LogVerbatim("HCalGeom") << "dx|dy|r " << cms::convert2mm(dx) << ":" << cms::convert2mm(dy) << ":"
513  << cms::convert2mm(r);
514 #endif
515  if (r > 1.0e-8) {
516  parm.theta = atan(r / (zo - zi));
517  parm.phi = atan2(dy, dx);
518  } else {
519  parm.theta = parm.phi = 0;
520  }
521 #ifdef EDM_ML_DEBUG
522  edm::LogVerbatim("HCalGeom") << "Output Dimensions " << cms::convert2mm(parm.yh1) << " "
523  << cms::convert2mm(parm.bl1) << " " << cms::convert2mm(parm.tl1) << " "
524  << cms::convert2mm(parm.yh2) << " " << cms::convert2mm(parm.bl2) << " "
525  << cms::convert2mm(parm.tl2) << " " << convertRadToDeg(parm.alp) << " "
526  << convertRadToDeg(parm.theta) << " " << convertRadToDeg(parm.phi) << " Position "
527  << cms::convert2mm(parm.xpos) << " " << cms::convert2mm(parm.ypos) << " "
528  << cms::convert2mm(parm.zpos);
529 #endif
530  return parm;
531  }
Log< level::Info, true > LogVerbatim
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
constexpr NumType convert2mm(NumType length)
Definition: DDutils.h:7
T sqrt(T t)
Definition: SSEVec.h:23
Tan< T >::type tan(const T &t)
Definition: Tan.h:22

◆ parameterLayer0()

HcalEndcapPar HCalEndcapModuleAlgo::parameterLayer0 ( unsigned int  iphi)
inline

Definition at line 423 of file DDHCalEndcapModuleAlgo.cc.

References HCalEndcapModuleAlgo::HcalEndcapPar::alp, simBeamSpotPI::alpha, HCalEndcapModuleAlgo::HcalEndcapPar::bl1, HCalEndcapModuleAlgo::HcalEndcapPar::bl2, cms::convert2mm(), angle_units::operators::convertRadToDeg(), hcalRecHitTable_cff::iphi, volumeBasedMagneticField_160812_cfi::sectors, funct::tan(), HCalEndcapModuleAlgo::HcalEndcapPar::tl1, HCalEndcapModuleAlgo::HcalEndcapPar::tl2, HCalEndcapModuleAlgo::HcalEndcapPar::xpos, HCalEndcapModuleAlgo::HcalEndcapPar::yh1, HCalEndcapModuleAlgo::HcalEndcapPar::yh2, HCalEndcapModuleAlgo::HcalEndcapPar::ypos, and HCalEndcapModuleAlgo::HcalEndcapPar::zpos.

423  {
425  //Given module and layer number compute parameters of trapezoid
426  //and positioning parameters
427  double alpha = (1._pi) / sectors;
428 #ifdef EDM_ML_DEBUG
429  edm::LogVerbatim("HCalGeom") << "Input " << iphi << " Alpha " << convertRadToDeg(alpha);
430 #endif
431  double zi, zo;
432  if (iphi == 0) {
433  zi = zMinBlock;
434  zo = zi + layerThick;
435  } else {
436  zo = zMaxBlock;
437  zi = zo - layerThick;
438  }
439  double rin, rout;
440  if (modNumber == 0) {
441  rin = zo * slopeTopF;
442  rout = (zi - z1Beam) * slopeTop;
443  } else if (modNumber > 0) {
444  rin = zo * slopeBot;
445  rout = zi * slopeTopF;
446  } else {
447  rin = zo * slopeBot;
448  rout = (zi - z1Beam) * slopeTop;
449  }
450 #ifdef EDM_ML_DEBUG
451  edm::LogVerbatim("HCalGeom") << "ModNumber " << modNumber << " " << cms::convert2mm(zi) << " "
452  << cms::convert2mm(zo) << " " << slopeTopF << " " << slopeTop << " " << slopeBot << " "
453  << cms::convert2mm(rin) << " " << cms::convert2mm(rout) << " "
455 #endif
456  double yh = 0.5 * (rout - rin);
457  double bl = 0.5 * rin * tan(alpha);
458  double tl = 0.5 * rout * tan(alpha);
459  parm.xpos = 0.5 * (rin + rout);
460  parm.ypos = 0.5 * (bl + tl);
461  parm.zpos = 0.5 * (zi + zo);
462  parm.yh1 = parm.yh2 = yh - getTrim(iphi);
463  parm.bl1 = parm.bl2 = bl - getTrim(iphi);
464  parm.tl1 = parm.tl2 = tl - getTrim(iphi);
465  parm.alp = atan(0.5 * tan(alpha));
466  if (iphi == 0) {
467  parm.ypos = -parm.ypos;
468  } else {
469  parm.alp = -parm.alp;
470  }
471 #ifdef EDM_ML_DEBUG
472  edm::LogVerbatim("HCalGeom") << "Output Dimensions " << cms::convert2mm(parm.yh1) << " "
473  << cms::convert2mm(parm.bl1) << " " << cms::convert2mm(parm.tl1) << " "
474  << convertRadToDeg(parm.alp) << " Position " << cms::convert2mm(parm.xpos) << " "
475  << cms::convert2mm(parm.ypos) << " " << cms::convert2mm(parm.zpos);
476 #endif
477  return parm;
478  }
Log< level::Info, true > LogVerbatim
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
constexpr NumType convert2mm(NumType length)
Definition: DDutils.h:7
double getTrim(unsigned int j) const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22

Member Data Documentation

◆ absorberMat

std::string HCalEndcapModuleAlgo::absorberMat

Definition at line 24 of file DDHCalEndcapModuleAlgo.cc.

◆ dzStep

double HCalEndcapModuleAlgo::dzStep

Definition at line 33 of file DDHCalEndcapModuleAlgo.cc.

◆ genMaterial

std::string HCalEndcapModuleAlgo::genMaterial

Definition at line 23 of file DDHCalEndcapModuleAlgo.cc.

◆ idName

std::string HCalEndcapModuleAlgo::idName

Definition at line 52 of file DDHCalEndcapModuleAlgo.cc.

◆ idOffset

int HCalEndcapModuleAlgo::idOffset

Definition at line 54 of file DDHCalEndcapModuleAlgo.cc.

◆ layerName

std::vector<std::string> HCalEndcapModuleAlgo::layerName

Definition at line 50 of file DDHCalEndcapModuleAlgo.cc.

◆ layerNumber

std::vector<int> HCalEndcapModuleAlgo::layerNumber

Definition at line 48 of file DDHCalEndcapModuleAlgo.cc.

◆ layerThick

double HCalEndcapModuleAlgo::layerThick

Definition at line 35 of file DDHCalEndcapModuleAlgo.cc.

◆ layerType

int HCalEndcapModuleAlgo::layerType

Definition at line 47 of file DDHCalEndcapModuleAlgo.cc.

◆ modName

std::string HCalEndcapModuleAlgo::modName

Definition at line 53 of file DDHCalEndcapModuleAlgo.cc.

◆ modNumber

int HCalEndcapModuleAlgo::modNumber

Definition at line 46 of file DDHCalEndcapModuleAlgo.cc.

◆ modType

int HCalEndcapModuleAlgo::modType

Definition at line 45 of file DDHCalEndcapModuleAlgo.cc.

◆ moduleThick

double HCalEndcapModuleAlgo::moduleThick

Definition at line 34 of file DDHCalEndcapModuleAlgo.cc.

◆ phiName

std::vector<std::string> HCalEndcapModuleAlgo::phiName

Definition at line 49 of file DDHCalEndcapModuleAlgo.cc.

◆ plasticMat

std::string HCalEndcapModuleAlgo::plasticMat

Definition at line 25 of file DDHCalEndcapModuleAlgo.cc.

◆ rMaxBack

double HCalEndcapModuleAlgo::rMaxBack

Definition at line 37 of file DDHCalEndcapModuleAlgo.cc.

◆ rMaxFront

double HCalEndcapModuleAlgo::rMaxFront

Definition at line 38 of file DDHCalEndcapModuleAlgo.cc.

◆ rotstr

std::string HCalEndcapModuleAlgo::rotstr

Definition at line 27 of file DDHCalEndcapModuleAlgo.cc.

◆ scintMat

std::string HCalEndcapModuleAlgo::scintMat

Definition at line 26 of file DDHCalEndcapModuleAlgo.cc.

◆ scintThick

double HCalEndcapModuleAlgo::scintThick

Definition at line 36 of file DDHCalEndcapModuleAlgo.cc.

◆ sectors

int HCalEndcapModuleAlgo::sectors

Definition at line 28 of file DDHCalEndcapModuleAlgo.cc.

◆ slopeBot

double HCalEndcapModuleAlgo::slopeBot

Definition at line 39 of file DDHCalEndcapModuleAlgo.cc.

◆ slopeTop

double HCalEndcapModuleAlgo::slopeTop

Definition at line 40 of file DDHCalEndcapModuleAlgo.cc.

◆ slopeTopF

double HCalEndcapModuleAlgo::slopeTopF

Definition at line 41 of file DDHCalEndcapModuleAlgo.cc.

◆ tolAbs

double HCalEndcapModuleAlgo::tolAbs

Definition at line 44 of file DDHCalEndcapModuleAlgo.cc.

◆ trimLeft

double HCalEndcapModuleAlgo::trimLeft

Definition at line 42 of file DDHCalEndcapModuleAlgo.cc.

◆ trimRight

double HCalEndcapModuleAlgo::trimRight

Definition at line 43 of file DDHCalEndcapModuleAlgo.cc.

◆ z1Beam

double HCalEndcapModuleAlgo::z1Beam

Definition at line 31 of file DDHCalEndcapModuleAlgo.cc.

◆ ziDip

double HCalEndcapModuleAlgo::ziDip

Definition at line 32 of file DDHCalEndcapModuleAlgo.cc.

◆ zMaxBlock

double HCalEndcapModuleAlgo::zMaxBlock

Definition at line 30 of file DDHCalEndcapModuleAlgo.cc.

◆ zMinBlock

double HCalEndcapModuleAlgo::zMinBlock

Definition at line 29 of file DDHCalEndcapModuleAlgo.cc.