CMS 3D CMS Logo

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);
19  void eventSetup(const edm::EventSetup& es) {
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
HGCalConcentratorSuperTriggerCellImpl::superTriggerCell
Definition: HGCalConcentratorSuperTriggerCellImpl.h:31
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getSumHwPt
int getSumHwPt() const
Definition: HGCalConcentratorSuperTriggerCellImpl.h:94
HGCalTriggerTools.h
HGCalTriggerTools::eventSetup
void eventSetup(const edm::EventSetup &)
Definition: HGCalTriggerTools.cc:35
HGCalConcentratorSuperTriggerCellImpl::eventSetup
void eventSetup(const edm::EventSetup &es)
Definition: HGCalConcentratorSuperTriggerCellImpl.h:19
HGCalConcentratorSuperTriggerCellImpl::oneBitFractionThreshold_
double oneBitFractionThreshold_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:47
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::size
int size() const
Definition: HGCalConcentratorSuperTriggerCellImpl.h:101
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
HGCalConcentratorSuperTriggerCellImpl::kTriggerCellsForDivision_
static constexpr int kTriggerCellsForDivision_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:52
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::fracsum_
float fracsum_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:62
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getSumMipPt
float getSumMipPt() const
Definition: HGCalConcentratorSuperTriggerCellImpl.h:93
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::stcId_
uint32_t stcId_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:64
HGCalCoarseTriggerCellMapping::eventSetup
void eventSetup(const edm::EventSetup &es)
Definition: HGCalCoarseTriggerCellMapping.h:17
HGCalConcentratorSuperTriggerCellImpl::calibrationHEsi_
HGCalTriggerCellCalibration calibrationHEsi_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:55
HGCalConcentratorSuperTriggerCellImpl::createAllTriggerCells
void createAllTriggerCells(std::unordered_map< unsigned, SuperTriggerCell > &STCs, std::vector< l1t::HGCalTriggerCell > &trigCellVecOutput) const
Definition: HGCalConcentratorSuperTriggerCellImpl.cc:39
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell
Definition: HGCalConcentratorSuperTriggerCellImpl.h:60
HGCalConcentratorSuperTriggerCellImpl::calibrationEE_
HGCalTriggerCellCalibration calibrationEE_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:54
TtFullHadEvtBuilder_cfi.sumPt
sumPt
Definition: TtFullHadEvtBuilder_cfi.py:38
HGCalTriggerCellCalibration::eventSetup
void eventSetup(const edm::EventSetup &es)
Definition: HGCalTriggerCellCalibration.h:12
HGCalConcentratorSuperTriggerCellImpl::fixedDataSizePerHGCROC_
bool fixedDataSizePerHGCROC_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:41
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getTCpt
float getTCpt(uint32_t tcid) const
Definition: HGCalConcentratorSuperTriggerCellImpl.h:97
HGCalConcentratorSuperTriggerCellImpl::calibrationNose_
HGCalTriggerCellCalibration calibrationNose_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:57
HGCalVFECompressionImpl
Definition: HGCalVFECompressionImpl.h:9
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::add
void add(const l1t::HGCalTriggerCell &c, uint32_t stcId)
Definition: HGCalConcentratorSuperTriggerCellImpl.h:70
HGCalTriggerCellCalibration.h
DivergingColor.frac
float frac
Definition: DivergingColor.py:175
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::sumHwPt_
int sumHwPt_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:63
HGCalConcentratorSuperTriggerCellImpl::EnergyDivisionType
EnergyDivisionType
Definition: HGCalConcentratorSuperTriggerCellImpl.h:30
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::maxMipPt_
float maxMipPt_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:62
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getSTCId
uint32_t getSTCId() const
Definition: HGCalConcentratorSuperTriggerCellImpl.h:92
l1t::HGCalTriggerCell
Definition: HGCalTriggerCell.h:14
HGCalConcentratorSuperTriggerCellImpl::oneBitFractionLowValue_
double oneBitFractionLowValue_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:48
HGCalConcentratorSuperTriggerCellImpl::HGCalConcentratorSuperTriggerCellImpl
HGCalConcentratorSuperTriggerCellImpl(const edm::ParameterSet &conf)
Definition: HGCalConcentratorSuperTriggerCellImpl.cc:3
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::tc_pts_
std::map< uint32_t, float > tc_pts_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:65
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getFractionSum
float getFractionSum() const
Definition: HGCalConcentratorSuperTriggerCellImpl.h:96
edm::ParameterSet
Definition: ParameterSet.h:47
HGCalConcentratorSuperTriggerCellImpl::select
void select(const std::vector< l1t::HGCalTriggerCell > &trigCellVecInput, std::vector< l1t::HGCalTriggerCell > &trigCellVecOutput)
Definition: HGCalConcentratorSuperTriggerCellImpl.cc:178
HGCalConcentratorSuperTriggerCellImpl::getCompressedSTCEnergy
uint32_t getCompressedSTCEnergy(const SuperTriggerCell &stc) const
Definition: HGCalConcentratorSuperTriggerCellImpl.cc:32
HGCalConcentratorSuperTriggerCellImpl::triggerTools_
HGCalTriggerTools triggerTools_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:40
HGCalCoarseTriggerCellMapping
Definition: HGCalCoarseTriggerCellMapping.h:9
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::SuperTriggerCell
SuperTriggerCell()
Definition: HGCalConcentratorSuperTriggerCellImpl.h:68
edm::EventSetup
Definition: EventSetup.h:58
HGCalConcentratorSuperTriggerCellImpl::coarseTCmapping_
HGCalCoarseTriggerCellMapping coarseTCmapping_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:43
HGCalVFECompressionImpl.h
HGCalConcentratorSuperTriggerCellImpl::assignSuperTriggerCellEnergyAndPosition
void assignSuperTriggerCellEnergyAndPosition(l1t::HGCalTriggerCell &c, const SuperTriggerCell &stc) const
Definition: HGCalConcentratorSuperTriggerCellImpl.cc:96
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::maxId_
uint32_t maxId_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:64
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getMaxId
uint32_t getMaxId() const
Definition: HGCalConcentratorSuperTriggerCellImpl.h:91
HGCalConcentratorSuperTriggerCellImpl
Definition: HGCalConcentratorSuperTriggerCellImpl.h:13
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getSumPt
float getSumPt() const
Definition: HGCalConcentratorSuperTriggerCellImpl.h:95
HGCalConcentratorSuperTriggerCellImpl::oneBitFraction
Definition: HGCalConcentratorSuperTriggerCellImpl.h:32
HGCalCoarseTriggerCellMapping.h
HGCalConcentratorSuperTriggerCellImpl::oneBitFractionHighValue_
double oneBitFractionHighValue_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:49
HGCalConcentratorSuperTriggerCellImpl::getTriggerCellOneBitFraction
float getTriggerCellOneBitFraction(float tcPt, float sumPt) const
Definition: HGCalConcentratorSuperTriggerCellImpl.cc:166
Exception
Definition: hltDiff.cc:245
HGCalConcentratorSuperTriggerCellImpl::kOddNumberMask_
static constexpr int kOddNumberMask_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:38
HGCalConcentratorSuperTriggerCellImpl::energyDivisionType_
EnergyDivisionType energyDivisionType_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:36
HGCalTriggerTools
Definition: HGCalTriggerTools.h:32
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::sumMipPt_
float sumMipPt_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:62
HGCalConcentratorSuperTriggerCellImpl::kHighDensityThickness_
static constexpr int kHighDensityThickness_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:37
ParameterSet.h
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::sumPt_
float sumPt_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:62
HGCalTriggerCellCalibration
Definition: HGCalTriggerCellCalibration.h:9
HGCalConcentratorSuperTriggerCellImpl::equalShare
Definition: HGCalConcentratorSuperTriggerCellImpl.h:33
HGCalConcentratorSuperTriggerCellImpl::superTCmapping_
HGCalCoarseTriggerCellMapping superTCmapping_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:44
HGCalConcentratorSuperTriggerCellImpl::calibrationHEsc_
HGCalTriggerCellCalibration calibrationHEsc_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:56
HGCalConcentratorSuperTriggerCellImpl::vfeCompression_
HGCalVFECompressionImpl vfeCompression_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:58
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::addToFractionSum
void addToFractionSum(float frac)
Definition: HGCalConcentratorSuperTriggerCellImpl.h:84
HGCalConcentratorSuperTriggerCellImpl::coarsenTriggerCells_
std::vector< unsigned > coarsenTriggerCells_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:42