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>
12 
13 class CaloGeometry;
15 class DetId;
16 
17 namespace edm {
18  class Event;
19  class EventSetup;
20 } // namespace edm
21 
22 namespace hgcal {
23  class RecHitTools {
24  public:
27 
28  void setGeometry(CaloGeometry const&);
30 
31  GlobalPoint getPosition(const DetId& id) const;
32  GlobalPoint getPositionLayer(int layer, bool nose = false) const;
33  // zside returns +/- 1
34  int zside(const DetId& id) const;
35 
36  std::float_t getSiThickness(const DetId&) const;
37  std::float_t getRadiusToSide(const DetId&) const;
38  int getSiThickIndex(const DetId&) const;
39 
40  unsigned int getLayer(DetId::Detector type, bool nose = false) const;
41  unsigned int getLayer(ForwardSubdetector type) const;
42  unsigned int getLayer(const DetId&) const;
43  unsigned int getLayerWithOffset(const DetId&) const;
44  std::pair<int, int> getWafer(const DetId&) const;
45  std::pair<int, int> getCell(const DetId&) const;
46 
47  bool isHalfCell(const DetId&) const;
48 
49  bool isSilicon(const DetId&) const;
50 
51  bool isOnlySilicon(const unsigned int layer) const;
52 
53  // 4-vector helper functions using GlobalPoint
54  float getEta(const GlobalPoint& position, const float& vertex_z = 0.) const;
55  float getPhi(const GlobalPoint& position) const;
56  float getPt(const GlobalPoint& position, const float& hitEnergy, const float& vertex_z = 0.) const;
57 
58  // 4-vector helper functions using DetId
59  float getEta(const DetId& id, const float& vertex_z = 0.) const;
60  float getPhi(const DetId& id) const;
61  float getPt(const DetId& id, const float& hitEnergy, const float& vertex_z = 0.) const;
62 
63  inline const CaloGeometry* getGeometry() const { return geom_; };
64  unsigned int lastLayerEE(bool nose = false) const { return (nose ? HFNoseDetId::HFNoseLayerEEmax : fhOffset_); }
65  unsigned int lastLayerFH() const { return fhLastLayer_; }
66  unsigned int firstLayerBH() const { return bhOffset_ + 1; }
67  unsigned int lastLayerBH() const { return bhLastLayer_; }
68  unsigned int lastLayer(bool nose = false) const { return (nose ? noseLastLayer_ : bhLastLayer_); }
69  unsigned int maxNumberOfWafersPerLayer(bool nose = false) const {
71  }
72  inline int getScintMaxIphi() const { return bhMaxIphi_; }
73  inline int getGeometryType() const { return geometryType_; }
74  bool maskCell(const DetId& id, int corners = 3) const;
75 
76  private:
82  };
83 } // namespace hgcal
84 
85 #endif
hgcal::RecHitTools::geom_
const CaloGeometry * geom_
Definition: RecHitTools.h:77
hgcal::RecHitTools
Definition: RecHitTools.h:23
hgcal::RecHitTools::getSiThickness
std::float_t getSiThickness(const DetId &) const
Definition: RecHitTools.cc:176
hgcal::RecHitTools::geometryType_
int geometryType_
Definition: RecHitTools.h:80
hgcal::RecHitTools::getRadiusToSide
std::float_t getRadiusToSide(const DetId &) const
Definition: RecHitTools.cc:222
hgcal::RecHitTools::getSiThickIndex
int getSiThickIndex(const DetId &) const
Definition: RecHitTools.cc:202
hgcal::RecHitTools::isHalfCell
bool isHalfCell(const DetId &) const
Definition: RecHitTools.cc:402
hgcal::RecHitTools::maxNumberOfWafersPerLayer
unsigned int maxNumberOfWafersPerLayer(bool nose=false) const
Definition: RecHitTools.h:69
ForwardSubdetector
ForwardSubdetector
Definition: ForwardSubdetector.h:4
edm
HLT enums.
Definition: AlignableModifier.h:19
hgcal::RecHitTools::fhLastLayer_
unsigned int fhLastLayer_
Definition: RecHitTools.h:78
hgcal::RecHitTools::getCell
std::pair< int, int > getCell(const DetId &) const
Definition: RecHitTools.cc:384
HFNoseDetId.h
hgcal::RecHitTools::maxNumberOfWafersNose_
unsigned int maxNumberOfWafersNose_
Definition: RecHitTools.h:79
hgcal::RecHitTools::bhOffset_
unsigned int bhOffset_
Definition: RecHitTools.h:78
hgcal::RecHitTools::getGeometryType
int getGeometryType() const
Definition: RecHitTools.h:73
hgcal
Definition: EgammaPCAHelper.h:31
ForwardSubdetector.h
DetId
Definition: DetId.h:17
hgcal::RecHitTools::lastLayerFH
unsigned int lastLayerFH() const
Definition: RecHitTools.h:65
CaloGeometry
Definition: CaloGeometry.h:21
hgcal::RecHitTools::getPt
float getPt(const GlobalPoint &position, const float &hitEnergy, const float &vertex_z=0.) const
Definition: RecHitTools.cc:448
hgcal::RecHitTools::RecHitTools
RecHitTools()
Definition: RecHitTools.h:25
Event
Point3DBase< float, GlobalTag >
hgcal::RecHitTools::getWafer
std::pair< int, int > getWafer(const DetId &) const
Definition: RecHitTools.cc:366
CaloGeometryRecord.h
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
hgcal::RecHitTools::lastLayerBH
unsigned int lastLayerBH() const
Definition: RecHitTools.h:67
hgcal::RecHitTools::getPhi
float getPhi(const GlobalPoint &position) const
Definition: RecHitTools.cc:437
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
hgcal::RecHitTools::getLayerWithOffset
unsigned int getLayerWithOffset(const DetId &) const
Definition: RecHitTools.cc:352
hgcal::RecHitTools::isSilicon
bool isSilicon(const DetId &) const
Definition: RecHitTools.cc:415
hgcal::RecHitTools::lastLayerEE
unsigned int lastLayerEE(bool nose=false) const
Definition: RecHitTools.h:64
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
hgcal::RecHitTools::maxNumberOfWafersPerLayer_
unsigned int maxNumberOfWafersPerLayer_
Definition: RecHitTools.h:79
DetId::Detector
Detector
Definition: DetId.h:24
hgcal::RecHitTools::zside
int zside(const DetId &id) const
Definition: RecHitTools.cc:160
hgcal::RecHitTools::~RecHitTools
~RecHitTools()
Definition: RecHitTools.h:26
hgcal::RecHitTools::getPositionLayer
GlobalPoint getPositionLayer(int layer, bool nose=false) const
Definition: RecHitTools.cc:138
hgcal::RecHitTools::getSubdetectorGeometry
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
Definition: RecHitTools.cc:116
HFNoseDetId::HFNoseLayerEEmax
static const int HFNoseLayerEEmax
Definition: HFNoseDetId.h:29
hgcal::RecHitTools::lastLayer
unsigned int lastLayer(bool nose=false) const
Definition: RecHitTools.h:68
hgcal::RecHitTools::getLayer
unsigned int getLayer(DetId::Detector type, bool nose=false) const
Definition: RecHitTools.cc:294
hgcal::RecHitTools::firstLayerBH
unsigned int firstLayerBH() const
Definition: RecHitTools.h:66
hgcal::RecHitTools::getEta
float getEta(const GlobalPoint &position, const float &vertex_z=0.) const
Definition: RecHitTools.cc:426
hgcal::RecHitTools::fhOffset_
unsigned int fhOffset_
Definition: RecHitTools.h:78
DetId.h
hgcal::RecHitTools::setGeometry
void setGeometry(CaloGeometry const &)
Definition: RecHitTools.cc:68
hgcal::RecHitTools::maskCell
bool maskCell(const DetId &id, int corners=3) const
Definition: RecHitTools.cc:461
hgcal::RecHitTools::noseLastLayer_
unsigned int noseLastLayer_
Definition: RecHitTools.h:78
CaloGeometry.h
hgcal::RecHitTools::isOnlySilicon
bool isOnlySilicon(const unsigned int layer) const
Definition: RecHitTools.cc:420
CaloSubdetectorGeometry
Definition: CaloSubdetectorGeometry.h:22
hgcal::RecHitTools::bhMaxIphi_
int bhMaxIphi_
Definition: RecHitTools.h:81
EventSetup
hgcal::RecHitTools::bhLastLayer_
unsigned int bhLastLayer_
Definition: RecHitTools.h:78
hgcal::RecHitTools::getPosition
GlobalPoint getPosition(const DetId &id) const
Definition: RecHitTools.cc:126
GlobalPoint.h
hgcal::RecHitTools::getScintMaxIphi
int getScintMaxIphi() const
Definition: RecHitTools.h:72
hgcal::RecHitTools::getGeometry
const CaloGeometry * getGeometry() const
Definition: RecHitTools.h:63