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(bool nose = false) const { return (nose ? HFNoseDetId::HFNoseLayerEEmax : eeLayers_); }
55  unsigned lastLayerFH() const { return eeLayers_ + fhLayers_; }
56  unsigned lastLayerBH() const { return totalLayers_; }
57  unsigned lastLayerNose() const { return noseLayers_; }
58  unsigned lastLayer(bool nose = false) const { return nose ? noseLayers_ : totalLayers_; }
59 
60  // 4-vector helper functions using GlobalPoint
61  float getEta(const GlobalPoint& position, const float& vertex_z = 0.) const;
62  float getPhi(const GlobalPoint& position) const;
63  float getPt(const GlobalPoint& position, const float& hitEnergy, const float& vertex_z = 0.) const;
64 
65  // 4-vector helper functions using DetId
66  float getTCEta(const DetId& id, const float& vertex_z = 0.) const;
67  float getTCPhi(const DetId& id) const;
68  float getTCPt(const DetId& id, const float& hitEnergy, const float& vertex_z = 0.) const;
69 
70  inline const HGCalTriggerGeometryBase* getTriggerGeometry() const { return geom_; };
71 
72  float getLayerZ(const unsigned& layerWithOffset) const;
73  float getLayerZ(const int& subdet, const unsigned& layer) const;
74 
75  template <typename T>
76  std::vector<T> bxVectorToVector(const BXVector<T>& inputBXVector) {
77  std::vector<T> outputVector;
78  // loop over collection for a given bx and put the objects into a std::vector
79  outputVector.insert(outputVector.end(), inputBXVector.begin(0), inputBXVector.end(0));
80  return outputVector;
81  }
82 
83  DetId simToReco(const DetId&, const HGCalTopology&) const;
84  DetId simToReco(const DetId&, const HcalTopology&) const;
85  unsigned triggerLayer(const unsigned id) const { return geom_->triggerLayer(id); }
86 
87  static constexpr unsigned kScintillatorPseudoThicknessIndex_ = 3;
88 
93  };
94  SubDetectorType getSubDetectorType(const DetId& id) const;
95 
96 private:
98  unsigned eeLayers_;
99  unsigned fhLayers_;
100  unsigned bhLayers_;
101  unsigned noseLayers_;
102  unsigned totalLayers_;
103 
104  int sensorCellThicknessV8(const DetId& id) const;
105 };
106 
107 #endif
HGCalTriggerGeometryBase
Definition: HGCalTriggerGeometryBase.h:19
HGCalTriggerTools::geom_
const HGCalTriggerGeometryBase * geom_
Definition: HGCalTriggerTools.h:97
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:101
HGCalTriggerGeometryBase::triggerLayer
virtual unsigned triggerLayer(const unsigned id) const =0
HGCalTriggerTools::getTriggerGeometry
const HGCalTriggerGeometryBase * getTriggerGeometry() const
Definition: HGCalTriggerTools.h:70
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:90
HGCalTriggerTools::getTCPt
float getTCPt(const DetId &id, const float &hitEnergy, const float &vertex_z=0.) const
Definition: HGCalTriggerTools.cc:307
Event
HGCalTriggerTools::lastLayer
unsigned lastLayer(bool nose=false) const
Definition: HGCalTriggerTools.h:58
HGCalTriggerTools::layerWithOffset
unsigned layerWithOffset(const DetId &) const
Definition: HGCalTriggerTools.cc:134
HGCalTriggerTools::hgcal_silicon_CEH
Definition: HGCalTriggerTools.h:91
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:100
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:39
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:102
edm::EventSetup
Definition: EventSetup.h:58
HGCalTriggerTools::layers
unsigned layers(ForwardSubdetector type) const
Definition: HGCalTriggerTools.cc:65
HGCalTriggerTools::simToReco
DetId simToReco(const DetId &, const HGCalTopology &) const
Definition: HGCalTriggerTools.cc:346
HFNoseDetId::HFNoseLayerEEmax
static const int HFNoseLayerEEmax
Definition: HFNoseDetId.h:29
HGCalTopology
Definition: HGCalTopology.h:12
HGCalTriggerTools::triggerLayer
unsigned triggerLayer(const unsigned id) const
Definition: HGCalTriggerTools.h:85
HGCalTriggerTools::eeLayers_
unsigned eeLayers_
Definition: HGCalTriggerTools.h:98
HGCalTriggerTools::bxVectorToVector
std::vector< T > bxVectorToVector(const BXVector< T > &inputBXVector)
Definition: HGCalTriggerTools.h:76
DetId.h
HGCalTriggerTools::SubDetectorType
SubDetectorType
Definition: HGCalTriggerTools.h:89
HGCalTriggerTools::HGCalTriggerTools
HGCalTriggerTools()
Definition: HGCalTriggerTools.h:34
HGCalTriggerTools::fhLayers_
unsigned fhLayers_
Definition: HGCalTriggerTools.h:99
HGCalTriggerTools::kScintillatorPseudoThicknessIndex_
static constexpr unsigned kScintillatorPseudoThicknessIndex_
Definition: HGCalTriggerTools.h:87
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::getLayerZ
float getLayerZ(const unsigned &layerWithOffset) const
Definition: HGCalTriggerTools.cc:312
GlobalPoint.h
HGCalTriggerTools::lastLayerEE
unsigned lastLayerEE(bool nose=false) const
Definition: HGCalTriggerTools.h:54
HGCalTriggerTools::hgcal_scintillator
Definition: HGCalTriggerTools.h:92