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 
16 #include <array>
17 #include <cmath>
18 #include <vector>
20 
23 
25 class DetId;
26 
27 
28 namespace edm {
29  class Event;
30  class EventSetup;
31 }
32 
34  public:
36  eeLayers_(0), fhLayers_(0), bhLayers_(0), totalLayers_(0){}
38 
39  void eventSetup(const edm::EventSetup&);
40  GlobalPoint getTCPosition(const DetId& id) const;
41  unsigned layers(ForwardSubdetector type) const;
42  unsigned layer(const DetId&) const;
43  unsigned layerWithOffset(const DetId&) const;
44 
45  unsigned lastLayerEE() const {return eeLayers_;}
46  unsigned lastLayerFH() const {return eeLayers_+fhLayers_;}
47  unsigned lastLayerBH() const {return totalLayers_;}
48 
49  // 4-vector helper functions using GlobalPoint
50  float getEta(const GlobalPoint& position, const float& vertex_z = 0.) const;
51  float getPhi(const GlobalPoint& position) const;
52  float getPt(const GlobalPoint& position, const float& hitEnergy, const float& vertex_z = 0.) const;
53 
54  // 4-vector helper functions using DetId
55  float getTCEta(const DetId& id, const float& vertex_z = 0.) const;
56  float getTCPhi(const DetId& id) const;
57  float getTCPt(const DetId& id, const float& hitEnergy, const float& vertex_z = 0.) const;
58 
59  inline const HGCalTriggerGeometryBase * getTriggerGeometry() const {return geom_;};
60 
61  float getLayerZ(const unsigned& layerWithOffset) const;
62  float getLayerZ(const int& subdet, const unsigned& layer) const;
63 
64  template<typename T>
65  std::vector<T> bxVectorToVector(const BXVector<T>& inputBXVector){
66  std::vector<T> outputVector;
67  //loop over collection for a given bx and put the objects into a std::vector
68  outputVector.insert(outputVector.end(), inputBXVector.begin(0), inputBXVector.end(0));
69  return outputVector;
70  }
71 
72  private:
74  unsigned eeLayers_;
75  unsigned fhLayers_;
76  unsigned bhLayers_;
77  unsigned totalLayers_;
78 };
79 
80 
81 #endif
const_iterator end(int bx) const
type
Definition: HCALResponse.h:21
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
unsigned lastLayerEE() const
const HGCalTriggerGeometryBase * geom_
const HGCalTriggerGeometryBase * getTriggerGeometry() const
#define nullptr
ForwardSubdetector
unsigned lastLayerBH() const
Definition: DetId.h:18
HLT enums.
static int position[264][3]
Definition: ReadPGInfo.cc:509
std::vector< T > bxVectorToVector(const BXVector< T > &inputBXVector)
const_iterator begin(int bx) const
unsigned lastLayerFH() const