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(), true);
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 }
electrons_cff.bool
bool
Definition: electrons_cff.py:393
HGCalConcentratorCoarsenerImpl::triggerTools_
HGCalTriggerTools triggerTools_
Definition: HGCalConcentratorCoarsenerImpl.h:23
HGCalConcentratorCoarsenerImpl::coarseTCs_
std::unordered_map< uint32_t, CoarseTC > coarseTCs_
Definition: HGCalConcentratorCoarsenerImpl.h:39
HGCalTriggerTools::thicknessIndex
int thicknessIndex(const DetId &, bool tc=false) const
Definition: HGCalTriggerTools.cc:233
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition: LeafCandidate.h:146
l1t::HGCalTriggerCell::setDetId
void setDetId(uint32_t detid)
Definition: HGCalTriggerCell.h:22
HGCalConcentratorCoarsenerImpl.h
HGCalCoarseTriggerCellMapping::getCoarseTriggerCellId
uint32_t getCoarseTriggerCellId(uint32_t detid) const
Definition: HGCalCoarseTriggerCellMapping.cc:60
HGCalConcentratorCoarsenerImpl::coarseTCmapping_
HGCalCoarseTriggerCellMapping coarseTCmapping_
Definition: HGCalConcentratorCoarsenerImpl.h:25
HGCalConcentratorCoarsenerImpl::coarsen
void coarsen(const std::vector< l1t::HGCalTriggerCell > &trigCellVecInput, std::vector< l1t::HGCalTriggerCell > &trigCellVecOutput)
Definition: HGCalConcentratorCoarsenerImpl.cc:33
HGCalConcentratorCoarsenerImpl::HGCalConcentratorCoarsenerImpl
HGCalConcentratorCoarsenerImpl(const edm::ParameterSet &conf)
Definition: HGCalConcentratorCoarsenerImpl.cc:3
Calorimetry_cff.thickness
thickness
Definition: Calorimetry_cff.py:114
l1t::HGCalTriggerCell
Definition: HGCalTriggerCell.h:14
Point3DBase< float, GlobalTag >
l1t::HGCalTriggerCell::mipPt
double mipPt() const
Definition: HGCalTriggerCell.h:31
l1t::HGCalTriggerCell::detId
uint32_t detId() const
Definition: HGCalTriggerCell.h:25
edm::ParameterSet
Definition: ParameterSet.h:47
HGCalConcentratorCoarsenerImpl::kHighDensityThickness_
static constexpr int kHighDensityThickness_
Definition: HGCalConcentratorCoarsenerImpl.h:26
p4
double p4[4]
Definition: TauolaWrapper.h:92
HGCalConcentratorCoarsenerImpl::CoarseTC::sumHwPt
int sumHwPt
Definition: HGCalConcentratorCoarsenerImpl.h:34
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
HGCalConcentratorCoarsenerImpl::fixedDataSizePerHGCROC_
bool fixedDataSizePerHGCROC_
Definition: HGCalConcentratorCoarsenerImpl.h:24
HGCalConcentratorCoarsenerImpl::updateCoarseTriggerCellMaps
void updateCoarseTriggerCellMaps(const l1t::HGCalTriggerCell &tc, uint32_t ctcid)
Definition: HGCalConcentratorCoarsenerImpl.cc:9
l1t::L1Candidate::setHwPt
void setHwPt(int pt)
Definition: L1Candidate.h:28
HGCalCoarseTriggerCellMapping::getCoarseTriggerCellPosition
GlobalPoint getCoarseTriggerCellPosition(uint32_t ctcId) const
Definition: HGCalCoarseTriggerCellMapping.cc:196
edm::getParameterSet
ParameterSet const & getParameterSet(ParameterSetID const &id)
Definition: ParameterSet.cc:862
reco::LeafCandidate::setP4
void setP4(const LorentzVector &p4) final
set 4-momentum
Definition: LeafCandidate.h:158
std
Definition: JetResolutionObject.h:76
l1t::HGCalTriggerCell::setPosition
void setPosition(const GlobalPoint &position)
Definition: HGCalTriggerCell.h:23
HGCalConcentratorCoarsenerImpl::vfeCompression_
HGCalVFECompressionImpl vfeCompression_
Definition: HGCalConcentratorCoarsenerImpl.h:29
l1t::L1Candidate::hwPt
int hwPt() const
Definition: L1Candidate.h:35
HGCalVFECompressionImpl::compressSingle
void compressSingle(const uint32_t value, uint32_t &compressedCode, uint32_t &compressedValue) const
Definition: HGCalVFECompressionImpl.cc:19
HGCalConcentratorCoarsenerImpl::CoarseTC
Definition: HGCalConcentratorCoarsenerImpl.h:31
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
HGCalConcentratorCoarsenerImpl::assignCoarseTriggerCellEnergy
void assignCoarseTriggerCellEnergy(l1t::HGCalTriggerCell &c, const CoarseTC &ctc) const
Definition: HGCalConcentratorCoarsenerImpl.cc:22
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
HGCalConcentratorCoarsenerImpl::calibration_
HGCalTriggerCellCalibration calibration_
Definition: HGCalConcentratorCoarsenerImpl.h:28