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

CaloCellGeometrymakeCell (int ieta, int iphi, CaloSubdetectorGeometry *geom) const
 

Private Attributes

HcalTopology limits
 

Detailed Description

Date:
2008/08/27 15:57:15
Revision:
1.3
Author
J. Mans - Minnesota

Definition at line 14 of file CaloTowerHardcodeGeometryLoader.h.

Member Function Documentation

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

Definition at line 8 of file CaloTowerHardcodeGeometryLoader.cc.

References abs, CaloSubdetectorGeometry::addCell(), 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().

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

Definition at line 46 of file CaloTowerHardcodeGeometryLoader.cc.

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

Referenced by load().

48  {
49  const double EBradius = 143.0; // cm
50  const double HOradius = 406.0+1.0;
51  const double EEz = 320.0; // rough (cm)
52  const double HEz = 568.0; // back (cm)
53  const double HFz = 1100.0;
54  const double HFthick = 165;
55  // Tower 17 is the last EB tower
56 
57  int etaRing=abs(ieta);
58  int sign=(ieta>0)?(1):(-1);
59  double eta1, eta2;
60  if (etaRing>limits.lastHERing()) {
61  eta1 = theHFEtaBounds[etaRing-limits.firstHFRing()];
62  eta2 = theHFEtaBounds[etaRing-limits.firstHFRing()+1];
63  } else {
64  eta1 = theHBHEEtaBounds[etaRing-1];
65  eta2 = theHBHEEtaBounds[etaRing];
66  }
67  double eta = 0.5*(eta1+eta2);
68  double deta = (eta2-eta1);
69 
70  // in radians
71  double dphi_nominal = 2.0*M_PI / limits.nPhiBins(1); // always the same
72  double dphi_half = M_PI / limits.nPhiBins(etaRing); // half-width
73 
74  double phi_low = dphi_nominal*(iphi-1); // low-edge boundaries are constant...
75  double phi = phi_low+dphi_half;
76 
77  double x,y,z,thickness;
78  bool alongZ=true;
79  if (etaRing>limits.lastHERing()) { // forward
80  z=HFz;
81  double r=z/sinh(eta);
82  x=r * cos(phi);
83  y=r * sin(phi);
84  thickness=HFthick/tanh(eta);
85  } else if (etaRing>17) { // EE-containing
86  z=EEz;
87  double r=z/sinh(eta);
88  x=r * cos(phi);
89  y=r * sin(phi);
90  thickness=(HEz-EEz)/tanh(eta);
91  } else { // EB-containing
92  x=EBradius * cos(phi);
93  y=EBradius * sin(phi);
94  alongZ=false;
95  z=EBradius * sinh(eta);
96  thickness=(HOradius-EBradius) * cosh(eta);
97  }
98 
99  z*=sign;
100  GlobalPoint point(x,y,z);
101 
102  const double mysign ( !alongZ ? 1 : -1 ) ;
103  std::vector<double> hh ;
104  hh.reserve(5) ;
105  hh.push_back( deta/2 ) ;
106  hh.push_back( dphi_half ) ;
107  hh.push_back( mysign*thickness/2. ) ;
108 
109  hh.push_back( fabs( eta ) ) ;
110  hh.push_back( fabs( z ) ) ;
111 
112  return new calogeom::IdealObliquePrism(
113  point,
114  geom->cornersMgr(),
116  geom->parMgr(),
117  geom->parVecVec() ) );
118 }
int firstHFRing() const
Definition: HcalTopology.h:65
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
#define M_PI
Definition: BFit3D.cc:3
static const double theHFEtaBounds[]
CaloCellGeometry::CornersMgr * cornersMgr()
static const double * getParmPtr(const std::vector< double > &vd, ParMgr *mgr, ParVecVec &pvv)
Definition: DDAxes.h:10
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().