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  calibrationEE_(conf.getParameterSet("superTCCalibration_ee")),
9  calibrationHEsi_(conf.getParameterSet("superTCCalibration_hesi")),
10  calibrationHEsc_(conf.getParameterSet("superTCCalibration_hesc")),
11  calibrationNose_(conf.getParameterSet("superTCCalibration_nose")),
12  vfeCompression_(conf.getParameterSet("superTCCompression")) {
13  std::string energyType(conf.getParameter<string>("type_energy_division"));
14 
15  if (energyType == "superTriggerCell") {
17  } else if (energyType == "oneBitFraction") {
19 
20  oneBitFractionThreshold_ = conf.getParameter<double>("oneBitFractionThreshold");
21  oneBitFractionLowValue_ = conf.getParameter<double>("oneBitFractionLowValue");
22  oneBitFractionHighValue_ = conf.getParameter<double>("oneBitFractionHighValue");
23 
24  } else if (energyType == "equalShare") {
26 
27  } else {
29  }
30 }
31 
33  uint32_t code(0);
34  uint32_t compressed_value(0);
35  vfeCompression_.compressSingle(stc.getSumHwPt(), code, compressed_value);
36  return compressed_value;
37 }
38 
40  std::unordered_map<unsigned, SuperTriggerCell>& STCs, std::vector<l1t::HGCalTriggerCell>& trigCellVecOutput) const {
41  for (auto& s : STCs) {
42  std::vector<uint32_t> output_ids = superTCmapping_.getConstituentTriggerCells(s.second.getSTCId());
43  if (output_ids.empty())
44  continue;
45 
47  int thickness = (!output_ids.empty() ? triggerTools_.thicknessIndex(output_ids.at(0), true) : 0);
48 
49  for (const auto& id : output_ids) {
52  continue;
53  }
54 
56  continue;
57  }
58 
59  l1t::HGCalTriggerCell triggerCell;
60  triggerCell.setDetId(id);
61  if (energyDivisionType_ == superTriggerCell && id != s.second.getMaxId()) {
62  continue;
63  }
64 
65  DetId tc_Id(id);
66 
67  //To guard against the case in v8 geometry where
68  //there might be different thicknesses within a module
69  //This is a small effect, but in principle energy might
70  //be lost.
71  if (superTCmapping_.getCoarseTriggerCellId(id) != s.second.getSTCId()) {
73  throw cms::Exception("NonExistingCoarseTC")
74  << "The coarse trigger cell correponsing to the nominal trigger cell does not exist";
75  } else {
76  continue;
77  }
78  }
79  trigCellVecOutput.push_back(triggerCell);
80  if (energyDivisionType_ == oneBitFraction) { //Get the 1 bit fractions
81 
82  if (id != s.second.getMaxId()) {
83  float tc_fraction = getTriggerCellOneBitFraction(s.second.getTCpt(id), s.second.getSumPt());
84  s.second.addToFractionSum(tc_fraction);
85  }
86  }
87  }
88  }
89  // assign energy
90  for (l1t::HGCalTriggerCell& tc : trigCellVecOutput) {
91  const auto& stc = STCs[superTCmapping_.getCoarseTriggerCellId(tc.detId())];
93  }
94 }
95 
97  const SuperTriggerCell& stc) const {
98  //Compress and recalibrate STC energy
99  uint32_t compressed_value = getCompressedSTCEnergy(stc);
100 
102  int thickness = triggerTools_.thicknessIndex(c.detId(), true);
103 
104  bool isSilicon = triggerTools_.isSilicon(c.detId());
105  bool isEM = triggerTools_.isEm(c.detId());
106  bool isNose = triggerTools_.isNose(c.detId());
107 
111  } else {
112  point = triggerTools_.getTCPosition(c.detId());
113  }
114  c.setPosition(point);
115 
116  math::PtEtaPhiMLorentzVector p4(c.pt(), point.eta(), point.phi(), 0.);
117  c.setP4(p4);
118 
120  if (c.detId() == stc.getMaxId()) {
121  c.setHwPt(compressed_value);
122  } else {
123  throw cms::Exception("NonMaxIdSuperTriggerCell")
124  << "Trigger Cell with detId not equal to the maximum of the superTriggerCell found";
125  }
126  } else if (energyDivisionType_ == equalShare) {
127  double coarseTriggerCellSize =
128  coarsenTriggerCells_[subdet]
129  ? double(
131  .size())
132  : 1.;
133 
134  double denominator =
136  ? double(kTriggerCellsForDivision_)
137  : double(superTCmapping_.getConstituentTriggerCells(stc.getSTCId()).size()) / coarseTriggerCellSize;
138 
139  c.setHwPt(std::round(compressed_value / denominator));
140 
141  } else if (energyDivisionType_ == oneBitFraction) {
142  double frac = 0;
143 
144  if (c.detId() != stc.getMaxId()) {
145  frac = getTriggerCellOneBitFraction(stc.getTCpt(c.detId()), stc.getSumPt());
146  } else {
147  frac = 1 - stc.getFractionSum();
148  }
149 
150  c.setHwPt(std::round(compressed_value * frac));
151  }
152  // calibration
153  if (isNose) {
155  } else if (isSilicon) {
156  if (isEM) {
158  } else {
160  }
161  } else {
163  }
164 }
165 
167  double f = tcPt / sumPt;
168  double frac = 0;
169  if (f < oneBitFractionThreshold_) {
171  } else {
173  }
174 
175  return frac;
176 }
177 
178 void HGCalConcentratorSuperTriggerCellImpl::select(const std::vector<l1t::HGCalTriggerCell>& trigCellVecInput,
179  std::vector<l1t::HGCalTriggerCell>& trigCellVecOutput) {
180  std::unordered_map<unsigned, SuperTriggerCell> STCs;
181  // first pass, fill the "coarse" trigger cells
182  for (const l1t::HGCalTriggerCell& tc : trigCellVecInput) {
183  uint32_t stcid = superTCmapping_.getCoarseTriggerCellId(tc.detId());
184  STCs[stcid].add(tc, stcid);
185  }
186 
187  createAllTriggerCells(STCs, trigCellVecOutput);
188 }
HGCalConcentratorSuperTriggerCellImpl::superTriggerCell
Definition: HGCalConcentratorSuperTriggerCellImpl.h:31
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getSumHwPt
int getSumHwPt() const
Definition: HGCalConcentratorSuperTriggerCellImpl.h:94
electrons_cff.bool
bool
Definition: electrons_cff.py:366
HGCalConcentratorSuperTriggerCellImpl::oneBitFractionThreshold_
double oneBitFractionThreshold_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:47
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
HGCalConcentratorSuperTriggerCellImpl::kTriggerCellsForDivision_
static constexpr int kTriggerCellsForDivision_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:52
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
HGCalTriggerTools::isSilicon
bool isSilicon(const DetId &) const
Definition: HGCalTriggerTools.cc:181
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
HGCalCoarseTriggerCellMapping::getCoarseTriggerCellId
uint32_t getCoarseTriggerCellId(uint32_t detid) const
Definition: HGCalCoarseTriggerCellMapping.cc:60
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell
Definition: HGCalConcentratorSuperTriggerCellImpl.h:60
HGCalConcentratorSuperTriggerCellImpl::calibrationEE_
HGCalTriggerCellCalibration calibrationEE_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:54
TtFullHadEvtBuilder_cfi.sumPt
sumPt
Definition: TtFullHadEvtBuilder_cfi.py:38
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
DetId
Definition: DetId.h:17
alignCSCRings.s
s
Definition: alignCSCRings.py:92
DivergingColor.frac
float frac
Definition: DivergingColor.py:175
HGCalTriggerTools::getTriggerGeometry
const HGCalTriggerGeometryBase * getTriggerGeometry() const
Definition: HGCalTriggerTools.h:70
Calorimetry_cff.thickness
thickness
Definition: Calorimetry_cff.py:115
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
Point3DBase< float, GlobalTag >
HGCalTriggerTools::getTCPosition
GlobalPoint getTCPosition(const DetId &id) const
Definition: HGCalTriggerTools.cc:54
HGCalTriggerTools::isNose
bool isNose(const DetId &) const
Definition: HGCalTriggerTools.cc:170
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
HGCalTriggerTools::isEm
bool isEm(const DetId &) const
Definition: HGCalTriggerTools.cc:151
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
HGCalTriggerGeometryBase::validTriggerCell
virtual bool validTriggerCell(const unsigned trigger_cell_id) const =0
p4
double p4[4]
Definition: TauolaWrapper.h:92
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
HGCalTriggerGeometryBase::isV9Geometry
bool isV9Geometry() const
Definition: HGCalTriggerGeometryBase.h:30
HGCalConcentratorSuperTriggerCellImpl::coarseTCmapping_
HGCalCoarseTriggerCellMapping coarseTCmapping_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:43
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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:96
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getMaxId
uint32_t getMaxId() const
Definition: HGCalConcentratorSuperTriggerCellImpl.h:91
HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getSumPt
float getSumPt() const
Definition: HGCalConcentratorSuperTriggerCellImpl.h:95
HGCalConcentratorSuperTriggerCellImpl::oneBitFraction
Definition: HGCalConcentratorSuperTriggerCellImpl.h:32
HLTTauDQMOffline_cfi.denominator
denominator
Definition: HLTTauDQMOffline_cfi.py:180
edm::getParameterSet
ParameterSet const & getParameterSet(ParameterSetID const &id)
Definition: ParameterSet.cc:862
std
Definition: JetResolutionObject.h:76
HGCalTriggerTools::SubDetectorType
SubDetectorType
Definition: HGCalTriggerTools.h:89
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::energyDivisionType_
EnergyDivisionType energyDivisionType_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:36
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HGCalConcentratorSuperTriggerCellImpl::kHighDensityThickness_
static constexpr int kHighDensityThickness_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:37
HGCalVFECompressionImpl::compressSingle
void compressSingle(const uint32_t value, uint32_t &compressedCode, uint32_t &compressedValue) const
Definition: HGCalVFECompressionImpl.cc:19
math::PtEtaPhiMLorentzVector
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
HGCalTriggerCellCalibration::calibrateInGeV
void calibrateInGeV(l1t::HGCalTriggerCell &) const
Definition: HGCalTriggerCellCalibration.cc:99
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
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: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
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
HGCalConcentratorSuperTriggerCellImpl::coarsenTriggerCells_
std::vector< unsigned > coarsenTriggerCells_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:42