CMS 3D CMS Logo

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

#include <HcalHardcodeGeometryLoader.h>

Public Types

typedef CaloSubdetectorGeometryReturnType
 

Public Member Functions

 HcalHardcodeGeometryLoader (const HcalTopology &ht)
 
ReturnType load (DetId::Detector det, int subdet)
 
ReturnType load ()
 Load all of HCAL. More...
 
virtual ~HcalHardcodeGeometryLoader ()
 

Private Member Functions

void fill (HcalSubdetector subdet, int firstEtaRing, int lastEtaRing, ReturnType cg)
 
void init ()
 
void makeCell (const HcalDetId &detId, ReturnType geom) const
 

Private Attributes

const HcalTopologyextTopology
 
double theBarrelRadius
 
double theHB15aThickness
 
double theHB15bThickness
 
double theHB16aThickness
 
double theHB16bThickness
 
double theHBThickness
 
double theHEZPos [4]
 
double theHFThickness
 
double theHFZPos [2]
 
double theHOThickness
 
double theOuterRadius
 
HcalTopologytheTopology
 

Detailed Description

Note
The HE geometry is not currently correct. The z positions must be corrected.
Author
R. Wilkinson - Caltech

Definition at line 17 of file HcalHardcodeGeometryLoader.h.

Member Typedef Documentation

Definition at line 21 of file HcalHardcodeGeometryLoader.h.

Constructor & Destructor Documentation

HcalHardcodeGeometryLoader::HcalHardcodeGeometryLoader ( const HcalTopology ht)
explicit

Definition at line 12 of file HcalHardcodeGeometryLoader.cc.

References init().

12  :
13  theTopology ( 0 ) ,
14  extTopology ( &ht )
15 {
16  init();
17 }
virtual HcalHardcodeGeometryLoader::~HcalHardcodeGeometryLoader ( )
inlinevirtual

Definition at line 24 of file HcalHardcodeGeometryLoader.h.

References theTopology.

24 { delete theTopology ; }

Member Function Documentation

void HcalHardcodeGeometryLoader::fill ( HcalSubdetector  subdet,
int  firstEtaRing,
int  lastEtaRing,
ReturnType  cg 
)
private

helper functions to make all the ids and cells, and put them into the vectors and mpas passed in.

Definition at line 84 of file HcalHardcodeGeometryLoader.cc.

References HcalTopology::depthBinInformation(), extTopology, makeCell(), max(), ecaldqm::binning::nPhiBins, HcalTopology::nPhiBins(), and HcalTopology::valid().

Referenced by load().

88 {
89  // start by making the new HcalDetIds
90  std::vector<HcalDetId> hcalIds;
91  int nDepthSegments, startingDepthSegment;
92  for(int etaRing = firstEtaRing; etaRing <= lastEtaRing; ++etaRing) {
93  extTopology->depthBinInformation(subdet, etaRing, nDepthSegments, startingDepthSegment);
94  unsigned int nPhiBins = extTopology->nPhiBins(etaRing);
95  unsigned int phiInc=72/std::max(36u,nPhiBins);
96  for(int idepth = 0; idepth < nDepthSegments; ++idepth) {
97  int depthBin = startingDepthSegment + idepth;
98 
99  for(unsigned iphi = 1; iphi <= 72; iphi+=phiInc) {
100  for(int zsign = -1; zsign <= 1; zsign += 2) {
101  HcalDetId id( subdet, zsign * etaRing, iphi, depthBin);
102  if (extTopology->valid(id)) hcalIds.push_back(id);
103  }
104  }
105  }
106  }
107 
108  edm::LogInfo("HcalHardcodeGeometry") << "Number of HCAL DetIds made: "
109  << subdet
110  << " " << hcalIds.size();
111  // for each new HcalDetId, make a CaloCellGeometry
112  for(std::vector<HcalDetId>::const_iterator hcalIdItr = hcalIds.begin();
113  hcalIdItr != hcalIds.end(); ++hcalIdItr)
114  {
115  makeCell(*hcalIdItr,geom) ;
116  }
117 }
int nPhiBins(int etaRing) const
how many phi segments in this ring
const T & max(const T &a, const T &b)
void depthBinInformation(HcalSubdetector subdet, int etaRing, int &nDepthBins, int &startingBin) const
finds the number of depth bins and which is the number to start with
virtual bool valid(const DetId &id) const
Definition: HcalTopology.cc:58
void makeCell(const HcalDetId &detId, ReturnType geom) const
void HcalHardcodeGeometryLoader::init ( void  )
private

Definition at line 20 of file HcalHardcodeGeometryLoader.cc.

References theBarrelRadius, theHB15aThickness, theHB15bThickness, theHB16aThickness, theHB16bThickness, theHBThickness, theHEZPos, theHFThickness, theHFZPos, theHOThickness, and theOuterRadius.

Referenced by HcalHardcodeGeometryLoader().

21 {
22  theBarrelRadius = 190.;
23  theHBThickness = 93.6; // just from drawings. All thicknesses needs to be done right
24 
25  theHB15aThickness = theHBThickness * 12.0/17.0; // relative weight from layer count!
26  theHB15bThickness = theHBThickness * 4.0/17.0; // relative weight from layer count!
27  theHB16aThickness = theHBThickness * 1.0/17.0; // relative weight from layer count!
28  theHB16bThickness = theHBThickness * 7.0/17.0; // relative weight from layer count!
29 
30  theOuterRadius = 406;
31  theHOThickness = 1.;
32 
33  theHEZPos[0] = 388.0;
34  theHEZPos[1] = 397.0;
35  theHEZPos[2] = 450.0;
36  theHEZPos[3] = 568.0;
37 
38  theHFZPos[0] = 1100.0;
39  theHFZPos[1] = 1120.0;
40  theHFThickness = 165;
41 
42 }
HcalHardcodeGeometryLoader::ReturnType HcalHardcodeGeometryLoader::load ( DetId::Detector  det,
int  subdet 
)

Definition at line 46 of file HcalHardcodeGeometryLoader.cc.

References CaloSubdetectorGeometry::allocateCorners(), CaloSubdetectorGeometry::allocatePar(), CaloSubdetectorGeometry::cornersMgr(), extTopology, fill(), HcalTopology::firstHBRing(), HcalTopology::firstHERing(), HcalTopology::firstHFRing(), HcalTopology::firstHORing(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, HcalGeometry::k_NumberOfParametersPerShape, HcalTopology::lastHBRing(), HcalTopology::lastHERing(), HcalTopology::lastHFRing(), HcalTopology::lastHORing(), HcalTopology::ncells(), CaloSubdetectorGeometry::numberOfShapes(), and CaloSubdetectorGeometry::parMgr().

48 {
49  HcalSubdetector hsub=static_cast<HcalSubdetector>( subdet );
50  ReturnType hg( new HcalGeometry( *extTopology) );
51 
52  if( hg->cornersMgr() == 0 ) hg->allocateCorners( extTopology->ncells() );
53  if( hg->parMgr() == 0 ) hg->allocatePar(
54  HcalGeometry::k_NumberOfParametersPerShape*hg->numberOfShapes(),
56 
57  switch (hsub)
58  {
59  case (HcalBarrel) : fill(hsub, extTopology->firstHBRing(), extTopology->lastHBRing(), hg ); break;
60  case (HcalEndcap) : fill(hsub, extTopology->firstHERing(), extTopology->lastHERing(), hg ); break;
61  case (HcalForward) : fill(hsub, extTopology->firstHFRing(), extTopology->lastHFRing(), hg ); break;
62  case (HcalOuter) : fill(hsub, extTopology->firstHORing(), extTopology->lastHORing(), hg ); break;
63  default: break;
64  }
65  return hg;
66 }
int firstHFRing() const
Definition: HcalTopology.h:83
CaloSubdetectorGeometry * ReturnType
int firstHBRing() const
Definition: HcalTopology.h:79
int lastHBRing() const
Definition: HcalTopology.h:80
int lastHFRing() const
Definition: HcalTopology.h:84
HcalSubdetector
Definition: HcalAssistant.h:31
int firstHORing() const
Definition: HcalTopology.h:85
void fill(HcalSubdetector subdet, int firstEtaRing, int lastEtaRing, ReturnType cg)
int firstHERing() const
Definition: HcalTopology.h:81
int lastHORing() const
Definition: HcalTopology.h:86
virtual unsigned int ncells() const
return a count of valid cells (for dense indexing use)
int lastHERing() const
Definition: HcalTopology.h:82
HcalHardcodeGeometryLoader::ReturnType HcalHardcodeGeometryLoader::load ( )

Load all of HCAL.

Definition at line 69 of file HcalHardcodeGeometryLoader.cc.

References CaloSubdetectorGeometry::allocateCorners(), CaloSubdetectorGeometry::allocatePar(), CaloSubdetectorGeometry::cornersMgr(), extTopology, fill(), HcalTopology::firstHBRing(), HcalTopology::firstHERing(), HcalTopology::firstHFRing(), HcalTopology::firstHORing(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, HcalTopology::lastHBRing(), HcalTopology::lastHERing(), HcalTopology::lastHFRing(), HcalTopology::lastHORing(), HcalTopology::ncells(), and CaloSubdetectorGeometry::parMgr().

70 {
71  ReturnType hg( new HcalGeometry( *extTopology ) ) ;
72 
73  if( hg->cornersMgr() == 0 ) hg->allocateCorners( extTopology->ncells() );
74  if( hg->parMgr() == 0 ) hg->allocatePar( 500, 5 ) ;
75 
80  return hg;
81 }
int firstHFRing() const
Definition: HcalTopology.h:83
CaloSubdetectorGeometry * ReturnType
int firstHBRing() const
Definition: HcalTopology.h:79
int lastHBRing() const
Definition: HcalTopology.h:80
int lastHFRing() const
Definition: HcalTopology.h:84
int firstHORing() const
Definition: HcalTopology.h:85
void fill(HcalSubdetector subdet, int firstEtaRing, int lastEtaRing, ReturnType cg)
int firstHERing() const
Definition: HcalTopology.h:81
int lastHORing() const
Definition: HcalTopology.h:86
virtual unsigned int ncells() const
return a count of valid cells (for dense indexing use)
int lastHERing() const
Definition: HcalTopology.h:82
void HcalHardcodeGeometryLoader::makeCell ( const HcalDetId detId,
ReturnType  geom 
) const
private

Definition at line 123 of file HcalHardcodeGeometryLoader.cc.

References funct::cos(), HcalDetId::depth(), HcalTopology::depthBinInformation(), PV3DBase< T, PVType, FrameType >::eta(), eta(), extTopology, HcalTopology::firstHFRing(), CaloCellGeometry::getParmPtr(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, AnalysisDataFormats_SUSYBSMObjects::hp, HcalDetId::ietaAbs(), HcalDetId::iphi(), M_PI, CaloSubdetectorGeometry::newCell(), HcalTopology::nPhiBins(), CaloSubdetectorGeometry::parMgr(), CaloSubdetectorGeometry::parVecVec(), phi, point, alignCSCRings::r, funct::sin(), HcalDetId::subdet(), funct::tan(), theBarrelRadius, theHB15aThickness, theHB15bThickness, theHB16aThickness, theHB16bThickness, theHBHEEtaBounds, theHBThickness, theHEZPos, theHFEtaBounds, theHFThickness, theHFZPos, theHOThickness, theOuterRadius, theta(), theta_from_eta(), x, detailsBasic3DVector::y, detailsBasic3DVector::z, PV3DBase< T, PVType, FrameType >::z(), and HcalDetId::zside().

Referenced by fill().

125 {
126  // the two eta boundaries of the cell
127  double eta1, eta2;
128  HcalSubdetector subdet = detId.subdet();
129  int etaRing = detId.ietaAbs();
130  if(subdet == HcalForward)
131  {
132  eta1 = theHFEtaBounds[etaRing-extTopology->firstHFRing()];
133  eta2 = theHFEtaBounds[etaRing-extTopology->firstHFRing()+1];
134  }
135  else if (etaRing==28 && detId.depth()==3)
136  {
137  // double-width in eta at depth 3 in ieta=28
138  eta1 = theHBHEEtaBounds[etaRing-1];
139  eta2 = theHBHEEtaBounds[etaRing+1];
140  }
141  else
142  {
143  eta1 = theHBHEEtaBounds[etaRing-1];
144  eta2 = theHBHEEtaBounds[etaRing];
145  }
146  double eta = 0.5*(eta1+eta2) * detId.zside();
147  double deta = 0.5*(eta2-eta1);
148  double theta = theta_from_eta(eta);
149 
150  int nDepthBins, startingBin;
151  extTopology->depthBinInformation(subdet,etaRing,nDepthBins,startingBin);
152 
153  // in radians
154  double dphi_nominal = 2.0*M_PI / extTopology->nPhiBins(1); // always the same
155  double dphi_half = M_PI / extTopology->nPhiBins(etaRing); // half-width
156 
157  double phi_low = dphi_nominal*(detId.iphi()-1); // low-edge boundaries are constant...
158  double phi = phi_low+dphi_half;
159 
160  bool isBarrel = (subdet == HcalBarrel || subdet == HcalOuter);
161 
162  double x,y,z,r;
163  double thickness;
164 
165  if(isBarrel)
166  {
167  if(subdet == HcalBarrel)
168  {
169  if (detId.ietaAbs()==15)
170  {
171  if (detId.depth()==1)
172  {
173  r = theBarrelRadius;
174  thickness = theHB15aThickness;
175  }
176  else
177  {
179  thickness = theHB15bThickness;
180  }
181  }
182  else if (detId.ietaAbs()==16)
183  {
184  if (detId.depth()==1)
185  {
186  r = theBarrelRadius;
187  thickness = theHB16aThickness;
188  }
189  else
190  {
192  thickness = theHB16bThickness;
193  }
194  }
195  else
196  {
197  r = theBarrelRadius;
198  thickness = theHBThickness;
199  }
200  }
201  else
202  { // HO
203  r = theOuterRadius;
204  thickness = theHOThickness;
205  }
206  z = r * sinh(eta); // sinh(eta) == 1/tan(theta)
207  thickness *= cosh(eta); // cosh(eta) == 1/sin(theta)
208  }
209  else
210  {
211  int depth = detId.depth();
212  if(subdet == HcalEndcap)
213  { // Sadly, Z must be made a function of ieta.
214  if (nDepthBins==1)
215  {
216  z = theHEZPos[depth - 1];
217  thickness = theHEZPos[3] - z;
218  }
219  else if (nDepthBins==2 && depth==2)
220  {
221  z = theHEZPos[depth - 1];
222  if (etaRing==29) // special case for tower 29
223  thickness = theHEZPos[depth] - z;
224  else
225  thickness = theHEZPos[3] - z;
226  }
227  else
228  {
229  z = theHEZPos[depth - 1];
230  thickness = theHEZPos[depth] - z;
231  }
232  thickness /= fabs(tanh(eta));
233  }
234  else
235  {
236  z = theHFZPos[depth - 1];
237  thickness = theHFThickness-(theHFZPos[depth-1]-theHFZPos[0]);
238  }
239  z*=detId.zside(); // get the sign right.
240  r = z * tan(theta);
241  assert(r>0.);
242  }
243 
244  x = r * cos(phi);
245  y = r * sin(phi);
246  GlobalPoint point(x,y,z);
247 
248  std::vector<CCGFloat> hp ;
249  hp.reserve(5) ;
250 
251  if (subdet==HcalForward)
252  {
253  hp.push_back( deta ) ;
254  hp.push_back( dphi_half ) ;
255  hp.push_back( thickness/2 ) ;
256  hp.push_back( fabs( point.eta() ) ) ;
257  hp.push_back( fabs( point.z() ) ) ;
258  }
259  else
260  {
261  const double mysign ( isBarrel ? 1 : -1 ) ;
262  hp.push_back( deta ) ;
263  hp.push_back( dphi_half ) ;
264  hp.push_back( mysign*thickness/2. ) ;
265  hp.push_back( fabs( point.eta() ) ) ;
266  hp.push_back( fabs( point.z() ) ) ;
267  }
268  geom->newCell( point, point, point,
270  geom->parMgr(),
271  geom->parVecVec() ),
272  detId );
273 }
int firstHFRing() const
Definition: HcalTopology.h:83
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:30
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalDetId.h:32
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
double theta_from_eta(double eta)
int nPhiBins(int etaRing) const
how many phi segments in this ring
T eta() const
float float float z
int depth() const
get the tower depth
Definition: HcalDetId.h:40
susybsm::HSCParticleRefProd hp
Definition: classes.h:27
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
HcalSubdetector
Definition: HcalAssistant.h:31
void depthBinInformation(HcalSubdetector subdet, int etaRing, int &nDepthBins, int &startingBin) const
finds the number of depth bins and which is the number to start with
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
#define M_PI
int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:34
int iphi() const
get the cell iphi
Definition: HcalDetId.h:38
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
Definition: DDAxes.h:10

Member Data Documentation

const HcalTopology* HcalHardcodeGeometryLoader::extTopology
private

Definition at line 44 of file HcalHardcodeGeometryLoader.h.

Referenced by fill(), load(), and makeCell().

double HcalHardcodeGeometryLoader::theBarrelRadius
private

Definition at line 46 of file HcalHardcodeGeometryLoader.h.

Referenced by init(), and makeCell().

double HcalHardcodeGeometryLoader::theHB15aThickness
private

Definition at line 52 of file HcalHardcodeGeometryLoader.h.

Referenced by init(), and makeCell().

double HcalHardcodeGeometryLoader::theHB15bThickness
private

Definition at line 52 of file HcalHardcodeGeometryLoader.h.

Referenced by init(), and makeCell().

double HcalHardcodeGeometryLoader::theHB16aThickness
private

Definition at line 53 of file HcalHardcodeGeometryLoader.h.

Referenced by init(), and makeCell().

double HcalHardcodeGeometryLoader::theHB16bThickness
private

Definition at line 53 of file HcalHardcodeGeometryLoader.h.

Referenced by init(), and makeCell().

double HcalHardcodeGeometryLoader::theHBThickness
private

Definition at line 51 of file HcalHardcodeGeometryLoader.h.

Referenced by init(), and makeCell().

double HcalHardcodeGeometryLoader::theHEZPos[4]
private

Definition at line 48 of file HcalHardcodeGeometryLoader.h.

Referenced by init(), and makeCell().

double HcalHardcodeGeometryLoader::theHFThickness
private

Definition at line 54 of file HcalHardcodeGeometryLoader.h.

Referenced by init(), and makeCell().

double HcalHardcodeGeometryLoader::theHFZPos[2]
private

Definition at line 49 of file HcalHardcodeGeometryLoader.h.

Referenced by init(), and makeCell().

double HcalHardcodeGeometryLoader::theHOThickness
private

Definition at line 55 of file HcalHardcodeGeometryLoader.h.

Referenced by init(), and makeCell().

double HcalHardcodeGeometryLoader::theOuterRadius
private

Definition at line 47 of file HcalHardcodeGeometryLoader.h.

Referenced by init(), and makeCell().

HcalTopology* HcalHardcodeGeometryLoader::theTopology
private

Definition at line 43 of file HcalHardcodeGeometryLoader.h.

Referenced by ~HcalHardcodeGeometryLoader().