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 (const HcalTopology *limits)
 

Private Member Functions

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

Private Attributes

const HcalTopologym_limits
 

Detailed Description

Author
J. Mans - Minnesota

Definition at line 12 of file CaloTowerHardcodeGeometryLoader.h.

Member Function Documentation

std::auto_ptr< CaloSubdetectorGeometry > CaloTowerHardcodeGeometryLoader::load ( const HcalTopology limits)

Definition at line 10 of file CaloTowerHardcodeGeometryLoader.cc.

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

Referenced by CaloTowerHardcodeGeometryEP::produce().

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

Definition at line 50 of file CaloTowerHardcodeGeometryLoader.cc.

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

Referenced by load().

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

Member Data Documentation

const HcalTopology* CaloTowerHardcodeGeometryLoader::m_limits
private

Definition at line 17 of file CaloTowerHardcodeGeometryLoader.h.

Referenced by load(), and makeCell().