CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
HGCalConcentratorCoarsenerImpl Class Reference

#include <HGCalConcentratorCoarsenerImpl.h>

Classes

struct  CoarseTC
 

Public Member Functions

void coarsen (const std::vector< l1t::HGCalTriggerCell > &trigCellVecInput, std::vector< l1t::HGCalTriggerCell > &trigCellVecOutput)
 
 HGCalConcentratorCoarsenerImpl (const edm::ParameterSet &conf)
 
void setGeometry (const HGCalTriggerGeometryBase *const geom)
 

Private Member Functions

void assignCoarseTriggerCellEnergy (l1t::HGCalTriggerCell &c, const CoarseTC &ctc) const
 
void updateCoarseTriggerCellMaps (const l1t::HGCalTriggerCell &tc, uint32_t ctcid)
 

Private Attributes

HGCalTriggerCellCalibration calibration_
 
HGCalCoarseTriggerCellMapping coarseTCmapping_
 
std::unordered_map< uint32_t, CoarseTCcoarseTCs_
 
bool fixedDataSizePerHGCROC_
 
HGCalTriggerTools triggerTools_
 
HGCalVFECompressionImpl vfeCompression_
 

Static Private Attributes

static constexpr int kHighDensityThickness_ = 0
 

Detailed Description

Definition at line 10 of file HGCalConcentratorCoarsenerImpl.h.

Constructor & Destructor Documentation

◆ HGCalConcentratorCoarsenerImpl()

HGCalConcentratorCoarsenerImpl::HGCalConcentratorCoarsenerImpl ( const edm::ParameterSet conf)

Definition at line 3 of file HGCalConcentratorCoarsenerImpl.cc.

4  : fixedDataSizePerHGCROC_(conf.getParameter<bool>("fixedDataSizePerHGCROC")),
5  coarseTCmapping_(conf.getParameter<std::vector<unsigned>>("ctcSize")),
6  calibration_(conf.getParameterSet("superTCCalibration")),
7  vfeCompression_(conf.getParameterSet("coarseTCCompression")) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
ParameterSet const & getParameterSet(std::string const &) const
HGCalCoarseTriggerCellMapping coarseTCmapping_

Member Function Documentation

◆ assignCoarseTriggerCellEnergy()

void HGCalConcentratorCoarsenerImpl::assignCoarseTriggerCellEnergy ( l1t::HGCalTriggerCell c,
const CoarseTC ctc 
) const
private

Definition at line 22 of file HGCalConcentratorCoarsenerImpl.cc.

References HGCalTriggerCellCalibration::calibrateInGeV(), calibration_, HGCalVFECompressionImpl::compressSingle(), WZElectronSkims53X_cff::max, l1t::L1Candidate::setHwPt(), HGCalConcentratorCoarsenerImpl::CoarseTC::sumHwPt, and vfeCompression_.

Referenced by coarsen().

23  {
24  //Compress and recalibrate CTC energy
25  uint32_t code(0);
26  uint64_t compressed_value(0);
27  vfeCompression_.compressSingle(ctc.sumHwPt, code, compressed_value);
28 
29  if (compressed_value > std::numeric_limits<int>::max())
30  edm::LogWarning("CompressedValueDowncasting") << "Compressed value cannot fit into 32-bit word. Downcasting.";
31 
32  tc.setHwPt(static_cast<int>(compressed_value));
34 }
void calibrateInGeV(l1t::HGCalTriggerCell &) const
void compressSingle(const uint64_t value, uint32_t &compressedCode, uint64_t &compressedValue) const
unsigned long long uint64_t
Definition: Time.h:13
Log< level::Warning, false > LogWarning

◆ coarsen()

void HGCalConcentratorCoarsenerImpl::coarsen ( const std::vector< l1t::HGCalTriggerCell > &  trigCellVecInput,
std::vector< l1t::HGCalTriggerCell > &  trigCellVecOutput 
)

Definition at line 36 of file HGCalConcentratorCoarsenerImpl.cc.

References assignCoarseTriggerCellEnergy(), coarseTCmapping_, coarseTCs_, fixedDataSizePerHGCROC_, HGCalCoarseTriggerCellMapping::getCoarseTriggerCellId(), HGCalCoarseTriggerCellMapping::getCoarseTriggerCellPosition(), HGCalCoarseTriggerCellMapping::getRepresentativeDetId(), kHighDensityThickness_, point, reco::LeafCandidate::pt(), l1t::HGCalTriggerCell::setDetId(), reco::LeafCandidate::setP4(), l1t::HGCalTriggerCell::setPosition(), ppsPixelTopologyESSourceRun2_cfi::thickness, HGCalTriggerTools::thicknessIndex(), triggerTools_, and updateCoarseTriggerCellMaps().

37  {
38  coarseTCs_.clear();
39 
40  // first pass, fill the coarse trigger cell information
41  for (const l1t::HGCalTriggerCell& tc : trigCellVecInput) {
42  int thickness = triggerTools_.thicknessIndex(tc.detId());
43 
45  trigCellVecOutput.push_back(tc);
46  continue;
47  }
48 
49  uint32_t ctcid = coarseTCmapping_.getCoarseTriggerCellId(tc.detId());
50  updateCoarseTriggerCellMaps(tc, ctcid);
51  }
52 
53  for (const auto& ctc : coarseTCs_) {
54  l1t::HGCalTriggerCell triggerCell;
55 
56  uint32_t representativeId = coarseTCmapping_.getRepresentativeDetId(ctc.second.maxId);
57  triggerCell.setDetId(representativeId);
58 
60  math::PtEtaPhiMLorentzVector initial_p4(ctc.second.sumPt, point.eta(), point.phi(), 0);
61 
62  triggerCell.setP4(initial_p4);
63  assignCoarseTriggerCellEnergy(triggerCell, ctc.second);
64 
65  math::PtEtaPhiMLorentzVector p4(triggerCell.pt(), point.eta(), point.phi(), 0);
66  triggerCell.setPosition(point);
67  triggerCell.setP4(p4);
68  trigCellVecOutput.push_back(triggerCell);
69  }
70 }
uint32_t getRepresentativeDetId(uint32_t tcid) const
double pt() const final
transverse momentum
int thicknessIndex(const DetId &) const
void updateCoarseTriggerCellMaps(const l1t::HGCalTriggerCell &tc, uint32_t ctcid)
uint32_t getCoarseTriggerCellId(uint32_t detid) const
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
void setDetId(uint32_t detid)
GlobalPoint getCoarseTriggerCellPosition(uint32_t ctcId) const
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

◆ setGeometry()

void HGCalConcentratorCoarsenerImpl::setGeometry ( const HGCalTriggerGeometryBase *const  geom)
inline

◆ updateCoarseTriggerCellMaps()

void HGCalConcentratorCoarsenerImpl::updateCoarseTriggerCellMaps ( const l1t::HGCalTriggerCell tc,
uint32_t  ctcid 
)
private

Definition at line 9 of file HGCalConcentratorCoarsenerImpl.cc.

References coarseTCs_, l1t::HGCalTriggerCell::detId(), l1t::L1Candidate::hwPt(), l1t::HGCalTriggerCell::mipPt(), and reco::LeafCandidate::pt().

Referenced by coarsen().

9  {
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 }
double pt() const final
transverse momentum
uint32_t detId() const
int hwPt() const
Definition: L1Candidate.h:35
std::unordered_map< uint32_t, CoarseTC > coarseTCs_

Member Data Documentation

◆ calibration_

HGCalTriggerCellCalibration HGCalConcentratorCoarsenerImpl::calibration_
private

Definition at line 28 of file HGCalConcentratorCoarsenerImpl.h.

Referenced by assignCoarseTriggerCellEnergy(), and setGeometry().

◆ coarseTCmapping_

HGCalCoarseTriggerCellMapping HGCalConcentratorCoarsenerImpl::coarseTCmapping_
private

Definition at line 25 of file HGCalConcentratorCoarsenerImpl.h.

Referenced by coarsen(), and setGeometry().

◆ coarseTCs_

std::unordered_map<uint32_t, CoarseTC> HGCalConcentratorCoarsenerImpl::coarseTCs_
private

Definition at line 39 of file HGCalConcentratorCoarsenerImpl.h.

Referenced by coarsen(), and updateCoarseTriggerCellMaps().

◆ fixedDataSizePerHGCROC_

bool HGCalConcentratorCoarsenerImpl::fixedDataSizePerHGCROC_
private

Definition at line 24 of file HGCalConcentratorCoarsenerImpl.h.

Referenced by coarsen().

◆ kHighDensityThickness_

constexpr int HGCalConcentratorCoarsenerImpl::kHighDensityThickness_ = 0
staticprivate

Definition at line 26 of file HGCalConcentratorCoarsenerImpl.h.

Referenced by coarsen().

◆ triggerTools_

HGCalTriggerTools HGCalConcentratorCoarsenerImpl::triggerTools_
private

Definition at line 23 of file HGCalConcentratorCoarsenerImpl.h.

Referenced by coarsen(), and setGeometry().

◆ vfeCompression_

HGCalVFECompressionImpl HGCalConcentratorCoarsenerImpl::vfeCompression_
private

Definition at line 29 of file HGCalConcentratorCoarsenerImpl.h.

Referenced by assignCoarseTriggerCellEnergy().