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) {
24  }
25 
26 private:
31  };
32 
34  static constexpr int kHighDensityThickness_ = 0;
35  static constexpr int kOddNumberMask_ = 1;
36 
39  std::vector<unsigned> coarsenTriggerCells_;
42 
43  //Parameters for energyDivisionType_ = oneBitFraction
47 
48  //Parameters for energyDivisionType_ = equalShare
49  static constexpr int kTriggerCellsForDivision_ = 4;
50 
53 
55  private:
57  int sumHwPt_;
58  uint32_t maxId_, stcId_;
59  std::map<uint32_t, float> tc_pts_;
60 
61  public:
63 
64  void add(const l1t::HGCalTriggerCell& c, uint32_t stcId) {
65  sumPt_ += c.pt();
66  sumMipPt_ += c.mipPt();
67  sumHwPt_ += c.hwPt();
68  if (maxId_ == 0 || c.mipPt() > maxMipPt_) {
69  maxMipPt_ = c.mipPt();
70  maxId_ = c.detId();
71  }
72 
73  if (stcId_ == 0) {
74  stcId_ = stcId;
75  }
76  tc_pts_[c.detId()] = c.mipPt();
77  }
78  void addToFractionSum(float frac) {
79  fracsum_ += frac;
80  if (fracsum_ > 1) {
81  throw cms::Exception("HGCalConcentratorSuperTriggerCellError")
82  << "Sum of Trigger Cell fractions should not be greater than 1";
83  }
84  }
85  uint32_t getMaxId() const { return maxId_; }
86  uint32_t getSTCId() const { return stcId_; }
87  float getSumMipPt() const { return sumMipPt_; }
88  int getSumHwPt() const { return sumHwPt_; }
89  float getSumPt() const { return sumPt_; }
90  float getFractionSum() const { return fracsum_; }
91  float getTCpt(uint32_t tcid) const {
92  const auto pt = tc_pts_.find(tcid);
93  return (pt == tc_pts_.end() ? 0 : pt->second);
94  }
95  int size() const { return tc_pts_.size(); }
96  };
97  void createAllTriggerCells(std::unordered_map<unsigned, SuperTriggerCell>& STCs,
98  std::vector<l1t::HGCalTriggerCell>& trigCellVecOutput) const;
99  void assignSuperTriggerCellEnergyAndPosition(l1t::HGCalTriggerCell& c, const SuperTriggerCell& stc) const;
100  float getTriggerCellOneBitFraction(float tcPt, float sumPt) const;
101  uint32_t getCompressedSTCEnergy(const SuperTriggerCell& stc) const;
102 };
103 
104 #endif
HGCalConcentratorSuperTriggerCellImpl::superTriggerCell
Definition: HGCalConcentratorSuperTriggerCellImpl.h:28
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getSumHwPt
int getSumHwPt() const
Definition: HGCalConcentratorSuperTriggerCellImpl.h:88
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:44
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::size
int size() const
Definition: HGCalConcentratorSuperTriggerCellImpl.h:95
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
HGCalConcentratorSuperTriggerCellImpl::kTriggerCellsForDivision_
static constexpr int kTriggerCellsForDivision_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:49
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::fracsum_
float fracsum_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:56
cropTnPTrees.frac
frac
Definition: cropTnPTrees.py:18
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getSumMipPt
float getSumMipPt() const
Definition: HGCalConcentratorSuperTriggerCellImpl.h:87
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::stcId_
uint32_t stcId_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:58
HGCalCoarseTriggerCellMapping::eventSetup
void eventSetup(const edm::EventSetup &es)
Definition: HGCalCoarseTriggerCellMapping.h:17
HGCalConcentratorSuperTriggerCellImpl::createAllTriggerCells
void createAllTriggerCells(std::unordered_map< unsigned, SuperTriggerCell > &STCs, std::vector< l1t::HGCalTriggerCell > &trigCellVecOutput) const
Definition: HGCalConcentratorSuperTriggerCellImpl.cc:36
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell
Definition: HGCalConcentratorSuperTriggerCellImpl.h:54
TtFullHadEvtBuilder_cfi.sumPt
sumPt
Definition: TtFullHadEvtBuilder_cfi.py:38
HGCalTriggerCellCalibration::eventSetup
void eventSetup(const edm::EventSetup &es)
Definition: HGCalTriggerCellCalibration.h:18
HGCalConcentratorSuperTriggerCellImpl::fixedDataSizePerHGCROC_
bool fixedDataSizePerHGCROC_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:38
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getTCpt
float getTCpt(uint32_t tcid) const
Definition: HGCalConcentratorSuperTriggerCellImpl.h:91
HGCalVFECompressionImpl
Definition: HGCalVFECompressionImpl.h:7
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::add
void add(const l1t::HGCalTriggerCell &c, uint32_t stcId)
Definition: HGCalConcentratorSuperTriggerCellImpl.h:64
HGCalTriggerCellCalibration.h
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::sumHwPt_
int sumHwPt_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:57
HGCalConcentratorSuperTriggerCellImpl::EnergyDivisionType
EnergyDivisionType
Definition: HGCalConcentratorSuperTriggerCellImpl.h:27
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::maxMipPt_
float maxMipPt_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:56
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getSTCId
uint32_t getSTCId() const
Definition: HGCalConcentratorSuperTriggerCellImpl.h:86
l1t::HGCalTriggerCell
Definition: HGCalTriggerCell.h:14
HGCalConcentratorSuperTriggerCellImpl::oneBitFractionLowValue_
double oneBitFractionLowValue_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:45
HGCalConcentratorSuperTriggerCellImpl::calibration_
HGCalTriggerCellCalibration calibration_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:51
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:59
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getFractionSum
float getFractionSum() const
Definition: HGCalConcentratorSuperTriggerCellImpl.h:90
edm::ParameterSet
Definition: ParameterSet.h:36
HGCalConcentratorSuperTriggerCellImpl::select
void select(const std::vector< l1t::HGCalTriggerCell > &trigCellVecInput, std::vector< l1t::HGCalTriggerCell > &trigCellVecOutput)
Definition: HGCalConcentratorSuperTriggerCellImpl.cc:162
HGCalConcentratorSuperTriggerCellImpl::getCompressedSTCEnergy
uint32_t getCompressedSTCEnergy(const SuperTriggerCell &stc) const
Definition: HGCalConcentratorSuperTriggerCellImpl.cc:29
HGCalConcentratorSuperTriggerCellImpl::triggerTools_
HGCalTriggerTools triggerTools_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:37
HGCalCoarseTriggerCellMapping
Definition: HGCalCoarseTriggerCellMapping.h:9
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::SuperTriggerCell
SuperTriggerCell()
Definition: HGCalConcentratorSuperTriggerCellImpl.h:62
edm::EventSetup
Definition: EventSetup.h:57
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
HGCalConcentratorSuperTriggerCellImpl::coarseTCmapping_
HGCalCoarseTriggerCellMapping coarseTCmapping_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:40
HGCalVFECompressionImpl.h
HGCalConcentratorSuperTriggerCellImpl::assignSuperTriggerCellEnergyAndPosition
void assignSuperTriggerCellEnergyAndPosition(l1t::HGCalTriggerCell &c, const SuperTriggerCell &stc) const
Definition: HGCalConcentratorSuperTriggerCellImpl.cc:93
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::maxId_
uint32_t maxId_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:58
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getMaxId
uint32_t getMaxId() const
Definition: HGCalConcentratorSuperTriggerCellImpl.h:85
HGCalConcentratorSuperTriggerCellImpl
Definition: HGCalConcentratorSuperTriggerCellImpl.h:13
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getSumPt
float getSumPt() const
Definition: HGCalConcentratorSuperTriggerCellImpl.h:89
HGCalConcentratorSuperTriggerCellImpl::oneBitFraction
Definition: HGCalConcentratorSuperTriggerCellImpl.h:29
HGCalCoarseTriggerCellMapping.h
HGCalConcentratorSuperTriggerCellImpl::oneBitFractionHighValue_
double oneBitFractionHighValue_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:46
HGCalConcentratorSuperTriggerCellImpl::getTriggerCellOneBitFraction
float getTriggerCellOneBitFraction(float tcPt, float sumPt) const
Definition: HGCalConcentratorSuperTriggerCellImpl.cc:150
Exception
Definition: hltDiff.cc:246
HGCalConcentratorSuperTriggerCellImpl::kOddNumberMask_
static constexpr int kOddNumberMask_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:35
HGCalConcentratorSuperTriggerCellImpl::energyDivisionType_
EnergyDivisionType energyDivisionType_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:33
HGCalTriggerTools
Definition: HGCalTriggerTools.h:32
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::sumMipPt_
float sumMipPt_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:56
HGCalConcentratorSuperTriggerCellImpl::kHighDensityThickness_
static constexpr int kHighDensityThickness_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:34
ParameterSet.h
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::sumPt_
float sumPt_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:56
HGCalTriggerCellCalibration
Definition: HGCalTriggerCellCalibration.h:15
HGCalConcentratorSuperTriggerCellImpl::equalShare
Definition: HGCalConcentratorSuperTriggerCellImpl.h:30
HGCalConcentratorSuperTriggerCellImpl::superTCmapping_
HGCalCoarseTriggerCellMapping superTCmapping_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:41
HGCalConcentratorSuperTriggerCellImpl::vfeCompression_
HGCalVFECompressionImpl vfeCompression_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:52
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::addToFractionSum
void addToFractionSum(float frac)
Definition: HGCalConcentratorSuperTriggerCellImpl.h:78
HGCalConcentratorSuperTriggerCellImpl::coarsenTriggerCells_
std::vector< unsigned > coarsenTriggerCells_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:39