CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
void initialize (const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs)
 
virtual ~DDHCalEndcapModuleAlgo ()
 

Protected Member Functions

void constructInsideModule (DDLogicalPart module, DDCompactView &cpv)
 
void constructInsideModule0 (DDLogicalPart module, DDCompactView &cpv)
 
void constructScintLayer (DDLogicalPart detector, double dz, DDHCalEndcapModuleAlgo::HcalEndcapPar parm, 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 21 of file DDHCalEndcapModuleAlgo.cc.

21  {
22  edm::LogInfo("HCalGeom") << "DDHCalEndcapModuleAlgo info: Creating an instance";
23 }
DDHCalEndcapModuleAlgo::~DDHCalEndcapModuleAlgo ( )
virtual

Definition at line 25 of file DDHCalEndcapModuleAlgo.cc.

25 {}

Member Function Documentation

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

Definition at line 227 of file DDHCalEndcapModuleAlgo.cc.

References DDHCalEndcapModuleAlgo::HcalEndcapPar::alp, alpha, DDHCalEndcapModuleAlgo::HcalEndcapPar::bl1, DDHCalEndcapModuleAlgo::HcalEndcapPar::bl2, constructScintLayer(), DDBase< N, C >::ddname(), DDSplit(), dzStep, plotBeamSpotDB::first, genMaterial, getRout(), getTrim(), i, idName, idNameSpace, idOffset, layerName, layerNumber, layerThick, layerType, modName, modNumber, moduleThick, mergeVDriftHistosByStation::name, DDBase< N, C >::name(), parameterLayer(), DDHCalEndcapModuleAlgo::HcalEndcapPar::phi, phiName, pi, plasticMat, DDCompactView::position(), diffTwoXMLs::r1, diffTwoXMLs::r2, makeMuonMisalignmentScenario::rot, rotstr, scintThick, edm::second(), sectors, slopeBot, slopeTopF, 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, zMinBlock, and DDHCalEndcapModuleAlgo::HcalEndcapPar::zpos.

Referenced by execute().

227  {
228 
229  edm::LogInfo("HCalGeom") << "DDHCalEndcapModuleAlgo test: \t\tInside module";
230 
232  //Pointers to the Rotation Matrices and to the Materials
235  DDMaterial matter(matName);
236  DDName plasName(DDSplit(plasticMat).first, DDSplit(plasticMat).second);
237  DDMaterial matplastic(plasName);
238 
239  double alpha = CLHEP::pi/sectors;
240  double zi = zMinBlock;
241 
242  for (unsigned int i=0; i<layerName.size(); i++) {
244  DDSolid solid;
245  DDLogicalPart glog, plog;
246  int layer = layerNumber[i];
247  double zo = zi + 0.5*dzStep;
248 
249  for (unsigned int iphi=0; iphi<phiName.size(); iphi++) {
250  double ziAir = zo - moduleThick;
251  double rinF, rinB;
252  if (modNumber == 0) {
253  rinF = ziAir * slopeTopF;
254  rinB = zo * slopeTopF;
255  } else {
256  rinF = ziAir * slopeBot;
257  rinB = zo * slopeBot;
258  }
259  double routF = getRout(ziAir);
260  double routB = getRout(zo);
261  edm::LogInfo("HCalGeom") << "DDHCalEndcapModuleAlgo test: Layer " << i
262  << " Phi " << iphi << " Front " << ziAir <<", "
263  << rinF << ", " << routF << " Back " << zo
264  << ", " << rinB << ", " << routB;
266  routF, rinB,
267  routB, ziAir,
268  zo);
269 
270  name = idName+modName+layerName[i]+phiName[iphi]+"Air";
271  solid = DDSolidFactory::trap(DDName(name, idNameSpace),
272  0.5*moduleThick, parm.theta, parm.phi,
273  parm.yh1, parm.bl1, parm.tl1, parm.alp,
274  parm.yh2, parm.bl2, parm.tl2, parm.alp);
275  edm::LogInfo("HCalGeom") << "DDHCalEndcapModuleAlgo test: "
276  << solid.name() << " Trap made of " << matName
277  << " of dimensions " << 0.5*moduleThick << ", "
278  << parm.theta/CLHEP::deg << ", "
279  << parm.phi/CLHEP::deg << ", " << parm.yh1
280  << ", " << parm.bl1 << ", " << parm.tl1 << ", "
281  << parm.alp/CLHEP::deg << ", " << parm.yh2
282  << ", " << parm.bl2 << ", " << parm.tl2 << ", "
283  << parm.alp/CLHEP::deg;
284  glog = DDLogicalPart(solid.ddname(), matter, solid);
285 
286  DDTranslation r1(parm.xpos, parm.ypos, parm.zpos);
287  cpv.position(glog, module, layer+1, r1, rot);
288  edm::LogInfo("HCalGeom") << "DDHCalEndcapModuleAlgo test: " <<glog.name()
289  << " number " << layer+1 << " positioned in "
290  << module.name() << " at " << r1 << " with "
291  << rot;
292 
293  //Now the plastic with scintillators
294  parm.yh1 = 0.5 * (routF - rinB) - getTrim(iphi);
295  parm.bl1 = 0.5 * rinB * tan(alpha) - getTrim(iphi);
296  parm.tl1 = 0.5 * routF * tan(alpha) - getTrim(iphi);
297  name = idName+modName+layerName[i]+phiName[iphi];
298  solid = DDSolidFactory::trap(DDName(name, idNameSpace),
299  0.5*layerThick, 0, 0, parm.yh1,
300  parm.bl1, parm.tl1, parm.alp, parm.yh1,
301  parm.bl1, parm.tl1, parm.alp);
302  edm::LogInfo("HCalGeom") << "DDHCalEndcapModuleAlgo test: "<<solid.name()
303  << " Trap made of " << plasName
304  << " of dimensions " << 0.5*layerThick
305  << ", 0, 0, " << parm.yh1 << ", " << parm.bl1
306  << ", " << parm.tl1 <<", "<< parm.alp/CLHEP::deg
307  << ", " << parm.yh1 << ", " << parm.bl1 << ", "
308  << parm.tl1 << ", " << parm.alp/CLHEP::deg;
309  plog = DDLogicalPart(solid.ddname(), matplastic, solid);
310 
311  double ypos = 0.5*(routF+rinB) - parm.xpos;
312  DDTranslation r2(0., ypos, 0.);
313  cpv.position(plog, glog, idOffset+layer+1, r2, DDRotation());
314  edm::LogInfo("HCalGeom") << "DDHCalEndcapModuleAlgo test: " <<plog.name()
315  << " number " << idOffset+layer+1
316  << " positioned in " << glog.name() << " at "
317  << r2 << " with no rotation";
318 
319  //Constructin the scintillators inside
320  int copyNo = layer*10 + layerType;
321  name = modName+layerName[i]+phiName[iphi];
322  constructScintLayer (plog, scintThick, parm, name, copyNo, cpv);
323  zo += 0.5*dzStep;
324  } // End of loop over phi indices
325  zi = zo - 0.5*dzStep;
326  } // End of loop on layers
327 }
int i
Definition: DBlmapReader.cc:9
float alpha
Definition: AMPTWrapper.h:95
const N & name() const
Definition: DDBase.h:78
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:41
std::vector< int > layerNumber
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
A DDSolid represents the shape of a part.
Definition: DDSolid.h:35
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
const Double_t pi
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
U second(std::pair< T, U > const &p)
std::vector< std::string > phiName
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:88
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:723
std::vector< std::string > layerName
double getTrim(unsigned int j) const
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:4
void constructScintLayer(DDLogicalPart detector, double dz, DDHCalEndcapModuleAlgo::HcalEndcapPar parm, std::string nm, int id, DDCompactView &cpv)
const N & ddname() const
Definition: DDBase.h:80
void DDHCalEndcapModuleAlgo::constructInsideModule0 ( DDLogicalPart  module,
DDCompactView cpv 
)
protected

Definition at line 125 of file DDHCalEndcapModuleAlgo.cc.

References absorberMat, DDHCalEndcapModuleAlgo::HcalEndcapPar::alp, DDHCalEndcapModuleAlgo::HcalEndcapPar::bl1, DDHCalEndcapModuleAlgo::HcalEndcapPar::bl2, constructScintLayer(), DDBase< N, C >::ddname(), DDSplit(), dzStep, plotBeamSpotDB::first, idName, idNameSpace, idOffset, layerName, layerNumber, layerThick, layerType, modName, modNumber, moduleThick, mergeVDriftHistosByStation::name, DDBase< N, C >::name(), parameterLayer(), parameterLayer0(), DDHCalEndcapModuleAlgo::HcalEndcapPar::phi, phiName, plasticMat, DDCompactView::position(), diffTwoXMLs::r1, diffTwoXMLs::r2, makeMuonMisalignmentScenario::rot, rotstr, scintThick, edm::second(), slopeBot, slopeTop, slopeTopF, AlCaHLTBitMon_QueryRunRegistry::string, DDHCalEndcapModuleAlgo::HcalEndcapPar::theta, DDHCalEndcapModuleAlgo::HcalEndcapPar::tl1, DDHCalEndcapModuleAlgo::HcalEndcapPar::tl2, tolAbs, DDSolidFactory::trap(), DDHCalEndcapModuleAlgo::HcalEndcapPar::xpos, DDHCalEndcapModuleAlgo::HcalEndcapPar::yh1, DDHCalEndcapModuleAlgo::HcalEndcapPar::yh2, DDHCalEndcapModuleAlgo::HcalEndcapPar::ypos, z1Beam, zMinBlock, and DDHCalEndcapModuleAlgo::HcalEndcapPar::zpos.

Referenced by execute().

125  {
126 
127  edm::LogInfo("HCalGeom") <<"DDHCalEndcapModuleAlgo test: \t\tInside module0";
128 
130  //Pointers to the Rotation Matrices and to the Materials
133  DDMaterial matabsorbr(matName);
134  DDName plasName(DDSplit(plasticMat).first, DDSplit(plasticMat).second);
135  DDMaterial matplastic(plasName);
136 
137  int layer = layerNumber[0];
138  int layer0 = layerNumber[1];
140  DDSolid solid;
141  DDLogicalPart glog, plog;
142  for (unsigned int iphi=0; iphi<phiName.size(); iphi++) {
144  name = idName+modName+layerName[0]+phiName[iphi];
145  solid = DDSolidFactory::trap(DDName(name, idNameSpace),
146  0.5*layerThick, 0, 0, parm.yh1, parm.bl1,
147  parm.tl1, parm.alp, parm.yh2, parm.bl1,
148  parm.tl2, parm.alp);
149  edm::LogInfo("HCalGeom") << "DDHCalEndcapModuleAlgo test: " << solid.name()
150  << " Trap made of " << plasName
151  << " of dimensions " << 0.5*layerThick
152  << ", 0, 0, " << parm.yh1 << ", " << parm.bl1
153  << ", " << parm.tl1 << ", " << parm.alp/CLHEP::deg
154  << ", " << parm.yh2 << ", " << parm.bl2 << ", "
155  << parm.tl2 << ", " << parm.alp/CLHEP::deg;
156  glog = DDLogicalPart(solid.ddname(), matplastic, solid);
157 
158  DDTranslation r1(parm.xpos, parm.ypos, parm.zpos);
159  cpv.position(glog, module, idOffset+layer+1, r1, rot);
160  edm::LogInfo("HCalGeom") << "DDHCalEndcapModuleAlgo test: " << glog.name()
161  << " number " << idOffset+layer+1 << " positioned in "
162  << module.name() << " at " << r1 << " with " << rot;
163  //Now construct the layer of scintillator inside this
164  int copyNo = layer0*10 + layerType;
165  name = modName+layerName[0]+phiName[iphi];
166  constructScintLayer (glog, scintThick, parm, name, copyNo, cpv);
167  }
168 
169  //Now the absorber layer
170  double zi = zMinBlock + layerThick;
171  double zo = zi + 0.5*dzStep;
172  double rinF, routF, rinB, routB;
173  if (modNumber == 0) {
174  rinF = zi * slopeTopF;
175  routF = (zi - z1Beam) * slopeTop;
176  rinB = zo * slopeTopF;
177  routB = (zo - z1Beam) * slopeTop;
178  } else if (modNumber > 0) {
179  rinF = zi * slopeBot;
180  routF = zi * slopeTopF;
181  rinB = zo * slopeBot;
182  routB = zo * slopeTopF;
183  } else {
184  rinF = zi * slopeBot;
185  routF = (zi - z1Beam) * slopeTop;
186  rinB = zo * slopeBot;
187  routB = (zo - z1Beam) * slopeTop;
188  }
189  edm::LogInfo("HCalGeom") << "DDHCalEndcapModuleAlgo test: Front "
190  << zi << ", " << rinF << ", " << routF << " Back "
191  << zo << ", " << rinB << ", " << routB;
193  rinB, routB, zi,
194  zo);
195  edm::LogInfo("HCalGeom") << "DDHCalEndcapModuleAlgo test: Trim " << tolAbs
196  << " Param " << parm.yh1 << ", " << parm.bl1 << ", "
197  << parm.tl1 << ", " << parm.yh2 << ", " << parm.bl2
198  << ", " << parm.tl2;
199  parm.bl1 -= tolAbs;
200  parm.tl1 -= tolAbs;
201  parm.bl2 -= tolAbs;
202  parm.tl2 -= tolAbs;
203 
204  name = idName+modName+layerName[0]+"Absorber";
205  solid = DDSolidFactory::trap(DDName(name, idNameSpace),
206  0.5*moduleThick, parm.theta, parm.phi, parm.yh1,
207  parm.bl1, parm.tl1, parm.alp, parm.yh2,
208  parm.bl2, parm.tl2, parm.alp);
209  edm::LogInfo("HCalGeom") << "DDHCalEndcapModuleAlgo test: " << solid.name()
210  << " Trap made of " << matName << " of dimensions "
211  << 0.5*moduleThick << ", " << parm.theta/CLHEP::deg
212  << ", " << parm.phi/CLHEP::deg << ", " << parm.yh1
213  << ", " << parm.bl1 << ", " << parm.tl1 << ", "
214  << parm.alp/CLHEP::deg << ", " << parm.yh2 << ", "
215  << parm.bl2 << ", " << parm.tl2 << ", "
216  << parm.alp/CLHEP::deg;
217  glog = DDLogicalPart(solid.ddname(), matabsorbr, solid);
218 
219  DDTranslation r2(parm.xpos, parm.ypos, parm.zpos);
220  cpv.position(glog, module, 1, r2, rot);
221  edm::LogInfo("HCalGeom") << "DDHCalEndcapModuleAlgo test: " << glog.name()
222  << " number 1 positioned in " << module.name()
223  << " at " << r2 << " with " << rot;
224 }
const N & name() const
Definition: DDBase.h:78
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:41
std::vector< int > layerNumber
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
A DDSolid represents the shape of a part.
Definition: DDSolid.h:35
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:66
U second(std::pair< T, U > const &p)
std::vector< std::string > phiName
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:88
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:723
std::vector< std::string > layerName
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
void constructScintLayer(DDLogicalPart detector, double dz, DDHCalEndcapModuleAlgo::HcalEndcapPar parm, std::string nm, int id, DDCompactView &cpv)
const N & ddname() const
Definition: DDBase.h:80
void DDHCalEndcapModuleAlgo::constructScintLayer ( DDLogicalPart  detector,
double  dz,
DDHCalEndcapModuleAlgo::HcalEndcapPar  parm,
std::string  nm,
int  id,
DDCompactView cpv 
)
protected

Definition at line 431 of file DDHCalEndcapModuleAlgo.cc.

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

Referenced by constructInsideModule(), and constructInsideModule0().

433  {
434 
436  DDMaterial matter(matname);
437  std::string name = idName+"Scintillator"+nm;
438 
439  DDSolid solid = DDSolidFactory::trap(DDName(name, idNameSpace), 0.5*dz, 0, 0,
440  parm.yh1, parm.bl1, parm.tl1, parm.alp,
441  parm.yh1, parm.bl1, parm.tl1, parm.alp);
442  edm::LogInfo("HCalGeom") << "DDHCalEndcapModuleAlgo test: " << solid.name()
443  << " Trap made of " << scintMat << " of dimensions "
444  << 0.5*dz << ", 0, 0, " << parm.yh1 << ", "
445  << parm.bl1 << ", " << parm.tl1 << ", "
446  << parm.alp/CLHEP::deg << ", " << parm.yh1 << ", "
447  << parm.bl1 << ", " << parm.tl1 << ", "
448  << parm.alp/CLHEP::deg;
449 
450  DDLogicalPart glog(solid.ddname(), matter, solid);
451 
452  cpv.position(glog, detector, id, DDTranslation(0,0,0), DDRotation());
453  edm::LogInfo("HCalGeom") << "DDHCalEndcapModuleAlgo test: " << glog.name()
454  << " number " << id << " positioned in "
455  << detector.name() <<" at (0,0,0) with no rotation";
456 
457 }
const N & name() const
Definition: DDBase.h:78
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
A DDSolid represents the shape of a part.
Definition: DDSolid.h:35
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
U second(std::pair< T, U > const &p)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:88
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:723
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
const N & ddname() const
Definition: DDBase.h:80
void DDHCalEndcapModuleAlgo::execute ( DDCompactView cpv)

Definition at line 114 of file DDHCalEndcapModuleAlgo.cc.

References constructInsideModule(), constructInsideModule0(), modType, and dbtoconf::parent.

114  {
115 
116  edm::LogInfo("HCalGeom") << "==>> Constructing DDHCalEndcapModuleAlgo...";
117  if (modType == 0)
119  else
120  constructInsideModule (parent(), cpv);
121  edm::LogInfo("HCalGeom") << "<<== End of DDHCalEndcapModuleAlgo construction ...";
122 }
void constructInsideModule(DDLogicalPart module, DDCompactView &cpv)
list parent
Definition: dbtoconf.py:74
void constructInsideModule0(DDLogicalPart module, DDCompactView &cpv)
double DDHCalEndcapModuleAlgo::getRout ( double  z) const
protected

Definition at line 465 of file DDHCalEndcapModuleAlgo.cc.

References modNumber, alignCSCRings::r, rMaxBack, rMaxFront, slopeTop, slopeTopF, z1Beam, and ziDip.

Referenced by constructInsideModule().

465  {
466  double r = (modNumber >= 0) ? ((z - z1Beam) * slopeTop) : z * slopeTopF;
467  if (z > ziDip) {
468  if (r > rMaxBack) r = rMaxBack;
469  } else {
470  if (r > rMaxFront) r = rMaxFront;
471  }
472  return r;
473 }
double DDHCalEndcapModuleAlgo::getTrim ( unsigned int  j) const
protected

Definition at line 459 of file DDHCalEndcapModuleAlgo.cc.

References trimLeft, and trimRight.

Referenced by constructInsideModule(), and parameterLayer0().

459  {
460 
461  if (j == 0) return trimLeft;
462  else return trimRight;
463 }
int j
Definition: DBlmapReader.cc:9
void DDHCalEndcapModuleAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 27 of file DDHCalEndcapModuleAlgo.cc.

References absorberMat, dbl_to_int(), dzStep, genMaterial, i, idName, idNameSpace, idOffset, layerName, layerNumber, layerThick, layerType, modName, modNumber, modType, moduleThick, DDCurrentNamespace::ns(), dbtoconf::parent, phiName, plasticMat, rMaxBack, rMaxFront, rotstr, scintMat, scintThick, sectors, slopeBot, slopeTop, slopeTopF, tolAbs, trimLeft, trimRight, z1Beam, ziDip, zMaxBlock, and zMinBlock.

31  {
32 
33  genMaterial = sArgs["MaterialName"];
34  absorberMat = sArgs["AbsorberMat"];
35  plasticMat = sArgs["PlasticMat"];
36  scintMat = sArgs["ScintMat"];
37  rotstr = sArgs["Rotation"];
38  sectors = int (nArgs["Sectors"]);
39  edm::LogInfo("HCalGeom") << "DDHCalEndcapModuleAlgo: General material "
40  << genMaterial << "\tAbsorber " << absorberMat
41  << "\tPlastic " << plasticMat << "\tScintillator "
42  << scintMat << "\tRotation " << rotstr
43  << "\tSectors " << sectors;
44 
45  zMinBlock = nArgs["ZMinBlock"];
46  zMaxBlock = nArgs["ZMaxBlock"];
47  z1Beam = nArgs["Z1Beam"];
48  ziDip = nArgs["ZiDip"];
49  dzStep = nArgs["DzStep"];
50  moduleThick = nArgs["ModuleThick"];
51  layerThick = nArgs["LayerThick"];
52  scintThick = nArgs["ScintThick"];
53  edm::LogInfo("HCalGeom") << "DDHCalEndcapModuleAlgo: Zmin " << zMinBlock
54  << "\tZmax " << zMaxBlock << "\tZ1Beam " << z1Beam
55  << "\tZiDip " << ziDip << "\tDzStep " << dzStep
56  << "\tModuleThick " << moduleThick <<"\tLayerThick "
57  << layerThick << "\tScintThick " << scintThick;
58 
59  rMaxFront = nArgs["RMaxFront"];
60  rMaxBack = nArgs["RMaxBack"];
61  trimLeft = nArgs["TrimLeft"];
62  trimRight = nArgs["TrimRight"];
63  tolAbs = nArgs["TolAbs"];
64  edm::LogInfo("HCalGeom") << "DDHCalEndcapModuleAlgo: RMaxFront " << rMaxFront
65  <<"\tRmaxBack " << rMaxBack << "\tTrims " <<trimLeft
66  << ":" << trimRight << "\tTolAbs " << tolAbs;
67 
68  slopeBot = nArgs["SlopeBottom"];
69  slopeTop = nArgs["SlopeTop"];
70  slopeTopF = nArgs["SlopeTopFront"];
71  modType = (int)(nArgs["ModType"]);
72  modNumber = (int)(nArgs["ModNumber"]);
73  layerType = (int)(nArgs["LayerType"]);
74  edm::LogInfo("HCalGeom") << "DDHCalEndcapModuleAlgo: slopeBot " << slopeBot
75  << "\tslopeTop " << slopeTop << "\tslopeTopF "
76  << slopeTopF << "\tmodType " << modType
77  << "\tmodNumber " << modNumber << "\tlayerType "
78  << layerType;
79 
80  layerNumber = dbl_to_int(vArgs["LayerNumber"]);
81  edm::LogInfo("HCalGeom") << "DDHCalEndcapModuleAlgo: " << layerNumber.size()
82  << " layer Numbers";
83  for (unsigned int i=0; i<layerNumber.size(); ++i)
84  edm::LogInfo("HCalGeom") << "LayerNumber[" << i << "] = " <<layerNumber[i];
85 
86  phiName = vsArgs["PhiName"];
87  edm::LogInfo("HCalGeom") << "DDHCalEndcapModuleAlgo: " << phiName.size()
88  << " phi sectors";
89  for (unsigned int i=0; i<phiName.size(); ++i)
90  edm::LogInfo("HCalGeom") << "PhiName[" << i << "] = " << phiName[i];
91 
92  layerName = vsArgs["LayerName"];
93  edm::LogInfo("HCalGeom") << "DDHCalEndcapModuleAlgo: " << layerName.size()
94  << " layers";
95  for (unsigned int i=0; i<layerName.size(); ++i)
96  edm::LogInfo("HCalGeom") << "LayerName[" << i << "] = " << layerName[i];
97 
98  idName = sArgs["MotherName"];
100  idOffset = int (nArgs["IdOffset"]);
101  DDName parentName = parent().name();
102  modName = sArgs["ModName"];
103  edm::LogInfo("HCalGeom") << "DDHCalEndcapModuleAlgo debug: Parent "
104  << parentName << " " << modName << " idName "
105  << idName << " NameSpace " << idNameSpace
106  << " Offset " << idOffset;
107 
108 }
int i
Definition: DBlmapReader.cc:9
list parent
Definition: dbtoconf.py:74
std::vector< int > layerNumber
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
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.cc:4
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 383 of file DDHCalEndcapModuleAlgo.cc.

References DDHCalEndcapModuleAlgo::HcalEndcapPar::alp, alpha, DDHCalEndcapModuleAlgo::HcalEndcapPar::bl1, DDHCalEndcapModuleAlgo::HcalEndcapPar::bl2, alignCSCRings::e, DDHCalEndcapModuleAlgo::HcalEndcapPar::phi, pi, alignCSCRings::r, sectors, 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 constructInsideModule(), and constructInsideModule0().

385  {
386 
388  //Given rin, rout compute parameters of the trapezoid and
389  //position of the trapezoid for a standrd layer
390  double alpha = CLHEP::pi/sectors;
391  edm::LogInfo("HCalGeom") << "Input " << iphi << " Front " << rinF << " "
392  << routF << " " << zi << " Back " << rinB << " "
393  << routB << " " << zo<<" Alpha " <<alpha/CLHEP::deg;
394 
395  parm.yh1 = 0.5 * (routF - rinB);
396  parm.bl1 = 0.5 * rinB * tan(alpha);
397  parm.tl1 = 0.5 * routF * tan(alpha);
398  parm.yh2 = 0.5 * (routF - rinB);
399  parm.bl2 = 0.5 * rinB * tan(alpha);
400  parm.tl2 = 0.5 * routF * tan(alpha);
401  double dx = 0.25* (parm.bl2+parm.tl2-parm.bl1-parm.tl1);
402  double dy = 0.5 * (rinB+routF-rinB-routF);
403  parm.xpos = 0.25*(rinB+routF+rinB+routF);
404  parm.ypos = 0.25*(parm.bl2+parm.tl2+parm.bl1+parm.tl1);
405  parm.zpos = 0.5*(zi+zo);
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  dx = -dx;
412  }
413  double r = sqrt (dx*dx + dy*dy);
414  edm::LogInfo("HCalGeom") << "dx|dy|r " << dx << ":" << dy << ":" << r;
415  if (r > 1.0e-8) {
416  parm.theta = atan (r/(zo-zi));
417  parm.phi = atan2 (dy, dx);
418  } else {
419  parm.theta = parm.phi = 0;
420  }
421  edm::LogInfo("HCalGeom") << "Output Dimensions " << parm.yh1 << " "
422  << parm.bl1 << " " << parm.tl1 << " " << parm.yh2
423  << " " << parm.bl2 << " " << parm.tl2 << " "
424  << parm.alp/CLHEP::deg <<" " <<parm.theta/CLHEP::deg
425  << " " << parm.phi/CLHEP::deg << " Position "
426  << parm.xpos << " " << parm.ypos << " " <<parm.zpos;
427  return parm;
428 }
float alpha
Definition: AMPTWrapper.h:95
const Double_t pi
T sqrt(T t)
Definition: SSEVec.h:48
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
DDHCalEndcapModuleAlgo::HcalEndcapPar DDHCalEndcapModuleAlgo::parameterLayer0 ( unsigned int  iphi)
protected

Definition at line 331 of file DDHCalEndcapModuleAlgo.cc.

References DDHCalEndcapModuleAlgo::HcalEndcapPar::alp, alpha, DDHCalEndcapModuleAlgo::HcalEndcapPar::bl1, DDHCalEndcapModuleAlgo::HcalEndcapPar::bl2, getTrim(), layerThick, modNumber, pi, sectors, slopeBot, slopeTop, slopeTopF, funct::tan(), DDHCalEndcapModuleAlgo::HcalEndcapPar::tl1, DDHCalEndcapModuleAlgo::HcalEndcapPar::tl2, DDHCalEndcapModuleAlgo::HcalEndcapPar::xpos, DDHCalEndcapModuleAlgo::HcalEndcapPar::yh1, DDHCalEndcapModuleAlgo::HcalEndcapPar::yh2, DDHCalEndcapModuleAlgo::HcalEndcapPar::ypos, z1Beam, zMaxBlock, zMinBlock, and DDHCalEndcapModuleAlgo::HcalEndcapPar::zpos.

Referenced by constructInsideModule0().

331  {
332 
334  //Given module and layer number compute parameters of trapezoid
335  //and positioning parameters
336  double alpha = CLHEP::pi/sectors;
337  edm::LogInfo("HCalGeom") << "Input " << iphi << " Alpha " <<alpha/CLHEP::deg;
338 
339  double zi, zo;
340  if (iphi == 0) {
341  zi = zMinBlock;
342  zo = zi + layerThick;
343  } else {
344  zo = zMaxBlock;
345  zi = zo - layerThick;
346  }
347  double rin, rout;
348  if (modNumber == 0) {
349  rin = zo * slopeTopF;
350  rout = (zi - z1Beam) * slopeTop;
351  } else if (modNumber > 0) {
352  rin = zo * slopeBot;
353  rout = zi * slopeTopF;
354  } else {
355  rin = zo * slopeBot;
356  rout = (zi - z1Beam) * slopeTop;
357  }
358  edm::LogInfo("HCalGeom") << "ModNumber " << modNumber << " " << zi << " " << zo << " " << slopeTopF << " " << slopeTop << " " << slopeBot << " " << rin << " " << rout << " " << getTrim(iphi);
359  double yh = 0.5 * (rout - rin);
360  double bl = 0.5 * rin * tan (alpha);
361  double tl = 0.5 * rout * tan(alpha);
362  parm.xpos = 0.5 * (rin + rout);
363  parm.ypos = 0.5 * (bl + tl);
364  parm.zpos = 0.5 * (zi + zo);
365  parm.yh1 = parm.yh2 = yh - getTrim(iphi);
366  parm.bl1 = parm.bl2 = bl - getTrim(iphi);
367  parm.tl1 = parm.tl2 = tl - getTrim(iphi);
368  parm.alp = atan(0.5 * tan(alpha));
369  if (iphi == 0) {
370  parm.ypos = -parm.ypos;
371  } else {
372  parm.alp = -parm.alp;
373  }
374  edm::LogInfo("HCalGeom") << "Output Dimensions " << parm.yh1 << " "
375  << parm.bl1 << " " << parm.tl1 << " "
376  << parm.alp/CLHEP::deg << " Position " << parm.xpos
377  << " " << parm.ypos << " " << parm.zpos;
378  return parm;
379 }
float alpha
Definition: AMPTWrapper.h:95
const Double_t pi
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.

Referenced by constructInsideModule0(), and initialize().

double DDHCalEndcapModuleAlgo::dzStep
private
std::string DDHCalEndcapModuleAlgo::genMaterial
private

Definition at line 47 of file DDHCalEndcapModuleAlgo.h.

Referenced by constructInsideModule(), and initialize().

std::string DDHCalEndcapModuleAlgo::idName
private
std::string DDHCalEndcapModuleAlgo::idNameSpace
private
int DDHCalEndcapModuleAlgo::idOffset
private
std::vector<std::string> DDHCalEndcapModuleAlgo::layerName
private
std::vector<int> DDHCalEndcapModuleAlgo::layerNumber
private
double DDHCalEndcapModuleAlgo::layerThick
private
int DDHCalEndcapModuleAlgo::layerType
private
std::string DDHCalEndcapModuleAlgo::modName
private
int DDHCalEndcapModuleAlgo::modNumber
private
int DDHCalEndcapModuleAlgo::modType
private

Definition at line 69 of file DDHCalEndcapModuleAlgo.h.

Referenced by execute(), and initialize().

double DDHCalEndcapModuleAlgo::moduleThick
private
std::vector<std::string> DDHCalEndcapModuleAlgo::phiName
private
std::string DDHCalEndcapModuleAlgo::plasticMat
private
double DDHCalEndcapModuleAlgo::rMaxBack
private

Definition at line 61 of file DDHCalEndcapModuleAlgo.h.

Referenced by getRout(), and initialize().

double DDHCalEndcapModuleAlgo::rMaxFront
private

Definition at line 62 of file DDHCalEndcapModuleAlgo.h.

Referenced by getRout(), and initialize().

std::string DDHCalEndcapModuleAlgo::rotstr
private
std::string DDHCalEndcapModuleAlgo::scintMat
private

Definition at line 50 of file DDHCalEndcapModuleAlgo.h.

Referenced by constructScintLayer(), and initialize().

double DDHCalEndcapModuleAlgo::scintThick
private
int DDHCalEndcapModuleAlgo::sectors
private
double DDHCalEndcapModuleAlgo::slopeBot
private
double DDHCalEndcapModuleAlgo::slopeTop
private
double DDHCalEndcapModuleAlgo::slopeTopF
private
double DDHCalEndcapModuleAlgo::tolAbs
private

Definition at line 68 of file DDHCalEndcapModuleAlgo.h.

Referenced by constructInsideModule0(), and initialize().

double DDHCalEndcapModuleAlgo::trimLeft
private

Definition at line 66 of file DDHCalEndcapModuleAlgo.h.

Referenced by getTrim(), and initialize().

double DDHCalEndcapModuleAlgo::trimRight
private

Definition at line 67 of file DDHCalEndcapModuleAlgo.h.

Referenced by getTrim(), and initialize().

double DDHCalEndcapModuleAlgo::z1Beam
private
double DDHCalEndcapModuleAlgo::ziDip
private

Definition at line 56 of file DDHCalEndcapModuleAlgo.h.

Referenced by getRout(), and initialize().

double DDHCalEndcapModuleAlgo::zMaxBlock
private

Definition at line 54 of file DDHCalEndcapModuleAlgo.h.

Referenced by initialize(), and parameterLayer0().

double DDHCalEndcapModuleAlgo::zMinBlock
private