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_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::vector
< CaloCellGeometry const * > 
CellSet
 
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 CaloCellGeometrygetGeometry (const DetId &id) const
 Get the cell geometry of a given detector id. Should return false if not found. More...
 
virtual void getSummary (CaloSubdetectorGeometry::TrVec &trVector, CaloSubdetectorGeometry::IVec &iVector, CaloSubdetectorGeometry::DimVec &dimVector, CaloSubdetectorGeometry::IVec &dinsVector) 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 (const HcalTopology &topology)
 
void localCorners (Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
 
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 CellSet getCellSet (const GlobalPoint &r, double dR) 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 alignmentBarEndForIndexLocal (const DetId &id, unsigned int nD)
 
static unsigned int alignmentBarrelIndexLocal (const DetId &id)
 
static unsigned int alignmentEndcapIndexLocal (const DetId &id)
 
static unsigned int alignmentForwardIndexLocal (const DetId &id)
 
static unsigned int alignmentOuterIndexLocal (const DetId &id)
 
static unsigned int alignmentTransformIndexGlobal (const DetId &id)
 
static unsigned int alignmentTransformIndexLocal (const DetId &id)
 
static std::string dbString ()
 
static DetId detIdFromBarrelAlignmentIndex (unsigned int i)
 
static DetId detIdFromEndcapAlignmentIndex (unsigned int i)
 
static DetId detIdFromForwardAlignmentIndex (unsigned int i)
 
static DetId detIdFromLocalAlignmentIndex (unsigned int i)
 
static DetId detIdFromOuterAlignmentIndex (unsigned int i)
 
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 (unsigned int index) const
 
virtual unsigned int indexFor (const DetId &id) const
 
virtual unsigned int sizeForDenseIndex (const DetId &id) const
 
- Protected Member Functions inherited from CaloSubdetectorGeometry
void addValidID (const DetId &id)
 
virtual const CaloCellGeometrycellGeomPtr (uint32_t index) const =0
 

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

CaloSubdetectorGeometry::IVec m_dins
 
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
 
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
 

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
Enumerator
k_NumberOfParametersPerShape 

Definition at line 31 of file HcalGeometry.h.

Constructor & Destructor Documentation

HcalGeometry::HcalGeometry ( const HcalTopology topology)
explicit

Definition at line 15 of file HcalGeometry.cc.

References init().

15  :
16  theTopology( topology ) {
17  init();
18 }
const HcalTopology & theTopology
Definition: HcalGeometry.h:123
HcalGeometry::~HcalGeometry ( )
virtual

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

Definition at line 21 of file HcalGeometry.cc.

21 {}

Member Function Documentation

unsigned int HcalGeometry::alignmentBarEndForIndexLocal ( const DetId id,
unsigned int  nD 
)
static

Definition at line 358 of file HcalGeometry.cc.

References HcalDetId::ieta(), getHLTprescales::index, and HcalDetId::iphi().

Referenced by alignmentBarrelIndexLocal(), alignmentEndcapIndexLocal(), and alignmentForwardIndexLocal().

360 {
361  const HcalDetId hid ( id ) ;
362  const unsigned int iphi ( hid.iphi() ) ;
363  const int ieta ( hid.ieta() ) ;
364  const unsigned int index ( ( 0 < ieta ? nD/2 : 0 ) + ( iphi + 1 )%72/4 ) ;
365  assert( index < nD ) ;
366  return index ;
367 }
unsigned int HcalGeometry::alignmentBarrelIndexLocal ( const DetId id)
static

Definition at line 370 of file HcalGeometry.cc.

References alignmentBarEndForIndexLocal(), and numberOfBarrelAlignments().

Referenced by alignmentTransformIndexLocal().

371 {
373 }
static unsigned int numberOfBarrelAlignments()
Definition: HcalGeometry.h:54
static unsigned int alignmentBarEndForIndexLocal(const DetId &id, unsigned int nD)
unsigned int HcalGeometry::alignmentEndcapIndexLocal ( const DetId id)
static

Definition at line 375 of file HcalGeometry.cc.

References alignmentBarEndForIndexLocal(), and numberOfEndcapAlignments().

Referenced by alignmentTransformIndexLocal().

376 {
378 }
static unsigned int numberOfEndcapAlignments()
Definition: HcalGeometry.h:56
static unsigned int alignmentBarEndForIndexLocal(const DetId &id, unsigned int nD)
unsigned int HcalGeometry::alignmentForwardIndexLocal ( const DetId id)
static

Definition at line 381 of file HcalGeometry.cc.

References alignmentBarEndForIndexLocal(), and numberOfForwardAlignments().

Referenced by alignmentTransformIndexLocal().

382 {
384 }
static unsigned int numberOfForwardAlignments()
Definition: HcalGeometry.h:58
static unsigned int alignmentBarEndForIndexLocal(const DetId &id, unsigned int nD)
unsigned int HcalGeometry::alignmentOuterIndexLocal ( const DetId id)
static

Definition at line 387 of file HcalGeometry.cc.

References HcalDetId::ieta(), getHLTprescales::index, HcalDetId::iphi(), numberOfOuterAlignments(), and relativeConstraints::ring.

Referenced by alignmentTransformIndexLocal().

388 {
389  const HcalDetId hid ( id ) ;
390  const int ieta ( hid.ieta() ) ;
391  const int iphi ( hid.iphi() ) ;
392  const int ring ( ieta < -10 ? 0 :
393  ( ieta < -4 ? 1 :
394  ( ieta < 5 ? 2 :
395  ( ieta < 11 ? 3 : 4 ) ) ) ) ;
396 
397  const unsigned int index ( 12*ring + ( iphi - 1 )/6 ) ;
398  assert( index < numberOfOuterAlignments() ) ;
399  return index ;
400 }
static unsigned int numberOfOuterAlignments()
Definition: HcalGeometry.h:60
unsigned int HcalGeometry::alignmentTransformIndexGlobal ( const DetId id)
static

Definition at line 430 of file HcalGeometry.cc.

References DetId::Hcal.

Referenced by CaloGeometryDBEP< T, U >::produceAligned().

431 {
432  return (unsigned int)DetId::Hcal - 1 ;
433 }
unsigned int HcalGeometry::alignmentTransformIndexLocal ( const DetId id)
static

Definition at line 403 of file HcalGeometry.cc.

References alignmentBarrelIndexLocal(), alignmentEndcapIndexLocal(), alignmentForwardIndexLocal(), alignmentOuterIndexLocal(), DetId::Hcal, HcalBarrel, HcalEndcap, HcalForward, getHLTprescales::index, isHB(), isHE(), isHF(), numberOfAlignments(), numberOfBarrelAlignments(), numberOfEndcapAlignments(), numberOfForwardAlignments(), and HcalDetId::subdet().

Referenced by CaloGeometryDBEP< T, U >::produceAligned().

404 {
405  assert(id.det() == DetId::Hcal) ;
406 
407  const HcalDetId hid ( id ) ;
408  bool isHB = (hid.subdet() == HcalBarrel);
409  bool isHE = (hid.subdet() == HcalEndcap);
410  bool isHF = (hid.subdet() == HcalForward);
411  // bool isHO = (hid.subdet() == HcalOuter);
412 
413  const unsigned int nB ( numberOfBarrelAlignments() ) ;
414  const unsigned int nE ( numberOfEndcapAlignments() ) ;
415  const unsigned int nF ( numberOfForwardAlignments() ) ;
416  // const unsigned int nO ( numberOfOuterAlignments() ) ;
417 
418  const unsigned int index (
419  isHB ? alignmentBarrelIndexLocal(id) :
420  isHE ? alignmentEndcapIndexLocal(id) + nB :
421  isHF ? alignmentForwardIndexLocal( id ) + nB + nE :
422  alignmentOuterIndexLocal(id) + nB + nE + nF
423  );
424 
425  assert( index < numberOfAlignments() ) ;
426  return index ;
427 }
static unsigned int numberOfBarrelAlignments()
Definition: HcalGeometry.h:54
static unsigned int alignmentEndcapIndexLocal(const DetId &id)
bool isHE(int etabin, int depth)
static unsigned int alignmentBarrelIndexLocal(const DetId &id)
bool isHB(int etabin, int depth)
static unsigned int alignmentOuterIndexLocal(const DetId &id)
static unsigned int numberOfEndcapAlignments()
Definition: HcalGeometry.h:56
bool isHF(int etabin, int depth)
static unsigned int numberOfForwardAlignments()
Definition: HcalGeometry.h:58
static unsigned int alignmentForwardIndexLocal(const DetId &id)
static unsigned int numberOfAlignments()
Definition: HcalGeometry.h:64
const CaloCellGeometry * HcalGeometry::cellGeomPtr ( unsigned int  index) const
protectedvirtual

Definition at line 493 of file HcalGeometry.cc.

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

Referenced by getGeometry(), and getSummary().

494 {
495  const CaloCellGeometry* cell ( 0 ) ;
496  if( m_hbCellVec.size() > din )
497  {
498  cell = &m_hbCellVec[ din ] ;
499  }
500  else
501  {
502  if( m_hbCellVec.size() +
503  m_heCellVec.size() > din )
504  {
505  const unsigned int index ( din - m_hbCellVec.size() ) ;
506  cell = &m_heCellVec[ index ] ;
507  }
508  else
509  {
510  if( m_hbCellVec.size() +
511  m_heCellVec.size() +
512  m_hoCellVec.size() > din )
513  {
514  const unsigned int index ( din
515  - m_hbCellVec.size()
516  - m_heCellVec.size() ) ;
517  cell = &m_hoCellVec[ index ] ;
518  }
519  else
520  {
521  if( m_hbCellVec.size() +
522  m_heCellVec.size() +
523  m_hoCellVec.size() +
524  m_hfCellVec.size() > din )
525  {
526  const unsigned int index ( din
527  - m_hbCellVec.size()
528  - m_heCellVec.size()
529  - m_hoCellVec.size() ) ;
530  cell = &m_hfCellVec[ index ] ;
531  }
532  }
533  }
534  }
535 
536  return (( 0 == cell || 0 == cell->param()) ? 0 : cell ) ;
537 }
HBCellVec m_hbCellVec
Definition: HcalGeometry.h:132
HOCellVec m_hoCellVec
Definition: HcalGeometry.h:134
HFCellVec m_hfCellVec
Definition: HcalGeometry.h:135
HECellVec m_heCellVec
Definition: HcalGeometry.h:133
static std::string HcalGeometry::dbString ( )
inlinestatic

Definition at line 33 of file HcalGeometry.h.

Referenced by CaloGeometryDBEP< T, U >::produceAligned().

33 { return "PHcalRcd" ; }
DetId HcalGeometry::detIdFromBarrelAlignmentIndex ( unsigned int  i)
static

Definition at line 302 of file HcalGeometry.cc.

References HcalBarrel, and numberOfBarrelAlignments().

Referenced by detIdFromLocalAlignmentIndex(), FakeCaloAlignmentEP::produceHBAli(), and TestCaloAlignmentEP::produceHBAli().

303 {
304  assert( i < numberOfBarrelAlignments() ) ;
305  const int ieta ( i < numberOfBarrelAlignments()/2 ? -1 : 1 ) ;
306  const int iphi ( 1 + (4*i)%72 ) ;
307  return HcalDetId( HcalBarrel, ieta, iphi, 1 ) ;
308 }
static unsigned int numberOfBarrelAlignments()
Definition: HcalGeometry.h:54
int i
Definition: DBlmapReader.cc:9
DetId HcalGeometry::detIdFromEndcapAlignmentIndex ( unsigned int  i)
static

Definition at line 311 of file HcalGeometry.cc.

References HcalEndcap, and numberOfEndcapAlignments().

Referenced by detIdFromLocalAlignmentIndex(), FakeCaloAlignmentEP::produceHEAli(), and TestCaloAlignmentEP::produceHEAli().

312 {
313  assert( i < numberOfEndcapAlignments() ) ;
314  const int ieta ( i < numberOfEndcapAlignments()/2 ? -16 : 16 ) ;
315  const int iphi ( 1 + (4*i)%72 ) ;
316  return HcalDetId( HcalEndcap, ieta, iphi, 1 ) ;
317 }
int i
Definition: DBlmapReader.cc:9
static unsigned int numberOfEndcapAlignments()
Definition: HcalGeometry.h:56
DetId HcalGeometry::detIdFromForwardAlignmentIndex ( unsigned int  i)
static

Definition at line 320 of file HcalGeometry.cc.

References HcalForward, and numberOfForwardAlignments().

Referenced by detIdFromLocalAlignmentIndex(), FakeCaloAlignmentEP::produceHFAli(), and TestCaloAlignmentEP::produceHFAli().

321 {
322  assert( i < numberOfForwardAlignments() ) ;
323  const int ieta ( i < numberOfForwardAlignments()/2 ? -29 : 29 ) ;
324  const int iphi ( 1 + (4*i)%72 ) ;
325  return HcalDetId( HcalForward, ieta, iphi, 1 ) ;
326 }
int i
Definition: DBlmapReader.cc:9
static unsigned int numberOfForwardAlignments()
Definition: HcalGeometry.h:58
DetId HcalGeometry::detIdFromLocalAlignmentIndex ( unsigned int  i)
static

Definition at line 342 of file HcalGeometry.cc.

References detIdFromBarrelAlignmentIndex(), detIdFromEndcapAlignmentIndex(), detIdFromForwardAlignmentIndex(), detIdFromOuterAlignmentIndex(), numberOfAlignments(), numberOfBarrelAlignments(), numberOfEndcapAlignments(), and numberOfForwardAlignments().

343 {
344  assert( i < numberOfAlignments() ) ;
345 
346  const unsigned int nB ( numberOfBarrelAlignments() ) ;
347  const unsigned int nE ( numberOfEndcapAlignments() ) ;
348  const unsigned int nF ( numberOfForwardAlignments() ) ;
349 // const unsigned int nO ( numberOfOuterAlignments() ) ;
350 
351  return ( i < nB ? detIdFromBarrelAlignmentIndex( i ) :
352  i < nB+nE ? detIdFromEndcapAlignmentIndex( i - nB ) :
353  i < nB+nE+nF ? detIdFromForwardAlignmentIndex( i - nB - nE ) :
354  detIdFromOuterAlignmentIndex( i - nB - nE - nF ) ) ;
355 }
static unsigned int numberOfBarrelAlignments()
Definition: HcalGeometry.h:54
int i
Definition: DBlmapReader.cc:9
static DetId detIdFromOuterAlignmentIndex(unsigned int i)
static DetId detIdFromForwardAlignmentIndex(unsigned int i)
static DetId detIdFromBarrelAlignmentIndex(unsigned int i)
static unsigned int numberOfEndcapAlignments()
Definition: HcalGeometry.h:56
static unsigned int numberOfForwardAlignments()
Definition: HcalGeometry.h:58
static DetId detIdFromEndcapAlignmentIndex(unsigned int i)
static unsigned int numberOfAlignments()
Definition: HcalGeometry.h:64
DetId HcalGeometry::detIdFromOuterAlignmentIndex ( unsigned int  i)
static

Definition at line 329 of file HcalGeometry.cc.

References HcalOuter, numberOfOuterAlignments(), and relativeConstraints::ring.

Referenced by detIdFromLocalAlignmentIndex(), FakeCaloAlignmentEP::produceHOAli(), and TestCaloAlignmentEP::produceHOAli().

330 {
331  assert( i < numberOfOuterAlignments() ) ;
332  const int ring ( i/12 ) ;
333  const int ieta ( 0 == ring ? -11 :
334  1 == ring ? -5 :
335  2 == ring ? 1 :
336  3 == ring ? 5 : 11 ) ;
337  const int iphi ( 1 + ( i - ring*12 )*6 ) ;
338  return HcalDetId( HcalOuter, ieta, iphi, 4 ) ;
339 }
int i
Definition: DBlmapReader.cc:9
static unsigned int numberOfOuterAlignments()
Definition: HcalGeometry.h:60
int HcalGeometry::etaRing ( HcalSubdetector  bc,
double  abseta 
) const
private

helper methods for getClosestCell

Definition at line 170 of file HcalGeometry.cc.

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

Referenced by getCells(), and getClosestCell().

171 {
172  int etaring;
173  if( bc == HcalForward ) {
174  for(etaring = theTopology.firstHFRing();
175  etaring <= theTopology.lastHFRing(); ++etaring)
176  {
177  if(theHFEtaBounds[etaring-theTopology.firstHFRing()+1] > abseta) break;
178  }
179  }
180  else
181  {
182  for(etaring = 1;
183  etaring <= theTopology.lastHERing(); ++etaring)
184  {
185  if(theHBHEEtaBounds[etaring] >= abseta) break;
186  }
187  }
188 
189  return etaring;
190 }
int firstHFRing() const
Definition: HcalTopology.h:81
const HcalTopology & theTopology
Definition: HcalGeometry.h:123
int lastHFRing() const
Definition: HcalTopology.h:82
static const double theHFEtaBounds[]
static const double theHBHEEtaBounds[]
int lastHERing() const
Definition: HcalTopology.h:80
void HcalGeometry::fillDetIds ( ) const
private

Definition at line 38 of file HcalGeometry.cc.

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

Referenced by getValidDetIds().

39 {
40  const std::vector<DetId>& baseIds ( CaloSubdetectorGeometry::getValidDetIds() ) ;
41  for( unsigned int i ( 0 ) ; i != baseIds.size() ; ++i )
42  {
43  const DetId id ( baseIds[i] );
44  if( id.subdetId() == HcalBarrel )
45  {
46  m_hbIds.push_back( id ) ;
47  }
48  else
49  {
50  if( id.subdetId() == HcalEndcap )
51  {
52  m_heIds.push_back( id ) ;
53  }
54  else
55  {
56  if( id.subdetId() == HcalOuter )
57  {
58  m_hoIds.push_back( id ) ;
59  }
60  else
61  {
62  if( id.subdetId() == HcalForward )
63  {
64  m_hfIds.push_back( id ) ;
65  }
66  }
67  }
68  }
69  }
70  std::sort( m_hbIds.begin(), m_hbIds.end() ) ;
71  std::sort( m_heIds.begin(), m_heIds.end() ) ;
72  std::sort( m_hoIds.begin(), m_hoIds.end() ) ;
73  std::sort( m_hfIds.begin(), m_hfIds.end() ) ;
74 
75  m_emptyIds.resize( 0 ) ;
76 }
std::vector< DetId > m_heIds
Definition: HcalGeometry.h:126
int i
Definition: DBlmapReader.cc:9
std::vector< DetId > m_emptyIds
Definition: HcalGeometry.h:129
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:125
std::vector< DetId > m_hoIds
Definition: HcalGeometry.h:127
std::vector< DetId > m_hfIds
Definition: HcalGeometry.h:128
Definition: DetId.h:18
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 222 of file HcalGeometry.cc.

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

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

References funct::abs(), PV3DBase< T, PVType, FrameType >::eta(), etaRing(), 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().

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

Get the cell geometry of a given detector id. Should return false if not found.

Reimplemented from CaloSubdetectorGeometry.

Definition at line 97 of file HcalGeometry.h.

References cellGeomPtr(), HcalTopology::detId2denseId(), and theTopology.

Referenced by getCells(), and getClosestCell().

97  {
98  return cellGeomPtr( theTopology.detId2denseId( id ) ) ;
99  }
virtual unsigned int detId2denseId(const DetId &id) const
return a linear packed id
const HcalTopology & theTopology
Definition: HcalGeometry.h:123
virtual const CaloCellGeometry * cellGeomPtr(unsigned int index) const
void HcalGeometry::getSummary ( CaloSubdetectorGeometry::TrVec trVector,
CaloSubdetectorGeometry::IVec iVector,
CaloSubdetectorGeometry::DimVec dimVector,
CaloSubdetectorGeometry::IVec dinsVector 
) const
virtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 540 of file HcalGeometry.cc.

References begin, EZArrayFL< T >::begin(), cellGeomPtr(), EZArrayFL< T >::end(), CaloCellGeometry::getPosition(), CaloCellGeometry::getTransform(), i, gen::k, m_dins, HcalTopology::ncells(), numberOfParametersPerShape(), numberOfShapes(), CaloSubdetectorGeometry::numberOfTransformParms(), convertSQLiteXML::ok, CaloCellGeometry::param(), CaloSubdetectorGeometry::parVecVec(), findQualityFiles::rr, theTopology, and groupFilesInBlocks::tt.

544 {
545  tVec.reserve( m_dins.size()*numberOfTransformParms() ) ;
546  iVec.reserve( numberOfShapes()==1 ? 1 : m_dins.size() ) ;
547  dVec.reserve( numberOfShapes()*numberOfParametersPerShape() ) ;
548  dinsVec.reserve( m_dins.size() );
549 
550  for( ParVecVec::const_iterator ivv ( parVecVec().begin() ) ; ivv != parVecVec().end() ; ++ivv )
551  {
552  const ParVec& pv ( *ivv ) ;
553  for( ParVec::const_iterator iv ( pv.begin() ) ; iv != pv.end() ; ++iv )
554  {
555  dVec.push_back( *iv ) ;
556  }
557  }
558 
559  for( unsigned int i ( 0 ) ; i < theTopology.ncells() ; ++i )
560  {
561  Tr3D tr ;
562  const CaloCellGeometry* ptr ( cellGeomPtr( i ) ) ;
563 
564  if( 0 != ptr )
565  {
566  dinsVec.push_back( i );
567 
568  ptr->getTransform( tr, ( Pt3DVec* ) 0 ) ;
569 
570  if( Tr3D() == tr ) // for preshower there is no rotation
571  {
572  const GlobalPoint& gp ( ptr->getPosition() ) ;
573  tr = HepGeom::Translate3D( gp.x(), gp.y(), gp.z() ) ;
574  }
575 
576  const CLHEP::Hep3Vector tt ( tr.getTranslation() ) ;
577  tVec.push_back( tt.x() ) ;
578  tVec.push_back( tt.y() ) ;
579  tVec.push_back( tt.z() ) ;
580  if( 6 == numberOfTransformParms() )
581  {
582  const CLHEP::HepRotation rr ( tr.getRotation() ) ;
583  const ROOT::Math::Transform3D rtr ( rr.xx(), rr.xy(), rr.xz(), tt.x(),
584  rr.yx(), rr.yy(), rr.yz(), tt.y(),
585  rr.zx(), rr.zy(), rr.zz(), tt.z() ) ;
587  rtr.GetRotation( ea ) ;
588  tVec.push_back( ea.Phi() ) ;
589  tVec.push_back( ea.Theta() ) ;
590  tVec.push_back( ea.Psi() ) ;
591  }
592 
593  const CCGFloat* par ( ptr->param() ) ;
594 
595  unsigned int ishape ( 9999 ) ;
596  for( unsigned int ivv ( 0 ) ; ivv != parVecVec().size() ; ++ivv )
597  {
598  bool ok ( true ) ;
599  const CCGFloat* pv ( &(*parVecVec()[ivv].begin() ) ) ;
600  for( unsigned int k ( 0 ) ; k != numberOfParametersPerShape() ; ++k )
601  {
602  ok = ok && ( fabs( par[k] - pv[k] ) < 1.e-6 ) ;
603  }
604  if( ok )
605  {
606  ishape = ivv ;
607  break ;
608  }
609  }
610  assert( 9999 != ishape ) ;
611 
612 
613  const unsigned int nn (( numberOfShapes()==1) ? (unsigned int)1 : m_dins.size() ) ;
614  if( iVec.size() < nn ) iVec.push_back( ishape ) ;
615  }
616  }
617 }
int i
Definition: DBlmapReader.cc:9
virtual unsigned int numberOfParametersPerShape() const
Definition: HcalGeometry.h:36
const HcalTopology & theTopology
Definition: HcalGeometry.h:123
CaloCellGeometry::CCGFloat CCGFloat
CaloSubdetectorGeometry::IVec m_dins
Definition: HcalGeometry.h:130
CaloCellGeometry::ParVec ParVec
int k[5][pyjets_maxn]
AlgebraicVector EulerAngles
Definition: Definitions.h:36
CaloCellGeometry::Pt3DVec Pt3DVec
virtual const CaloCellGeometry * cellGeomPtr(unsigned int index) const
CaloCellGeometry::Tr3D Tr3D
MgrType::const_iterator const_iterator
Definition: EZArrayFL.h:27
virtual unsigned int numberOfShapes() const
Definition: HcalGeometry.h:35
#define begin
Definition: vmac.h:30
virtual unsigned int numberOfTransformParms() const
virtual unsigned int ncells() const
return a count of valid cells (for dense indexing use)
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 79 of file HcalGeometry.cc.

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

81 {
82  if( 0 != subdet &&
83  0 == m_hbIds.size() ) fillDetIds() ;
84  return ( 0 == subdet ? CaloSubdetectorGeometry::getValidDetIds() :
85  ( HcalBarrel == subdet ? m_hbIds :
86  ( HcalEndcap == subdet ? m_heIds :
87  ( HcalOuter == subdet ? m_hoIds :
88  ( HcalForward == subdet ? m_hfIds : m_emptyIds ) ) ) ) ) ;
89 }
std::vector< DetId > m_heIds
Definition: HcalGeometry.h:126
std::vector< DetId > m_emptyIds
Definition: HcalGeometry.h:129
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:125
std::vector< DetId > m_hoIds
Definition: HcalGeometry.h:127
std::vector< DetId > m_hfIds
Definition: HcalGeometry.h:128
void fillDetIds() const
Definition: HcalGeometry.cc:38
virtual unsigned int HcalGeometry::indexFor ( const DetId id) const
inlineprotectedvirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 109 of file HcalGeometry.h.

References HcalTopology::detId2denseId(), and theTopology.

109 { return theTopology.detId2denseId(id); }
virtual unsigned int detId2denseId(const DetId &id) const
return a linear packed id
const HcalTopology & theTopology
Definition: HcalGeometry.h:123
void HcalGeometry::init ( void  )
private

Definition at line 24 of file HcalGeometry.cc.

References HcalTopology::getHBSize(), HcalTopology::getHESize(), HcalTopology::getHFSize(), HcalTopology::getHOSize(), m_hbCellVec, m_heCellVec, m_hfCellVec, m_hoCellVec, and theTopology.

Referenced by HcalGeometry().

24  {
25  edm::LogInfo("HcalGeometry") << "HcalGeometry::init() "
26  << " HBSize " << theTopology.getHBSize()
27  << " HESize " << theTopology.getHESize()
28  << " HOSize " << theTopology.getHOSize()
29  << " HFSize " << theTopology.getHFSize();
30 
35 }
unsigned int getHFSize() const
Definition: HcalTopology.h:112
unsigned int getHOSize() const
Definition: HcalTopology.h:111
std::vector< IdealObliquePrism > HECellVec
Definition: HcalGeometry.h:17
const HcalTopology & theTopology
Definition: HcalGeometry.h:123
HBCellVec m_hbCellVec
Definition: HcalGeometry.h:132
HOCellVec m_hoCellVec
Definition: HcalGeometry.h:134
HFCellVec m_hfCellVec
Definition: HcalGeometry.h:135
std::vector< IdealObliquePrism > HOCellVec
Definition: HcalGeometry.h:18
std::vector< IdealZPrism > HFCellVec
Definition: HcalGeometry.h:19
std::vector< IdealObliquePrism > HBCellVec
Definition: HcalGeometry.h:16
unsigned int getHESize() const
Definition: HcalTopology.h:110
HECellVec m_heCellVec
Definition: HcalGeometry.h:133
unsigned int getHBSize() const
Definition: HcalTopology.h:109
void HcalGeometry::localCorners ( Pt3DVec lc,
const CCGFloat pv,
unsigned int  i,
Pt3D ref 
)

Definition at line 436 of file HcalGeometry.cc.

References HcalTopology::denseId2detId(), HcalForward, IdealZPrism::localCorners(), IdealObliquePrism::localCorners(), HcalDetId::subdet(), and theTopology.

440 {
442 
443  if( hid.subdet() == HcalForward )
444  {
445  IdealZPrism::localCorners( lc, pv, ref ) ;
446  }
447  else
448  {
449  IdealObliquePrism::localCorners( lc, pv, ref ) ;
450  }
451 }
int i
Definition: DBlmapReader.cc:9
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:30
const HcalTopology & theTopology
Definition: HcalGeometry.h:123
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
virtual DetId denseId2detId(unsigned int) const
return a linear packed id
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 454 of file HcalGeometry.cc.

References CaloSubdetectorGeometry::addValidID(), CaloSubdetectorGeometry::cornersMgr(), DetId::det(), HcalTopology::detId2denseId(), cropTnPTrees::din, DetId::Hcal, HcalBarrel, HcalEndcap, HcalOuter, getHLTprescales::index, m_dins, m_hbCellVec, m_heCellVec, m_hfCellVec, m_hoCellVec, DetId::rawId(), DetId::subdetId(), and theTopology.

458  {
459 
460  assert (detId.det()==DetId::Hcal);
461 
462  const HcalDetId hid ( detId ) ;
463  unsigned int din=theTopology.detId2denseId(detId);
464 
465  edm::LogInfo("HcalGeometry") << " newCell subdet "
466  << detId.subdetId() << ", raw ID "
467  << detId.rawId() << ", hid " << hid << ", din "
468  << din << ", index ";
469 
470  if( hid.subdet()==HcalBarrel) {
471  m_hbCellVec[ din ] = IdealObliquePrism( f1, cornersMgr(), parm ) ;
472  } else if( hid.subdet()==HcalEndcap ) {
473  const unsigned int index ( din - m_hbCellVec.size() ) ;
474  m_heCellVec[ index ] = IdealObliquePrism( f1, cornersMgr(), parm ) ;
475  } else if( hid.subdet()==HcalOuter ) {
476  const unsigned int index ( din
477  - m_hbCellVec.size()
478  - m_heCellVec.size() ) ;
479  m_hoCellVec[ index ] = IdealObliquePrism( f1, cornersMgr(), parm ) ;
480  } else {
481  const unsigned int index ( din
482  - m_hbCellVec.size()
483  - m_heCellVec.size()
484  - m_hoCellVec.size() ) ;
485  m_hfCellVec[ index ] = IdealZPrism( f1, cornersMgr(), parm ) ;
486  }
487 
488  addValidID( detId ) ;
489  m_dins.push_back( din );
490 }
virtual unsigned int detId2denseId(const DetId &id) const
return a linear packed id
const HcalTopology & theTopology
Definition: HcalGeometry.h:123
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
HBCellVec m_hbCellVec
Definition: HcalGeometry.h:132
HOCellVec m_hoCellVec
Definition: HcalGeometry.h:134
HFCellVec m_hfCellVec
Definition: HcalGeometry.h:135
CaloSubdetectorGeometry::IVec m_dins
Definition: HcalGeometry.h:130
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
void addValidID(const DetId &id)
CaloCellGeometry::CornersMgr * cornersMgr()
HECellVec m_heCellVec
Definition: HcalGeometry.h:133
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
static unsigned int HcalGeometry::numberOfAlignments ( )
inlinestatic
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

Reimplemented from CaloSubdetectorGeometry.

Definition at line 36 of file HcalGeometry.h.

References k_NumberOfParametersPerShape.

Referenced by getSummary().

virtual unsigned int HcalGeometry::numberOfShapes ( ) const
inlinevirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 35 of file HcalGeometry.h.

References HcalTopology::getNumberOfShapes(), and theTopology.

Referenced by getSummary().

35 { return theTopology.getNumberOfShapes() ; }
const HcalTopology & theTopology
Definition: HcalGeometry.h:123
unsigned int getNumberOfShapes() const
Definition: HcalTopology.h:132
int HcalGeometry::phiBin ( double  phi,
int  etaring 
) const
private

Definition at line 193 of file HcalGeometry.cc.

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

Referenced by getCells(), and getClosestCell().

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

Reimplemented from CaloSubdetectorGeometry.

Definition at line 110 of file HcalGeometry.h.

References HcalTopology::ncells(), and theTopology.

110 { return theTopology.ncells(); }
const HcalTopology & theTopology
Definition: HcalGeometry.h:123
virtual unsigned int ncells() const
return a count of valid cells (for dense indexing use)

Member Data Documentation

CaloSubdetectorGeometry::IVec HcalGeometry::m_dins
mutableprivate

Definition at line 130 of file HcalGeometry.h.

Referenced by getSummary(), and newCell().

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

Definition at line 129 of file HcalGeometry.h.

Referenced by fillDetIds(), and getValidDetIds().

HBCellVec HcalGeometry::m_hbCellVec
private

Definition at line 132 of file HcalGeometry.h.

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

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

Definition at line 125 of file HcalGeometry.h.

Referenced by fillDetIds(), and getValidDetIds().

HECellVec HcalGeometry::m_heCellVec
private

Definition at line 133 of file HcalGeometry.h.

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

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

Definition at line 126 of file HcalGeometry.h.

Referenced by fillDetIds(), and getValidDetIds().

HFCellVec HcalGeometry::m_hfCellVec
private

Definition at line 135 of file HcalGeometry.h.

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

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

Definition at line 128 of file HcalGeometry.h.

Referenced by fillDetIds(), and getValidDetIds().

HOCellVec HcalGeometry::m_hoCellVec
private

Definition at line 134 of file HcalGeometry.h.

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

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

Definition at line 127 of file HcalGeometry.h.

Referenced by fillDetIds(), and getValidDetIds().

const HcalTopology& HcalGeometry::theTopology
private