CMS 3D CMS Logo

HGCalTriggerTowerGeometryHelper.h
Go to the documentation of this file.
1 #ifndef __L1Trigger_L1THGCal_HGCalTriggerTowerGeometryHelper_h__
2 #define __L1Trigger_L1THGCal_HGCalTriggerTowerGeometryHelper_h__
3 
19 
20 #include <vector>
21 #include <unordered_map>
22 
23 namespace l1t {
24  class HGCalTowerID;
25  struct HGCalTowerCoord;
26 } // namespace l1t
27 
29 public:
31 
33 
35 
36  unsigned packLayerSubdetWaferId(int subdet, int layer, int moduleU, int moduleV) const;
37  unsigned packTowerIDandShare(int towerEta, int towerPhi, int towerShare) const;
38  void unpackTowerIDandShare(unsigned towerIDandShare, int& towerEta_raw, int& towerPhi_raw, int& towerShare) const;
39  int moveToCorrectSector(int towerPhi_raw, int sector) const;
40  void reverseXaxis(int& towerPhi) const;
41 
42  const std::vector<l1t::HGCalTowerCoord>& getTowerCoordinates() const;
43 
44  unsigned short getTriggerTowerFromEtaPhi(const float& eta, const float& phi) const;
45  std::unordered_map<unsigned short, float> getTriggerTower(const l1t::HGCalTriggerCell&) const;
46  std::unordered_map<unsigned short, float> getTriggerTower(const l1t::HGCalTriggerSums&) const;
47 
48  const bool isNose() { return doNose_; }
49 
50 private:
51  static const int towerShareMask = 0x7F;
52  static const int towerShareShift = 14;
53  static const int signMask = 0x1;
54  static const int sign1Shift = 21;
55  static const int sign2Shift = 22;
56  std::vector<l1t::HGCalTowerCoord> tower_coords_;
57  std::unordered_map<unsigned, short> cells_to_trigger_towers_;
58  std::unordered_map<unsigned, std::vector<unsigned>> modules_to_trigger_towers_;
59 
60  bool doNose_;
61  double minEta_;
62  double maxEta_;
63  double minPhi_;
64  double maxPhi_;
65  unsigned int nBinsEta_;
66  unsigned int nBinsPhi_;
67 
68  std::vector<double> binsEta_;
69  std::vector<double> binsPhi_;
70 
76  int reverseX_;
77 
79 };
80 
81 #endif
void setGeometry(const HGCalTriggerGeometryBase *const geom)
const std::vector< l1t::HGCalTowerCoord > & getTowerCoordinates() const
delete x;
Definition: CaloConfig.h:22
std::unordered_map< unsigned, std::vector< unsigned > > modules_to_trigger_towers_
void setGeometry(const HGCalTriggerGeometryBase *const)
std::vector< l1t::HGCalTowerCoord > tower_coords_
unsigned packTowerIDandShare(int towerEta, int towerPhi, int towerShare) const
std::unordered_map< unsigned short, float > getTriggerTower(const l1t::HGCalTriggerCell &) const
int moveToCorrectSector(int towerPhi_raw, int sector) const
std::unordered_map< unsigned, short > cells_to_trigger_towers_
HGCalTriggerTowerGeometryHelper(const edm::ParameterSet &conf)
unsigned packLayerSubdetWaferId(int subdet, int layer, int moduleU, int moduleV) const
void unpackTowerIDandShare(unsigned towerIDandShare, int &towerEta_raw, int &towerPhi_raw, int &towerShare) const
unsigned short getTriggerTowerFromEtaPhi(const float &eta, const float &phi) const