CMS 3D CMS Logo

HGCalConcentratorCoarsenerImpl.cc
Go to the documentation of this file.
2 
4  : fixedDataSizePerHGCROC_(conf.getParameter<bool>("fixedDataSizePerHGCROC")),
5  coarseTCmapping_(conf.getParameter<std::vector<unsigned>>("ctcSize")),
6  calibration_(conf.getParameterSet("superTCCalibration")),
7  vfeCompression_(conf.getParameterSet("coarseTCCompression")) {}
8 
10  auto& ctc = coarseTCs_[ctcid];
11 
12  ctc.sumPt += tc.pt();
13  ctc.sumHwPt += tc.hwPt();
14  ctc.sumMipPt += tc.mipPt();
15 
16  if (tc.mipPt() > ctc.maxMipPt) {
17  ctc.maxId = tc.detId();
18  ctc.maxMipPt = tc.mipPt();
19  }
20 }
21 
23  const CoarseTC& ctc) const {
24  //Compress and recalibrate CTC energy
25  uint32_t code(0);
26  uint32_t compressed_value(0);
27  vfeCompression_.compressSingle(ctc.sumHwPt, code, compressed_value);
28 
29  tc.setHwPt(compressed_value);
31 }
32 
33 void HGCalConcentratorCoarsenerImpl::coarsen(const std::vector<l1t::HGCalTriggerCell>& trigCellVecInput,
34  std::vector<l1t::HGCalTriggerCell>& trigCellVecOutput) {
35  coarseTCs_.clear();
36 
37  // first pass, fill the coarse trigger cell information
38  for (const l1t::HGCalTriggerCell& tc : trigCellVecInput) {
39  int thickness = triggerTools_.thicknessIndex(tc.detId());
40 
42  trigCellVecOutput.push_back(tc);
43  continue;
44  }
45 
46  uint32_t ctcid = coarseTCmapping_.getCoarseTriggerCellId(tc.detId());
47  updateCoarseTriggerCellMaps(tc, ctcid);
48  }
49 
50  for (const auto& ctc : coarseTCs_) {
51  l1t::HGCalTriggerCell triggerCell;
52 
53  uint32_t representativeId = coarseTCmapping_.getRepresentativeDetId(ctc.second.maxId);
54  triggerCell.setDetId(representativeId);
55 
57  math::PtEtaPhiMLorentzVector initial_p4(ctc.second.sumPt, point.eta(), point.phi(), 0);
58 
59  triggerCell.setP4(initial_p4);
60  assignCoarseTriggerCellEnergy(triggerCell, ctc.second);
61 
62  math::PtEtaPhiMLorentzVector p4(triggerCell.pt(), point.eta(), point.phi(), 0);
63  triggerCell.setPosition(point);
64  triggerCell.setP4(p4);
65  trigCellVecOutput.push_back(triggerCell);
66  }
67 }
uint32_t getRepresentativeDetId(uint32_t tcid) const
double pt() const final
transverse momentum
void coarsen(const std::vector< l1t::HGCalTriggerCell > &trigCellVecInput, std::vector< l1t::HGCalTriggerCell > &trigCellVecOutput)
int thicknessIndex(const DetId &) const
void updateCoarseTriggerCellMaps(const l1t::HGCalTriggerCell &tc, uint32_t ctcid)
void calibrateInGeV(l1t::HGCalTriggerCell &) const
uint32_t getCoarseTriggerCellId(uint32_t detid) const
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
void compressSingle(const uint32_t value, uint32_t &compressedCode, uint32_t &compressedValue) const
void setDetId(uint32_t detid)
uint32_t detId() const
GlobalPoint getCoarseTriggerCellPosition(uint32_t ctcId) const
int hwPt() const
Definition: L1Candidate.h:35
HGCalConcentratorCoarsenerImpl(const edm::ParameterSet &conf)
ParameterSet const & getParameterSet(ParameterSetID const &id)
void setHwPt(int pt)
Definition: L1Candidate.h:28
std::unordered_map< uint32_t, CoarseTC > coarseTCs_
HGCalCoarseTriggerCellMapping coarseTCmapping_
void setPosition(const GlobalPoint &position)
void setP4(const LorentzVector &p4) final
set 4-momentum
*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
void assignCoarseTriggerCellEnergy(l1t::HGCalTriggerCell &c, const CoarseTC &ctc) const