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
 
edm::AtomicPtrCache
< std::vector< DetId > > 
m_emptyIds
 
HBCellVec m_hbCellVec
 
edm::AtomicPtrCache
< std::vector< DetId > > 
m_hbIds
 
HECellVec m_heCellVec
 
edm::AtomicPtrCache
< std::vector< DetId > > 
m_heIds
 
HFCellVec m_hfCellVec
 
edm::AtomicPtrCache
< std::vector< DetId > > 
m_hfIds
 
HOCellVec m_hoCellVec
 
edm::AtomicPtrCache
< std::vector< DetId > > 
m_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 14 of file HcalGeometry.h.

Member Typedef Documentation

Definition at line 28 of file HcalGeometry.h.

Definition at line 27 of file HcalGeometry.h.

Definition at line 23 of file HcalGeometry.h.

Definition at line 30 of file HcalGeometry.h.

Definition at line 18 of file HcalGeometry.h.

Definition at line 19 of file HcalGeometry.h.

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

Definition at line 21 of file HcalGeometry.h.

Definition at line 20 of file HcalGeometry.h.

Definition at line 29 of file HcalGeometry.h.

Definition at line 24 of file HcalGeometry.h.

Definition at line 25 of file HcalGeometry.h.

Member Enumeration Documentation

anonymous enum
Enumerator
k_NumberOfParametersPerShape 

Definition at line 33 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:125
HcalGeometry::~HcalGeometry ( )
virtual

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

Definition at line 20 of file HcalGeometry.cc.

20 {}

Member Function Documentation

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

Definition at line 368 of file HcalGeometry.cc.

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

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

370 {
371  const HcalDetId hid ( id ) ;
372  const unsigned int iphi ( hid.iphi() ) ;
373  const int ieta ( hid.ieta() ) ;
374  const unsigned int index ( ( 0 < ieta ? nD/2 : 0 ) + ( iphi + 1 )%72/4 ) ;
375  assert( index < nD ) ;
376  return index ;
377 }
unsigned int HcalGeometry::alignmentBarrelIndexLocal ( const DetId id)
static

Definition at line 380 of file HcalGeometry.cc.

References alignmentBarEndForIndexLocal(), and numberOfBarrelAlignments().

Referenced by alignmentTransformIndexLocal().

381 {
383 }
static unsigned int numberOfBarrelAlignments()
Definition: HcalGeometry.h:56
static unsigned int alignmentBarEndForIndexLocal(const DetId &id, unsigned int nD)
unsigned int HcalGeometry::alignmentEndcapIndexLocal ( const DetId id)
static

Definition at line 385 of file HcalGeometry.cc.

References alignmentBarEndForIndexLocal(), and numberOfEndcapAlignments().

Referenced by alignmentTransformIndexLocal().

386 {
388 }
static unsigned int numberOfEndcapAlignments()
Definition: HcalGeometry.h:58
static unsigned int alignmentBarEndForIndexLocal(const DetId &id, unsigned int nD)
unsigned int HcalGeometry::alignmentForwardIndexLocal ( const DetId id)
static

Definition at line 391 of file HcalGeometry.cc.

References alignmentBarEndForIndexLocal(), and numberOfForwardAlignments().

Referenced by alignmentTransformIndexLocal().

392 {
394 }
static unsigned int numberOfForwardAlignments()
Definition: HcalGeometry.h:60
static unsigned int alignmentBarEndForIndexLocal(const DetId &id, unsigned int nD)
unsigned int HcalGeometry::alignmentOuterIndexLocal ( const DetId id)
static

Definition at line 397 of file HcalGeometry.cc.

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

Referenced by alignmentTransformIndexLocal().

398 {
399  const HcalDetId hid ( id ) ;
400  const int ieta ( hid.ieta() ) ;
401  const int iphi ( hid.iphi() ) ;
402  const int ring ( ieta < -10 ? 0 :
403  ( ieta < -4 ? 1 :
404  ( ieta < 5 ? 2 :
405  ( ieta < 11 ? 3 : 4 ) ) ) ) ;
406 
407  const unsigned int index ( 12*ring + ( iphi - 1 )/6 ) ;
408  assert( index < numberOfOuterAlignments() ) ;
409  return index ;
410 }
static unsigned int numberOfOuterAlignments()
Definition: HcalGeometry.h:62
unsigned int HcalGeometry::alignmentTransformIndexGlobal ( const DetId id)
static

Definition at line 440 of file HcalGeometry.cc.

References DetId::Hcal.

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

441 {
442  return (unsigned int)DetId::Hcal - 1 ;
443 }
unsigned int HcalGeometry::alignmentTransformIndexLocal ( const DetId id)
static

Definition at line 413 of file HcalGeometry.cc.

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

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

414 {
415  assert(id.det() == DetId::Hcal) ;
416 
417  const HcalDetId hid ( id ) ;
418  bool isHB = (hid.subdet() == HcalBarrel);
419  bool isHE = (hid.subdet() == HcalEndcap);
420  bool isHF = (hid.subdet() == HcalForward);
421  // bool isHO = (hid.subdet() == HcalOuter);
422 
423  const unsigned int nB ( numberOfBarrelAlignments() ) ;
424  const unsigned int nE ( numberOfEndcapAlignments() ) ;
425  const unsigned int nF ( numberOfForwardAlignments() ) ;
426  // const unsigned int nO ( numberOfOuterAlignments() ) ;
427 
428  const unsigned int index (
429  isHB ? alignmentBarrelIndexLocal(id) :
430  isHE ? alignmentEndcapIndexLocal(id) + nB :
431  isHF ? alignmentForwardIndexLocal( id ) + nB + nE :
432  alignmentOuterIndexLocal(id) + nB + nE + nF
433  );
434 
435  assert( index < numberOfAlignments() ) ;
436  return index ;
437 }
static unsigned int numberOfBarrelAlignments()
Definition: HcalGeometry.h:56
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:58
bool isHF(int etabin, int depth)
static unsigned int numberOfForwardAlignments()
Definition: HcalGeometry.h:60
static unsigned int alignmentForwardIndexLocal(const DetId &id)
static unsigned int numberOfAlignments()
Definition: HcalGeometry.h:66
const CaloCellGeometry * HcalGeometry::cellGeomPtr ( unsigned int  index) const
protectedvirtual

Definition at line 503 of file HcalGeometry.cc.

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

Referenced by getGeometry(), and getSummary().

504 {
505  const CaloCellGeometry* cell ( 0 ) ;
506  if( m_hbCellVec.size() > din )
507  {
508  cell = &m_hbCellVec[ din ] ;
509  }
510  else
511  {
512  if( m_hbCellVec.size() +
513  m_heCellVec.size() > din )
514  {
515  const unsigned int index ( din - m_hbCellVec.size() ) ;
516  cell = &m_heCellVec[ index ] ;
517  }
518  else
519  {
520  if( m_hbCellVec.size() +
521  m_heCellVec.size() +
522  m_hoCellVec.size() > din )
523  {
524  const unsigned int index ( din
525  - m_hbCellVec.size()
526  - m_heCellVec.size() ) ;
527  cell = &m_hoCellVec[ index ] ;
528  }
529  else
530  {
531  if( m_hbCellVec.size() +
532  m_heCellVec.size() +
533  m_hoCellVec.size() +
534  m_hfCellVec.size() > din )
535  {
536  const unsigned int index ( din
537  - m_hbCellVec.size()
538  - m_heCellVec.size()
539  - m_hoCellVec.size() ) ;
540  cell = &m_hfCellVec[ index ] ;
541  }
542  }
543  }
544  }
545 
546  return (( 0 == cell || 0 == cell->param()) ? 0 : cell ) ;
547 }
HBCellVec m_hbCellVec
Definition: HcalGeometry.h:134
HOCellVec m_hoCellVec
Definition: HcalGeometry.h:136
HFCellVec m_hfCellVec
Definition: HcalGeometry.h:137
HECellVec m_heCellVec
Definition: HcalGeometry.h:135
static std::string HcalGeometry::dbString ( )
inlinestatic

Definition at line 35 of file HcalGeometry.h.

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

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

Definition at line 312 of file HcalGeometry.cc.

References HcalBarrel, and numberOfBarrelAlignments().

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

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

Definition at line 321 of file HcalGeometry.cc.

References HcalEndcap, and numberOfEndcapAlignments().

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

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

Definition at line 330 of file HcalGeometry.cc.

References HcalForward, and numberOfForwardAlignments().

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

331 {
332  assert( i < numberOfForwardAlignments() ) ;
333  const int ieta ( i < numberOfForwardAlignments()/2 ? -29 : 29 ) ;
334  const int iphi ( 1 + (4*i)%72 ) ;
335  return HcalDetId( HcalForward, ieta, iphi, 1 ) ;
336 }
int i
Definition: DBlmapReader.cc:9
static unsigned int numberOfForwardAlignments()
Definition: HcalGeometry.h:60
DetId HcalGeometry::detIdFromLocalAlignmentIndex ( unsigned int  i)
static

Definition at line 352 of file HcalGeometry.cc.

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

353 {
354  assert( i < numberOfAlignments() ) ;
355 
356  const unsigned int nB ( numberOfBarrelAlignments() ) ;
357  const unsigned int nE ( numberOfEndcapAlignments() ) ;
358  const unsigned int nF ( numberOfForwardAlignments() ) ;
359 // const unsigned int nO ( numberOfOuterAlignments() ) ;
360 
361  return ( i < nB ? detIdFromBarrelAlignmentIndex( i ) :
362  i < nB+nE ? detIdFromEndcapAlignmentIndex( i - nB ) :
363  i < nB+nE+nF ? detIdFromForwardAlignmentIndex( i - nB - nE ) :
364  detIdFromOuterAlignmentIndex( i - nB - nE - nF ) ) ;
365 }
static unsigned int numberOfBarrelAlignments()
Definition: HcalGeometry.h:56
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:58
static unsigned int numberOfForwardAlignments()
Definition: HcalGeometry.h:60
static DetId detIdFromEndcapAlignmentIndex(unsigned int i)
static unsigned int numberOfAlignments()
Definition: HcalGeometry.h:66
DetId HcalGeometry::detIdFromOuterAlignmentIndex ( unsigned int  i)
static

Definition at line 339 of file HcalGeometry.cc.

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

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

340 {
341  assert( i < numberOfOuterAlignments() ) ;
342  const int ring ( i/12 ) ;
343  const int ieta ( 0 == ring ? -11 :
344  1 == ring ? -5 :
345  2 == ring ? 1 :
346  3 == ring ? 5 : 11 ) ;
347  const int iphi ( 1 + ( i - ring*12 )*6 ) ;
348  return HcalDetId( HcalOuter, ieta, iphi, 4 ) ;
349 }
int i
Definition: DBlmapReader.cc:9
static unsigned int numberOfOuterAlignments()
Definition: HcalGeometry.h:62
int HcalGeometry::etaRing ( HcalSubdetector  bc,
double  abseta 
) const
private

helper methods for getClosestCell

Definition at line 180 of file HcalGeometry.cc.

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

Referenced by getCells(), and getClosestCell().

181 {
182  int etaring;
183  if( bc == HcalForward ) {
184  for(etaring = theTopology.firstHFRing();
185  etaring <= theTopology.lastHFRing(); ++etaring)
186  {
187  if(theHFEtaBounds[etaring-theTopology.firstHFRing()+1] > abseta) break;
188  }
189  }
190  else
191  {
192  for(etaring = 1;
193  etaring <= theTopology.lastHERing(); ++etaring)
194  {
195  if(theHBHEEtaBounds[etaring] >= abseta) break;
196  }
197  }
198 
199  return etaring;
200 }
int firstHFRing() const
Definition: HcalTopology.h:83
const HcalTopology & theTopology
Definition: HcalGeometry.h:125
int lastHFRing() const
Definition: HcalTopology.h:84
static const double theHFEtaBounds[]
static const double theHBHEEtaBounds[]
int lastHERing() const
Definition: HcalTopology.h:82
void HcalGeometry::fillDetIds ( ) const
private

Definition at line 36 of file HcalGeometry.cc.

References CaloSubdetectorGeometry::getValidDetIds(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, i, edm::AtomicPtrCache< T >::isSet(), m_emptyIds, m_hbIds, m_heIds, m_hfIds, m_hoIds, edm::AtomicPtrCache< T >::set(), and python.multivaluedict::sort().

Referenced by getValidDetIds().

37 {
38  if(!m_emptyIds.isSet()) {
39  std::unique_ptr<std::vector<DetId>> p_hbIds{new std::vector<DetId>};
40  std::unique_ptr<std::vector<DetId>> p_heIds{new std::vector<DetId>};
41  std::unique_ptr<std::vector<DetId>> p_hoIds{new std::vector<DetId>};
42  std::unique_ptr<std::vector<DetId>> p_hfIds{new std::vector<DetId>};
43  std::unique_ptr<std::vector<DetId>> p_emptyIds{new std::vector<DetId>};
44 
45  const std::vector<DetId>& baseIds ( CaloSubdetectorGeometry::getValidDetIds() ) ;
46  for( unsigned int i ( 0 ) ; i != baseIds.size() ; ++i )
47  {
48  const DetId id ( baseIds[i] );
49  if( id.subdetId() == HcalBarrel )
50  {
51  p_hbIds->push_back( id ) ;
52  }
53  else
54  {
55  if( id.subdetId() == HcalEndcap )
56  {
57  p_heIds->push_back( id ) ;
58  }
59  else
60  {
61  if( id.subdetId() == HcalOuter )
62  {
63  p_hoIds->push_back( id ) ;
64  }
65  else
66  {
67  if( id.subdetId() == HcalForward )
68  {
69  p_hfIds->push_back( id ) ;
70  }
71  }
72  }
73  }
74  }
75  std::sort( p_hbIds->begin(), p_hbIds->end() ) ;
76  std::sort( p_heIds->begin(), p_heIds->end() ) ;
77  std::sort( p_hoIds->begin(), p_hoIds->end() ) ;
78  std::sort( p_hfIds->begin(), p_hfIds->end() ) ;
79  p_emptyIds->resize( 0 ) ;
80 
81  m_hbIds.set(std::move(p_hbIds));
82  m_heIds.set(std::move(p_heIds));
83  m_hoIds.set(std::move(p_hoIds));
84  m_hfIds.set(std::move(p_hfIds));
85  m_emptyIds.set(std::move(p_emptyIds));
86  }
87 }
int i
Definition: DBlmapReader.cc:9
edm::AtomicPtrCache< std::vector< DetId > > m_heIds
Definition: HcalGeometry.h:128
edm::AtomicPtrCache< std::vector< DetId > > m_emptyIds
Definition: HcalGeometry.h:131
bool isSet() 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)
Definition: DetId.h:18
bool set(std::unique_ptr< T > iNewValue) const
edm::AtomicPtrCache< std::vector< DetId > > m_hfIds
Definition: HcalGeometry.h:130
edm::AtomicPtrCache< std::vector< DetId > > m_hoIds
Definition: HcalGeometry.h:129
edm::AtomicPtrCache< std::vector< DetId > > m_hbIds
Definition: HcalGeometry.h:127
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 232 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().

234 {
235  CaloSubdetectorGeometry::DetIdSet dis; // this is the return object
236 
237  if( 0.000001 < dR )
238  {
239  if( dR > M_PI/2. ) // this version needs "small" dR
240  {
241  dis = CaloSubdetectorGeometry::getCells( r, dR ) ; // base class version
242  }
243  else
244  {
245  const double dR2 ( dR*dR ) ;
246  const double reta ( r.eta() ) ;
247  const double rphi ( r.phi() ) ;
248  const double lowEta ( reta - dR ) ;
249  const double highEta ( reta + dR ) ;
250  const double lowPhi ( rphi - dR ) ;
251  const double highPhi ( rphi + dR ) ;
252 
253  const double hfEtaHi ( theHFEtaBounds[ theTopology.lastHFRing() -
254  theTopology.firstHFRing() + 1 ] ) ;
255 
256  if( highEta > -hfEtaHi &&
257  lowEta < hfEtaHi ) // in hcal
258  {
260 
261  for( unsigned int is ( 0 ) ; is != 4 ; ++is )
262  {
263  const int sign ( reta>0 ? 1 : -1 ) ;
264  const int ieta_center ( sign*etaRing( hs[is], fabs( reta ) ) ) ;
265  const int ieta_lo ( ( 0 < lowEta*sign ? sign : -sign )*etaRing( hs[is], fabs( lowEta ) ) ) ;
266  const int ieta_hi ( ( 0 < highEta*sign ? sign : -sign )*etaRing( hs[is], fabs( highEta ) ) ) ;
267  const int iphi_lo ( phiBin( lowPhi , ieta_center ) ) ;
268  const int iphi_hi ( phiBin( highPhi, ieta_center ) ) ;
269  const int jphi_lo ( iphi_lo>iphi_hi ? iphi_lo - 72 : iphi_lo ) ;
270  const int jphi_hi ( iphi_hi ) ;
271 
272  const int idep_lo ( 1 == is ? 4 : 1 ) ;
273  const int idep_hi ( 1 == is ? 4 :
274  ( 2 == is ? 3 : 2 ) ) ;
275  for( int ieta ( ieta_lo ) ; ieta <= ieta_hi ; ++ieta ) // over eta limits
276  {
277  if( ieta != 0 )
278  {
279  for( int jphi ( jphi_lo ) ; jphi <= jphi_hi ; ++jphi ) // over phi limits
280  {
281  const int iphi ( 1 > jphi ? jphi+72 : jphi ) ;
282 
283  for( int idep ( idep_lo ) ; idep <= idep_hi ; ++idep )
284  {
285  const HcalDetId did ( hs[is], ieta, iphi, idep ) ;
286  if( theTopology.valid(did) )
287 
288  {
289  const CaloCellGeometry* cell ( getGeometry( did ) );
290  if( 0 != cell )
291  {
292  const GlobalPoint& p ( cell->getPosition() ) ;
293  const double eta ( p.eta() ) ;
294  const double phi ( p.phi() ) ;
295  if( reco::deltaR2( eta, phi, reta, rphi ) < dR2 ) dis.insert( did ) ;
296  }
297  }
298  }
299  }
300  }
301  }
302  }
303  }
304  }
305  }
306  return dis;
307 }
int firstHFRing() const
Definition: HcalTopology.h:83
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:99
T eta() const
const HcalTopology & theTopology
Definition: HcalGeometry.h:125
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:84
HcalSubdetector
Definition: HcalAssistant.h:31
double deltaR2(const T1 &t1, const T2 &t2)
Definition: deltaR.h:36
int etaRing(HcalSubdetector bc, double abseta) const
helper methods for getClosestCell
#define M_PI
static const double theHFEtaBounds[]
virtual bool valid(const DetId &id) const
Definition: HcalTopology.cc: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 101 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().

101  {
102 
103  // Now find the closest eta_bin, eta value of a bin i is average
104  // of eta[i] and eta[i-1]
105  double abseta = fabs(r.eta());
106 
107  // figure out subdetector, giving preference to HE in HE/HF overlap region
109  if (abseta <= theHBHEEtaBounds[theTopology.lastHBRing()] ) {
110  bc = HcalBarrel;
111  } else if (abseta <= theHBHEEtaBounds[theTopology.lastHERing()] ) {
112  bc = HcalEndcap;
113  } else {
114  bc = HcalForward;
115  }
116 
117  if (bc == HcalForward) {
118  static const double z_short=1137.0;
119  int etaring = etaRing(bc, abseta); // This is safer
120  /*
121  static const double z_long=1115.0;
122  // determine front-face eta
123  double radius=sqrt(pow(r.x(),2)+pow(r.y(),2));
124  double trueAeta=asinh(z_long/radius);
125  // find eta bin
126  int etaring = etaRing(bc, trueAeta);
127  */
128  if (etaring>theTopology.lastHFRing()) etaring=theTopology.lastHFRing();
129 
130  int phibin = phiBin(r.phi(), etaring);
131 
132  // add a sign to the etaring
133  int etabin = (r.z() > 0) ? etaring : -etaring;
134  // Next line is premature depth 1 and 2 can coexist for large z-extent
135  // HcalDetId bestId(bc,etabin,phibin,((fabs(r.z())>=z_short)?(2):(1)));
136  // above line is no good with finite precision
137  HcalDetId bestId(bc,etabin,phibin,((fabs(r.z()) - z_short >-0.1)?(2):(1)));
138  return bestId;
139  } else {
140 
141  // find eta bin
142  int etaring = etaRing(bc, abseta);
143 
144  int phibin = phiBin(r.phi(), etaring);
145 
146  // add a sign to the etaring
147  int etabin = (r.z() > 0) ? etaring : -etaring;
148 
149  //Now do depth if required
150  int dbin = 1;
151  double pointrz=0, drz=99999.;
152  HcalDetId currentId(bc, etabin, phibin, dbin);
153  if (bc == HcalBarrel) pointrz = r.mag();
154  else pointrz = std::abs(r.z());
155  HcalDetId bestId;
156 // std::cout << "Current ID " << currentId << std::endl;
157  for ( ; currentId != HcalDetId(); theTopology.incrementDepth(currentId)) {
158 // std::cout << "Incremented Current ID " << currentId << std::endl;
159  const CaloCellGeometry * cell = getGeometry(currentId);
160  if (cell == 0) {
161 // std::cout << "Cell 0 for " << currentId << " Best " << bestId << " dummy " << HcalDetId() << std::endl;
162  assert (bestId != HcalDetId());
163  break;
164  } else {
165  double rz;
166  if (bc == HcalEndcap) rz = std::abs(cell->getPosition().z());
167  else rz = cell->getPosition().mag();
168  if (std::abs(pointrz-rz)<drz) {
169  bestId = currentId;
170  drz = std::abs(pointrz-rz);
171  }
172  }
173  }
174 
175  return bestId;
176  }
177 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
int lastHBRing() const
Definition: HcalTopology.h:80
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:99
const HcalTopology & theTopology
Definition: HcalGeometry.h:125
T mag() const
Definition: PV3DBase.h:67
T z() const
Definition: PV3DBase.h:64
int lastHFRing() const
Definition: HcalTopology.h:84
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:82
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 99 of file HcalGeometry.h.

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

Referenced by getCells(), and getClosestCell().

99  {
100  return cellGeomPtr( theTopology.detId2denseId( id ) ) ;
101  }
virtual unsigned int detId2denseId(const DetId &id) const
return a linear packed id
const HcalTopology & theTopology
Definition: HcalGeometry.h:125
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 550 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.

554 {
555  tVec.reserve( m_dins.size()*numberOfTransformParms() ) ;
556  iVec.reserve( numberOfShapes()==1 ? 1 : m_dins.size() ) ;
557  dVec.reserve( numberOfShapes()*numberOfParametersPerShape() ) ;
558  dinsVec.reserve( m_dins.size() );
559 
560  for( ParVecVec::const_iterator ivv ( parVecVec().begin() ) ; ivv != parVecVec().end() ; ++ivv )
561  {
562  const ParVec& pv ( *ivv ) ;
563  for( ParVec::const_iterator iv ( pv.begin() ) ; iv != pv.end() ; ++iv )
564  {
565  dVec.push_back( *iv ) ;
566  }
567  }
568 
569  for( unsigned int i ( 0 ) ; i < theTopology.ncells() ; ++i )
570  {
571  Tr3D tr ;
572  const CaloCellGeometry* ptr ( cellGeomPtr( i ) ) ;
573 
574  if( 0 != ptr )
575  {
576  dinsVec.push_back( i );
577 
578  ptr->getTransform( tr, ( Pt3DVec* ) 0 ) ;
579 
580  if( Tr3D() == tr ) // for preshower there is no rotation
581  {
582  const GlobalPoint& gp ( ptr->getPosition() ) ;
583  tr = HepGeom::Translate3D( gp.x(), gp.y(), gp.z() ) ;
584  }
585 
586  const CLHEP::Hep3Vector tt ( tr.getTranslation() ) ;
587  tVec.push_back( tt.x() ) ;
588  tVec.push_back( tt.y() ) ;
589  tVec.push_back( tt.z() ) ;
590  if( 6 == numberOfTransformParms() )
591  {
592  const CLHEP::HepRotation rr ( tr.getRotation() ) ;
593  const ROOT::Math::Transform3D rtr ( rr.xx(), rr.xy(), rr.xz(), tt.x(),
594  rr.yx(), rr.yy(), rr.yz(), tt.y(),
595  rr.zx(), rr.zy(), rr.zz(), tt.z() ) ;
597  rtr.GetRotation( ea ) ;
598  tVec.push_back( ea.Phi() ) ;
599  tVec.push_back( ea.Theta() ) ;
600  tVec.push_back( ea.Psi() ) ;
601  }
602 
603  const CCGFloat* par ( ptr->param() ) ;
604 
605  unsigned int ishape ( 9999 ) ;
606  for( unsigned int ivv ( 0 ) ; ivv != parVecVec().size() ; ++ivv )
607  {
608  bool ok ( true ) ;
609  const CCGFloat* pv ( &(*parVecVec()[ivv].begin() ) ) ;
610  for( unsigned int k ( 0 ) ; k != numberOfParametersPerShape() ; ++k )
611  {
612  ok = ok && ( fabs( par[k] - pv[k] ) < 1.e-6 ) ;
613  }
614  if( ok )
615  {
616  ishape = ivv ;
617  break ;
618  }
619  }
620  assert( 9999 != ishape ) ;
621 
622 
623  const unsigned int nn (( numberOfShapes()==1) ? (unsigned int)1 : m_dins.size() ) ;
624  if( iVec.size() < nn ) iVec.push_back( ishape ) ;
625  }
626  }
627 }
int i
Definition: DBlmapReader.cc:9
virtual unsigned int numberOfParametersPerShape() const
Definition: HcalGeometry.h:38
const HcalTopology & theTopology
Definition: HcalGeometry.h:125
CaloCellGeometry::CCGFloat CCGFloat
CaloSubdetectorGeometry::IVec m_dins
Definition: HcalGeometry.h:132
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:37
#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 90 of file HcalGeometry.cc.

References fillDetIds(), CaloSubdetectorGeometry::getValidDetIds(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, edm::AtomicPtrCache< T >::isSet(), edm::AtomicPtrCache< T >::load(), m_emptyIds, m_hbIds, m_heIds, m_hfIds, and m_hoIds.

92 {
93  if( 0 != subdet && !m_hbIds.isSet() ) fillDetIds() ;
94  return ( 0 == subdet ? CaloSubdetectorGeometry::getValidDetIds() :
95  ( HcalBarrel == subdet ? *m_hbIds.load() :
96  ( HcalEndcap == subdet ? *m_heIds.load() :
97  ( HcalOuter == subdet ? *m_hoIds.load() :
98  ( HcalForward == subdet ? *m_hfIds.load() : *m_emptyIds.load() ) ) ) ) ) ;
99 }
edm::AtomicPtrCache< std::vector< DetId > > m_heIds
Definition: HcalGeometry.h:128
edm::AtomicPtrCache< std::vector< DetId > > m_emptyIds
Definition: HcalGeometry.h:131
bool isSet() 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)
edm::AtomicPtrCache< std::vector< DetId > > m_hfIds
Definition: HcalGeometry.h:130
void fillDetIds() const
Definition: HcalGeometry.cc:36
edm::AtomicPtrCache< std::vector< DetId > > m_hoIds
Definition: HcalGeometry.h:129
T const * load() const
edm::AtomicPtrCache< std::vector< DetId > > m_hbIds
Definition: HcalGeometry.h:127
virtual unsigned int HcalGeometry::indexFor ( const DetId id) const
inlineprotectedvirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 111 of file HcalGeometry.h.

References HcalTopology::detId2denseId(), and theTopology.

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

Definition at line 22 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().

22  {
23  edm::LogInfo("HcalGeometry") << "HcalGeometry::init() "
24  << " HBSize " << theTopology.getHBSize()
25  << " HESize " << theTopology.getHESize()
26  << " HOSize " << theTopology.getHOSize()
27  << " HFSize " << theTopology.getHFSize();
28 
33 }
unsigned int getHFSize() const
Definition: HcalTopology.h:114
unsigned int getHOSize() const
Definition: HcalTopology.h:113
std::vector< IdealObliquePrism > HECellVec
Definition: HcalGeometry.h:19
const HcalTopology & theTopology
Definition: HcalGeometry.h:125
HBCellVec m_hbCellVec
Definition: HcalGeometry.h:134
HOCellVec m_hoCellVec
Definition: HcalGeometry.h:136
HFCellVec m_hfCellVec
Definition: HcalGeometry.h:137
std::vector< IdealObliquePrism > HOCellVec
Definition: HcalGeometry.h:20
std::vector< IdealZPrism > HFCellVec
Definition: HcalGeometry.h:21
std::vector< IdealObliquePrism > HBCellVec
Definition: HcalGeometry.h:18
unsigned int getHESize() const
Definition: HcalTopology.h:112
HECellVec m_heCellVec
Definition: HcalGeometry.h:135
unsigned int getHBSize() const
Definition: HcalTopology.h:111
void HcalGeometry::localCorners ( Pt3DVec lc,
const CCGFloat pv,
unsigned int  i,
Pt3D ref 
)

Definition at line 446 of file HcalGeometry.cc.

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

450 {
452 
453  if( hid.subdet() == HcalForward )
454  {
455  IdealZPrism::localCorners( lc, pv, ref ) ;
456  }
457  else
458  {
459  IdealObliquePrism::localCorners( lc, pv, ref ) ;
460  }
461 }
int i
Definition: DBlmapReader.cc:9
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:30
const HcalTopology & theTopology
Definition: HcalGeometry.h:125
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 464 of file HcalGeometry.cc.

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

468  {
469 
470  assert (detId.det()==DetId::Hcal);
471 
472  const HcalDetId hid ( detId ) ;
473  unsigned int din=theTopology.detId2denseId(detId);
474 
475  edm::LogInfo("HcalGeometry") << " newCell subdet "
476  << detId.subdetId() << ", raw ID "
477  << detId.rawId() << ", hid " << hid << ", din "
478  << din << ", index ";
479 
480  if( hid.subdet()==HcalBarrel) {
481  m_hbCellVec[ din ] = IdealObliquePrism( f1, cornersMgr(), parm ) ;
482  } else if( hid.subdet()==HcalEndcap ) {
483  const unsigned int index ( din - m_hbCellVec.size() ) ;
484  m_heCellVec[ index ] = IdealObliquePrism( f1, cornersMgr(), parm ) ;
485  } else if( hid.subdet()==HcalOuter ) {
486  const unsigned int index ( din
487  - m_hbCellVec.size()
488  - m_heCellVec.size() ) ;
489  m_hoCellVec[ index ] = IdealObliquePrism( f1, cornersMgr(), parm ) ;
490  } else {
491  const unsigned int index ( din
492  - m_hbCellVec.size()
493  - m_heCellVec.size()
494  - m_hoCellVec.size() ) ;
495  m_hfCellVec[ index ] = IdealZPrism( f1, cornersMgr(), parm ) ;
496  }
497 
498  addValidID( detId ) ;
499  m_dins.push_back( din );
500 }
virtual unsigned int detId2denseId(const DetId &id) const
return a linear packed id
const HcalTopology & theTopology
Definition: HcalGeometry.h:125
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
HBCellVec m_hbCellVec
Definition: HcalGeometry.h:134
HOCellVec m_hoCellVec
Definition: HcalGeometry.h:136
HFCellVec m_hfCellVec
Definition: HcalGeometry.h:137
CaloSubdetectorGeometry::IVec m_dins
Definition: HcalGeometry.h:132
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:135
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 38 of file HcalGeometry.h.

References k_NumberOfParametersPerShape.

Referenced by getSummary().

virtual unsigned int HcalGeometry::numberOfShapes ( ) const
inlinevirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 37 of file HcalGeometry.h.

References HcalTopology::getNumberOfShapes(), and theTopology.

Referenced by getSummary().

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

Definition at line 203 of file HcalGeometry.cc.

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

Referenced by getCells(), and getClosestCell().

204 {
205  constexpr double twopi = M_PI+M_PI;
206  //put phi in correct range (0->2pi)
207  if(phi<0.0) phi += twopi;
208  if(phi>twopi) phi -= twopi;
209  int nphibins = theTopology.nPhiBins(etaring);
210  int phibin= static_cast<int>(phi/twopi*nphibins)+1;
211  int iphi;
212 
213  // rings 40 and 41 are offset wrt the other phi numbering
214  // 1 1 1 2
215  // ------------------------------
216  // 72 36 36 1
217  if(etaring >= theTopology.firstHFQuadPhiRing())
218  {
219  phi+=(twopi/36); //shift by half tower.
220  phibin=static_cast<int>(phi/twopi*nphibins);
221  if (phibin==0) phibin=18;
222  iphi=phibin*4-1; // 71,3,5,
223  } else {
224  // convert to the convention of numbering 1,3,5, in 36 phi bins
225  iphi=(phibin-1)*(72/nphibins) + 1;
226  }
227 
228  return iphi;
229 }
int nPhiBins(int etaRing) const
how many phi segments in this ring
#define constexpr
const HcalTopology & theTopology
Definition: HcalGeometry.h:125
#define M_PI
int firstHFQuadPhiRing() const
Definition: HcalTopology.h:89
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 112 of file HcalGeometry.h.

References HcalTopology::ncells(), and theTopology.

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

Member Data Documentation

CaloSubdetectorGeometry::IVec HcalGeometry::m_dins
private

Definition at line 132 of file HcalGeometry.h.

Referenced by getSummary(), and newCell().

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

Definition at line 131 of file HcalGeometry.h.

Referenced by fillDetIds(), and getValidDetIds().

HBCellVec HcalGeometry::m_hbCellVec
private

Definition at line 134 of file HcalGeometry.h.

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

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

Definition at line 127 of file HcalGeometry.h.

Referenced by fillDetIds(), and getValidDetIds().

HECellVec HcalGeometry::m_heCellVec
private

Definition at line 135 of file HcalGeometry.h.

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

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

Definition at line 128 of file HcalGeometry.h.

Referenced by fillDetIds(), and getValidDetIds().

HFCellVec HcalGeometry::m_hfCellVec
private

Definition at line 137 of file HcalGeometry.h.

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

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

Definition at line 130 of file HcalGeometry.h.

Referenced by fillDetIds(), and getValidDetIds().

HOCellVec HcalGeometry::m_hoCellVec
private

Definition at line 136 of file HcalGeometry.h.

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

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

Definition at line 129 of file HcalGeometry.h.

Referenced by fillDetIds(), and getValidDetIds().

const HcalTopology& HcalGeometry::theTopology
private