CMS 3D CMS Logo

HGCalConcentratorSuperTriggerCellImpl.cc
Go to the documentation of this file.
2 
4  : fixedDataSizePerHGCROC_(conf.getParameter<bool>("fixedDataSizePerHGCROC")),
5  coarsenTriggerCells_(conf.getParameter<std::vector<unsigned>>("coarsenTriggerCells")),
6  coarseTCmapping_(conf.getParameter<std::vector<unsigned>>("ctcSize")),
7  superTCmapping_(conf.getParameter<std::vector<unsigned>>("stcSize")),
8  calibration_(conf.getParameterSet("superTCCalibration")),
9  vfeCompression_(conf.getParameterSet("superTCCompression")) {
10  std::string energyType(conf.getParameter<string>("type_energy_division"));
11 
12  if (energyType == "superTriggerCell") {
14  } else if (energyType == "oneBitFraction") {
16 
17  oneBitFractionThreshold_ = conf.getParameter<double>("oneBitFractionThreshold");
18  oneBitFractionLowValue_ = conf.getParameter<double>("oneBitFractionLowValue");
19  oneBitFractionHighValue_ = conf.getParameter<double>("oneBitFractionHighValue");
20 
21  } else if (energyType == "equalShare") {
23 
24  } else {
26  }
27 }
28 
30  uint32_t code(0);
31  uint32_t compressed_value(0);
32  vfeCompression_.compressSingle(stc.getSumHwPt(), code, compressed_value);
33  return compressed_value;
34 }
35 
37  std::unordered_map<unsigned, SuperTriggerCell>& STCs, std::vector<l1t::HGCalTriggerCell>& trigCellVecOutput) const {
38  for (auto& s : STCs) {
39  std::vector<uint32_t> output_ids = superTCmapping_.getConstituentTriggerCells(s.second.getSTCId());
40  if (output_ids.empty())
41  continue;
42 
44  int thickness = (!output_ids.empty() ? triggerTools_.thicknessIndex(output_ids.at(0), true) : 0);
45 
46  for (const auto& id : output_ids) {
49  continue;
50  }
51 
53  continue;
54  }
55 
56  l1t::HGCalTriggerCell triggerCell;
57  triggerCell.setDetId(id);
58  if (energyDivisionType_ == superTriggerCell && id != s.second.getMaxId()) {
59  continue;
60  }
61 
62  DetId tc_Id(id);
63 
64  //To guard against the case in v8 geometry where
65  //there might be different thicknesses within a module
66  //This is a small effect, but in principle energy might
67  //be lost.
68  if (superTCmapping_.getCoarseTriggerCellId(id) != s.second.getSTCId()) {
70  throw cms::Exception("NonExistingCoarseTC")
71  << "The coarse trigger cell correponsing to the nominal trigger cell does not exist";
72  } else {
73  continue;
74  }
75  }
76  trigCellVecOutput.push_back(triggerCell);
77  if (energyDivisionType_ == oneBitFraction) { //Get the 1 bit fractions
78 
79  if (id != s.second.getMaxId()) {
80  float tc_fraction = getTriggerCellOneBitFraction(s.second.getTCpt(id), s.second.getSumPt());
81  s.second.addToFractionSum(tc_fraction);
82  }
83  }
84  }
85  }
86  // assign energy
87  for (l1t::HGCalTriggerCell& tc : trigCellVecOutput) {
88  const auto& stc = STCs[superTCmapping_.getCoarseTriggerCellId(tc.detId())];
90  }
91 }
92 
94  const SuperTriggerCell& stc) const {
95  //Compress and recalibrate STC energy
96  uint32_t compressed_value = getCompressedSTCEnergy(stc);
97 
99  int thickness = triggerTools_.thicknessIndex(c.detId(), true);
100 
104  } else {
105  point = triggerTools_.getTCPosition(c.detId());
106  }
107  c.setPosition(point);
108 
109  math::PtEtaPhiMLorentzVector p4(c.pt(), point.eta(), point.phi(), 0.);
110  c.setP4(p4);
111 
113  if (c.detId() == stc.getMaxId()) {
114  c.setHwPt(compressed_value);
116  } else {
117  throw cms::Exception("NonMaxIdSuperTriggerCell")
118  << "Trigger Cell with detId not equal to the maximum of the superTriggerCell found";
119  }
120  } else if (energyDivisionType_ == equalShare) {
121  double coarseTriggerCellSize =
122  coarsenTriggerCells_[subdet]
123  ? double(
125  .size())
126  : 1.;
127 
128  double denominator =
130  ? double(kTriggerCellsForDivision_)
131  : double(superTCmapping_.getConstituentTriggerCells(stc.getSTCId()).size()) / coarseTriggerCellSize;
132 
133  c.setHwPt(std::round(compressed_value / denominator));
135 
136  } else if (energyDivisionType_ == oneBitFraction) {
137  double frac = 0;
138 
139  if (c.detId() != stc.getMaxId()) {
140  frac = getTriggerCellOneBitFraction(stc.getTCpt(c.detId()), stc.getSumPt());
141  } else {
142  frac = 1 - stc.getFractionSum();
143  }
144 
145  c.setHwPt(std::round(compressed_value * frac));
147  }
148 }
149 
151  double f = tcPt / sumPt;
152  double frac = 0;
153  if (f < oneBitFractionThreshold_) {
155  } else {
157  }
158 
159  return frac;
160 }
161 
162 void HGCalConcentratorSuperTriggerCellImpl::select(const std::vector<l1t::HGCalTriggerCell>& trigCellVecInput,
163  std::vector<l1t::HGCalTriggerCell>& trigCellVecOutput) {
164  std::unordered_map<unsigned, SuperTriggerCell> STCs;
165  // first pass, fill the "coarse" trigger cells
166  for (const l1t::HGCalTriggerCell& tc : trigCellVecInput) {
167  uint32_t stcid = superTCmapping_.getCoarseTriggerCellId(tc.detId());
168  STCs[stcid].add(tc, stcid);
169  }
170 
171  createAllTriggerCells(STCs, trigCellVecOutput);
172 }
HGCalConcentratorSuperTriggerCellImpl::superTriggerCell
Definition: HGCalConcentratorSuperTriggerCellImpl.h:28
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getSumHwPt
int getSumHwPt() const
Definition: HGCalConcentratorSuperTriggerCellImpl.h:88
electrons_cff.bool
bool
Definition: electrons_cff.py:372
HGCalConcentratorSuperTriggerCellImpl::oneBitFractionThreshold_
double oneBitFractionThreshold_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:44
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
HGCalConcentratorSuperTriggerCellImpl::kTriggerCellsForDivision_
static constexpr int kTriggerCellsForDivision_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:49
cropTnPTrees.frac
frac
Definition: cropTnPTrees.py:18
HGCalTriggerTools::thicknessIndex
int thicknessIndex(const DetId &, bool tc=false) const
Definition: HGCalTriggerTools.cc:233
HGCalCoarseTriggerCellMapping::getConstituentTriggerCells
std::vector< uint32_t > getConstituentTriggerCells(uint32_t ctcId) const
Definition: HGCalCoarseTriggerCellMapping.cc:122
l1t::HGCalTriggerCell::setDetId
void setDetId(uint32_t detid)
Definition: HGCalTriggerCell.h:22
HGCalConcentratorSuperTriggerCellImpl::createAllTriggerCells
void createAllTriggerCells(std::unordered_map< unsigned, SuperTriggerCell > &STCs, std::vector< l1t::HGCalTriggerCell > &trigCellVecOutput) const
Definition: HGCalConcentratorSuperTriggerCellImpl.cc:36
HGCalCoarseTriggerCellMapping::getCoarseTriggerCellId
uint32_t getCoarseTriggerCellId(uint32_t detid) const
Definition: HGCalCoarseTriggerCellMapping.cc:60
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell
Definition: HGCalConcentratorSuperTriggerCellImpl.h:54
TtFullHadEvtBuilder_cfi.sumPt
sumPt
Definition: TtFullHadEvtBuilder_cfi.py:38
HGCalConcentratorSuperTriggerCellImpl::fixedDataSizePerHGCROC_
bool fixedDataSizePerHGCROC_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:38
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getTCpt
float getTCpt(uint32_t tcid) const
Definition: HGCalConcentratorSuperTriggerCellImpl.h:91
DetId
Definition: DetId.h:17
alignCSCRings.s
s
Definition: alignCSCRings.py:92
HGCalTriggerTools::getTriggerGeometry
const HGCalTriggerGeometryBase * getTriggerGeometry() const
Definition: HGCalTriggerTools.h:69
Calorimetry_cff.thickness
thickness
Definition: Calorimetry_cff.py:114
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
Point3DBase< float, GlobalTag >
HGCalConcentratorSuperTriggerCellImpl::calibration_
HGCalTriggerCellCalibration calibration_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:51
HGCalTriggerTools::getTCPosition
GlobalPoint getTCPosition(const DetId &id) const
Definition: HGCalTriggerTools.cc:54
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HGCalTriggerTools::getSubDetectorType
SubDetectorType getSubDetectorType(const DetId &id) const
Definition: HGCalTriggerTools.cc:198
HGCalConcentratorSuperTriggerCellImpl::HGCalConcentratorSuperTriggerCellImpl
HGCalConcentratorSuperTriggerCellImpl(const edm::ParameterSet &conf)
Definition: HGCalConcentratorSuperTriggerCellImpl.cc:3
HGCalConcentratorSuperTriggerCellImpl.h
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
HGCalTriggerGeometryBase::validTriggerCell
virtual bool validTriggerCell(const unsigned trigger_cell_id) const =0
p4
double p4[4]
Definition: TauolaWrapper.h:92
HGCalTriggerGeometryBase::isV9Geometry
bool isV9Geometry() const
Definition: HGCalTriggerGeometryBase.h:30
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
HGCalConcentratorSuperTriggerCellImpl::coarseTCmapping_
HGCalCoarseTriggerCellMapping coarseTCmapping_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:40
HGCalCoarseTriggerCellMapping::getCoarseTriggerCellPosition
GlobalPoint getCoarseTriggerCellPosition(uint32_t ctcId) const
Definition: HGCalCoarseTriggerCellMapping.cc:196
HGCalConcentratorSuperTriggerCellImpl::assignSuperTriggerCellEnergyAndPosition
void assignSuperTriggerCellEnergyAndPosition(l1t::HGCalTriggerCell &c, const SuperTriggerCell &stc) const
Definition: HGCalConcentratorSuperTriggerCellImpl.cc:93
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getMaxId
uint32_t getMaxId() const
Definition: HGCalConcentratorSuperTriggerCellImpl.h:85
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getSumPt
float getSumPt() const
Definition: HGCalConcentratorSuperTriggerCellImpl.h:89
HGCalConcentratorSuperTriggerCellImpl::oneBitFraction
Definition: HGCalConcentratorSuperTriggerCellImpl.h:29
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
HLTTauDQMOffline_cfi.denominator
denominator
Definition: HLTTauDQMOffline_cfi.py:195
edm::getParameterSet
ParameterSet const & getParameterSet(ParameterSetID const &id)
Definition: ParameterSet.cc:855
std
Definition: JetResolutionObject.h:76
HGCalTriggerTools::SubDetectorType
SubDetectorType
Definition: HGCalTriggerTools.h:88
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::energyDivisionType_
EnergyDivisionType energyDivisionType_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:33
HGCalConcentratorSuperTriggerCellImpl::kHighDensityThickness_
static constexpr int kHighDensityThickness_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:34
HGCalVFECompressionImpl::compressSingle
void compressSingle(const uint32_t value, uint32_t &compressedCode, uint32_t &compressedValue) const
Definition: HGCalVFECompressionImpl.cc:15
math::PtEtaPhiMLorentzVector
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
HGCalTriggerCellCalibration::calibrateInGeV
void calibrateInGeV(l1t::HGCalTriggerCell &) const
Definition: HGCalTriggerCellCalibration.cc:104
point
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
HGCalCoarseTriggerCellMapping::getRepresentativeDetId
uint32_t getRepresentativeDetId(uint32_t tcid) const
Definition: HGCalCoarseTriggerCellMapping.cc:47
HGCalConcentratorSuperTriggerCellImpl::equalShare
Definition: HGCalConcentratorSuperTriggerCellImpl.h:30
HGCalConcentratorSuperTriggerCellImpl::superTCmapping_
HGCalCoarseTriggerCellMapping superTCmapping_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:41
HGCalConcentratorSuperTriggerCellImpl::vfeCompression_
HGCalVFECompressionImpl vfeCompression_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:52
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
HGCalConcentratorSuperTriggerCellImpl::coarsenTriggerCells_
std::vector< unsigned > coarsenTriggerCells_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:39