CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HGCalConcentratorSuperTriggerCellImpl.h
Go to the documentation of this file.
1 #ifndef __L1Trigger_L1THGCal_HGCalConcentratorSuperTriggerCellImpl_h__
2 #define __L1Trigger_L1THGCal_HGCalConcentratorSuperTriggerCellImpl_h__
3 
9 
10 #include <array>
11 #include <vector>
12 
14 public:
16 
17  void select(const std::vector<l1t::HGCalTriggerCell>& trigCellVecInput,
18  std::vector<l1t::HGCalTriggerCell>& trigCellVecOutput);
27  }
28 
29 private:
34  };
35 
37  static constexpr int kHighDensityThickness_ = 0;
38  static constexpr int kOddNumberMask_ = 1;
39 
42  std::vector<unsigned> coarsenTriggerCells_;
45 
46  //Parameters for energyDivisionType_ = oneBitFraction
50 
51  //Parameters for energyDivisionType_ = equalShare
52  static constexpr int kTriggerCellsForDivision_ = 4;
53 
59 
61  private:
63  int sumHwPt_;
64  uint32_t maxId_, stcId_;
65  std::map<uint32_t, float> tc_pts_;
66 
67  public:
69 
70  void add(const l1t::HGCalTriggerCell& c, uint32_t stcId) {
71  sumPt_ += c.pt();
72  sumMipPt_ += c.mipPt();
73  sumHwPt_ += c.hwPt();
74  if (maxId_ == 0 || c.mipPt() > maxMipPt_) {
75  maxMipPt_ = c.mipPt();
76  maxId_ = c.detId();
77  }
78 
79  if (stcId_ == 0) {
80  stcId_ = stcId;
81  }
82  tc_pts_[c.detId()] = c.mipPt();
83  }
84  void addToFractionSum(float frac) {
85  fracsum_ += frac;
86  if (fracsum_ > 1) {
87  throw cms::Exception("HGCalConcentratorSuperTriggerCellError")
88  << "Sum of Trigger Cell fractions should not be greater than 1";
89  }
90  }
91  uint32_t getMaxId() const { return maxId_; }
92  uint32_t getSTCId() const { return stcId_; }
93  float getSumMipPt() const { return sumMipPt_; }
94  int getSumHwPt() const { return sumHwPt_; }
95  float getSumPt() const { return sumPt_; }
96  float getFractionSum() const { return fracsum_; }
97  float getTCpt(uint32_t tcid) const {
98  const auto pt = tc_pts_.find(tcid);
99  return (pt == tc_pts_.end() ? 0 : pt->second);
100  }
101  int size() const { return tc_pts_.size(); }
102  };
103  void createAllTriggerCells(std::unordered_map<unsigned, SuperTriggerCell>& STCs,
104  std::vector<l1t::HGCalTriggerCell>& trigCellVecOutput) const;
105  void assignSuperTriggerCellEnergyAndPosition(l1t::HGCalTriggerCell& c, const SuperTriggerCell& stc) const;
106  float getTriggerCellOneBitFraction(float tcPt, float sumPt) const;
107  uint32_t getCompressedSTCEnergy(const SuperTriggerCell& stc) const;
108 };
109 
110 #endif
void add(const l1t::HGCalTriggerCell &c, uint32_t stcId)
void setGeometry(const HGCalTriggerGeometryBase *const geom)
const edm::EventSetup & c
float getTriggerCellOneBitFraction(float tcPt, float sumPt) const
double pt() const final
transverse momentum
void select(const std::vector< l1t::HGCalTriggerCell > &trigCellVecInput, std::vector< l1t::HGCalTriggerCell > &trigCellVecOutput)
double mipPt() const
void setGeometry(const HGCalTriggerGeometryBase *const)
HGCalConcentratorSuperTriggerCellImpl(const edm::ParameterSet &conf)
uint32_t detId() const
int hwPt() const
Definition: L1Candidate.h:35
void setGeometry(const HGCalTriggerGeometryBase *const geom)
uint32_t getCompressedSTCEnergy(const SuperTriggerCell &stc) const
void createAllTriggerCells(std::unordered_map< unsigned, SuperTriggerCell > &STCs, std::vector< l1t::HGCalTriggerCell > &trigCellVecOutput) const
void setGeometry(const HGCalTriggerGeometryBase *const geom)
void assignSuperTriggerCellEnergyAndPosition(l1t::HGCalTriggerCell &c, const SuperTriggerCell &stc) const