CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HGCalVFEProcessorSums Class Reference

#include <HGCalVFEProcessorSums.h>

Inheritance diagram for HGCalVFEProcessorSums:
HGCalProcessorBaseT< InputCollection, OutputCollection >

Public Member Functions

 HGCalVFEProcessorSums (const edm::ParameterSet &conf)
 
void run (const HGCalDigiCollection &digiColl, l1t::HGCalTriggerCellBxCollection &triggerCellColl, const edm::EventSetup &es) override
 
- Public Member Functions inherited from HGCalProcessorBaseT< InputCollection, OutputCollection >
virtual void eventSetup (const edm::EventSetup &es)
 
 HGCalProcessorBaseT (const edm::ParameterSet &conf)
 
const std::string & name () const
 
virtual void run (const InputCollection &inputColl, OutputCollection &outColl, const edm::EventSetup &es)=0
 
void setGeometry (const HGCalTriggerGeometryBase *const geom)
 
virtual ~HGCalProcessorBaseT ()
 

Private Attributes

std::unique_ptr< HGCalTriggerCellCalibrationcalibrationEE_
 
std::unique_ptr< HGCalTriggerCellCalibrationcalibrationHEsc_
 
std::unique_ptr< HGCalTriggerCellCalibrationcalibrationHEsi_
 
std::unique_ptr< HGCalTriggerCellCalibrationcalibrationNose_
 
HGCalTriggerTools triggerTools_
 
std::unique_ptr< HGCalVFECompressionImplvfeCompressionHDMImpl_
 
std::unique_ptr< HGCalVFECompressionImplvfeCompressionLDMImpl_
 
std::unique_ptr< HGCalVFELinearizationImplvfeLinearizationScImpl_
 
std::unique_ptr< HGCalVFELinearizationImplvfeLinearizationSiImpl_
 
std::unique_ptr< HGCalVFESummationImplvfeSummationImpl_
 

Additional Inherited Members

- Protected Attributes inherited from HGCalProcessorBaseT< InputCollection, OutputCollection >
const HGCalTriggerGeometryBasegeometry_
 

Detailed Description

Definition at line 12 of file HGCalVFEProcessorSums.h.

Constructor & Destructor Documentation

◆ HGCalVFEProcessorSums()

HGCalVFEProcessorSums::HGCalVFEProcessorSums ( const edm::ParameterSet conf)

Definition at line 5 of file HGCalVFEProcessorSums.cc.

5  : HGCalVFEProcessorBase(conf) {
7  std::make_unique<HGCalVFELinearizationImpl>(conf.getParameter<edm::ParameterSet>("linearizationCfg_si"));
9  std::make_unique<HGCalVFELinearizationImpl>(conf.getParameter<edm::ParameterSet>("linearizationCfg_sc"));
10 
11  vfeSummationImpl_ = std::make_unique<HGCalVFESummationImpl>(conf.getParameter<edm::ParameterSet>("summationCfg"));
12 
14  std::make_unique<HGCalVFECompressionImpl>(conf.getParameter<edm::ParameterSet>("compressionCfg_ldm"));
16  std::make_unique<HGCalVFECompressionImpl>(conf.getParameter<edm::ParameterSet>("compressionCfg_hdm"));
17 
19  std::make_unique<HGCalTriggerCellCalibration>(conf.getParameter<edm::ParameterSet>("calibrationCfg_ee"));
21  std::make_unique<HGCalTriggerCellCalibration>(conf.getParameter<edm::ParameterSet>("calibrationCfg_hesi"));
23  std::make_unique<HGCalTriggerCellCalibration>(conf.getParameter<edm::ParameterSet>("calibrationCfg_hesc"));
25  std::make_unique<HGCalTriggerCellCalibration>(conf.getParameter<edm::ParameterSet>("calibrationCfg_nose"));
26 }

References calibrationEE_, calibrationHEsc_, calibrationHEsi_, calibrationNose_, edm::ParameterSet::getParameter(), vfeCompressionHDMImpl_, vfeCompressionLDMImpl_, vfeLinearizationScImpl_, vfeLinearizationSiImpl_, and vfeSummationImpl_.

Member Function Documentation

◆ run()

void HGCalVFEProcessorSums::run ( const HGCalDigiCollection digiColl,
l1t::HGCalTriggerCellBxCollection triggerCellColl,
const edm::EventSetup es 
)
override

Definition at line 28 of file HGCalVFEProcessorSums.cc.

30  {
31  vfeSummationImpl_->eventSetup(es);
32  calibrationEE_->eventSetup(es);
33  calibrationHEsi_->eventSetup(es);
34  calibrationHEsc_->eventSetup(es);
35  calibrationNose_->eventSetup(es);
37 
38  std::vector<HGCalDataFrame> dataframes;
39  std::vector<std::pair<DetId, uint32_t>> linearized_dataframes;
40  std::unordered_map<uint32_t, uint32_t> tc_payload;
41  std::unordered_map<uint32_t, std::array<uint32_t, 2>> tc_compressed_payload;
42 
43  // Remove disconnected modules and invalid cells
44  for (const auto& digiData : digiColl) {
45  if (DetId(digiData.id()).det() == DetId::Hcal && HcalDetId(digiData.id()).subdetId() != HcalEndcap)
46  continue;
47  if (!geometry_->validCell(digiData.id()))
48  continue;
49  uint32_t module = geometry_->getModuleFromCell(digiData.id());
50 
51  // no disconnected layer for HFNose
52  if (DetId(digiData.id()).subdetId() != ForwardSubdetector::HFNose) {
54  continue;
55  }
56 
57  dataframes.emplace_back(digiData.id());
58  for (int i = 0; i < digiData.size(); i++) {
59  dataframes.back().setSample(i, digiData.sample(i));
60  }
61  }
62  if (dataframes.empty())
63  return;
64 
65  constexpr int kHighDensityThickness = 0;
66  bool isSilicon = triggerTools_.isSilicon(dataframes[0].id());
67  bool isEM = triggerTools_.isEm(dataframes[0].id());
68  bool isNose = triggerTools_.isNose(dataframes[0].id());
69  int thickness = triggerTools_.thicknessIndex(dataframes[0].id(), true);
70  // Linearization of ADC and TOT values to the same LSB
71  if (isSilicon) {
72  vfeLinearizationSiImpl_->linearize(dataframes, linearized_dataframes);
73  } else {
74  vfeLinearizationScImpl_->linearize(dataframes, linearized_dataframes);
75  }
76  // Sum of sensor cells into trigger cells
77  vfeSummationImpl_->triggerCellSums(linearized_dataframes, tc_payload);
78  // Compression of trigger cell charges to a floating point format
79  if (thickness == kHighDensityThickness) {
80  vfeCompressionHDMImpl_->compress(tc_payload, tc_compressed_payload);
81  } else {
82  vfeCompressionLDMImpl_->compress(tc_payload, tc_compressed_payload);
83  }
84 
85  // Transform map to trigger cell vector
86  for (const auto& [tc_id, tc_value] : tc_payload) {
87  if (tc_value > 0) {
88  const auto& [tc_compressed_code, tc_compressed_value] = tc_compressed_payload[tc_id];
89  l1t::HGCalTriggerCell triggerCell(reco::LeafCandidate::LorentzVector(), tc_compressed_value, 0, 0, 0, tc_id);
90  triggerCell.setCompressedCharge(tc_compressed_code);
91  triggerCell.setUncompressedCharge(tc_value);
93 
94  // 'value' is hardware, so p4 is meaningless, except for eta and phi
95  math::PtEtaPhiMLorentzVector p4((double)tc_compressed_value / cosh(point.eta()), point.eta(), point.phi(), 0.);
96  triggerCell.setP4(p4);
97  triggerCell.setPosition(point);
98 
99  // calibration
100  if (triggerCell.hwPt() > 0) {
101  l1t::HGCalTriggerCell calibratedtriggercell(triggerCell);
102  if (isNose) {
103  calibrationNose_->calibrateInGeV(calibratedtriggercell);
104  } else if (isSilicon) {
105  if (isEM) {
106  calibrationEE_->calibrateInGeV(calibratedtriggercell);
107  } else {
108  calibrationHEsi_->calibrateInGeV(calibratedtriggercell);
109  }
110  } else {
111  calibrationHEsc_->calibrateInGeV(calibratedtriggercell);
112  }
113  triggerCellColl.push_back(0, calibratedtriggercell);
114  }
115  }
116  }
117 }

References calibrationEE_, calibrationHEsc_, calibrationHEsi_, calibrationNose_, DigiToRawDM_cff::digiColl, HGCalTriggerGeometryBase::disconnectedModule(), HGCalTriggerTools::eventSetup(), HGCalProcessorBaseT< InputCollection, OutputCollection >::geometry_, HGCalTriggerGeometryBase::getModuleFromCell(), HGCalTriggerGeometryBase::getTriggerCellPosition(), DetId::Hcal, HcalEndcap, HFNose, l1t::L1Candidate::hwPt(), mps_fire::i, HGCalTriggerTools::isEm(), HGCalTriggerTools::isNose(), HGCalTriggerTools::isSilicon(), callgraph::module, p4, point, BXVector< T >::push_back(), l1t::HGCalTriggerCell::setCompressedCharge(), reco::LeafCandidate::setP4(), l1t::HGCalTriggerCell::setPosition(), l1t::HGCalTriggerCell::setUncompressedCharge(), Calorimetry_cff::thickness, HGCalTriggerTools::thicknessIndex(), triggerTools_, HGCalTriggerGeometryBase::validCell(), vfeCompressionHDMImpl_, vfeCompressionLDMImpl_, vfeLinearizationScImpl_, vfeLinearizationSiImpl_, and vfeSummationImpl_.

Member Data Documentation

◆ calibrationEE_

std::unique_ptr<HGCalTriggerCellCalibration> HGCalVFEProcessorSums::calibrationEE_
private

Definition at line 26 of file HGCalVFEProcessorSums.h.

Referenced by HGCalVFEProcessorSums(), and run().

◆ calibrationHEsc_

std::unique_ptr<HGCalTriggerCellCalibration> HGCalVFEProcessorSums::calibrationHEsc_
private

Definition at line 28 of file HGCalVFEProcessorSums.h.

Referenced by HGCalVFEProcessorSums(), and run().

◆ calibrationHEsi_

std::unique_ptr<HGCalTriggerCellCalibration> HGCalVFEProcessorSums::calibrationHEsi_
private

Definition at line 27 of file HGCalVFEProcessorSums.h.

Referenced by HGCalVFEProcessorSums(), and run().

◆ calibrationNose_

std::unique_ptr<HGCalTriggerCellCalibration> HGCalVFEProcessorSums::calibrationNose_
private

Definition at line 29 of file HGCalVFEProcessorSums.h.

Referenced by HGCalVFEProcessorSums(), and run().

◆ triggerTools_

HGCalTriggerTools HGCalVFEProcessorSums::triggerTools_
private

Definition at line 31 of file HGCalVFEProcessorSums.h.

Referenced by run().

◆ vfeCompressionHDMImpl_

std::unique_ptr<HGCalVFECompressionImpl> HGCalVFEProcessorSums::vfeCompressionHDMImpl_
private

Definition at line 25 of file HGCalVFEProcessorSums.h.

Referenced by HGCalVFEProcessorSums(), and run().

◆ vfeCompressionLDMImpl_

std::unique_ptr<HGCalVFECompressionImpl> HGCalVFEProcessorSums::vfeCompressionLDMImpl_
private

Definition at line 24 of file HGCalVFEProcessorSums.h.

Referenced by HGCalVFEProcessorSums(), and run().

◆ vfeLinearizationScImpl_

std::unique_ptr<HGCalVFELinearizationImpl> HGCalVFEProcessorSums::vfeLinearizationScImpl_
private

Definition at line 22 of file HGCalVFEProcessorSums.h.

Referenced by HGCalVFEProcessorSums(), and run().

◆ vfeLinearizationSiImpl_

std::unique_ptr<HGCalVFELinearizationImpl> HGCalVFEProcessorSums::vfeLinearizationSiImpl_
private

Definition at line 21 of file HGCalVFEProcessorSums.h.

Referenced by HGCalVFEProcessorSums(), and run().

◆ vfeSummationImpl_

std::unique_ptr<HGCalVFESummationImpl> HGCalVFEProcessorSums::vfeSummationImpl_
private

Definition at line 23 of file HGCalVFEProcessorSums.h.

Referenced by HGCalVFEProcessorSums(), and run().

HGCalVFEProcessorSums::vfeLinearizationSiImpl_
std::unique_ptr< HGCalVFELinearizationImpl > vfeLinearizationSiImpl_
Definition: HGCalVFEProcessorSums.h:21
HGCalVFEProcessorSums::calibrationNose_
std::unique_ptr< HGCalTriggerCellCalibration > calibrationNose_
Definition: HGCalVFEProcessorSums.h:29
DigiToRawDM_cff.digiColl
digiColl
Definition: DigiToRawDM_cff.py:32
HGCalVFEProcessorSums::calibrationEE_
std::unique_ptr< HGCalTriggerCellCalibration > calibrationEE_
Definition: HGCalVFEProcessorSums.h:26
HGCalVFEProcessorSums::vfeSummationImpl_
std::unique_ptr< HGCalVFESummationImpl > vfeSummationImpl_
Definition: HGCalVFEProcessorSums.h:23
HGCalTriggerTools::eventSetup
void eventSetup(const edm::EventSetup &)
Definition: HGCalTriggerTools.cc:35
mps_fire.i
i
Definition: mps_fire.py:428
HGCalTriggerGeometryBase::disconnectedModule
virtual bool disconnectedModule(const unsigned module_id) const =0
HGCalTriggerGeometryBase::validCell
virtual bool validCell(const unsigned cell_id) const =0
DetId::Hcal
Definition: DetId.h:28
HGCalTriggerTools::thicknessIndex
int thicknessIndex(const DetId &, bool tc=false) const
Definition: HGCalTriggerTools.cc:233
HGCalTriggerGeometryBase::getModuleFromCell
virtual unsigned getModuleFromCell(const unsigned cell_det_id) const =0
HGCalTriggerTools::isSilicon
bool isSilicon(const DetId &) const
Definition: HGCalTriggerTools.cc:181
HGCalVFEProcessorSums::calibrationHEsc_
std::unique_ptr< HGCalTriggerCellCalibration > calibrationHEsc_
Definition: HGCalVFEProcessorSums.h:28
HGCalVFEProcessorSums::vfeCompressionHDMImpl_
std::unique_ptr< HGCalVFECompressionImpl > vfeCompressionHDMImpl_
Definition: HGCalVFEProcessorSums.h:25
DetId
Definition: DetId.h:17
Calorimetry_cff.thickness
thickness
Definition: Calorimetry_cff.py:115
HFNose
Definition: ForwardSubdetector.h:11
HGCalVFEProcessorBase
HGCalProcessorBaseT< HGCalDigiCollection, l1t::HGCalTriggerCellBxCollection > HGCalVFEProcessorBase
Definition: HGCalProcessorBase.h:18
l1t::HGCalTriggerCell
Definition: HGCalTriggerCell.h:14
Point3DBase< float, GlobalTag >
HGCalTriggerTools::isNose
bool isNose(const DetId &) const
Definition: HGCalTriggerTools.cc:170
HGCalTriggerTools::isEm
bool isEm(const DetId &) const
Definition: HGCalTriggerTools.cc:151
HGCalVFEProcessorSums::triggerTools_
HGCalTriggerTools triggerTools_
Definition: HGCalVFEProcessorSums.h:31
edm::ParameterSet
Definition: ParameterSet.h:47
HGCalProcessorBaseT::geometry_
const HGCalTriggerGeometryBase * geometry_
Definition: HGCalProcessorBaseT.h:26
HcalDetId
Definition: HcalDetId.h:12
p4
double p4[4]
Definition: TauolaWrapper.h:92
HGCalVFEProcessorSums::vfeCompressionLDMImpl_
std::unique_ptr< HGCalVFECompressionImpl > vfeCompressionLDMImpl_
Definition: HGCalVFEProcessorSums.h:24
callgraph.module
module
Definition: callgraph.py:61
HcalEndcap
Definition: HcalAssistant.h:34
HGCalTriggerGeometryBase::getTriggerCellPosition
virtual GlobalPoint getTriggerCellPosition(const unsigned trigger_cell_det_id) const =0
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
math::PtEtaPhiMLorentzVector
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
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
BXVector::push_back
void push_back(int bx, T object)
HGCalVFEProcessorSums::calibrationHEsi_
std::unique_ptr< HGCalTriggerCellCalibration > calibrationHEsi_
Definition: HGCalVFEProcessorSums.h:27
HGCalVFEProcessorSums::vfeLinearizationScImpl_
std::unique_ptr< HGCalVFELinearizationImpl > vfeLinearizationScImpl_
Definition: HGCalVFEProcessorSums.h:22
reco::LeafCandidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: LeafCandidate.h:23