CMS 3D CMS Logo

HGCalVFEProcessorSums.cc
Go to the documentation of this file.
2 #include <limits>
3 
6 
8 
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 }
15 
17  l1t::HGCalTriggerCellBxCollection& triggerCellColl,
18  const edm::EventSetup& es) {
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  if (!geometry_->validCell(digiData.id()))
32  continue;
33  uint32_t module = geometry_->getModuleFromCell(digiData.id());
34 
35  // no disconnected layer for HFNose
36  if (DetId(digiData.id()).subdetId() != ForwardSubdetector::HFNose) {
38  continue;
39  }
40 
41  dataframes.emplace_back(digiData.id());
42  for (int i = 0; i < digiData.size(); i++) {
43  dataframes.back().setSample(i, digiData.sample(i));
44  }
45  }
46 
47  vfeLinearizationImpl_->linearize(dataframes, linearized_dataframes);
48  vfeSummationImpl_->triggerCellSums(*geometry_, linearized_dataframes, payload);
49  vfeCompressionImpl_->compress(payload, compressed_payload);
50 
51  // Transform map to trigger cell vector vector<HGCalTriggerCell>
52  for (const auto& id_value : payload) {
53  if (id_value.second > 0) {
54  l1t::HGCalTriggerCell triggerCell(
55  reco::LeafCandidate::LorentzVector(), compressed_payload[id_value.first][1], 0, 0, 0, id_value.first);
56  triggerCell.setCompressedCharge(compressed_payload[id_value.first][0]);
57  triggerCell.setUncompressedCharge(id_value.second);
59 
60  // 'value' is hardware, so p4 is meaningless, except for eta and phi
61  math::PtEtaPhiMLorentzVector p4((double)id_value.second / cosh(point.eta()), point.eta(), point.phi(), 0.);
62  triggerCell.setP4(p4);
63  triggerCell.setPosition(point);
64 
65  // calibration part ---------------------------
66  if (triggerCell.hwPt() > 0) {
67  l1t::HGCalTriggerCell calibratedtriggercell(triggerCell);
68  calibration_->calibrateInGeV(calibratedtriggercell);
69  triggerCellColl.push_back(0, calibratedtriggercell);
70  }
71  }
72  }
73 }
DigiToRawDM_cff.digiColl
digiColl
Definition: DigiToRawDM_cff.py:32
HGCalVFEProcessorSums::vfeSummationImpl_
std::unique_ptr< HGCalVFESummationImpl > vfeSummationImpl_
Definition: HGCalVFEProcessorSums.h:26
mps_fire.i
i
Definition: mps_fire.py:355
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
HGCalVFEProcessorSums
Definition: HGCalVFEProcessorSums.h:16
edm::SortedCollection
Definition: SortedCollection.h:49
HGCalTriggerGeometryBase::getModuleFromCell
virtual unsigned getModuleFromCell(const unsigned cell_det_id) const =0
HGCalVFEProcessorSums::HGCalVFEProcessorSums
HGCalVFEProcessorSums(const edm::ParameterSet &conf)
Definition: HGCalVFEProcessorSums.cc:9
BXVector
Definition: BXVector.h:15
DetId
Definition: DetId.h:17
l1t::HGCalTriggerCell::setCompressedCharge
void setCompressedCharge(uint32_t value)
Definition: HGCalTriggerCell.h:36
HGCalVFEProcessorSums::vfeLinearizationImpl_
std::unique_ptr< HGCalVFELinearizationImpl > vfeLinearizationImpl_
Definition: HGCalVFEProcessorSums.h:25
HFNose
Definition: ForwardSubdetector.h:11
LeafCandidate.h
l1t::HGCalTriggerCell
Definition: HGCalTriggerCell.h:14
jets_cff.payload
payload
Definition: jets_cff.py:34
Point3DBase< float, GlobalTag >
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
HGCalVFEProcessorSums::run
void run(const HGCalDigiCollection &digiColl, l1t::HGCalTriggerCellBxCollection &triggerCellColl, const edm::EventSetup &es) override
Definition: HGCalVFEProcessorSums.cc:16
edm::ParameterSet
Definition: ParameterSet.h:36
edmplugin::PluginFactory
Definition: PluginFactory.h:34
HGCalProcessorBaseT::geometry_
const HGCalTriggerGeometryBase * geometry_
Definition: HGCalProcessorBaseT.h:24
HcalDetId
Definition: HcalDetId.h:12
p4
double p4[4]
Definition: TauolaWrapper.h:92
HGCalVFEProcessorSums::calibration_
std::unique_ptr< HGCalTriggerCellCalibration > calibration_
Definition: HGCalVFEProcessorSums.h:28
edm::EventSetup
Definition: EventSetup.h:57
module
Definition: vlib.h:198
reco::LeafCandidate::setP4
void setP4(const LorentzVector &p4) final
set 4-momentum
Definition: LeafCandidate.h:158
HGCalVFEProcessorSums.h
HcalEndcap
Definition: HcalAssistant.h:34
l1t::HGCalTriggerCell::setPosition
void setPosition(const GlobalPoint &position)
Definition: HGCalTriggerCell.h:23
HGCalTriggerGeometryBase::getTriggerCellPosition
virtual GlobalPoint getTriggerCellPosition(const unsigned trigger_cell_det_id) const =0
l1t::L1Candidate::hwPt
int hwPt() const
Definition: L1Candidate.h:35
l1t::HGCalTriggerCell::setUncompressedCharge
void setUncompressedCharge(uint32_t value)
Definition: HGCalTriggerCell.h:33
HGCalTriggerCell.h
math::PtEtaPhiMLorentzVector
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
HGCalVFEProcessorSums::vfeCompressionImpl_
std::unique_ptr< HGCalVFECompressionImpl > vfeCompressionImpl_
Definition: HGCalVFEProcessorSums.h:27
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)
HGCalProcessorBaseT
Definition: HGCalProcessorBaseT.h:10
reco::LeafCandidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: LeafCandidate.h:23