CMS 3D CMS Logo

HcalGeometry.h
Go to the documentation of this file.
1 #ifndef HcalGeometry_h
2 #define HcalGeometry_h
3 
5 
13 
15 
16 public:
17 
18  typedef std::vector<IdealObliquePrism> HBCellVec ;
19  typedef std::vector<IdealObliquePrism> HECellVec ;
20  typedef std::vector<IdealObliquePrism> HOCellVec ;
21  typedef std::vector<IdealZPrism> HFCellVec ;
22 
26 
30  typedef HcalDetId DetIdType ;
31 
32 
34 
35  static std::string dbString() { return "PHcalRcd" ; }
36 
37  virtual unsigned int numberOfShapes() const { return m_topology.getNumberOfShapes() ; }
38  virtual unsigned int numberOfParametersPerShape() const { return k_NumberOfParametersPerShape ; }
39 
40  explicit HcalGeometry(const HcalTopology& topology);
41 
43  virtual ~HcalGeometry();
44 
45  virtual const std::vector<DetId>& getValidDetIds(DetId::Detector det = DetId::Detector ( 0 ),
46  int subdet = 0 ) const;
47 
48  virtual DetId getClosestCell(const GlobalPoint& r) const ;
49 
51  double dR ) const ;
52 
53  GlobalPoint getPosition(const DetId& id) const;
54  GlobalPoint getBackPosition(const DetId& id) const;
56 
57  static std::string producerTag() { return "HCAL" ; }
58 
59  static unsigned int numberOfBarrelAlignments() { return 36 ; }
60 
61  static unsigned int numberOfEndcapAlignments() { return 36 ; }
62 
63  static unsigned int numberOfForwardAlignments() { return 36 ; }
64 
65  static unsigned int numberOfOuterAlignments() { return 60 ; }
66 
67  unsigned int getHxSize(const int type) const;
68 
69  static unsigned int numberOfAlignments()
70  { return ( numberOfBarrelAlignments() +
74 
75  static unsigned int alignmentBarrelIndexLocal( const DetId& id ) ;
76  static unsigned int alignmentEndcapIndexLocal( const DetId& id ) ;
77  static unsigned int alignmentForwardIndexLocal( const DetId& id ) ;
78  static unsigned int alignmentOuterIndexLocal( const DetId& id ) ;
79  static unsigned int alignmentTransformIndexLocal( const DetId& id ) ;
80 
81  static unsigned int alignmentBarEndForIndexLocal( const DetId& id,unsigned int nD ) ;
82 
83  static unsigned int alignmentTransformIndexGlobal( const DetId& id ) ;
84 
85  static DetId detIdFromLocalAlignmentIndex( unsigned int i ) ;
86  static DetId detIdFromBarrelAlignmentIndex( unsigned int i ) ;
87  static DetId detIdFromEndcapAlignmentIndex( unsigned int i ) ;
88  static DetId detIdFromForwardAlignmentIndex( unsigned int i ) ;
89  static DetId detIdFromOuterAlignmentIndex( unsigned int i ) ;
90 
91  void localCorners( Pt3DVec& lc ,
92  const CCGFloat* pv ,
93  unsigned int i ,
94  Pt3D& ref ) ;
95 
96  virtual void newCell( const GlobalPoint& f1 ,
97  const GlobalPoint& f2 ,
98  const GlobalPoint& f3 ,
99  const CCGFloat* parm,
100  const DetId& detId ) ;
101 
102  virtual const CaloCellGeometry* getGeometry( const DetId& id ) const {
103  return cellGeomPtr( m_topology.detId2denseId( id ) ) ;
104  }
105 
106  virtual void getSummary( CaloSubdetectorGeometry::TrVec& trVector,
109  CaloSubdetectorGeometry::IVec& dinsVector ) const ;
110 
111  const HcalTopology& topology() const { return m_topology; }
112 
113 protected:
114 
115  virtual const CaloCellGeometry* cellGeomPtr( unsigned int index ) const ;
116 
117  virtual unsigned int indexFor(const DetId& id) const { return m_topology.detId2denseId(id); }
118  virtual unsigned int sizeForDenseIndex(const DetId& id) const { return m_topology.ncells(); }
119 
120 private:
121 
122  void fillDetIds() const ;
123 
124  void init() ;
125 
127  int etaRing(HcalSubdetector bc, double abseta) const;
128  int phiBin(HcalSubdetector bc, int etaring, double phi) const;
129  DetId correctId(const DetId& id) const ;
130 
133 
140 
141  HBCellVec m_hbCellVec ;
142  HECellVec m_heCellVec ;
143  HOCellVec m_hoCellVec ;
144  HFCellVec m_hfCellVec ;
145 };
146 
147 
148 #endif
149 
static unsigned int numberOfBarrelAlignments()
Definition: HcalGeometry.h:59
type
Definition: HCALResponse.h:21
virtual void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)
int i
Definition: DBlmapReader.cc:9
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: HcalGeometry.cc:81
static unsigned int alignmentTransformIndexLocal(const DetId &id)
virtual unsigned int detId2denseId(const DetId &id) const
return a linear packed id
std::vector< CCGFloat > DimVec
edm::AtomicPtrCache< std::vector< DetId > > m_heIds
Definition: HcalGeometry.h:135
static unsigned int alignmentEndcapIndexLocal(const DetId &id)
virtual void getSummary(CaloSubdetectorGeometry::TrVec &trVector, CaloSubdetectorGeometry::IVec &iVector, CaloSubdetectorGeometry::DimVec &dimVector, CaloSubdetectorGeometry::IVec &dinsVector) const
unsigned int getHxSize(const int type) const
static DetId detIdFromOuterAlignmentIndex(unsigned int i)
static std::string producerTag()
Definition: HcalGeometry.h:57
const HcalTopology & m_topology
Definition: HcalGeometry.h:131
std::vector< unsigned int > IVec
edm::AtomicPtrCache< std::vector< DetId > > m_emptyIds
Definition: HcalGeometry.h:138
std::vector< CCGFloat > TrVec
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:102
HcalAlignmentRcd AlignmentRecord
Definition: HcalGeometry.h:27
std::vector< IdealObliquePrism > HECellVec
Definition: HcalGeometry.h:19
std::vector< Pt3D > Pt3DVec
bool m_mergePosition
Definition: HcalGeometry.h:132
virtual unsigned int numberOfParametersPerShape() const
Definition: HcalGeometry.h:38
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: HcalGeometry.cc:71
virtual CaloSubdetectorGeometry::DetIdSet getCells(const GlobalPoint &r, double dR) const
Get a list of all cells within a dR of the given cell.
const HcalTopology & topology() const
Definition: HcalGeometry.h:111
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: HcalGeometry.h:25
HBCellVec m_hbCellVec
Definition: HcalGeometry.h:141
PHcalRcd PGeometryRecord
Definition: HcalGeometry.h:29
HOCellVec m_hoCellVec
Definition: HcalGeometry.h:143
unsigned int getNumberOfShapes() const
Definition: HcalTopology.h:158
HFCellVec m_hfCellVec
Definition: HcalGeometry.h:144
std::vector< IdealObliquePrism > HOCellVec
Definition: HcalGeometry.h:20
static unsigned int numberOfOuterAlignments()
Definition: HcalGeometry.h:65
DetId correctId(const DetId &id) const
static DetId detIdFromForwardAlignmentIndex(unsigned int i)
static unsigned int alignmentTransformIndexGlobal(const DetId &id)
static unsigned int alignmentBarrelIndexLocal(const DetId &id)
virtual unsigned int sizeForDenseIndex(const DetId &id) const
Definition: HcalGeometry.h:118
HcalSubdetector
Definition: HcalAssistant.h:31
def pv(vc)
Definition: MetAnalyzer.py:6
static DetId detIdFromBarrelAlignmentIndex(unsigned int i)
int phiBin(HcalSubdetector bc, int etaring, double phi) const
static DetId detIdFromLocalAlignmentIndex(unsigned int i)
int etaRing(HcalSubdetector bc, double abseta) const
helper methods for getClosestCell
CaloSubdetectorGeometry::IVec m_dins
Definition: HcalGeometry.h:139
HcalGeometry(const HcalTopology &topology)
Definition: HcalGeometry.cc:14
HcalGeometryRecord AlignedRecord
Definition: HcalGeometry.h:28
GlobalPoint getPosition(const DetId &id) const
void localCorners(Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
static unsigned int alignmentOuterIndexLocal(const DetId &id)
std::vector< IdealZPrism > HFCellVec
Definition: HcalGeometry.h:21
Definition: DetId.h:18
static unsigned int numberOfEndcapAlignments()
Definition: HcalGeometry.h:61
static std::string dbString()
Definition: HcalGeometry.h:35
virtual ~HcalGeometry()
The HcalGeometry will delete all its cell geometries at destruction time.
Definition: HcalGeometry.cc:19
Detector
Definition: DetId.h:24
CaloCellGeometry::CCGFloat CCGFloat
Definition: HcalGeometry.h:23
CaloCellGeometry::CornersVec getCorners(const DetId &id) const
HepGeom::Point3D< CCGFloat > Pt3D
std::vector< IdealObliquePrism > HBCellVec
Definition: HcalGeometry.h:18
virtual const CaloCellGeometry * cellGeomPtr(unsigned int index) const
HECellVec m_heCellVec
Definition: HcalGeometry.h:142
virtual unsigned int indexFor(const DetId &id) const
Definition: HcalGeometry.h:117
virtual unsigned int numberOfShapes() const
Definition: HcalGeometry.h:37
edm::AtomicPtrCache< std::vector< DetId > > m_hfIds
Definition: HcalGeometry.h:137
void fillDetIds() const
Definition: HcalGeometry.cc:35
static unsigned int numberOfForwardAlignments()
Definition: HcalGeometry.h:63
static unsigned int alignmentForwardIndexLocal(const DetId &id)
GlobalPoint getBackPosition(const DetId &id) const
HcalDetId DetIdType
Definition: HcalGeometry.h:30
static DetId detIdFromEndcapAlignmentIndex(unsigned int i)
static unsigned int alignmentBarEndForIndexLocal(const DetId &id, unsigned int nD)
edm::AtomicPtrCache< std::vector< DetId > > m_hoIds
Definition: HcalGeometry.h:136
CaloCellGeometry::Pt3D Pt3D
Definition: HcalGeometry.h:24
edm::AtomicPtrCache< std::vector< DetId > > m_hbIds
Definition: HcalGeometry.h:134
static unsigned int numberOfAlignments()
Definition: HcalGeometry.h:69
virtual unsigned int ncells() const
return a count of valid cells (for dense indexing use)