CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Protected Member Functions | Private Attributes
DDHCalEndcapModuleAlgo Class Reference

#include <DDHCalEndcapModuleAlgo.h>

Inheritance diagram for DDHCalEndcapModuleAlgo:

Classes

struct  HcalEndcapPar
 

Public Member Functions

 DDHCalEndcapModuleAlgo ()
 
void execute (DDCompactView &cpv) override
 
void initialize (const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
 
 ~DDHCalEndcapModuleAlgo () override
 

Protected Member Functions

void constructInsideModule (const DDLogicalPart &module, DDCompactView &cpv)
 
void constructInsideModule0 (const DDLogicalPart &module, DDCompactView &cpv)
 
void constructScintLayer (const DDLogicalPart &detector, double dz, DDHCalEndcapModuleAlgo::HcalEndcapPar parm, const std::string &nm, int id, DDCompactView &cpv)
 
double getRout (double z) const
 
double getTrim (unsigned int j) const
 
HcalEndcapPar parameterLayer (unsigned int iphi, double rinF, double routF, double rinB, double routB, double zi, double zo)
 
HcalEndcapPar parameterLayer0 (unsigned int iphi)
 

Private 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 10 of file DDHCalEndcapModuleAlgo.h.

Constructor & Destructor Documentation

DDHCalEndcapModuleAlgo::DDHCalEndcapModuleAlgo ( )

Definition at line 23 of file DDHCalEndcapModuleAlgo.cc.

23  {
24 #ifdef EDM_ML_DEBUG
25  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: Creating an instance";
26 #endif
27 }
DDHCalEndcapModuleAlgo::~DDHCalEndcapModuleAlgo ( )
override

Definition at line 29 of file DDHCalEndcapModuleAlgo.cc.

29 {}

Member Function Documentation

void DDHCalEndcapModuleAlgo::constructInsideModule ( const DDLogicalPart module,
DDCompactView cpv 
)
protected

Definition at line 253 of file DDHCalEndcapModuleAlgo.cc.

References DDHCalEndcapModuleAlgo::HcalEndcapPar::alp, alpha, DDHCalEndcapModuleAlgo::HcalEndcapPar::bl1, DDHCalEndcapModuleAlgo::HcalEndcapPar::bl2, geant_units::operators::convertRadToDeg(), DDBase< N, C >::ddname(), DDSplit(), plotBeamSpotDB::first, mps_fire::i, trivialCutFlow_cff::idName, dataset::name, DDBase< N, C >::name(), DDHCalEndcapModuleAlgo::HcalEndcapPar::phi, DDCompactView::position(), diffTwoXMLs::r1, diffTwoXMLs::r2, makeMuonMisalignmentScenario::rot, edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, funct::tan(), DDHCalEndcapModuleAlgo::HcalEndcapPar::theta, DDHCalEndcapModuleAlgo::HcalEndcapPar::tl1, DDHCalEndcapModuleAlgo::HcalEndcapPar::tl2, DDSolidFactory::trap(), DDHCalEndcapModuleAlgo::HcalEndcapPar::xpos, DDHCalEndcapModuleAlgo::HcalEndcapPar::yh1, DDHCalEndcapModuleAlgo::HcalEndcapPar::yh2, DDHCalEndcapModuleAlgo::HcalEndcapPar::ypos, and DDHCalEndcapModuleAlgo::HcalEndcapPar::zpos.

Referenced by DDHCalEndcapModuleAlgo::HcalEndcapPar::HcalEndcapPar().

253  {
254 
255 #ifdef EDM_ML_DEBUG
256  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: \t\tInside module";
257 #endif
258  //Pointers to the Rotation Matrices and to the Materials
262  DDMaterial matter(matName);
263  DDName plasName(DDSplit(plasticMat).first, DDSplit(plasticMat).second);
264  DDMaterial matplastic(plasName);
265 
266  double alpha = (1._pi)/sectors;
267  double zi = zMinBlock;
268 
269  for (unsigned int i=0; i<layerName.size(); i++) {
271  DDSolid solid;
272  DDLogicalPart glog, plog;
273  int layer = layerNumber[i];
274  double zo = zi + 0.5*dzStep;
275 
276  for (unsigned int iphi=0; iphi<phiName.size(); iphi++) {
277  double ziAir = zo - moduleThick;
278  double rinF, rinB;
279  if (modNumber == 0) {
280  rinF = ziAir * slopeTopF;
281  rinB = zo * slopeTopF;
282  } else {
283  rinF = ziAir * slopeBot;
284  rinB = zo * slopeBot;
285  }
286  double routF = getRout(ziAir);
287  double routB = getRout(zo);
288 #ifdef EDM_ML_DEBUG
289  edm::LogVerbatim("HCalGeom")
290  << "DDHCalEndcapModuleAlgo: Layer " << i << " Phi " << iphi << " Front "
291  << ziAir <<", " << rinF << ", " << routF << " Back " << zo << ", " << rinB
292  << ", " << routB;
293 #endif
295  routF, rinB,
296  routB, ziAir,
297  zo);
298 
299  name = idName+modName+layerName[i]+phiName[iphi]+"Air";
300  solid = DDSolidFactory::trap(DDName(name, idNameSpace),
301  0.5*moduleThick, parm.theta, parm.phi,
302  parm.yh1, parm.bl1, parm.tl1, parm.alp,
303  parm.yh2, parm.bl2, parm.tl2, parm.alp);
304 #ifdef EDM_ML_DEBUG
305  edm::LogVerbatim("HCalGeom")
306  << "DDHCalEndcapModuleAlgo: " << solid.name() << " Trap made of "
307  << matName << " of dimensions " << 0.5*moduleThick << ", "
308  << convertRadToDeg(parm.theta) << ", " << convertRadToDeg(parm.phi)
309  << ", " << parm.yh1 << ", " << parm.bl1 << ", " << parm.tl1 << ", "
310  << convertRadToDeg(parm.alp) << ", " << parm.yh2 << ", " << parm.bl2
311  << ", " << parm.tl2 << ", " << convertRadToDeg(parm.alp);
312 #endif
313  glog = DDLogicalPart(solid.ddname(), matter, solid);
314 
315  DDTranslation r1(parm.xpos, parm.ypos, parm.zpos);
316  cpv.position(glog, module, layer+1, r1, rot);
317 #ifdef EDM_ML_DEBUG
318  edm::LogVerbatim("HCalGeom")
319  << "DDHCalEndcapModuleAlgo: " <<glog.name() << " number " << layer+1
320  << " positioned in " << module.name() << " at " << r1 << " with " << rot;
321 #endif
322  //Now the plastic with scintillators
323  parm.yh1 = 0.5 * (routF - rinB) - getTrim(iphi);
324  parm.bl1 = 0.5 * rinB * tan(alpha) - getTrim(iphi);
325  parm.tl1 = 0.5 * routF * tan(alpha) - getTrim(iphi);
326  name = idName+modName+layerName[i]+phiName[iphi];
327  solid = DDSolidFactory::trap(DDName(name, idNameSpace),
328  0.5*layerThick, 0, 0, parm.yh1,
329  parm.bl1, parm.tl1, parm.alp, parm.yh1,
330  parm.bl1, parm.tl1, parm.alp);
331 #ifdef EDM_ML_DEBUG
332  edm::LogVerbatim("HCalGeom")
333  << "DDHCalEndcapModuleAlgo: "<< solid.name() << " Trap made of "
334  << plasName << " of dimensions " << 0.5*layerThick << ", 0, 0, "
335  << parm.yh1 << ", " << parm.bl1 << ", " << parm.tl1 <<", "
336  << convertRadToDeg(parm.alp) << ", " << parm.yh1 << ", " << parm.bl1
337  << ", " << parm.tl1 << ", " << convertRadToDeg(parm.alp);
338 #endif
339  plog = DDLogicalPart(solid.ddname(), matplastic, solid);
340 
341  double ypos = 0.5*(routF+rinB) - parm.xpos;
342  DDTranslation r2(0., ypos, 0.);
343  cpv.position(plog, glog, idOffset+layer+1, r2, DDRotation());
344 #ifdef EDM_ML_DEBUG
345  edm::LogVerbatim("HCalGeom")
346  << "DDHCalEndcapModuleAlgo: " << plog.name() << " number "
347  << idOffset+layer+1 << " positioned in " << glog.name() << " at "
348  << r2 << " with no rotation";
349 #endif
350  //Constructin the scintillators inside
351  int copyNo = layer*10 + layerType;
352  name = modName+layerName[i]+phiName[iphi];
353  constructScintLayer (plog, scintThick, parm, name, copyNo, cpv);
354  zo += 0.5*dzStep;
355  } // End of loop over phi indices
356  zi = zo - 0.5*dzStep;
357  } // End of loop on layers
358 }
float alpha
Definition: AMPTWrapper.h:95
const N & name() const
Definition: DDBase.h:74
HcalEndcapPar parameterLayer(unsigned int iphi, double rinF, double routF, double rinB, double routB, double zi, double zo)
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:43
std::vector< int > layerNumber
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:68
U second(std::pair< T, U > const &p)
std::vector< std::string > phiName
void constructScintLayer(const DDLogicalPart &detector, double dz, DDHCalEndcapModuleAlgo::HcalEndcapPar parm, const std::string &nm, int id, DDCompactView &cpv)
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
static DDSolid trap(const DDName &name, double pDz, double pTheta, double pPhi, double pDy1, double pDx1, double pDx2, double pAlp1, double pDy2, double pDx3, double pDx4, double pAlp2)
Definition: DDSolid.cc:792
std::vector< std::string > layerName
double getTrim(unsigned int j) const
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
double getRout(double z) const
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
const N & ddname() const
Definition: DDBase.h:76
void DDHCalEndcapModuleAlgo::constructInsideModule0 ( const DDLogicalPart module,
DDCompactView cpv 
)
protected

Definition at line 141 of file DDHCalEndcapModuleAlgo.cc.

References DDHCalEndcapModuleAlgo::HcalEndcapPar::alp, DDHCalEndcapModuleAlgo::HcalEndcapPar::bl1, DDHCalEndcapModuleAlgo::HcalEndcapPar::bl2, geant_units::operators::convertRadToDeg(), DDBase< N, C >::ddname(), DDSplit(), plotBeamSpotDB::first, trivialCutFlow_cff::idName, dataset::name, DDBase< N, C >::name(), DDHCalEndcapModuleAlgo::HcalEndcapPar::phi, DDCompactView::position(), diffTwoXMLs::r1, diffTwoXMLs::r2, makeMuonMisalignmentScenario::rot, edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, DDHCalEndcapModuleAlgo::HcalEndcapPar::theta, DDHCalEndcapModuleAlgo::HcalEndcapPar::tl1, DDHCalEndcapModuleAlgo::HcalEndcapPar::tl2, DDSolidFactory::trap(), DDHCalEndcapModuleAlgo::HcalEndcapPar::xpos, DDHCalEndcapModuleAlgo::HcalEndcapPar::yh1, DDHCalEndcapModuleAlgo::HcalEndcapPar::yh2, DDHCalEndcapModuleAlgo::HcalEndcapPar::ypos, and DDHCalEndcapModuleAlgo::HcalEndcapPar::zpos.

Referenced by DDHCalEndcapModuleAlgo::HcalEndcapPar::HcalEndcapPar().

141  {
142 
143 #ifdef EDM_ML_DEBUG
144  edm::LogVerbatim("HCalGeom") << "DDHCalEndcapModuleAlgo: \t\tInside module0";
145 #endif
146  //Pointers to the Rotation Matrices and to the Materials
150  DDMaterial matabsorbr(matName);
151  DDName plasName(DDSplit(plasticMat).first, DDSplit(plasticMat).second);
152  DDMaterial matplastic(plasName);
153 
154  int layer = layerNumber[0];
155  int layer0 = layerNumber[1];
157  DDSolid solid;
158  DDLogicalPart glog, plog;
159  for (unsigned int iphi=0; iphi<phiName.size(); iphi++) {
161  name = idName+modName+layerName[0]+phiName[iphi];
162  solid = DDSolidFactory::trap(DDName(name, idNameSpace),
163  0.5*layerThick, 0, 0, parm.yh1, parm.bl1,
164  parm.tl1, parm.alp, parm.yh2, parm.bl1,
165  parm.tl2, parm.alp);
166 #ifdef EDM_ML_DEBUG
167  edm::LogVerbatim("HCalGeom")
168  << "DDHCalEndcapModuleAlgo: " << solid.name() << " Trap made of "
169  << plasName << " of dimensions " << 0.5*layerThick << ", 0, 0, "
170  << parm.yh1 << ", " << parm.bl1 << ", " << parm.tl1 << ", "
171  << convertRadToDeg(parm.alp) << ", " << parm.yh2 << ", " << parm.bl2
172  << ", " << parm.tl2 << ", " << convertRadToDeg(parm.alp);
173 #endif
174  glog = DDLogicalPart(solid.ddname(), matplastic, solid);
175 
176  DDTranslation r1(parm.xpos, parm.ypos, parm.zpos);
177  cpv.position(glog, module, idOffset+layer+1, r1, rot);
178 #ifdef EDM_ML_DEBUG
179  edm::LogVerbatim("HCalGeom")
180  << "DDHCalEndcapModuleAlgo: " << glog.name() << " number "
181  << idOffset+layer+1 << " positioned in " << module.name() << " at " << r1
182  << " with " << rot;
183 #endif
184  //Now construct the layer of scintillator inside this
185  int copyNo = layer0*10 + layerType;
186  name = modName+layerName[0]+phiName[iphi];
187  constructScintLayer (glog, scintThick, parm, name, copyNo, cpv);
188  }
189 
190  //Now the absorber layer
191  double zi = zMinBlock + layerThick;
192  double zo = zi + 0.5*dzStep;
193  double rinF, routF, rinB, routB;
194  if (modNumber == 0) {
195  rinF = zi * slopeTopF;
196  routF = (zi - z1Beam) * slopeTop;
197  rinB = zo * slopeTopF;
198  routB = (zo - z1Beam) * slopeTop;
199  } else if (modNumber > 0) {
200  rinF = zi * slopeBot;
201  routF = zi * slopeTopF;
202  rinB = zo * slopeBot;
203  routB = zo * slopeTopF;
204  } else {
205  rinF = zi * slopeBot;
206  routF = (zi - z1Beam) * slopeTop;
207  rinB = zo * slopeBot;
208  routB = (zo - z1Beam) * slopeTop;
209  }
210 #ifdef EDM_ML_DEBUG
211  edm::LogVerbatim("HCalGeom")
212  << "DDHCalEndcapModuleAlgo: Front " << zi << ", " << rinF << ", " << routF
213  << " Back " << zo << ", " << rinB << ", " << routB;
214 #endif
216  rinB, routB, zi,zo);
217 #ifdef EDM_ML_DEBUG
218  edm::LogVerbatim("HCalGeom")
219  << "DDHCalEndcapModuleAlgo: Trim " << tolAbs << " Param " << parm.yh1 << ", "
220  << parm.bl1 << ", " << parm.tl1 << ", " << parm.yh2 << ", " << parm.bl2
221  << ", " << parm.tl2;
222 #endif
223  parm.bl1 -= tolAbs;
224  parm.tl1 -= tolAbs;
225  parm.bl2 -= tolAbs;
226  parm.tl2 -= tolAbs;
227 
228  name = idName+modName+layerName[0]+"Absorber";
229  solid = DDSolidFactory::trap(DDName(name, idNameSpace),
230  0.5*moduleThick, parm.theta, parm.phi, parm.yh1,
231  parm.bl1, parm.tl1, parm.alp, parm.yh2,
232  parm.bl2, parm.tl2, parm.alp);
233 #ifdef EDM_ML_DEBUG
234  edm::LogVerbatim("HCalGeom")
235  << "DDHCalEndcapModuleAlgo: " << solid.name() << " Trap made of " << matName
236  << " of dimensions " << 0.5*moduleThick << ", " << convertRadToDeg(parm.theta)
237  << ", " << convertRadToDeg(parm.phi) << ", " << parm.yh1 << ", " << parm.bl1
238  << ", " << parm.tl1 << ", " << convertRadToDeg(parm.alp) << ", " << parm.yh2
239  << ", " << parm.bl2 << ", " << parm.tl2 << ", " << convertRadToDeg(parm.alp);
240 #endif
241  glog = DDLogicalPart(solid.ddname(), matabsorbr, solid);
242 
243  DDTranslation r2(parm.xpos, parm.ypos, parm.zpos);
244  cpv.position(glog, module, 1, r2, rot);
245 #ifdef EDM_ML_DEBUG
246  edm::LogVerbatim("HCalGeom")
247  << "DDHCalEndcapModuleAlgo: " << glog.name() << " number 1 positioned in "
248  << module.name() << " at " << r2 << " with " << rot;
249 #endif
250 }
const N & name() const
Definition: DDBase.h:74
HcalEndcapPar parameterLayer(unsigned int iphi, double rinF, double routF, double rinB, double routB, double zi, double zo)
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:43
std::vector< int > layerNumber
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
HcalEndcapPar parameterLayer0(unsigned int iphi)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:68
U second(std::pair< T, U > const &p)
std::vector< std::string > phiName
void constructScintLayer(const DDLogicalPart &detector, double dz, DDHCalEndcapModuleAlgo::HcalEndcapPar parm, const std::string &nm, int id, DDCompactView &cpv)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
static DDSolid trap(const DDName &name, double pDz, double pTheta, double pPhi, double pDy1, double pDx1, double pDx2, double pAlp1, double pDy2, double pDx3, double pDx4, double pAlp2)
Definition: DDSolid.cc:792
std::vector< std::string > layerName
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
const N & ddname() const
Definition: DDBase.h:76
void DDHCalEndcapModuleAlgo::constructScintLayer ( const DDLogicalPart detector,
double  dz,
DDHCalEndcapModuleAlgo::HcalEndcapPar  parm,
const std::string &  nm,
int  id,
DDCompactView cpv 
)
protected

Definition at line 475 of file DDHCalEndcapModuleAlgo.cc.

References DDHCalEndcapModuleAlgo::HcalEndcapPar::alp, DDHCalEndcapModuleAlgo::HcalEndcapPar::bl1, geant_units::operators::convertRadToDeg(), DDBase< N, C >::ddname(), DDSplit(), plotBeamSpotDB::first, trivialCutFlow_cff::idName, dataset::name, DDBase< N, C >::name(), DDCompactView::position(), edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, DDHCalEndcapModuleAlgo::HcalEndcapPar::tl1, DDSolidFactory::trap(), and DDHCalEndcapModuleAlgo::HcalEndcapPar::yh1.

Referenced by DDHCalEndcapModuleAlgo::HcalEndcapPar::HcalEndcapPar().

477  {
478 
480  DDMaterial matter(matname);
481  std::string name = idName+"Scintillator"+nm;
482 
483  DDSolid solid = DDSolidFactory::trap(DDName(name, idNameSpace), 0.5*dz, 0, 0,
484  parm.yh1, parm.bl1, parm.tl1, parm.alp,
485  parm.yh1, parm.bl1, parm.tl1, parm.alp);
486 #ifdef EDM_ML_DEBUG
487  edm::LogVerbatim("HCalGeom")
488  << "DDHCalEndcapModuleAlgo: " << solid.name() << " Trap made of " << scintMat
489  << " of dimensions " << 0.5*dz << ", 0, 0, " << parm.yh1 << ", " << parm.bl1
490  << ", " << parm.tl1 << ", " << convertRadToDeg(parm.alp) << ", " << parm.yh1
491  << ", " << parm.bl1 << ", " << parm.tl1 << ", " << convertRadToDeg(parm.alp);
492 #endif
493  DDLogicalPart glog(solid.ddname(), matter, solid);
494 
495  cpv.position(glog, detector, id, DDTranslation(0,0,0), DDRotation());
496 #ifdef EDM_ML_DEBUG
497  edm::LogVerbatim("HCalGeom")
498  << "DDHCalEndcapModuleAlgo: " << glog.name() << " number " << id
499  << " positioned in " << detector.name() <<" at (0,0,0) with no rotation";
500 #endif
501 }
const N & name() const
Definition: DDBase.h:74
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:43
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:68
U second(std::pair< T, U > const &p)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
static DDSolid trap(const DDName &name, double pDz, double pTheta, double pPhi, double pDy1, double pDx1, double pDx2, double pAlp1, double pDy2, double pDx3, double pDx4, double pAlp2)
Definition: DDSolid.cc:792
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
const N & ddname() const
Definition: DDBase.h:76
void DDHCalEndcapModuleAlgo::execute ( DDCompactView cpv)
override

Definition at line 125 of file DDHCalEndcapModuleAlgo.cc.

References class-composition::parent.

Referenced by DDHCalEndcapModuleAlgo::HcalEndcapPar::HcalEndcapPar().

125  {
126 
127 #ifdef EDM_ML_DEBUG
128  edm::LogVerbatim("HCalGeom") << "==>> Constructing DDHCalEndcapModuleAlgo...";
129 #endif
130  if (modType == 0)
132  else
133  constructInsideModule (parent(), cpv);
134 #ifdef EDM_ML_DEBUG
135  edm::LogVerbatim("HCalGeom")
136  << "<<== End of DDHCalEndcapModuleAlgo construction ...";
137 #endif
138 }
void constructInsideModule0(const DDLogicalPart &module, DDCompactView &cpv)
void constructInsideModule(const DDLogicalPart &module, DDCompactView &cpv)
double DDHCalEndcapModuleAlgo::getRout ( double  z) const
protected

Definition at line 509 of file DDHCalEndcapModuleAlgo.cc.

References alignCSCRings::r.

Referenced by DDHCalEndcapModuleAlgo::HcalEndcapPar::HcalEndcapPar().

509  {
510  double r = (modNumber >= 0) ? ((z - z1Beam) * slopeTop) : z * slopeTopF;
511  if (z > ziDip) {
512  if (r > rMaxBack) r = rMaxBack;
513  } else {
514  if (r > rMaxFront) r = rMaxFront;
515  }
516  return r;
517 }
double DDHCalEndcapModuleAlgo::getTrim ( unsigned int  j) const
protected

Definition at line 503 of file DDHCalEndcapModuleAlgo.cc.

Referenced by DDHCalEndcapModuleAlgo::HcalEndcapPar::HcalEndcapPar().

503  {
504 
505  if (j == 0) return trimLeft;
506  else return trimRight;
507 }
void DDHCalEndcapModuleAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 31 of file DDHCalEndcapModuleAlgo.cc.

References dbl_to_int(), mps_fire::i, trivialCutFlow_cff::idName, createfilelist::int, DDCurrentNamespace::ns(), and class-composition::parent.

Referenced by DDHCalEndcapModuleAlgo::HcalEndcapPar::HcalEndcapPar().

35  {
36 
37  genMaterial = sArgs["MaterialName"];
38  absorberMat = sArgs["AbsorberMat"];
39  plasticMat = sArgs["PlasticMat"];
40  scintMat = sArgs["ScintMat"];
41  rotstr = sArgs["Rotation"];
42  sectors = int (nArgs["Sectors"]);
43 #ifdef EDM_ML_DEBUG
44  edm::LogVerbatim("HCalGeom")
45  << "DDHCalEndcapModuleAlgo: General material " << genMaterial << "\tAbsorber "
46  << absorberMat << "\tPlastic " << plasticMat << "\tScintillator "
47  << scintMat << "\tRotation " << rotstr << "\tSectors " << sectors;
48 #endif
49  zMinBlock = nArgs["ZMinBlock"];
50  zMaxBlock = nArgs["ZMaxBlock"];
51  z1Beam = nArgs["Z1Beam"];
52  ziDip = nArgs["ZiDip"];
53  dzStep = nArgs["DzStep"];
54  moduleThick = nArgs["ModuleThick"];
55  layerThick = nArgs["LayerThick"];
56  scintThick = nArgs["ScintThick"];
57 #ifdef EDM_ML_DEBUG
58  edm::LogVerbatim("HCalGeom")
59  << "DDHCalEndcapModuleAlgo: Zmin " << zMinBlock << "\tZmax " << zMaxBlock
60  << "\tZ1Beam " << z1Beam << "\tZiDip " << ziDip << "\tDzStep " << dzStep
61  << "\tModuleThick " << moduleThick <<"\tLayerThick " << layerThick
62  << "\tScintThick " << scintThick;
63 #endif
64  rMaxFront = nArgs["RMaxFront"];
65  rMaxBack = nArgs["RMaxBack"];
66  trimLeft = nArgs["TrimLeft"];
67  trimRight = nArgs["TrimRight"];
68  tolAbs = nArgs["TolAbs"];
69 #ifdef EDM_ML_DEBUG
70  edm::LogVerbatim("HCalGeom")
71  << "DDHCalEndcapModuleAlgo: RMaxFront " << rMaxFront <<"\tRmaxBack "
72  << rMaxBack << "\tTrims " <<trimLeft << ":" << trimRight << "\tTolAbs "
73  << tolAbs;
74 #endif
75  slopeBot = nArgs["SlopeBottom"];
76  slopeTop = nArgs["SlopeTop"];
77  slopeTopF = nArgs["SlopeTopFront"];
78  modType = (int)(nArgs["ModType"]);
79  modNumber = (int)(nArgs["ModNumber"]);
80  layerType = (int)(nArgs["LayerType"]);
81 #ifdef EDM_ML_DEBUG
82  edm::LogVerbatim("HCalGeom")
83  << "DDHCalEndcapModuleAlgo: slopeBot " << slopeBot << "\tslopeTop "
84  << slopeTop << "\tslopeTopF " << slopeTopF << "\tmodType " << modType
85  << "\tmodNumber " << modNumber << "\tlayerType " << layerType;
86 #endif
87  layerNumber = dbl_to_int(vArgs["LayerNumber"]);
88 #ifdef EDM_ML_DEBUG
89  edm::LogVerbatim("HCalGeom")
90  << "DDHCalEndcapModuleAlgo: " << layerNumber.size() << " layer Numbers";
91  for (unsigned int i=0; i<layerNumber.size(); ++i)
92  edm::LogVerbatim("HCalGeom")
93  << "LayerNumber[" << i << "] = " <<layerNumber[i];
94 #endif
95  phiName = vsArgs["PhiName"];
96 #ifdef EDM_ML_DEBUG
97  edm::LogVerbatim("HCalGeom")
98  << "DDHCalEndcapModuleAlgo: " << phiName.size() << " phi sectors";
99  for (unsigned int i=0; i<phiName.size(); ++i)
100  edm::LogVerbatim("HCalGeom") << "PhiName[" << i << "] = " << phiName[i];
101 #endif
102  layerName = vsArgs["LayerName"];
103 #ifdef EDM_ML_DEBUG
104  edm::LogVerbatim("HCalGeom")
105  << "DDHCalEndcapModuleAlgo: " << layerName.size() << " layers";
106  for (unsigned int i=0; i<layerName.size(); ++i)
107  edm::LogVerbatim("HCalGeom") << "LayerName[" << i << "] = " << layerName[i];
108 #endif
109  idName = sArgs["MotherName"];
111  idOffset = int (nArgs["IdOffset"]);
112  modName = sArgs["ModName"];
113 #ifdef EDM_ML_DEBUG
114  edm::LogVerbatim("HCalGeom")
115  << "DDHCalEndcapModuleAlgo: Parent " << parent().name() << " " << modName
116  << " idName " << idName << " NameSpace " << idNameSpace << " Offset "
117  << idOffset;
118 #endif
119 }
std::vector< int > layerNumber
static std::string & ns()
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
Definition: DDutils.h:7
std::vector< std::string > phiName
std::vector< std::string > layerName
DDHCalEndcapModuleAlgo::HcalEndcapPar DDHCalEndcapModuleAlgo::parameterLayer ( unsigned int  iphi,
double  rinF,
double  routF,
double  rinB,
double  routB,
double  zi,
double  zo 
)
protected

Definition at line 422 of file DDHCalEndcapModuleAlgo.cc.

References DDHCalEndcapModuleAlgo::HcalEndcapPar::alp, alpha, DDHCalEndcapModuleAlgo::HcalEndcapPar::bl1, DDHCalEndcapModuleAlgo::HcalEndcapPar::bl2, geant_units::operators::convertRadToDeg(), PVValHelper::dx, PVValHelper::dy, MillePedeFileConverter_cfg::e, DDHCalEndcapModuleAlgo::HcalEndcapPar::phi, alignCSCRings::r, mathSSE::sqrt(), funct::tan(), DDHCalEndcapModuleAlgo::HcalEndcapPar::theta, DDHCalEndcapModuleAlgo::HcalEndcapPar::tl1, DDHCalEndcapModuleAlgo::HcalEndcapPar::tl2, DDHCalEndcapModuleAlgo::HcalEndcapPar::xpos, DDHCalEndcapModuleAlgo::HcalEndcapPar::yh1, DDHCalEndcapModuleAlgo::HcalEndcapPar::yh2, DDHCalEndcapModuleAlgo::HcalEndcapPar::ypos, and DDHCalEndcapModuleAlgo::HcalEndcapPar::zpos.

Referenced by DDHCalEndcapModuleAlgo::HcalEndcapPar::HcalEndcapPar().

424  {
425 
427  //Given rin, rout compute parameters of the trapezoid and
428  //position of the trapezoid for a standrd layer
429  double alpha = (1._pi)/sectors;
430 #ifdef EDM_ML_DEBUG
431  edm::LogVerbatim("HCalGeom")
432  << "Input " << iphi << " Front " << rinF << " " << routF << " " << zi
433  << " Back " << rinB << " " << routB << " " << zo << " Alpha "
434  << convertRadToDeg(alpha);
435 #endif
436  parm.yh1 = 0.5 * (routF - rinB);
437  parm.bl1 = 0.5 * rinB * tan(alpha);
438  parm.tl1 = 0.5 * routF * tan(alpha);
439  parm.yh2 = 0.5 * (routF - rinB);
440  parm.bl2 = 0.5 * rinB * tan(alpha);
441  parm.tl2 = 0.5 * routF * tan(alpha);
442  double dx = 0.25* (parm.bl2+parm.tl2-parm.bl1-parm.tl1);
443  double dy = 0.5 * (rinB+routF-rinB-routF);
444  parm.xpos = 0.25*(rinB+routF+rinB+routF);
445  parm.ypos = 0.25*(parm.bl2+parm.tl2+parm.bl1+parm.tl1);
446  parm.zpos = 0.5*(zi+zo);
447  parm.alp = atan(0.5 * tan(alpha));
448  if (iphi == 0) {
449  parm.ypos = -parm.ypos;
450  } else {
451  parm.alp = -parm.alp;
452  dx = -dx;
453  }
454  double r = sqrt (dx*dx + dy*dy);
455 #ifdef EDM_ML_DEBUG
456  edm::LogVerbatim("HCalGeom") << "dx|dy|r " << dx << ":" << dy << ":" << r;
457 #endif
458  if (r > 1.0e-8) {
459  parm.theta = atan (r/(zo-zi));
460  parm.phi = atan2 (dy, dx);
461  } else {
462  parm.theta = parm.phi = 0;
463  }
464 #ifdef EDM_ML_DEBUG
465  edm::LogVerbatim("HCalGeom")
466  << "Output Dimensions " << parm.yh1 << " " << parm.bl1 << " " << parm.tl1
467  << " " << parm.yh2 << " " << parm.bl2 << " " << parm.tl2 << " "
468  << convertRadToDeg(parm.alp) <<" " << convertRadToDeg(parm.theta) << " "
469  << convertRadToDeg(parm.phi) << " Position " << parm.xpos << " " << parm.ypos
470  << " " <<parm.zpos;
471 #endif
472  return parm;
473 }
float alpha
Definition: AMPTWrapper.h:95
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
T sqrt(T t)
Definition: SSEVec.h:18
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
DDHCalEndcapModuleAlgo::HcalEndcapPar DDHCalEndcapModuleAlgo::parameterLayer0 ( unsigned int  iphi)
protected

Definition at line 362 of file DDHCalEndcapModuleAlgo.cc.

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

Referenced by DDHCalEndcapModuleAlgo::HcalEndcapPar::HcalEndcapPar().

362  {
363 
365  //Given module and layer number compute parameters of trapezoid
366  //and positioning parameters
367  double alpha = (1._pi)/sectors;
368 #ifdef EDM_ML_DEBUG
369  edm::LogVerbatim("HCalGeom")
370  << "Input " << iphi << " Alpha " << convertRadToDeg(alpha);
371 #endif
372  double zi, zo;
373  if (iphi == 0) {
374  zi = zMinBlock;
375  zo = zi + layerThick;
376  } else {
377  zo = zMaxBlock;
378  zi = zo - layerThick;
379  }
380  double rin, rout;
381  if (modNumber == 0) {
382  rin = zo * slopeTopF;
383  rout = (zi - z1Beam) * slopeTop;
384  } else if (modNumber > 0) {
385  rin = zo * slopeBot;
386  rout = zi * slopeTopF;
387  } else {
388  rin = zo * slopeBot;
389  rout = (zi - z1Beam) * slopeTop;
390  }
391 #ifdef EDM_ML_DEBUG
392  edm::LogVerbatim("HCalGeom")
393  << "ModNumber " << modNumber << " " << zi << " " << zo << " " << slopeTopF
394  << " " << slopeTop << " " << slopeBot << " " << rin << " " << rout << " "
395  << getTrim(iphi);
396 #endif
397  double yh = 0.5 * (rout - rin);
398  double bl = 0.5 * rin * tan (alpha);
399  double tl = 0.5 * rout * tan(alpha);
400  parm.xpos = 0.5 * (rin + rout);
401  parm.ypos = 0.5 * (bl + tl);
402  parm.zpos = 0.5 * (zi + zo);
403  parm.yh1 = parm.yh2 = yh - getTrim(iphi);
404  parm.bl1 = parm.bl2 = bl - getTrim(iphi);
405  parm.tl1 = parm.tl2 = tl - getTrim(iphi);
406  parm.alp = atan(0.5 * tan(alpha));
407  if (iphi == 0) {
408  parm.ypos = -parm.ypos;
409  } else {
410  parm.alp = -parm.alp;
411  }
412 #ifdef EDM_ML_DEBUG
413  edm::LogVerbatim("HCalGeom")
414  << "Output Dimensions " << parm.yh1 << " " << parm.bl1 << " " << parm.tl1
415  << " " << convertRadToDeg(parm.alp) << " Position " << parm.xpos << " "
416  << parm.ypos << " " << parm.zpos;
417 #endif
418  return parm;
419 }
float alpha
Definition: AMPTWrapper.h:95
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
double getTrim(unsigned int j) const

Member Data Documentation

std::string DDHCalEndcapModuleAlgo::absorberMat
private

Definition at line 48 of file DDHCalEndcapModuleAlgo.h.

double DDHCalEndcapModuleAlgo::dzStep
private

Definition at line 57 of file DDHCalEndcapModuleAlgo.h.

std::string DDHCalEndcapModuleAlgo::genMaterial
private

Definition at line 47 of file DDHCalEndcapModuleAlgo.h.

std::string DDHCalEndcapModuleAlgo::idName
private

Definition at line 76 of file DDHCalEndcapModuleAlgo.h.

std::string DDHCalEndcapModuleAlgo::idNameSpace
private

Definition at line 77 of file DDHCalEndcapModuleAlgo.h.

int DDHCalEndcapModuleAlgo::idOffset
private

Definition at line 79 of file DDHCalEndcapModuleAlgo.h.

std::vector<std::string> DDHCalEndcapModuleAlgo::layerName
private

Definition at line 74 of file DDHCalEndcapModuleAlgo.h.

std::vector<int> DDHCalEndcapModuleAlgo::layerNumber
private

Definition at line 72 of file DDHCalEndcapModuleAlgo.h.

double DDHCalEndcapModuleAlgo::layerThick
private

Definition at line 59 of file DDHCalEndcapModuleAlgo.h.

int DDHCalEndcapModuleAlgo::layerType
private

Definition at line 71 of file DDHCalEndcapModuleAlgo.h.

std::string DDHCalEndcapModuleAlgo::modName
private

Definition at line 78 of file DDHCalEndcapModuleAlgo.h.

int DDHCalEndcapModuleAlgo::modNumber
private

Definition at line 70 of file DDHCalEndcapModuleAlgo.h.

int DDHCalEndcapModuleAlgo::modType
private

Definition at line 69 of file DDHCalEndcapModuleAlgo.h.

double DDHCalEndcapModuleAlgo::moduleThick
private

Definition at line 58 of file DDHCalEndcapModuleAlgo.h.

std::vector<std::string> DDHCalEndcapModuleAlgo::phiName
private

Definition at line 73 of file DDHCalEndcapModuleAlgo.h.

std::string DDHCalEndcapModuleAlgo::plasticMat
private

Definition at line 49 of file DDHCalEndcapModuleAlgo.h.

double DDHCalEndcapModuleAlgo::rMaxBack
private

Definition at line 61 of file DDHCalEndcapModuleAlgo.h.

double DDHCalEndcapModuleAlgo::rMaxFront
private

Definition at line 62 of file DDHCalEndcapModuleAlgo.h.

std::string DDHCalEndcapModuleAlgo::rotstr
private

Definition at line 51 of file DDHCalEndcapModuleAlgo.h.

std::string DDHCalEndcapModuleAlgo::scintMat
private

Definition at line 50 of file DDHCalEndcapModuleAlgo.h.

double DDHCalEndcapModuleAlgo::scintThick
private

Definition at line 60 of file DDHCalEndcapModuleAlgo.h.

int DDHCalEndcapModuleAlgo::sectors
private

Definition at line 52 of file DDHCalEndcapModuleAlgo.h.

double DDHCalEndcapModuleAlgo::slopeBot
private

Definition at line 63 of file DDHCalEndcapModuleAlgo.h.

double DDHCalEndcapModuleAlgo::slopeTop
private

Definition at line 64 of file DDHCalEndcapModuleAlgo.h.

double DDHCalEndcapModuleAlgo::slopeTopF
private

Definition at line 65 of file DDHCalEndcapModuleAlgo.h.

double DDHCalEndcapModuleAlgo::tolAbs
private

Definition at line 68 of file DDHCalEndcapModuleAlgo.h.

double DDHCalEndcapModuleAlgo::trimLeft
private

Definition at line 66 of file DDHCalEndcapModuleAlgo.h.

double DDHCalEndcapModuleAlgo::trimRight
private

Definition at line 67 of file DDHCalEndcapModuleAlgo.h.

double DDHCalEndcapModuleAlgo::z1Beam
private

Definition at line 55 of file DDHCalEndcapModuleAlgo.h.

double DDHCalEndcapModuleAlgo::ziDip
private

Definition at line 56 of file DDHCalEndcapModuleAlgo.h.

double DDHCalEndcapModuleAlgo::zMaxBlock
private

Definition at line 54 of file DDHCalEndcapModuleAlgo.h.

double DDHCalEndcapModuleAlgo::zMinBlock
private

Definition at line 53 of file DDHCalEndcapModuleAlgo.h.