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 | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
HcalGeometry Class Reference

#include <HcalGeometry.h>

Inheritance diagram for HcalGeometry:
CaloSubdetectorGeometry

Public Types

enum  { k_NumberOfCellsForCorners = HcalDetId::kSizeForDenseIndexing }
 
enum  { k_NumberOfShapes = 87 }
 
enum  { k_NumberOfParametersPerShape = 5 }
 
typedef HcalGeometryRecord AlignedRecord
 
typedef HcalAlignmentRcd AlignmentRecord
 
typedef CaloCellGeometry::CCGFloat CCGFloat
 
typedef HcalDetId DetIdType
 
typedef std::vector
< IdealObliquePrism
HBCellVec
 
typedef std::vector
< IdealObliquePrism
HECellVec
 
typedef std::vector< IdealZPrismHFCellVec
 
typedef std::vector
< IdealObliquePrism
HOCellVec
 
typedef PHcalRcd PGeometryRecord
 
typedef CaloCellGeometry::Pt3D Pt3D
 
typedef CaloCellGeometry::Pt3DVec Pt3DVec
 
- Public Types inherited from CaloSubdetectorGeometry
typedef CaloCellGeometry::CCGFloat CCGFloat
 
typedef std::set< DetIdDetIdSet
 
typedef std::vector< CCGFloatDimVec
 
typedef std::vector< unsigned int > IVec
 
typedef CaloCellGeometry::ParMgr ParMgr
 
typedef CaloCellGeometry::ParVec ParVec
 
typedef CaloCellGeometry::ParVecVec ParVecVec
 
typedef std::vector< CCGFloatTrVec
 

Public Member Functions

virtual
CaloSubdetectorGeometry::DetIdSet 
getCells (const GlobalPoint &r, double dR) const
 Get a list of all cells within a dR of the given cell. More...
 
virtual DetId getClosestCell (const GlobalPoint &r) const
 
virtual const std::vector
< DetId > & 
getValidDetIds (DetId::Detector det=DetId::Detector(0), int subdet=0) const
 Get a list of valid detector ids (for the given subdetector) More...
 
 HcalGeometry ()
 
 HcalGeometry (const HcalTopology *topology)
 
virtual void newCell (const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)
 
virtual unsigned int numberOfParametersPerShape () const
 
virtual unsigned int numberOfShapes () const
 
virtual ~HcalGeometry ()
 The HcalGeometry will delete all its cell geometries at destruction time. More...
 
- Public Member Functions inherited from CaloSubdetectorGeometry
void allocateCorners (CaloCellGeometry::CornersVec::size_type n)
 
void allocatePar (ParVec::size_type n, unsigned int m)
 
 CaloSubdetectorGeometry ()
 
CaloCellGeometry::CornersMgrcornersMgr ()
 
CCGFloat deltaEta (const DetId &detId) const
 
CCGFloat deltaPhi (const DetId &detId) const
 
virtual void fillDefaultNamedParameters () const
 
virtual const CaloCellGeometrygetGeometry (const DetId &id) const
 Get the cell geometry of a given detector id. Should return false if not found. More...
 
void getSummary (TrVec &trVector, IVec &iVector, DimVec &dimVector) const
 
virtual void initializeParms ()
 
virtual unsigned int numberOfTransformParms () const
 
ParMgrparMgr ()
 
const ParMgrparMgrConst () const
 
ParVecVecparVecVec ()
 
const ParVecVecparVecVec () const
 
virtual bool present (const DetId &id) const
 is this detid present in the geometry? More...
 
virtual ~CaloSubdetectorGeometry ()
 The base class DOES assume that it owns the CaloCellGeometry objects. More...
 

Static Public Member Functions

static unsigned int alignmentTransformIndexGlobal (const DetId &id)
 
static unsigned int alignmentTransformIndexLocal (const DetId &id)
 
static std::string dbString ()
 
static void localCorners (Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
 
static unsigned int numberOfAlignments ()
 
static unsigned int numberOfBarrelAlignments ()
 
static unsigned int numberOfEndcapAlignments ()
 
static unsigned int numberOfForwardAlignments ()
 
static unsigned int numberOfOuterAlignments ()
 
static std::string producerTag ()
 

Protected Member Functions

virtual const CaloCellGeometrycellGeomPtr (uint32_t index) const
 

Private Member Functions

int etaRing (HcalSubdetector bc, double abseta) const
 helper methods for getClosestCell More...
 
void fillDetIds () const
 
void init ()
 
int phiBin (double phi, int etaring) const
 

Private Attributes

std::vector< DetIdm_emptyIds
 
HBCellVec m_hbCellVec
 
std::vector< DetIdm_hbIds
 
HECellVec m_heCellVec
 
std::vector< DetIdm_heIds
 
HFCellVec m_hfCellVec
 
std::vector< DetIdm_hfIds
 
HOCellVec m_hoCellVec
 
std::vector< DetIdm_hoIds
 
bool m_ownsTopology
 
const HcalTopologytheTopology
 

Additional Inherited Members

- Static Protected Member Functions inherited from CaloSubdetectorGeometry
static CCGFloat deltaR (const GlobalPoint &p1, const GlobalPoint &p2)
 
- Protected Attributes inherited from CaloSubdetectorGeometry
ParVecVec m_parVecVec
 
std::vector< DetIdm_validIds
 

Detailed Description

Definition at line 12 of file HcalGeometry.h.

Member Typedef Documentation

Definition at line 26 of file HcalGeometry.h.

Definition at line 25 of file HcalGeometry.h.

Definition at line 21 of file HcalGeometry.h.

Definition at line 28 of file HcalGeometry.h.

Definition at line 16 of file HcalGeometry.h.

Definition at line 17 of file HcalGeometry.h.

typedef std::vector<IdealZPrism> HcalGeometry::HFCellVec

Definition at line 19 of file HcalGeometry.h.

Definition at line 18 of file HcalGeometry.h.

Definition at line 27 of file HcalGeometry.h.

Definition at line 22 of file HcalGeometry.h.

Definition at line 23 of file HcalGeometry.h.

Member Enumeration Documentation

anonymous enum
anonymous enum
Enumerator
k_NumberOfShapes 

Definition at line 32 of file HcalGeometry.h.

anonymous enum
Enumerator
k_NumberOfParametersPerShape 

Definition at line 34 of file HcalGeometry.h.

Constructor & Destructor Documentation

HcalGeometry::HcalGeometry ( )

Definition at line 11 of file HcalGeometry.cc.

References init().

11  :
12  theTopology ( new HcalTopology ),
13  m_ownsTopology ( true )
14 {
15  init() ;
16 }
const HcalTopology * theTopology
Definition: HcalGeometry.h:104
bool m_ownsTopology
Definition: HcalGeometry.h:111
HcalGeometry::HcalGeometry ( const HcalTopology topology)

Definition at line 18 of file HcalGeometry.cc.

References init().

18  :
19  theTopology ( topology ) ,
20  m_ownsTopology ( false )
21 {
22  init() ;
23 }
const HcalTopology * theTopology
Definition: HcalGeometry.h:104
bool m_ownsTopology
Definition: HcalGeometry.h:111
HcalGeometry::~HcalGeometry ( )
virtual

The HcalGeometry will delete all its cell geometries at destruction time.

Definition at line 26 of file HcalGeometry.cc.

References m_ownsTopology, and theTopology.

27 {
28  if( m_ownsTopology ) delete theTopology ;
29 }
const HcalTopology * theTopology
Definition: HcalGeometry.h:104
bool m_ownsTopology
Definition: HcalGeometry.h:111

Member Function Documentation

unsigned int HcalGeometry::alignmentTransformIndexGlobal ( const DetId id)
static

Definition at line 342 of file HcalGeometry.cc.

References DetId::Hcal.

343 {
344  return (unsigned int)DetId::Hcal - 1 ;
345 }
unsigned int HcalGeometry::alignmentTransformIndexLocal ( const DetId id)
static

Definition at line 297 of file HcalGeometry.cc.

References getHLTprescales::index, CaloGenericDetId::isHB(), CaloGenericDetId::isHcal(), CaloGenericDetId::isHE(), CaloGenericDetId::isHF(), CaloGenericDetId::isHO(), numberOfAlignments(), numberOfBarrelAlignments(), numberOfEndcapAlignments(), numberOfForwardAlignments(), and relativeConstraints::ring.

298 {
299  const CaloGenericDetId gid ( id ) ;
300 
301  assert( gid.isHcal() ) ;
302 
303 
304  const HcalDetId hid ( id ) ;
305 
306  const int jz ( ( hid.zside() + 1 )/2 ) ;
307 
308  const int zoff ( jz*numberOfAlignments()/2 ) ;
309 
310  const int detoff ( zoff +
311  ( gid.isHB() ? 0 :
312  ( gid.isHE() ? numberOfBarrelAlignments()/2 :
313  ( gid.isHF() ? ( numberOfBarrelAlignments() +
317  numberOfForwardAlignments() )/2 ) ) ) ) ;
318 
319  const int iphi ( hid.iphi() ) ;
320 
321  unsigned int index ( numberOfAlignments() ) ;
322  if( gid.isHO() )
323  {
324  const int ieta ( hid.ieta() ) ;
325  const int ring ( ieta < -10 ? 0 :
326  ( ieta < -4 ? 1 :
327  ( ieta < 5 ? 2 :
328  ( ieta < 11 ? 3 : 4 ) ) ) ) ;
329 
330  index = detoff + 12*ring + ( iphi - 1 )%6 ;
331  }
332  else
333  {
334  index = detoff + ( iphi - 1 )%4 ;
335  }
336 
337  assert( index < numberOfAlignments() ) ;
338  return index ;
339 }
static unsigned int numberOfBarrelAlignments()
Definition: HcalGeometry.h:61
static unsigned int numberOfEndcapAlignments()
Definition: HcalGeometry.h:63
static unsigned int numberOfForwardAlignments()
Definition: HcalGeometry.h:67
static unsigned int numberOfAlignments()
Definition: HcalGeometry.h:69
const CaloCellGeometry * HcalGeometry::cellGeomPtr ( uint32_t  index) const
protectedvirtual

Implements CaloSubdetectorGeometry.

Definition at line 412 of file HcalGeometry.cc.

References cropTnPTrees::din, getHLTprescales::index, m_hbCellVec, m_heCellVec, m_hfCellVec, m_hoCellVec, and CaloCellGeometry::param().

413 {
414  const CaloCellGeometry* cell ( 0 ) ;
415  if( m_hbCellVec.size() > din )
416  {
417  cell = &m_hbCellVec[ din ] ;
418  }
419  else
420  {
421  if( m_hbCellVec.size() +
422  m_heCellVec.size() > din )
423  {
424  const unsigned int index ( din - m_hbCellVec.size() ) ;
425  cell = &m_heCellVec[ index ] ;
426  }
427  else
428  {
429  if( m_hbCellVec.size() +
430  m_heCellVec.size() +
431  m_hoCellVec.size() > din )
432  {
433  const unsigned int index ( din
434  - m_hbCellVec.size()
435  - m_heCellVec.size() ) ;
436  cell = &m_hoCellVec[ index ] ;
437  }
438  else
439  {
440  if( m_hbCellVec.size() +
441  m_heCellVec.size() +
442  m_hoCellVec.size() +
443  m_hfCellVec.size() > din )
444  {
445  const unsigned int index ( din
446  - m_hbCellVec.size()
447  - m_heCellVec.size()
448  - m_hoCellVec.size() ) ;
449  cell = &m_hfCellVec[ index ] ;
450  }
451  }
452  }
453  }
454  return ( 0 == cell || 0 == cell->param() ? 0 : cell ) ;
455 }
HBCellVec m_hbCellVec
Definition: HcalGeometry.h:113
HOCellVec m_hoCellVec
Definition: HcalGeometry.h:115
HFCellVec m_hfCellVec
Definition: HcalGeometry.h:116
HECellVec m_heCellVec
Definition: HcalGeometry.h:114
static std::string HcalGeometry::dbString ( )
inlinestatic

Definition at line 36 of file HcalGeometry.h.

36 { return "PHcalRcd" ; }
int HcalGeometry::etaRing ( HcalSubdetector  bc,
double  abseta 
) const
private

helper methods for getClosestCell

Definition at line 167 of file HcalGeometry.cc.

References HcalTopology::firstHFRing(), HcalForward, HcalTopology::lastHERing(), HcalTopology::lastHFRing(), theHBHEEtaBounds, theHFEtaBounds, and theTopology.

Referenced by getCells(), and getClosestCell().

168 {
169  int etaring;
170  if( bc == HcalForward ) {
171  for(etaring = theTopology->firstHFRing();
172  etaring <= theTopology->lastHFRing(); ++etaring)
173  {
174  if(theHFEtaBounds[etaring-theTopology->firstHFRing()+1] > abseta) break;
175  }
176  }
177  else
178  {
179  for(etaring = 1;
180  etaring <= theTopology->lastHERing(); ++etaring)
181  {
182  if(theHBHEEtaBounds[etaring] >= abseta) break;
183  }
184  }
185 
186  return etaring;
187 }
int firstHFRing() const
Definition: HcalTopology.h:65
const HcalTopology * theTopology
Definition: HcalGeometry.h:104
int lastHFRing() const
Definition: HcalTopology.h:66
static const double theHFEtaBounds[]
static const double theHBHEEtaBounds[]
int lastHERing() const
Definition: HcalTopology.h:64
void HcalGeometry::fillDetIds ( ) const
private

Definition at line 42 of file HcalGeometry.cc.

References CaloSubdetectorGeometry::getValidDetIds(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, i, errorMatrix2Lands_multiChannel::id, m_emptyIds, m_hbIds, m_heIds, m_hfIds, m_hoIds, and python.multivaluedict::sort().

Referenced by getValidDetIds().

43 {
44  const std::vector<DetId>& baseIds ( CaloSubdetectorGeometry::getValidDetIds() ) ;
45  for( unsigned int i ( 0 ) ; i != baseIds.size() ; ++i )
46  {
47  const DetId id ( baseIds[i] );
48  if( id.subdetId() == HcalBarrel )
49  {
50  m_hbIds.push_back( id ) ;
51  }
52  else
53  {
54  if( id.subdetId() == HcalEndcap )
55  {
56  m_heIds.push_back( id ) ;
57  }
58  else
59  {
60  if( id.subdetId() == HcalOuter )
61  {
62  m_hoIds.push_back( id ) ;
63  }
64  else
65  {
66  if( id.subdetId() == HcalForward )
67  {
68  m_hfIds.push_back( id ) ;
69  }
70  }
71  }
72  }
73  }
74  std::sort( m_hbIds.begin(), m_hbIds.end() ) ;
75  std::sort( m_heIds.begin(), m_heIds.end() ) ;
76  std::sort( m_hoIds.begin(), m_hoIds.end() ) ;
77  std::sort( m_hfIds.begin(), m_hfIds.end() ) ;
78  m_emptyIds.resize( 0 ) ;
79 }
std::vector< DetId > m_heIds
Definition: HcalGeometry.h:107
int i
Definition: DBlmapReader.cc:9
std::vector< DetId > m_emptyIds
Definition: HcalGeometry.h:110
virtual const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const
Get a list of valid detector ids (for the given subdetector)
std::vector< DetId > m_hbIds
Definition: HcalGeometry.h:106
std::vector< DetId > m_hoIds
Definition: HcalGeometry.h:108
std::vector< DetId > m_hfIds
Definition: HcalGeometry.h:109
Definition: DetId.h:20
CaloSubdetectorGeometry::DetIdSet HcalGeometry::getCells ( const GlobalPoint r,
double  dR 
) const
virtual

Get a list of all cells within a dR of the given cell.

The default implementation makes a loop over all cell geometries. Cleverer implementations are suggested to use rough conversions between eta/phi and ieta/iphi and test on the boundaries.

Reimplemented from CaloSubdetectorGeometry.

Definition at line 219 of file HcalGeometry.cc.

References reco::deltaR2(), PV3DBase< T, PVType, FrameType >::eta(), eta(), etaRing(), HcalTopology::firstHFRing(), CaloSubdetectorGeometry::getCells(), CaloSubdetectorGeometry::getGeometry(), CaloCellGeometry::getPosition(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, HcalTopology::lastHFRing(), M_PI, AlCaHLTBitMon_ParallelJobs::p, phi, PV3DBase< T, PVType, FrameType >::phi(), phiBin(), theHFEtaBounds, theTopology, and HcalDetId::validDetId().

221 {
222  CaloSubdetectorGeometry::DetIdSet dis; // this is the return object
223 
224  if( 0.000001 < dR )
225  {
226  if( dR > M_PI/2. ) // this version needs "small" dR
227  {
228  dis = CaloSubdetectorGeometry::getCells( r, dR ) ; // base class version
229  }
230  else
231  {
232  const double dR2 ( dR*dR ) ;
233  const double reta ( r.eta() ) ;
234  const double rphi ( r.phi() ) ;
235  const double lowEta ( reta - dR ) ;
236  const double highEta ( reta + dR ) ;
237  const double lowPhi ( rphi - dR ) ;
238  const double highPhi ( rphi + dR ) ;
239 
240  const double hfEtaHi ( theHFEtaBounds[ theTopology->lastHFRing() -
241  theTopology->firstHFRing() + 1 ] ) ;
242 
243  if( highEta > -hfEtaHi &&
244  lowEta < hfEtaHi ) // in hcal
245  {
247 
248  for( unsigned int is ( 0 ) ; is != 4 ; ++is )
249  {
250  const int sign ( reta>0 ? 1 : -1 ) ;
251  const int ieta_center ( sign*etaRing( hs[is], fabs( reta ) ) ) ;
252  const int ieta_lo ( ( 0 < lowEta*sign ? sign : -sign )*etaRing( hs[is], fabs( lowEta ) ) ) ;
253  const int ieta_hi ( ( 0 < highEta*sign ? sign : -sign )*etaRing( hs[is], fabs( highEta ) ) ) ;
254  const int iphi_lo ( phiBin( lowPhi , ieta_center ) ) ;
255  const int iphi_hi ( phiBin( highPhi, ieta_center ) ) ;
256  const int jphi_lo ( iphi_lo>iphi_hi ? iphi_lo - 72 : iphi_lo ) ;
257  const int jphi_hi ( iphi_hi ) ;
258 
259  const int idep_lo ( 1 == is ? 4 : 1 ) ;
260  const int idep_hi ( 1 == is ? 4 :
261  ( 2 == is ? 3 : 2 ) ) ;
262  for( int ieta ( ieta_lo ) ; ieta <= ieta_hi ; ++ieta ) // over eta limits
263  {
264  if( ieta != 0 )
265  {
266  for( int jphi ( jphi_lo ) ; jphi <= jphi_hi ; ++jphi ) // over phi limits
267  {
268  const int iphi ( 1 > jphi ? jphi+72 : jphi ) ;
269 
270  for( int idep ( idep_lo ) ; idep <= idep_hi ; ++idep )
271  {
272  if( HcalDetId::validDetId( hs[is], ieta, iphi, idep ) )
273  {
274  const HcalDetId did ( hs[is], ieta, iphi, idep ) ;
275  const CaloCellGeometry* cell ( getGeometry( did ) );
276  if( 0 != cell )
277  {
278  const GlobalPoint& p ( cell->getPosition() ) ;
279  const double eta ( p.eta() ) ;
280  const double phi ( p.phi() ) ;
281  if( reco::deltaR2( eta, phi, reta, rphi ) < dR2 ) dis.insert( did ) ;
282  }
283  }
284  }
285  }
286  }
287  }
288  }
289  }
290  }
291  }
292  return dis;
293 }
int firstHFRing() const
Definition: HcalTopology.h:65
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
T eta() const
const HcalTopology * theTopology
Definition: HcalGeometry.h:104
static bool validDetId(HcalSubdetector subdet, int tower_ieta, int tower_iphi, int depth)
Definition: HcalDetId.cc:70
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
virtual DetIdSet getCells(const GlobalPoint &r, double dR) const
Get a list of all cells within a dR of the given cell.
int lastHFRing() const
Definition: HcalTopology.h:66
HcalSubdetector
Definition: HcalAssistant.h:32
int etaRing(HcalSubdetector bc, double abseta) const
helper methods for getClosestCell
double deltaR2(double eta1, double phi1, double eta2, double phi2)
Definition: deltaR.h:13
#define M_PI
Definition: BFit3D.cc:3
static const double theHFEtaBounds[]
T eta() const
Definition: PV3DBase.h:75
int phiBin(double phi, int etaring) const
Definition: DDAxes.h:10
DetId HcalGeometry::getClosestCell ( const GlobalPoint r) const
virtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 94 of file HcalGeometry.cc.

References abs, PV3DBase< T, PVType, FrameType >::eta(), etaRing(), CaloSubdetectorGeometry::getGeometry(), CaloCellGeometry::getPosition(), HcalBarrel, HcalEmpty, HcalEndcap, HcalForward, HcalTopology::incrementDepth(), HcalTopology::lastHBRing(), HcalTopology::lastHERing(), HcalTopology::lastHFRing(), PV3DBase< T, PVType, FrameType >::mag(), PV3DBase< T, PVType, FrameType >::phi(), phiBin(), theHBHEEtaBounds, theTopology, and PV3DBase< T, PVType, FrameType >::z().

94  {
95 
96  // Now find the closest eta_bin, eta value of a bin i is average
97  // of eta[i] and eta[i-1]
98  double abseta = fabs(r.eta());
99 
100  // figure out subdetector, giving preference to HE in HE/HF overlap region
102  if (abseta <= theHBHEEtaBounds[theTopology->lastHBRing()] ) {
103  bc = HcalBarrel;
104  } else if (abseta <= theHBHEEtaBounds[theTopology->lastHERing()] ) {
105  bc = HcalEndcap;
106  } else {
107  bc = HcalForward;
108  }
109 
110  if (bc == HcalForward) {
111  static const double z_short=1137.0;
112  int etaring = etaRing(bc, abseta); // This is safer
113  /*
114  static const double z_long=1115.0;
115  // determine front-face eta
116  double radius=sqrt(pow(r.x(),2)+pow(r.y(),2));
117  double trueAeta=asinh(z_long/radius);
118  // find eta bin
119  int etaring = etaRing(bc, trueAeta);
120  */
121  if (etaring>theTopology->lastHFRing()) etaring=theTopology->lastHFRing();
122 
123  int phibin = phiBin(r.phi(), etaring);
124 
125  // add a sign to the etaring
126  int etabin = (r.z() > 0) ? etaring : -etaring;
127  // Next line is premature depth 1 and 2 can coexist for large z-extent
128 
129 // HcalDetId bestId(bc,etabin,phibin,((fabs(r.z())>=z_short)?(2):(1)));
130 // above line is no good with finite precision
131  HcalDetId bestId(bc,etabin,phibin,((fabs(r.z()) - z_short >-0.1)?(2):(1)));
132  return bestId;
133  } else {
134 
135  // find eta bin
136  int etaring = etaRing(bc, abseta);
137 
138  int phibin = phiBin(r.phi(), etaring);
139 
140  // add a sign to the etaring
141  int etabin = (r.z() > 0) ? etaring : -etaring;
142 
143  //Now do depth if required
144  int dbin = 1;
145  double pointrz=0, drz=99999.;
146  HcalDetId currentId(bc, etabin, phibin, dbin);
147  if (bc == HcalBarrel) pointrz = r.mag();
148  else pointrz = std::abs(r.z());
149  HcalDetId bestId;
150  for ( ; currentId != HcalDetId(); theTopology->incrementDepth(currentId)) {
151  const CaloCellGeometry * cell = getGeometry(currentId);
152  assert(cell != 0);
153  double rz;
154  if (bc == HcalEndcap) rz = std::abs(cell->getPosition().z());
155  else rz = cell->getPosition().mag();
156  if (std::abs(pointrz-rz)<drz) {
157  bestId = currentId;
158  drz = std::abs(pointrz-rz);
159  }
160  }
161 
162  return bestId;
163  }
164 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
#define abs(x)
Definition: mlp_lapack.h:159
int lastHBRing() const
Definition: HcalTopology.h:62
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
const HcalTopology * theTopology
Definition: HcalGeometry.h:104
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
T mag() const
Definition: PV3DBase.h:66
T z() const
Definition: PV3DBase.h:63
int lastHFRing() const
Definition: HcalTopology.h:66
HcalSubdetector
Definition: HcalAssistant.h:32
int etaRing(HcalSubdetector bc, double abseta) const
helper methods for getClosestCell
bool incrementDepth(HcalDetId &id) const
T eta() const
Definition: PV3DBase.h:75
static const double theHBHEEtaBounds[]
int phiBin(double phi, int etaring) const
int lastHERing() const
Definition: HcalTopology.h:64
const std::vector< DetId > & HcalGeometry::getValidDetIds ( DetId::Detector  det = DetId::Detector ( 0 ),
int  subdet = 0 
) const
virtual

Get a list of valid detector ids (for the given subdetector)

Note
The implementation in this class is relevant for SubdetectorGeometries which handle only a single subdetector at a time. It does not look at the det and subdet arguments.

Reimplemented from CaloSubdetectorGeometry.

Definition at line 82 of file HcalGeometry.cc.

References fillDetIds(), CaloSubdetectorGeometry::getValidDetIds(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, m_emptyIds, m_hbIds, m_heIds, m_hfIds, and m_hoIds.

84 {
85  if( 0 != subdet &&
86  0 == m_hbIds.size() ) fillDetIds() ;
87  return ( 0 == subdet ? CaloSubdetectorGeometry::getValidDetIds() :
88  ( HcalBarrel == subdet ? m_hbIds :
89  ( HcalEndcap == subdet ? m_heIds :
90  ( HcalOuter == subdet ? m_hoIds :
91  ( HcalForward == subdet ? m_hfIds : m_emptyIds ) ) ) ) ) ;
92 }
std::vector< DetId > m_heIds
Definition: HcalGeometry.h:107
std::vector< DetId > m_emptyIds
Definition: HcalGeometry.h:110
virtual const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const
Get a list of valid detector ids (for the given subdetector)
std::vector< DetId > m_hbIds
Definition: HcalGeometry.h:106
std::vector< DetId > m_hoIds
Definition: HcalGeometry.h:108
std::vector< DetId > m_hfIds
Definition: HcalGeometry.h:109
void fillDetIds() const
Definition: HcalGeometry.cc:42
void HcalGeometry::init ( void  )
private

Definition at line 33 of file HcalGeometry.cc.

References HcalDetId::kHBSize, HcalDetId::kHESize, HcalDetId::kHFSize, HcalDetId::kHOSize, m_hbCellVec, m_heCellVec, m_hfCellVec, and m_hoCellVec.

Referenced by HcalGeometry().

34 {
39 }
std::vector< IdealObliquePrism > HECellVec
Definition: HcalGeometry.h:17
HBCellVec m_hbCellVec
Definition: HcalGeometry.h:113
HOCellVec m_hoCellVec
Definition: HcalGeometry.h:115
HFCellVec m_hfCellVec
Definition: HcalGeometry.h:116
std::vector< IdealObliquePrism > HOCellVec
Definition: HcalGeometry.h:18
std::vector< IdealZPrism > HFCellVec
Definition: HcalGeometry.h:19
std::vector< IdealObliquePrism > HBCellVec
Definition: HcalGeometry.h:16
HECellVec m_heCellVec
Definition: HcalGeometry.h:114
void HcalGeometry::localCorners ( Pt3DVec lc,
const CCGFloat pv,
unsigned int  i,
Pt3D ref 
)
static

Definition at line 348 of file HcalGeometry.cc.

References HcalDetId::detIdFromDenseIndex(), CaloGenericDetId::isHF(), IdealZPrism::localCorners(), and IdealObliquePrism::localCorners().

352 {
353  const HcalDetId hid ( HcalDetId::detIdFromDenseIndex( i ) ) ;
354  const CaloGenericDetId cgid ( hid ) ;
355  if( cgid.isHF() )
356  {
357  IdealZPrism::localCorners( lc, pv, ref ) ;
358  }
359  else
360  {
361  IdealObliquePrism::localCorners( lc, pv, ref ) ;
362  }
363 }
int i
Definition: DBlmapReader.cc:9
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
static HcalDetId detIdFromDenseIndex(uint32_t di)
Definition: HcalDetId.cc:155
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
Definition: IdealZPrism.cc:103
void HcalGeometry::newCell ( const GlobalPoint f1,
const GlobalPoint f2,
const GlobalPoint f3,
const CCGFloat parm,
const DetId detId 
)
virtual

Implements CaloSubdetectorGeometry.

Definition at line 366 of file HcalGeometry.cc.

References CaloSubdetectorGeometry::cornersMgr(), CaloGenericDetId::denseIndex(), cropTnPTrees::din, getHLTprescales::index, CaloGenericDetId::isHB(), CaloGenericDetId::isHcal(), CaloGenericDetId::isHE(), CaloGenericDetId::isHO(), m_hbCellVec, m_heCellVec, m_hfCellVec, m_hoCellVec, and CaloSubdetectorGeometry::m_validIds.

371 {
372  const CaloGenericDetId cgid ( detId ) ;
373 
374  const unsigned int din ( cgid.denseIndex() ) ;
375 
376  assert( cgid.isHcal() ) ;
377 
378  if( cgid.isHB() )
379  {
380  m_hbCellVec[ din ] = IdealObliquePrism( f1, cornersMgr(), parm ) ;
381  }
382  else
383  {
384  if( cgid.isHE() )
385  {
386  const unsigned int index ( din - m_hbCellVec.size() ) ;
387  m_heCellVec[ index ] = IdealObliquePrism( f1, cornersMgr(), parm ) ;
388  }
389  else
390  {
391  if( cgid.isHO() )
392  {
393  const unsigned int index ( din
394  - m_hbCellVec.size()
395  - m_heCellVec.size() ) ;
396  m_hoCellVec[ index ] = IdealObliquePrism( f1, cornersMgr(), parm ) ;
397  }
398  else
399  {
400  const unsigned int index ( din
401  - m_hbCellVec.size()
402  - m_heCellVec.size()
403  - m_hoCellVec.size() ) ;
404  m_hfCellVec[ index ] = IdealZPrism( f1, cornersMgr(), parm ) ;
405  }
406  }
407  }
408  m_validIds.push_back( detId ) ;
409 }
HBCellVec m_hbCellVec
Definition: HcalGeometry.h:113
HOCellVec m_hoCellVec
Definition: HcalGeometry.h:115
HFCellVec m_hfCellVec
Definition: HcalGeometry.h:116
std::vector< DetId > m_validIds
CaloCellGeometry::CornersMgr * cornersMgr()
HECellVec m_heCellVec
Definition: HcalGeometry.h:114
static unsigned int HcalGeometry::numberOfAlignments ( )
inlinestatic

Definition at line 69 of file HcalGeometry.h.

References numberOfBarrelAlignments(), numberOfEndcapAlignments(), numberOfForwardAlignments(), and numberOfOuterAlignments().

Referenced by alignmentTransformIndexLocal(), and HcalAlignmentEP::produceHcalAli().

70  { return ( numberOfBarrelAlignments() +
static unsigned int numberOfBarrelAlignments()
Definition: HcalGeometry.h:61
static unsigned int numberOfOuterAlignments()
Definition: HcalGeometry.h:65
static unsigned int numberOfEndcapAlignments()
Definition: HcalGeometry.h:63
static unsigned int numberOfForwardAlignments()
Definition: HcalGeometry.h:67
static unsigned int HcalGeometry::numberOfBarrelAlignments ( )
inlinestatic
static unsigned int HcalGeometry::numberOfEndcapAlignments ( )
inlinestatic
static unsigned int HcalGeometry::numberOfForwardAlignments ( )
inlinestatic
static unsigned int HcalGeometry::numberOfOuterAlignments ( )
inlinestatic
virtual unsigned int HcalGeometry::numberOfParametersPerShape ( ) const
inlinevirtual
virtual unsigned int HcalGeometry::numberOfShapes ( ) const
inlinevirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 38 of file HcalGeometry.h.

References k_NumberOfShapes.

int HcalGeometry::phiBin ( double  phi,
int  etaring 
) const
private

Definition at line 190 of file HcalGeometry.cc.

References HcalTopology::firstHFQuadPhiRing(), M_PI, HcalTopology::nPhiBins(), and theTopology.

Referenced by getCells(), and getClosestCell().

191 {
192  static const double twopi = M_PI+M_PI;
193  //put phi in correct range (0->2pi)
194  if(phi<0.0) phi += twopi;
195  if(phi>twopi) phi -= twopi;
196  int nphibins = theTopology->nPhiBins(etaring);
197  int phibin= static_cast<int>(phi/twopi*nphibins)+1;
198  int iphi;
199 
200  // rings 40 and 41 are offset wrt the other phi numbering
201  // 1 1 1 2
202  // ------------------------------
203  // 72 36 36 1
204  if(etaring >= theTopology->firstHFQuadPhiRing())
205  {
206  phi+=(twopi/36); //shift by half tower.
207  phibin=static_cast<int>(phi/twopi*nphibins);
208  if (phibin==0) phibin=18;
209  iphi=phibin*4-1; // 71,3,5,
210  } else {
211  // convert to the convention of numbering 1,3,5, in 36 phi bins
212  iphi=(phibin-1)*(72/nphibins) + 1;
213  }
214 
215  return iphi;
216 }
int nPhiBins(int etaRing) const
how many phi segments in this ring
const HcalTopology * theTopology
Definition: HcalGeometry.h:104
#define M_PI
Definition: BFit3D.cc:3
int firstHFQuadPhiRing() const
Definition: HcalTopology.h:71
Definition: DDAxes.h:10
static std::string HcalGeometry::producerTag ( )
inlinestatic

Member Data Documentation

std::vector<DetId> HcalGeometry::m_emptyIds
mutableprivate

Definition at line 110 of file HcalGeometry.h.

Referenced by fillDetIds(), and getValidDetIds().

HBCellVec HcalGeometry::m_hbCellVec
private

Definition at line 113 of file HcalGeometry.h.

Referenced by cellGeomPtr(), init(), and newCell().

std::vector<DetId> HcalGeometry::m_hbIds
mutableprivate

Definition at line 106 of file HcalGeometry.h.

Referenced by fillDetIds(), and getValidDetIds().

HECellVec HcalGeometry::m_heCellVec
private

Definition at line 114 of file HcalGeometry.h.

Referenced by cellGeomPtr(), init(), and newCell().

std::vector<DetId> HcalGeometry::m_heIds
mutableprivate

Definition at line 107 of file HcalGeometry.h.

Referenced by fillDetIds(), and getValidDetIds().

HFCellVec HcalGeometry::m_hfCellVec
private

Definition at line 116 of file HcalGeometry.h.

Referenced by cellGeomPtr(), init(), and newCell().

std::vector<DetId> HcalGeometry::m_hfIds
mutableprivate

Definition at line 109 of file HcalGeometry.h.

Referenced by fillDetIds(), and getValidDetIds().

HOCellVec HcalGeometry::m_hoCellVec
private

Definition at line 115 of file HcalGeometry.h.

Referenced by cellGeomPtr(), init(), and newCell().

std::vector<DetId> HcalGeometry::m_hoIds
mutableprivate

Definition at line 108 of file HcalGeometry.h.

Referenced by fillDetIds(), and getValidDetIds().

bool HcalGeometry::m_ownsTopology
private

Definition at line 111 of file HcalGeometry.h.

Referenced by ~HcalGeometry().

const HcalTopology* HcalGeometry::theTopology
private

Definition at line 104 of file HcalGeometry.h.

Referenced by etaRing(), getCells(), getClosestCell(), phiBin(), and ~HcalGeometry().