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)
 
void eventSetup (const edm::EventSetup &es)
 
 HGCalConcentratorCoarsenerImpl (const edm::ParameterSet &conf)
 

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")) {}

Member Function Documentation

◆ assignCoarseTriggerCellEnergy()

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

Definition at line 22 of file HGCalConcentratorCoarsenerImpl.cc.

23  {
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 }

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

Referenced by coarsen().

◆ coarsen()

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

Definition at line 33 of file HGCalConcentratorCoarsenerImpl.cc.

34  {
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 }

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

◆ eventSetup()

void HGCalConcentratorCoarsenerImpl::eventSetup ( const edm::EventSetup es)
inline

◆ updateCoarseTriggerCellMaps()

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

Definition at line 9 of file HGCalConcentratorCoarsenerImpl.cc.

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 }

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

Referenced by coarsen().

Member Data Documentation

◆ calibration_

HGCalTriggerCellCalibration HGCalConcentratorCoarsenerImpl::calibration_
private

Definition at line 28 of file HGCalConcentratorCoarsenerImpl.h.

Referenced by assignCoarseTriggerCellEnergy(), and eventSetup().

◆ coarseTCmapping_

HGCalCoarseTriggerCellMapping HGCalConcentratorCoarsenerImpl::coarseTCmapping_
private

Definition at line 25 of file HGCalConcentratorCoarsenerImpl.h.

Referenced by coarsen(), and eventSetup().

◆ 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
staticconstexprprivate

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 eventSetup().

◆ vfeCompression_

HGCalVFECompressionImpl HGCalConcentratorCoarsenerImpl::vfeCompression_
private

Definition at line 29 of file HGCalConcentratorCoarsenerImpl.h.

Referenced by assignCoarseTriggerCellEnergy().

HGCalTriggerTools::eventSetup
void eventSetup(const edm::EventSetup &)
Definition: HGCalTriggerTools.cc:35
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
HGCalCoarseTriggerCellMapping::eventSetup
void eventSetup(const edm::EventSetup &es)
Definition: HGCalCoarseTriggerCellMapping.h:17
HGCalCoarseTriggerCellMapping::getCoarseTriggerCellId
uint32_t getCoarseTriggerCellId(uint32_t detid) const
Definition: HGCalCoarseTriggerCellMapping.cc:60
HGCalTriggerCellCalibration::eventSetup
void eventSetup(const edm::EventSetup &es)
Definition: HGCalTriggerCellCalibration.h:12
HGCalConcentratorCoarsenerImpl::coarseTCmapping_
HGCalCoarseTriggerCellMapping coarseTCmapping_
Definition: HGCalConcentratorCoarsenerImpl.h:25
Calorimetry_cff.thickness
thickness
Definition: Calorimetry_cff.py:115
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
HGCalConcentratorCoarsenerImpl::kHighDensityThickness_
static constexpr int kHighDensityThickness_
Definition: HGCalConcentratorCoarsenerImpl.h:26
p4
double p4[4]
Definition: TauolaWrapper.h:92
HGCalConcentratorCoarsenerImpl::fixedDataSizePerHGCROC_
bool fixedDataSizePerHGCROC_
Definition: HGCalConcentratorCoarsenerImpl.h:24
HGCalConcentratorCoarsenerImpl::updateCoarseTriggerCellMaps
void updateCoarseTriggerCellMaps(const l1t::HGCalTriggerCell &tc, uint32_t ctcid)
Definition: HGCalConcentratorCoarsenerImpl.cc:9
HGCalCoarseTriggerCellMapping::getCoarseTriggerCellPosition
GlobalPoint getCoarseTriggerCellPosition(uint32_t ctcId) const
Definition: HGCalCoarseTriggerCellMapping.cc:196
reco::LeafCandidate::setP4
void setP4(const LorentzVector &p4) final
set 4-momentum
Definition: LeafCandidate.h:158
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
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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
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
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2128
HGCalConcentratorCoarsenerImpl::calibration_
HGCalTriggerCellCalibration calibration_
Definition: HGCalConcentratorCoarsenerImpl.h:28