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 >
 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< HGCalTriggerCellCalibrationcalibration_
 
std::unique_ptr< HGCalVFECompressionImplvfeCompressionImpl_
 
std::unique_ptr< HGCalVFELinearizationImplvfeLinearizationImpl_
 
std::unique_ptr< HGCalVFESummationImplvfeSummationImpl_
 

Additional Inherited Members

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

Detailed Description

Definition at line 16 of file HGCalVFEProcessorSums.h.

Constructor & Destructor Documentation

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

Definition at line 9 of file HGCalVFEProcessorSums.cc.

References calibration_, vfeCompressionImpl_, vfeLinearizationImpl_, and vfeSummationImpl_.

9  : HGCalVFEProcessorBase(conf) {
10  vfeLinearizationImpl_ = std::make_unique<HGCalVFELinearizationImpl>(conf);
11  vfeSummationImpl_ = std::make_unique<HGCalVFESummationImpl>(conf);
12  vfeCompressionImpl_ = std::make_unique<HGCalVFECompressionImpl>(conf);
13  calibration_ = std::make_unique<HGCalTriggerCellCalibration>(conf);
14 }
std::unique_ptr< HGCalVFECompressionImpl > vfeCompressionImpl_
HGCalProcessorBaseT< HGCalDigiCollection, l1t::HGCalTriggerCellBxCollection > HGCalVFEProcessorBase
std::unique_ptr< HGCalVFELinearizationImpl > vfeLinearizationImpl_
std::unique_ptr< HGCalVFESummationImpl > vfeSummationImpl_
std::unique_ptr< HGCalTriggerCellCalibration > calibration_

Member Function Documentation

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

Definition at line 16 of file HGCalVFEProcessorSums.cc.

References calibration_, HGCalTriggerGeometryBase::disconnectedModule(), PV3DBase< T, PVType, FrameType >::eta(), HGCalProcessorBaseT< InputCollection, OutputCollection >::geometry_, HGCalTriggerGeometryBase::getModuleFromCell(), HGCalTriggerGeometryBase::getTriggerCellPosition(), DetId::Hcal, HcalEndcap, l1t::L1Candidate::hwPt(), mps_fire::i, p4, jets_cff::payload, PV3DBase< T, PVType, FrameType >::phi(), point, BXVector< T >::push_back(), l1t::HGCalTriggerCell::setCompressedCharge(), reco::LeafCandidate::setP4(), l1t::HGCalTriggerCell::setPosition(), l1t::HGCalTriggerCell::setUncompressedCharge(), vfeCompressionImpl_, vfeLinearizationImpl_, and vfeSummationImpl_.

18  {
19  vfeSummationImpl_->eventSetup(es);
20  calibration_->eventSetup(es);
21 
22  std::vector<HGCalDataFrame> dataframes;
23  std::vector<std::pair<DetId, uint32_t>> linearized_dataframes;
24  std::unordered_map<uint32_t, uint32_t> payload;
25  std::unordered_map<uint32_t, std::array<uint32_t, 2>> compressed_payload;
26 
27  // convert ee and fh hit collections into the same object
28  for (const auto& digiData : digiColl) {
29  if (DetId(digiData.id()).det() == DetId::Hcal && HcalDetId(digiData.id()).subdetId() != HcalEndcap)
30  continue;
31  uint32_t module = geometry_->getModuleFromCell(digiData.id());
32  if (geometry_->disconnectedModule(module))
33  continue;
34  dataframes.emplace_back(digiData.id());
35  for (int i = 0; i < digiData.size(); i++) {
36  dataframes.back().setSample(i, digiData.sample(i));
37  }
38  }
39 
40  vfeLinearizationImpl_->linearize(dataframes, linearized_dataframes);
41  vfeSummationImpl_->triggerCellSums(*geometry_, linearized_dataframes, payload);
42  vfeCompressionImpl_->compress(payload, compressed_payload);
43 
44  // Transform map to trigger cell vector vector<HGCalTriggerCell>
45  for (const auto& id_value : payload) {
46  if (id_value.second > 0) {
47  l1t::HGCalTriggerCell triggerCell(
48  reco::LeafCandidate::LorentzVector(), compressed_payload[id_value.first][1], 0, 0, 0, id_value.first);
49  triggerCell.setCompressedCharge(compressed_payload[id_value.first][0]);
50  triggerCell.setUncompressedCharge(id_value.second);
52 
53  // 'value' is hardware, so p4 is meaningless, except for eta and phi
54  math::PtEtaPhiMLorentzVector p4((double)id_value.second / cosh(point.eta()), point.eta(), point.phi(), 0.);
55  triggerCell.setP4(p4);
56  triggerCell.setPosition(point);
57 
58  // calibration part ---------------------------
59  if (triggerCell.hwPt() > 0) {
60  l1t::HGCalTriggerCell calibratedtriggercell(triggerCell);
61  calibration_->calibrateInGeV(calibratedtriggercell);
62  triggerCellColl.push_back(0, calibratedtriggercell);
63  }
64  }
65  }
66 }
const HGCalTriggerGeometryBase * geometry_
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
std::unique_ptr< HGCalVFECompressionImpl > vfeCompressionImpl_
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
double p4[4]
Definition: TauolaWrapper.h:92
std::unique_ptr< HGCalVFELinearizationImpl > vfeLinearizationImpl_
virtual bool disconnectedModule(const unsigned module_id) const =0
virtual unsigned getModuleFromCell(const unsigned cell_det_id) const =0
Definition: DetId.h:18
std::unique_ptr< HGCalVFESummationImpl > vfeSummationImpl_
T eta() const
Definition: PV3DBase.h:76
std::unique_ptr< HGCalTriggerCellCalibration > calibration_
Definition: vlib.h:208
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: LeafCandidate.h:23
*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
virtual GlobalPoint getTriggerCellPosition(const unsigned trigger_cell_det_id) const =0
void push_back(int bx, T object)

Member Data Documentation

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

Definition at line 28 of file HGCalVFEProcessorSums.h.

Referenced by HGCalVFEProcessorSums(), and run().

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

Definition at line 27 of file HGCalVFEProcessorSums.h.

Referenced by HGCalVFEProcessorSums(), and run().

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

Definition at line 25 of file HGCalVFEProcessorSums.h.

Referenced by HGCalVFEProcessorSums(), and run().

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

Definition at line 26 of file HGCalVFEProcessorSums.h.

Referenced by HGCalVFEProcessorSums(), and run().