CMS 3D CMS Logo

RecHitTools.h
Go to the documentation of this file.
1 #ifndef __RecoLocalCalo_HGCalRecAlgos_RecHitTools_h__
2 #define __RecoLocalCalo_HGCalRecAlgos_RecHitTools_h__
3 
4 #include <array>
5 #include <cmath>
9 
10 class CaloGeometry;
12 class DetId;
13 
14 namespace edm {
15  class Event;
16  class EventSetup;
17 }
18 
19 namespace hgcal {
20  class RecHitTools {
21  public:
22  RecHitTools() : geom_(nullptr), fhOffset_(0), bhOffset_(0), fhLastLayer_(0), geometryType_(0) {}
24 
25  void getEvent(const edm::Event&);
26  void getEventSetup(const edm::EventSetup&);
27  const CaloSubdetectorGeometry* getSubdetectorGeometry( const DetId& id ) const;
28 
29  GlobalPoint getPosition(const DetId& id) const;
30  GlobalPoint getPositionLayer(int layer) const;
31  // zside returns +/- 1
32  int zside(const DetId& id) const;
33 
34  std::float_t getSiThickness(const DetId&) const;
35  std::float_t getRadiusToSide(const DetId&) const;
36  int getSiThickIndex(const DetId&) const;
37 
38  unsigned int getLayer(DetId::Detector type) const;
39  unsigned int getLayer(ForwardSubdetector type) const;
40  unsigned int getLayer(const DetId&) const;
41  unsigned int getLayerWithOffset(const DetId&) const;
42  std::pair<int,int> getWafer(const DetId&) const;
43  std::pair<int,int> getCell(const DetId&) const;
44 
45  bool isHalfCell(const DetId&) const;
46 
47  // 4-vector helper functions using GlobalPoint
48  float getEta(const GlobalPoint& position, const float& vertex_z = 0.) const;
49  float getPhi(const GlobalPoint& position) const;
50  float getPt(const GlobalPoint& position, const float& hitEnergy, const float& vertex_z = 0.) const;
51 
52  // 4-vector helper functions using DetId
53  float getEta(const DetId& id, const float& vertex_z = 0.) const;
54  float getPhi(const DetId& id) const;
55  float getPt(const DetId& id, const float& hitEnergy, const float& vertex_z = 0.) const;
56 
57  inline const CaloGeometry * getGeometry() const {return geom_;};
58  unsigned int lastLayerEE() const {return fhOffset_;}
59  unsigned int lastLayerFH() const {return fhLastLayer_;}
60  unsigned int maxNumberOfWafersPerLayer() const {return maxNumberOfWafersPerLayer_;}
61  inline int getGeometryType() const {return geometryType_;}
62  bool maskCell(const DetId& id, int corners=3) const;
63  private:
65  unsigned int fhOffset_, bhOffset_, fhLastLayer_, maxNumberOfWafersPerLayer_;
67  };
68 }
69 
70 #endif
type
Definition: HCALResponse.h:21
unsigned int maxNumberOfWafersPerLayer() const
Definition: RecHitTools.h:60
#define nullptr
int zside(DetId const &)
ForwardSubdetector
unsigned int maxNumberOfWafersPerLayer_
Definition: RecHitTools.h:65
const CaloGeometry * geom_
Definition: RecHitTools.h:64
unsigned int lastLayerEE() const
Definition: RecHitTools.h:58
Definition: DetId.h:18
Detector
Definition: DetId.h:26
int getGeometryType() const
Definition: RecHitTools.h:61
HLT enums.
static int position[264][3]
Definition: ReadPGInfo.cc:509
const CaloGeometry * getGeometry() const
Definition: RecHitTools.h:57
unsigned int lastLayerFH() const
Definition: RecHitTools.h:59