CMS 3D CMS Logo

HcalGeometry.h
Go to the documentation of this file.
1 #ifndef HcalGeometry_h
2 #define HcalGeometry_h
3 
5 
13 
16 
18 
19 public:
20 
23 
24  typedef std::vector<IdealObliquePrism> HBCellVec ;
25  typedef std::vector<IdealObliquePrism> HECellVec ;
26  typedef std::vector<IdealObliquePrism> HOCellVec ;
27  typedef std::vector<IdealZPrism> HFCellVec ;
28 
32 
36  typedef HcalDetId DetIdType ;
37 
38 
40 
41  static std::string dbString() { return "PHcalRcd" ; }
42 
43  unsigned int numberOfShapes() const override { return m_topology.getNumberOfShapes() ; }
44  unsigned int numberOfParametersPerShape() const override { return k_NumberOfParametersPerShape ; }
45 
46  explicit HcalGeometry(const HcalTopology& topology);
47 
49  ~HcalGeometry() override;
50 
51  const std::vector<DetId>& getValidDetIds(DetId::Detector det = DetId::Detector ( 0 ),
52  int subdet = 0 ) const override;
53 
54  const CaloCellGeometry* getGeometry( const DetId& id ) const override ;
55 
56  DetId getClosestCell(const GlobalPoint& r) const override ;
57 
59  double dR ) const override ;
60 
61  GlobalPoint getPosition(const DetId& id) const;
62  GlobalPoint getBackPosition(const DetId& id) const;
64 
65  static std::string producerTag() { return "HCAL" ; }
66 
67  static unsigned int numberOfBarrelAlignments() { return 36 ; }
68 
69  static unsigned int numberOfEndcapAlignments() { return 36 ; }
70 
71  static unsigned int numberOfForwardAlignments() { return 36 ; }
72 
73  static unsigned int numberOfOuterAlignments() { return 60 ; }
74 
75  unsigned int getHxSize(const int type) const;
76 
77  static unsigned int numberOfAlignments() {
78  return ( numberOfBarrelAlignments() +
82 
83  static unsigned int alignmentBarrelIndexLocal( const DetId& id ) ;
84  static unsigned int alignmentEndcapIndexLocal( const DetId& id ) ;
85  static unsigned int alignmentForwardIndexLocal( const DetId& id ) ;
86  static unsigned int alignmentOuterIndexLocal( const DetId& id ) ;
87  static unsigned int alignmentTransformIndexLocal( const DetId& id ) ;
88 
89  static unsigned int alignmentBarEndForIndexLocal( const DetId& id,unsigned int nD ) ;
90 
91  static unsigned int alignmentTransformIndexGlobal( const DetId& id ) ;
92 
93  static DetId detIdFromLocalAlignmentIndex( unsigned int i ) ;
94  static DetId detIdFromBarrelAlignmentIndex( unsigned int i ) ;
95  static DetId detIdFromEndcapAlignmentIndex( unsigned int i ) ;
96  static DetId detIdFromForwardAlignmentIndex( unsigned int i ) ;
97  static DetId detIdFromOuterAlignmentIndex( unsigned int i ) ;
98 
99  void localCorners( Pt3DVec& lc ,
100  const CCGFloat* pv ,
101  unsigned int i ,
102  Pt3D& ref ) ;
103 
104  void newCell( const GlobalPoint& f1 ,
105  const GlobalPoint& f2 ,
106  const GlobalPoint& f3 ,
107  const CCGFloat* parm,
108  const DetId& detId ) override ;
109 
110  const CaloCellGeometry* getGeometryBase( const DetId& id ) const {
111  return cellGeomPtr( m_topology.detId2denseId( id ) ) ;
112  }
113 
117  CaloSubdetectorGeometry::IVec& dinsVector ) const override ;
118 
119  const HcalTopology& topology() const { return m_topology; }
120 
121 protected:
122 
123  const CaloCellGeometry* cellGeomPtr( unsigned int index ) const override ;
124 
125  unsigned int indexFor(const DetId& id) const override { return m_topology.detId2denseId(id); }
126  unsigned int sizeForDenseIndex(const DetId& id) const override { return m_topology.ncells(); }
127 
128 private:
129 
130  //returns din
131  unsigned int newCellImpl( const GlobalPoint& f1 ,
132  const GlobalPoint& f2 ,
133  const GlobalPoint& f3 ,
134  const CCGFloat* parm,
135  const DetId& detId ) ;
136 
137  //can only be used by friend classes, to ensure sorting is done at the end
138  void newCellFast( const GlobalPoint& f1 ,
139  const GlobalPoint& f2 ,
140  const GlobalPoint& f3 ,
141  const CCGFloat* parm,
142  const DetId& detId ) ;
143 
144  void increaseReserve(unsigned int extra);
145  void sortValidIds();
146 
147  void fillDetIds() const ;
148 
149  void init() ;
150 
152  int etaRing(HcalSubdetector bc, double abseta) const;
153  int phiBin(HcalSubdetector bc, int etaring, double phi) const;
154  DetId correctId(const DetId& id) const ;
155 
158 
165 
166  HBCellVec m_hbCellVec ;
167  HECellVec m_heCellVec ;
168  HOCellVec m_hoCellVec ;
169  HFCellVec m_hfCellVec ;
170 };
171 
172 
173 #endif
174 
static unsigned int numberOfBarrelAlignments()
Definition: HcalGeometry.h:67
type
Definition: HCALResponse.h:21
static unsigned int alignmentTransformIndexLocal(const DetId &id)
std::vector< CCGFloat > DimVec
CaloSubdetectorGeometry::DetIdSet getCells(const GlobalPoint &r, double dR) const override
Get a list of all cells within a dR of the given cell.
edm::AtomicPtrCache< std::vector< DetId > > m_heIds
Definition: HcalGeometry.h:160
static unsigned int alignmentEndcapIndexLocal(const DetId &id)
unsigned int getHxSize(const int type) const
static DetId detIdFromOuterAlignmentIndex(unsigned int i)
unsigned int detId2denseId(const DetId &id) const override
return a linear packed id
const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const override
Get a list of valid detector ids (for the given subdetector)
Definition: HcalGeometry.cc:76
static std::string producerTag()
Definition: HcalGeometry.h:65
unsigned int numberOfShapes() const override
Definition: HcalGeometry.h:43
const HcalTopology & m_topology
Definition: HcalGeometry.h:156
std::vector< unsigned int > IVec
edm::AtomicPtrCache< std::vector< DetId > > m_emptyIds
Definition: HcalGeometry.h:163
const CaloCellGeometry * getGeometryBase(const DetId &id) const
Definition: HcalGeometry.h:110
std::vector< CCGFloat > TrVec
HcalAlignmentRcd AlignmentRecord
Definition: HcalGeometry.h:33
std::vector< IdealObliquePrism > HECellVec
Definition: HcalGeometry.h:25
std::vector< Pt3D > Pt3DVec
bool m_mergePosition
Definition: HcalGeometry.h:157
const CaloCellGeometry * getGeometry(const DetId &id) const override
Get the cell geometry of a given detector id. Should return false if not found.
Definition: HcalGeometry.cc:86
const HcalTopology & topology() const
Definition: HcalGeometry.h:119
void newCellFast(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: HcalGeometry.h:31
HBCellVec m_hbCellVec
Definition: HcalGeometry.h:166
PHcalRcd PGeometryRecord
Definition: HcalGeometry.h:35
HOCellVec m_hoCellVec
Definition: HcalGeometry.h:168
unsigned int getNumberOfShapes() const
Definition: HcalTopology.h:158
HFCellVec m_hfCellVec
Definition: HcalGeometry.h:169
unsigned int numberOfParametersPerShape() const override
Definition: HcalGeometry.h:44
std::vector< IdealObliquePrism > HOCellVec
Definition: HcalGeometry.h:26
static unsigned int numberOfOuterAlignments()
Definition: HcalGeometry.h:73
void sortValidIds()
DetId correctId(const DetId &id) const
unsigned int sizeForDenseIndex(const DetId &id) const override
Definition: HcalGeometry.h:126
static DetId detIdFromForwardAlignmentIndex(unsigned int i)
static unsigned int alignmentTransformIndexGlobal(const DetId &id)
static unsigned int alignmentBarrelIndexLocal(const DetId &id)
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
const CaloCellGeometry * cellGeomPtr(unsigned int index) const override
static DetId detIdFromLocalAlignmentIndex(unsigned int i)
int etaRing(HcalSubdetector bc, double abseta) const
helper methods for getClosestCell
CaloSubdetectorGeometry::IVec m_dins
Definition: HcalGeometry.h:164
HcalGeometry(const HcalTopology &topology)
Definition: HcalGeometry.cc:16
HcalGeometryRecord AlignedRecord
Definition: HcalGeometry.h:34
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:27
~HcalGeometry() override
The HcalGeometry will delete all its cell geometries at destruction time.
Definition: HcalGeometry.cc:21
Definition: DetId.h:18
static unsigned int numberOfEndcapAlignments()
Definition: HcalGeometry.h:69
static std::string dbString()
Definition: HcalGeometry.h:41
Detector
Definition: DetId.h:24
CaloCellGeometry::CCGFloat CCGFloat
Definition: HcalGeometry.h:29
CaloCellGeometry::CornersVec getCorners(const DetId &id) const
HepGeom::Point3D< CCGFloat > Pt3D
std::vector< IdealObliquePrism > HBCellVec
Definition: HcalGeometry.h:24
HECellVec m_heCellVec
Definition: HcalGeometry.h:167
void increaseReserve(unsigned int extra)
void getSummary(CaloSubdetectorGeometry::TrVec &trVector, CaloSubdetectorGeometry::IVec &iVector, CaloSubdetectorGeometry::DimVec &dimVector, CaloSubdetectorGeometry::IVec &dinsVector) const override
edm::AtomicPtrCache< std::vector< DetId > > m_hfIds
Definition: HcalGeometry.h:162
void fillDetIds() const
Definition: HcalGeometry.cc:39
unsigned int indexFor(const DetId &id) const override
Definition: HcalGeometry.h:125
void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId) override
static unsigned int numberOfForwardAlignments()
Definition: HcalGeometry.h:71
unsigned int ncells() const override
return a count of valid cells (for dense indexing use)
static unsigned int alignmentForwardIndexLocal(const DetId &id)
GlobalPoint getBackPosition(const DetId &id) const
HcalDetId DetIdType
Definition: HcalGeometry.h:36
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:161
CaloCellGeometry::Pt3D Pt3D
Definition: HcalGeometry.h:30
unsigned int newCellImpl(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)
edm::AtomicPtrCache< std::vector< DetId > > m_hbIds
Definition: HcalGeometry.h:159
static unsigned int numberOfAlignments()
Definition: HcalGeometry.h:77
DetId getClosestCell(const GlobalPoint &r) const override