CMS 3D CMS Logo

HGCalTriggerTools.h
Go to the documentation of this file.
1 #ifndef __L1Trigger_L1THGCal_HGCalTriggerTools_h__
2 #define __L1Trigger_L1THGCal_HGCalTriggerTools_h__
3 
15 #include <array>
16 #include <cmath>
17 #include <vector>
19 
26 
27 namespace edm {
28  class Event;
29  class EventSetup;
30 } // namespace edm
31 
33 public:
36 
37  void eventSetup(const edm::EventSetup&);
38  GlobalPoint getTCPosition(const DetId& id) const;
39  unsigned layers(ForwardSubdetector type) const;
40  unsigned layers(DetId::Detector type) const;
41  unsigned layer(const DetId&) const;
42  unsigned layerWithOffset(const DetId&) const;
43  bool isEm(const DetId&) const;
44  bool isHad(const DetId& id) const { return !isEm(id); }
45  bool isSilicon(const DetId&) const;
46  bool isScintillator(const DetId& id) const { return !isSilicon(id); }
47  bool isNose(const DetId&) const;
48  int zside(const DetId&) const;
49  // tc argument is needed because of the impossibility
50  // to know whether the ID is a TC or a sensor cell
51  // in the v8 geometry detid scheme
52  int thicknessIndex(const DetId&, bool tc = false) const;
53 
54  unsigned lastLayerEE() const { return eeLayers_; }
55  unsigned lastLayerFH() const { return eeLayers_ + fhLayers_; }
56  unsigned lastLayerBH() const { return totalLayers_; }
57  unsigned lastLayerNose() const { return noseLayers_; }
58 
59  // 4-vector helper functions using GlobalPoint
60  float getEta(const GlobalPoint& position, const float& vertex_z = 0.) const;
61  float getPhi(const GlobalPoint& position) const;
62  float getPt(const GlobalPoint& position, const float& hitEnergy, const float& vertex_z = 0.) const;
63 
64  // 4-vector helper functions using DetId
65  float getTCEta(const DetId& id, const float& vertex_z = 0.) const;
66  float getTCPhi(const DetId& id) const;
67  float getTCPt(const DetId& id, const float& hitEnergy, const float& vertex_z = 0.) const;
68 
69  inline const HGCalTriggerGeometryBase* getTriggerGeometry() const { return geom_; };
70 
71  float getLayerZ(const unsigned& layerWithOffset) const;
72  float getLayerZ(const int& subdet, const unsigned& layer) const;
73 
74  template <typename T>
75  std::vector<T> bxVectorToVector(const BXVector<T>& inputBXVector) {
76  std::vector<T> outputVector;
77  // loop over collection for a given bx and put the objects into a std::vector
78  outputVector.insert(outputVector.end(), inputBXVector.begin(0), inputBXVector.end(0));
79  return outputVector;
80  }
81 
82  DetId simToReco(const DetId&, const HGCalTopology&) const;
83  DetId simToReco(const DetId&, const HcalTopology&) const;
84  unsigned triggerLayer(const unsigned id) const { return geom_->triggerLayer(id); }
85 
86  static constexpr unsigned kScintillatorPseudoThicknessIndex_ = 3;
87 
92  };
93  SubDetectorType getSubDetectorType(const DetId& id) const;
94 
95 private:
97  unsigned eeLayers_;
98  unsigned fhLayers_;
99  unsigned bhLayers_;
100  unsigned noseLayers_;
101  unsigned totalLayers_;
102 
103  int sensorCellThicknessV8(const DetId& id) const;
104 };
105 
106 #endif
HGCalTriggerGeometryBase
Definition: HGCalTriggerGeometryBase.h:19
HGCalTriggerTools::geom_
const HGCalTriggerGeometryBase * geom_
Definition: HGCalTriggerTools.h:96
HGCalTriggerTools::getTCEta
float getTCEta(const DetId &id, const float &vertex_z=0.) const
Definition: HGCalTriggerTools.cc:286
HGCalTriggerTools::eventSetup
void eventSetup(const edm::EventSetup &)
Definition: HGCalTriggerTools.cc:35
BXVector.h
ForwardSubdetector
ForwardSubdetector
Definition: ForwardSubdetector.h:4
edm
HLT enums.
Definition: AlignableModifier.h:19
HcalTopology
Definition: HcalTopology.h:26
HGCalTriggerTools::isHad
bool isHad(const DetId &id) const
Definition: HGCalTriggerTools.h:44
HGCalTriggerTools::thicknessIndex
int thicknessIndex(const DetId &, bool tc=false) const
Definition: HGCalTriggerTools.cc:233
HGCalTriggerTools::isScintillator
bool isScintillator(const DetId &id) const
Definition: HGCalTriggerTools.h:46
HGCalTriggerTools::isSilicon
bool isSilicon(const DetId &) const
Definition: HGCalTriggerTools.cc:181
HcalGeometry.h
ForwardSubdetector.h
BXVector
Definition: BXVector.h:15
DetId
Definition: DetId.h:17
HGCalTriggerTools::noseLayers_
unsigned noseLayers_
Definition: HGCalTriggerTools.h:100
HGCalTriggerGeometryBase::triggerLayer
virtual unsigned triggerLayer(const unsigned id) const =0
HGCalTriggerTools::getTriggerGeometry
const HGCalTriggerGeometryBase * getTriggerGeometry() const
Definition: HGCalTriggerTools.h:69
HGCalTriggerGeometryBase.h
HGCalTriggerTools::getTCPhi
float getTCPhi(const DetId &id) const
Definition: HGCalTriggerTools.cc:296
HGCalTriggerTools::lastLayerBH
unsigned lastLayerBH() const
Definition: HGCalTriggerTools.h:56
HGCalTriggerTools::hgcal_silicon_CEE
Definition: HGCalTriggerTools.h:89
HGCalTriggerTools::getTCPt
float getTCPt(const DetId &id, const float &hitEnergy, const float &vertex_z=0.) const
Definition: HGCalTriggerTools.cc:307
Event
HGCalTriggerTools::layerWithOffset
unsigned layerWithOffset(const DetId &) const
Definition: HGCalTriggerTools.cc:134
HGCalTriggerTools::hgcal_silicon_CEH
Definition: HGCalTriggerTools.h:90
HGCalTriggerTools::zside
int zside(const DetId &) const
Definition: HGCalTriggerTools.cc:210
Point3DBase< float, GlobalTag >
BXVector::begin
const_iterator begin(int bx) const
HGCalTriggerTools::lastLayerFH
unsigned lastLayerFH() const
Definition: HGCalTriggerTools.h:55
HGCalTriggerTools::getTCPosition
GlobalPoint getTCPosition(const DetId &id) const
Definition: HGCalTriggerTools.cc:54
HGCalTriggerTools::isNose
bool isNose(const DetId &) const
Definition: HGCalTriggerTools.cc:170
HGCalTriggerTools::getSubDetectorType
SubDetectorType getSubDetectorType(const DetId &id) const
Definition: HGCalTriggerTools.cc:198
HGCalTriggerTools::isEm
bool isEm(const DetId &) const
Definition: HGCalTriggerTools.cc:151
HGCalTriggerTools::getEta
float getEta(const GlobalPoint &position, const float &vertex_z=0.) const
Definition: HGCalTriggerTools.cc:281
HGCalTriggerTools::bhLayers_
unsigned bhLayers_
Definition: HGCalTriggerTools.h:99
HGCalTriggerTools::sensorCellThicknessV8
int sensorCellThicknessV8(const DetId &id) const
Definition: HGCalTriggerTools.cc:379
BXVector::end
const_iterator end(int bx) const
HGCalGeometry.h
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
HGCalTriggerTools::layer
unsigned layer(const DetId &) const
Definition: HGCalTriggerTools.cc:111
HGCalTriggerTools::~HGCalTriggerTools
~HGCalTriggerTools()
Definition: HGCalTriggerTools.h:35
HGCalTriggerTools::getPhi
float getPhi(const GlobalPoint &position) const
Definition: HGCalTriggerTools.cc:291
DetId::Detector
Detector
Definition: DetId.h:24
HGCalTriggerTools::totalLayers_
unsigned totalLayers_
Definition: HGCalTriggerTools.h:101
edm::EventSetup
Definition: EventSetup.h:57
HGCalTriggerTools::layers
unsigned layers(ForwardSubdetector type) const
Definition: HGCalTriggerTools.cc:65
HGCalTriggerTools::simToReco
DetId simToReco(const DetId &, const HGCalTopology &) const
Definition: HGCalTriggerTools.cc:346
HGCalTopology
Definition: HGCalTopology.h:12
HGCalTriggerTools::triggerLayer
unsigned triggerLayer(const unsigned id) const
Definition: HGCalTriggerTools.h:84
HGCalTriggerTools::eeLayers_
unsigned eeLayers_
Definition: HGCalTriggerTools.h:97
HGCalTriggerTools::bxVectorToVector
std::vector< T > bxVectorToVector(const BXVector< T > &inputBXVector)
Definition: HGCalTriggerTools.h:75
DetId.h
HGCalTriggerTools::SubDetectorType
SubDetectorType
Definition: HGCalTriggerTools.h:88
HGCalTriggerTools::HGCalTriggerTools
HGCalTriggerTools()
Definition: HGCalTriggerTools.h:34
HGCalTriggerTools::fhLayers_
unsigned fhLayers_
Definition: HGCalTriggerTools.h:98
HGCalTriggerTools::kScintillatorPseudoThicknessIndex_
static constexpr unsigned kScintillatorPseudoThicknessIndex_
Definition: HGCalTriggerTools.h:86
HGCalTriggerTools::getPt
float getPt(const GlobalPoint &position, const float &hitEnergy, const float &vertex_z=0.) const
Definition: HGCalTriggerTools.cc:301
HGCalTriggerTools
Definition: HGCalTriggerTools.h:32
EventSetup
HGCalTriggerTools::lastLayerNose
unsigned lastLayerNose() const
Definition: HGCalTriggerTools.h:57
HGCalTriggerTools::lastLayerEE
unsigned lastLayerEE() const
Definition: HGCalTriggerTools.h:54
HGCalTriggerTools::getLayerZ
float getLayerZ(const unsigned &layerWithOffset) const
Definition: HGCalTriggerTools.cc:312
GlobalPoint.h
HGCalTriggerTools::hgcal_scintillator
Definition: HGCalTriggerTools.h:91