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
 
std::string idNameSpace
 
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::HCalEndcapModuleAlgo ( )
delete
HCalEndcapModuleAlgo::HCalEndcapModuleAlgo ( cms::DDParsingContext ctxt,
xml_h  e 
)
inline

Definition at line 87 of file DDHCalEndcapModuleAlgo.cc.

References writedatasetfile::args, geant_units::operators::convertCmToMm(), mps_fire::i, cms::DDNamespace::name(), cms::DDAlgoArguments::parentName(), volumeBasedMagneticField_1103l_cfi::sectors, AlCaHLTBitMon_QueryRunRegistry::string, cms::DDAlgoArguments::value(), and cms::DDNamespace::volume().

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

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

Definition at line 306 of file DDHCalEndcapModuleAlgo.cc.

References HCalEndcapModuleAlgo::HcalEndcapPar::alp, zMuMuMuonUserData::alpha, HCalEndcapModuleAlgo::HcalEndcapPar::bl1, HCalEndcapModuleAlgo::HcalEndcapPar::bl2, geant_units::operators::convertCmToMm(), angle_units::operators::convertRadToDeg(), mps_fire::i, LEDCalibrationChannels::iphi, cms::DDNamespace::material(), g4SimHits_cfi::Material, Skims_PA_cff::name, HCalEndcapModuleAlgo::HcalEndcapPar::phi, cms::DDNamespace::prepend(), diffTwoXMLs::r1, diffTwoXMLs::r2, makeMuonMisalignmentScenario::rot, 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.

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

Definition at line 179 of file DDHCalEndcapModuleAlgo.cc.

References HCalEndcapModuleAlgo::HcalEndcapPar::alp, HCalEndcapModuleAlgo::HcalEndcapPar::bl1, HCalEndcapModuleAlgo::HcalEndcapPar::bl2, geant_units::operators::convertCmToMm(), angle_units::operators::convertRadToDeg(), LEDCalibrationChannels::iphi, cms::DDNamespace::material(), g4SimHits_cfi::Material, Skims_PA_cff::name, HCalEndcapModuleAlgo::HcalEndcapPar::phi, cms::DDNamespace::prepend(), diffTwoXMLs::r1, 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.

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

Definition at line 532 of file DDHCalEndcapModuleAlgo.cc.

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

537  {
538  dd4hep::Material matter = ns.material(scintMat);
539  std::string name = idName + "Scintillator" + nm;
540 
541  dd4hep::Solid solid = dd4hep::Trap(
542  ns.prepend(name), 0.5 * dz, 0, 0, parm.yh1, parm.bl1, parm.tl1, parm.alp, parm.yh1, parm.bl1, parm.tl1, parm.alp);
543 #ifdef EDM_ML_DEBUG
544  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << solid.name() << " Trap made of " << scintMat
545  << " of dimensions " << convertCmToMm(0.5 * dz) << ", 0, 0, "
546  << convertCmToMm(parm.yh1) << ", " << convertCmToMm(parm.bl1) << ", "
547  << convertCmToMm(parm.tl1) << ", " << convertRadToDeg(parm.alp) << ", "
548  << convertCmToMm(parm.yh1) << ", " << convertCmToMm(parm.bl1) << ", "
549  << convertCmToMm(parm.tl1) << ", " << convertRadToDeg(parm.alp);
550 #endif
551  dd4hep::Volume glog(solid.name(), solid, matter);
552 
553  detector.placeVolume(glog, id);
554 #ifdef EDM_ML_DEBUG
555  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: " << glog.name() << " number " << id << " positioned in "
556  << detector.name() << " at (0,0,0) with no rotation";
557 #endif
558  }
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
dd4hep::Material material(const std::string &name) const
Definition: DDNamespace.cc:121
std::string prepend(const std::string &) const
Definition: DDNamespace.cc:66
constexpr NumType convertCmToMm(NumType centimeters)
Definition: GeantUnits.h:68
dd4hep::Volume Volume
dd4hep::Rotation3D HCalEndcapModuleAlgo::getRotation ( const std::string &  rotstr,
cms::DDNamespace ns 
)
inline

Definition at line 579 of file DDHCalEndcapModuleAlgo.cc.

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

579  {
580  std::string rot = (strchr(rotstr.c_str(), NAMESPACE_SEP) == nullptr) ? ("rotations:" + rotstr) : rotstr;
581 #ifdef EDM_ML_DEBUG
582  edm::LogVerbatim("HCalGeom") << "getRotation: " << rotstr << ":" << rot << ":" << ns.rotation(rot);
583 #endif
584  return ns.rotation(rot);
585  }
const dd4hep::Rotation3D & rotation(const std::string &name) const
Definition: DDNamespace.cc:130
#define NAMESPACE_SEP
Definition: DDNamespace.h:79
double HCalEndcapModuleAlgo::getRout ( double  z) const
inline

Definition at line 567 of file DDHCalEndcapModuleAlgo.cc.

References alignCSCRings::r.

567  {
568  double r = (modNumber >= 0) ? ((z - z1Beam) * slopeTop) : z * slopeTopF;
569  if (z > ziDip) {
570  if (r > rMaxBack)
571  r = rMaxBack;
572  } else {
573  if (r > rMaxFront)
574  r = rMaxFront;
575  }
576  return r;
577  }
double HCalEndcapModuleAlgo::getTrim ( unsigned int  j) const
inline

Definition at line 560 of file DDHCalEndcapModuleAlgo.cc.

560  {
561  if (j == 0)
562  return trimLeft;
563  else
564  return trimRight;
565  }
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, zMuMuMuonUserData::alpha, HCalEndcapModuleAlgo::HcalEndcapPar::bl1, HCalEndcapModuleAlgo::HcalEndcapPar::bl2, geant_units::operators::convertCmToMm(), angle_units::operators::convertRadToDeg(), PVValHelper::dx, PVValHelper::dy, MillePedeFileConverter_cfg::e, HCalEndcapModuleAlgo::HcalEndcapPar::phi, alignCSCRings::r, 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 " << convertCmToMm(rinF) << " " << convertCmToMm(routF)
488  << " " << convertCmToMm(zi) << " Back " << convertCmToMm(rinB) << " "
489  << convertCmToMm(routB) << " " << convertCmToMm(zo) << " Alpha "
490  << 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 " << convertCmToMm(dx) << ":" << convertCmToMm(dy) << ":"
513  << convertCmToMm(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 " << convertCmToMm(parm.yh1) << " " << convertCmToMm(parm.bl1)
523  << " " << convertCmToMm(parm.tl1) << " " << convertCmToMm(parm.yh2) << " "
524  << convertCmToMm(parm.bl2) << " " << convertCmToMm(parm.tl2) << " "
525  << convertRadToDeg(parm.alp) << " " << convertRadToDeg(parm.theta) << " "
526  << convertRadToDeg(parm.phi) << " Position " << convertCmToMm(parm.xpos) << " "
527  << convertCmToMm(parm.ypos) << " " << convertCmToMm(parm.zpos);
528 #endif
529  return parm;
530  }
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
T sqrt(T t)
Definition: SSEVec.h:19
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
constexpr NumType convertCmToMm(NumType centimeters)
Definition: GeantUnits.h:68
alpha
zGenParticlesMatch = cms.InputTag(""),
HcalEndcapPar HCalEndcapModuleAlgo::parameterLayer0 ( unsigned int  iphi)
inline

Definition at line 424 of file DDHCalEndcapModuleAlgo.cc.

References HCalEndcapModuleAlgo::HcalEndcapPar::alp, zMuMuMuonUserData::alpha, HCalEndcapModuleAlgo::HcalEndcapPar::bl1, HCalEndcapModuleAlgo::HcalEndcapPar::bl2, geant_units::operators::convertCmToMm(), angle_units::operators::convertRadToDeg(), funct::tan(), HCalEndcapModuleAlgo::HcalEndcapPar::tl1, HCalEndcapModuleAlgo::HcalEndcapPar::tl2, HCalEndcapModuleAlgo::HcalEndcapPar::xpos, HCalEndcapModuleAlgo::HcalEndcapPar::yh1, HCalEndcapModuleAlgo::HcalEndcapPar::yh2, HCalEndcapModuleAlgo::HcalEndcapPar::ypos, and HCalEndcapModuleAlgo::HcalEndcapPar::zpos.

424  {
426  //Given module and layer number compute parameters of trapezoid
427  //and positioning parameters
428  double alpha = (1._pi) / sectors;
429 #ifdef EDM_ML_DEBUG
430  edm::LogVerbatim("HCalGeom") << "Input " << iphi << " Alpha " << convertRadToDeg(alpha);
431 #endif
432  double zi, zo;
433  if (iphi == 0) {
434  zi = zMinBlock;
435  zo = zi + layerThick;
436  } else {
437  zo = zMaxBlock;
438  zi = zo - layerThick;
439  }
440  double rin, rout;
441  if (modNumber == 0) {
442  rin = zo * slopeTopF;
443  rout = (zi - z1Beam) * slopeTop;
444  } else if (modNumber > 0) {
445  rin = zo * slopeBot;
446  rout = zi * slopeTopF;
447  } else {
448  rin = zo * slopeBot;
449  rout = (zi - z1Beam) * slopeTop;
450  }
451 #ifdef EDM_ML_DEBUG
452  edm::LogVerbatim("HCalGeom") << "ModNumber " << modNumber << " " << convertCmToMm(zi) << " " << convertCmToMm(zo)
453  << " " << slopeTopF << " " << slopeTop << " " << slopeBot << " " << convertCmToMm(rin)
454  << " " << convertCmToMm(rout) << " " << convertCmToMm(getTrim(iphi));
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 " << convertCmToMm(parm.yh1) << " " << convertCmToMm(parm.bl1)
473  << " " << convertCmToMm(parm.tl1) << " " << convertRadToDeg(parm.alp) << " Position "
474  << convertCmToMm(parm.xpos) << " " << convertCmToMm(parm.ypos) << " "
475  << convertCmToMm(parm.zpos);
476 #endif
477  return parm;
478  }
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
double getTrim(unsigned int j) const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
constexpr NumType convertCmToMm(NumType centimeters)
Definition: GeantUnits.h:68
alpha
zGenParticlesMatch = cms.InputTag(""),

Member Data Documentation

std::string HCalEndcapModuleAlgo::absorberMat

Definition at line 24 of file DDHCalEndcapModuleAlgo.cc.

double HCalEndcapModuleAlgo::dzStep

Definition at line 33 of file DDHCalEndcapModuleAlgo.cc.

std::string HCalEndcapModuleAlgo::genMaterial

Definition at line 23 of file DDHCalEndcapModuleAlgo.cc.

std::string HCalEndcapModuleAlgo::idName

Definition at line 52 of file DDHCalEndcapModuleAlgo.cc.

std::string HCalEndcapModuleAlgo::idNameSpace

Definition at line 53 of file DDHCalEndcapModuleAlgo.cc.

int HCalEndcapModuleAlgo::idOffset

Definition at line 55 of file DDHCalEndcapModuleAlgo.cc.

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

Definition at line 50 of file DDHCalEndcapModuleAlgo.cc.

std::vector<int> HCalEndcapModuleAlgo::layerNumber

Definition at line 48 of file DDHCalEndcapModuleAlgo.cc.

double HCalEndcapModuleAlgo::layerThick

Definition at line 35 of file DDHCalEndcapModuleAlgo.cc.

int HCalEndcapModuleAlgo::layerType

Definition at line 47 of file DDHCalEndcapModuleAlgo.cc.

std::string HCalEndcapModuleAlgo::modName

Definition at line 54 of file DDHCalEndcapModuleAlgo.cc.

int HCalEndcapModuleAlgo::modNumber

Definition at line 46 of file DDHCalEndcapModuleAlgo.cc.

int HCalEndcapModuleAlgo::modType

Definition at line 45 of file DDHCalEndcapModuleAlgo.cc.

double HCalEndcapModuleAlgo::moduleThick

Definition at line 34 of file DDHCalEndcapModuleAlgo.cc.

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

Definition at line 49 of file DDHCalEndcapModuleAlgo.cc.

std::string HCalEndcapModuleAlgo::plasticMat

Definition at line 25 of file DDHCalEndcapModuleAlgo.cc.

double HCalEndcapModuleAlgo::rMaxBack

Definition at line 37 of file DDHCalEndcapModuleAlgo.cc.

double HCalEndcapModuleAlgo::rMaxFront

Definition at line 38 of file DDHCalEndcapModuleAlgo.cc.

std::string HCalEndcapModuleAlgo::rotstr

Definition at line 27 of file DDHCalEndcapModuleAlgo.cc.

std::string HCalEndcapModuleAlgo::scintMat

Definition at line 26 of file DDHCalEndcapModuleAlgo.cc.

double HCalEndcapModuleAlgo::scintThick

Definition at line 36 of file DDHCalEndcapModuleAlgo.cc.

int HCalEndcapModuleAlgo::sectors

Definition at line 28 of file DDHCalEndcapModuleAlgo.cc.

double HCalEndcapModuleAlgo::slopeBot

Definition at line 39 of file DDHCalEndcapModuleAlgo.cc.

double HCalEndcapModuleAlgo::slopeTop

Definition at line 40 of file DDHCalEndcapModuleAlgo.cc.

double HCalEndcapModuleAlgo::slopeTopF

Definition at line 41 of file DDHCalEndcapModuleAlgo.cc.

double HCalEndcapModuleAlgo::tolAbs

Definition at line 44 of file DDHCalEndcapModuleAlgo.cc.

double HCalEndcapModuleAlgo::trimLeft

Definition at line 42 of file DDHCalEndcapModuleAlgo.cc.

double HCalEndcapModuleAlgo::trimRight

Definition at line 43 of file DDHCalEndcapModuleAlgo.cc.

double HCalEndcapModuleAlgo::z1Beam

Definition at line 31 of file DDHCalEndcapModuleAlgo.cc.

double HCalEndcapModuleAlgo::ziDip

Definition at line 32 of file DDHCalEndcapModuleAlgo.cc.

double HCalEndcapModuleAlgo::zMaxBlock

Definition at line 30 of file DDHCalEndcapModuleAlgo.cc.

double HCalEndcapModuleAlgo::zMinBlock

Definition at line 29 of file DDHCalEndcapModuleAlgo.cc.