CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
CaloTowerHardcodeGeometryLoader Class Reference

#include <CaloTowerHardcodeGeometryLoader.h>

Public Member Functions

std::auto_ptr
< CaloSubdetectorGeometry
load ()
 

Private Member Functions

void makeCell (int ieta, int iphi, CaloSubdetectorGeometry *geom) const
 

Private Attributes

HcalTopology limits
 

Detailed Description

Date:
2011/06/04 19:07:17
Revision:
1.5
Author
J. Mans - Minnesota

Definition at line 14 of file CaloTowerHardcodeGeometryLoader.h.

Member Function Documentation

std::auto_ptr< CaloSubdetectorGeometry > CaloTowerHardcodeGeometryLoader::load ( )

Definition at line 10 of file CaloTowerHardcodeGeometryLoader.cc.

References abs, CaloSubdetectorGeometry::allocateCorners(), CaloSubdetectorGeometry::allocatePar(), CaloSubdetectorGeometry::cornersMgr(), HcalTopology::firstHEDoublePhiRing(), HcalTopology::firstHFQuadPhiRing(), relativeConstraints::geom, CaloTowerGeometry::k_NumberOfCellsForCorners, CaloTowerGeometry::k_NumberOfParametersPerShape, CaloTowerGeometry::k_NumberOfShapes, HcalTopology::lastHFRing(), limits, makeCell(), n, and CaloSubdetectorGeometry::parMgr().

Referenced by CaloTowerHardcodeGeometryEP::produce().

10  {
12 
13  if( 0 == geom->cornersMgr() ) geom->allocateCorners (
15  if( 0 == geom->parMgr() ) geom->allocatePar (
18 
19  int nnn=0;
20  // simple loop
21  for (int ieta=-limits.lastHFRing(); ieta<=limits.lastHFRing(); ieta++) {
22  if (ieta==0) continue; // skip not existing eta=0 ring
23  for (int iphi=1; iphi<=72; iphi++) {
24  if (abs(ieta)>=limits.firstHFQuadPhiRing() && ((iphi-1)%4)==0) continue;
25  if (abs(ieta)>=limits.firstHEDoublePhiRing() && ((iphi-1)%2)!=0) continue;
26  ++nnn;
27  }
28  }
29  if( geom->cornersMgr() == 0 ) geom->allocateCorners( nnn ) ;
30  if( geom->parMgr() == 0 ) geom->allocatePar( 41, 3 ) ;
31 
32  int n=0;
33  // simple loop
34  for (int ieta=-limits.lastHFRing(); ieta<=limits.lastHFRing(); ieta++) {
35  if (ieta==0) continue; // skip not existing eta=0 ring
36  for (int iphi=1; iphi<=72; iphi++) {
37  if (abs(ieta)>=limits.firstHFQuadPhiRing() && ((iphi-1)%4)==0) continue;
38  if (abs(ieta)>=limits.firstHEDoublePhiRing() && ((iphi-1)%2)!=0) continue;
39  makeCell(ieta,iphi, geom);
40  n++;
41  }
42  }
43  edm::LogInfo("Geometry") << "CaloTowersHardcodeGeometry made " << n << " towers.";
44  return std::auto_ptr<CaloSubdetectorGeometry>(geom);
45 }
void makeCell(int ieta, int iphi, CaloSubdetectorGeometry *geom) const
#define abs(x)
Definition: mlp_lapack.h:159
void allocatePar(ParVec::size_type n, unsigned int m)
int lastHFRing() const
Definition: HcalTopology.h:66
int firstHEDoublePhiRing() const
Definition: HcalTopology.h:70
CaloCellGeometry::CornersMgr * cornersMgr()
int firstHFQuadPhiRing() const
Definition: HcalTopology.h:71
void allocateCorners(CaloCellGeometry::CornersVec::size_type n)
void CaloTowerHardcodeGeometryLoader::makeCell ( int  ieta,
int  iphi,
CaloSubdetectorGeometry geom 
) const
private

Definition at line 48 of file CaloTowerHardcodeGeometryLoader.cc.

References abs, funct::cos(), eta(), HcalTopology::firstHFRing(), CaloCellGeometry::getParmPtr(), HcalTopology::lastHERing(), limits, M_PI, CaloSubdetectorGeometry::newCell(), HcalTopology::nPhiBins(), CaloSubdetectorGeometry::parMgr(), CaloSubdetectorGeometry::parVecVec(), phi, point, alignCSCRings::r, funct::sin(), theHBHEEtaBounds, theHFEtaBounds, vdt::x, detailsBasic3DVector::y, and detailsBasic3DVector::z.

Referenced by load().

50  {
51  const double EBradius = 143.0; // cm
52  const double HOradius = 406.0+1.0;
53  const double EEz = 320.0; // rough (cm)
54  const double HEz = 568.0; // back (cm)
55  const double HFz = 1100.0;
56  const double HFthick = 165;
57  // Tower 17 is the last EB tower
58 
59  int etaRing=abs(ieta);
60  int sign=(ieta>0)?(1):(-1);
61  double eta1, eta2;
62  if (etaRing>limits.lastHERing()) {
63  eta1 = theHFEtaBounds[etaRing-limits.firstHFRing()];
64  eta2 = theHFEtaBounds[etaRing-limits.firstHFRing()+1];
65  } else {
66  eta1 = theHBHEEtaBounds[etaRing-1];
67  eta2 = theHBHEEtaBounds[etaRing];
68  }
69  double eta = 0.5*(eta1+eta2);
70  double deta = (eta2-eta1);
71 
72  // in radians
73  double dphi_nominal = 2.0*M_PI / limits.nPhiBins(1); // always the same
74  double dphi_half = M_PI / limits.nPhiBins(etaRing); // half-width
75 
76  double phi_low = dphi_nominal*(iphi-1); // low-edge boundaries are constant...
77  double phi = phi_low+dphi_half;
78 
79  double x,y,z,thickness;
80  bool alongZ=true;
81  if (etaRing>limits.lastHERing()) { // forward
82  z=HFz;
83  double r=z/sinh(eta);
84  x=r * cos(phi);
85  y=r * sin(phi);
86  thickness=HFthick/tanh(eta);
87  } else if (etaRing>17) { // EE-containing
88  z=EEz;
89  double r=z/sinh(eta);
90  x=r * cos(phi);
91  y=r * sin(phi);
92  thickness=(HEz-EEz)/tanh(eta);
93  } else { // EB-containing
94  x=EBradius * cos(phi);
95  y=EBradius * sin(phi);
96  alongZ=false;
97  z=EBradius * sinh(eta);
98  thickness=(HOradius-EBradius) * cosh(eta);
99  }
100 
101  z*=sign;
102  GlobalPoint point(x,y,z);
103 
104  const double mysign ( !alongZ ? 1 : -1 ) ;
105  std::vector<CCGFloat> hh ;
106  hh.reserve(5) ;
107  hh.push_back( deta/2 ) ;
108  hh.push_back( dphi_half ) ;
109  hh.push_back( mysign*thickness/2. ) ;
110 
111  hh.push_back( fabs( eta ) ) ;
112  hh.push_back( fabs( z ) ) ;
113 
114  geom->newCell( point, point, point,
116  geom->parMgr(),
117  geom->parVecVec() ),
118  CaloTowerDetId( ieta, iphi ) ) ;
119 }
int firstHFRing() const
Definition: HcalTopology.h:65
virtual void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)=0
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
int nPhiBins(int etaRing) const
how many phi segments in this ring
#define abs(x)
Definition: mlp_lapack.h:159
T eta() const
double double double z
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
#define M_PI
Definition: BFit3D.cc:3
static const double theHFEtaBounds[]
x
Definition: VDTMath.h:216
static const double theHBHEEtaBounds[]
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
int lastHERing() const
Definition: HcalTopology.h:64
Definition: DDAxes.h:10

Member Data Documentation

HcalTopology CaloTowerHardcodeGeometryLoader::limits
private

Definition at line 19 of file CaloTowerHardcodeGeometryLoader.h.

Referenced by load(), and makeCell().