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 
20 
21 public:
22 
25 
26  typedef std::vector<IdealObliquePrism> HBCellVec ;
27  typedef std::vector<IdealObliquePrism> HECellVec ;
28  typedef std::vector<IdealObliquePrism> HOCellVec ;
29  typedef std::vector<IdealZPrism> HFCellVec ;
30 
34 
38  typedef HcalDetId DetIdType ;
39 
40 
42 
43  static std::string dbString() { return "PHcalRcd" ; }
44 
45  unsigned int numberOfShapes() const override { return m_topology.getNumberOfShapes() ; }
46  unsigned int numberOfParametersPerShape() const override { return k_NumberOfParametersPerShape ; }
47 
48  explicit HcalGeometry(const HcalTopology& topology);
49 
51  ~HcalGeometry() override;
52 
53  const std::vector<DetId>& getValidDetIds(DetId::Detector det = DetId::Detector ( 0 ),
54  int subdet = 0 ) const override;
55 
56  std::shared_ptr<const CaloCellGeometry> getGeometry( const DetId& id ) const override ;
57 
58  DetId getClosestCell(const GlobalPoint& r) const override ;
59 
60  CaloSubdetectorGeometry::DetIdSet getCells(const GlobalPoint& r, double dR) const override ;
61 
62  GlobalPoint getPosition(const DetId& id) const;
63  GlobalPoint getBackPosition(const DetId& id) const;
65 
66  static std::string producerTag() { return "HCAL" ; }
67 
68  static unsigned int numberOfBarrelAlignments() { return 36 ; }
69 
70  static unsigned int numberOfEndcapAlignments() { return 36 ; }
71 
72  static unsigned int numberOfForwardAlignments() { return 36 ; }
73 
74  static unsigned int numberOfOuterAlignments() { return 60 ; }
75 
76  unsigned int getHxSize(const int type) const;
77 
78  static unsigned int numberOfAlignments() {
79  return ( numberOfBarrelAlignments() +
83 
84  static unsigned int alignmentBarrelIndexLocal( const DetId& id ) ;
85  static unsigned int alignmentEndcapIndexLocal( const DetId& id ) ;
86  static unsigned int alignmentForwardIndexLocal( const DetId& id ) ;
87  static unsigned int alignmentOuterIndexLocal( const DetId& id ) ;
88  static unsigned int alignmentTransformIndexLocal( const DetId& id ) ;
89 
90  static unsigned int alignmentBarEndForIndexLocal( const DetId& id,unsigned int nD ) ;
91 
92  static unsigned int alignmentTransformIndexGlobal( const DetId& id ) ;
93 
94  static DetId detIdFromLocalAlignmentIndex( unsigned int i ) ;
95  static DetId detIdFromBarrelAlignmentIndex( unsigned int i ) ;
96  static DetId detIdFromEndcapAlignmentIndex( unsigned int i ) ;
97  static DetId detIdFromForwardAlignmentIndex( unsigned int i ) ;
98  static DetId detIdFromOuterAlignmentIndex( unsigned int i ) ;
99 
100  void localCorners( Pt3DVec& lc ,
101  const CCGFloat* pv ,
102  unsigned int i ,
103  Pt3D& ref ) ;
104 
105  void newCell( const GlobalPoint& f1 ,
106  const GlobalPoint& f2 ,
107  const GlobalPoint& f3 ,
108  const CCGFloat* parm,
109  const DetId& detId ) override ;
110 
114  CaloSubdetectorGeometry::IVec& dinsVector ) const override ;
115 
116  const HcalTopology& topology() const { return m_topology; }
117 
118 protected:
119 
120  unsigned int indexFor(const DetId& id) const override { return m_topology.detId2denseId(id); }
121  unsigned int sizeForDenseIndex(const DetId& id) const override { return m_topology.ncells(); }
122 
123  // Modify the RawPtr class
124  const CaloCellGeometry* getGeometryRawPtr (uint32_t index) const override;
125 
126 private:
127 
128  // Base clas for getting geometry
129  std::shared_ptr<const CaloCellGeometry> getGeometryBase( const DetId& id ) const {
130  return cellGeomPtr( m_topology.detId2denseId( id ) ) ;
131  }
132 
133  //returns din
134  unsigned int newCellImpl( const GlobalPoint& f1 ,
135  const GlobalPoint& f2 ,
136  const GlobalPoint& f3 ,
137  const CCGFloat* parm,
138  const DetId& detId ) ;
139 
140  //can only be used by friend classes, to ensure sorting is done at the end
141  void newCellFast( const GlobalPoint& f1 ,
142  const GlobalPoint& f2 ,
143  const GlobalPoint& f3 ,
144  const CCGFloat* parm,
145  const DetId& detId ) ;
146 
147  void increaseReserve(unsigned int extra);
148  void sortValidIds();
149 
150  void fillDetIds() const ;
151 
152  void init() ;
153 
155  int etaRing(HcalSubdetector bc, double abseta) const;
156  int phiBin(HcalSubdetector bc, int etaring, double phi) const;
157  DetId correctId(const DetId& id) const ;
158 
161 
168 
169  HBCellVec m_hbCellVec ;
170  HECellVec m_heCellVec ;
171  HOCellVec m_hoCellVec ;
172  HFCellVec m_hfCellVec ;
173 };
174 
175 
176 #endif
177 
static unsigned int numberOfBarrelAlignments()
Definition: HcalGeometry.h:68
type
Definition: HCALResponse.h:21
static unsigned int alignmentTransformIndexLocal(const DetId &id)
std::shared_ptr< 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
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:163
const CaloCellGeometry * getGeometryRawPtr(uint32_t index) const override
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:66
unsigned int numberOfShapes() const override
Definition: HcalGeometry.h:45
const HcalTopology & m_topology
Definition: HcalGeometry.h:159
std::vector< unsigned int > IVec
edm::AtomicPtrCache< std::vector< DetId > > m_emptyIds
Definition: HcalGeometry.h:166
std::vector< CCGFloat > TrVec
HcalAlignmentRcd AlignmentRecord
Definition: HcalGeometry.h:35
std::vector< IdealObliquePrism > HECellVec
Definition: HcalGeometry.h:27
std::vector< Pt3D > Pt3DVec
bool m_mergePosition
Definition: HcalGeometry.h:160
const HcalTopology & topology() const
Definition: HcalGeometry.h:116
std::shared_ptr< const CaloCellGeometry > getGeometryBase(const DetId &id) const
Definition: HcalGeometry.h:129
void newCellFast(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: HcalGeometry.h:33
virtual std::shared_ptr< const CaloCellGeometry > cellGeomPtr(uint32_t index) const
HBCellVec m_hbCellVec
Definition: HcalGeometry.h:169
PHcalRcd PGeometryRecord
Definition: HcalGeometry.h:37
HOCellVec m_hoCellVec
Definition: HcalGeometry.h:171
unsigned int getNumberOfShapes() const
Definition: HcalTopology.h:164
HFCellVec m_hfCellVec
Definition: HcalGeometry.h:172
unsigned int numberOfParametersPerShape() const override
Definition: HcalGeometry.h:46
std::vector< IdealObliquePrism > HOCellVec
Definition: HcalGeometry.h:28
static unsigned int numberOfOuterAlignments()
Definition: HcalGeometry.h:74
void sortValidIds()
DetId correctId(const DetId &id) const
unsigned int sizeForDenseIndex(const DetId &id) const override
Definition: HcalGeometry.h:121
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
static DetId detIdFromLocalAlignmentIndex(unsigned int i)
int etaRing(HcalSubdetector bc, double abseta) const
helper methods for getClosestCell
CaloSubdetectorGeometry::IVec m_dins
Definition: HcalGeometry.h:167
HcalGeometry(const HcalTopology &topology)
Definition: HcalGeometry.cc:16
HcalGeometryRecord AlignedRecord
Definition: HcalGeometry.h:36
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:29
~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:70
static std::string dbString()
Definition: HcalGeometry.h:43
Detector
Definition: DetId.h:24
CaloCellGeometry::CCGFloat CCGFloat
Definition: HcalGeometry.h:31
CaloCellGeometry::CornersVec getCorners(const DetId &id) const
HepGeom::Point3D< CCGFloat > Pt3D
std::vector< IdealObliquePrism > HBCellVec
Definition: HcalGeometry.h:26
HECellVec m_heCellVec
Definition: HcalGeometry.h:170
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:165
void fillDetIds() const
Definition: HcalGeometry.cc:39
unsigned int indexFor(const DetId &id) const override
Definition: HcalGeometry.h:120
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:72
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:38
static DetId detIdFromEndcapAlignmentIndex(unsigned int i)
static unsigned int alignmentBarEndForIndexLocal(const DetId &id, unsigned int nD)
friend class HcalGeometryPlan1Tester
Definition: HcalGeometry.h:19
edm::AtomicPtrCache< std::vector< DetId > > m_hoIds
Definition: HcalGeometry.h:164
CaloCellGeometry::Pt3D Pt3D
Definition: HcalGeometry.h:32
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:162
static unsigned int numberOfAlignments()
Definition: HcalGeometry.h:78
DetId getClosestCell(const GlobalPoint &r) const override