CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HGCalConcentratorTrigSumImpl.cc
Go to the documentation of this file.
2 
4 
5 void HGCalConcentratorTrigSumImpl::doSum(uint32_t module_id,
6  const std::vector<l1t::HGCalTriggerCell>& trigCellVecInput,
7  std::vector<l1t::HGCalTriggerSums>& trigSumsVecOutput) const {
8  double ptsum = 0;
9  double mipptsum = 0;
10  double hwptsum = 0;
11 
12  for (const auto& trigCell : trigCellVecInput) {
13  // detId selection is already done in HGCalConcentratorProcessorSelection:
14  // here we do not worry about it and assume all cells are from the same module
15  ptsum += trigCell.pt();
16  mipptsum += trigCell.mipPt();
17  hwptsum += trigCell.hwPt();
18  }
19  if (!trigCellVecInput.empty()) {
21 
22  math::PtEtaPhiMLorentzVector p4(ptsum, module_pos.eta(), module_pos.phi(), 0);
24  ts.setP4(p4);
25  ts.setDetId(module_id);
26  ts.setPosition(module_pos);
27  ts.setMipPt(mipptsum);
28  ts.setHwPt(hwptsum);
29  trigSumsVecOutput.push_back(ts);
30  }
31 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
const HGCalTriggerGeometryBase * getTriggerGeometry() const
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
HGCalConcentratorTrigSumImpl(const edm::ParameterSet &conf)
virtual GlobalPoint getModulePosition(const unsigned module_det_id) const =0
T eta() const
Definition: PV3DBase.h:73
void setP4(const LorentzVector &p4) final
set 4-momentum
void doSum(uint32_t module_id, const std::vector< l1t::HGCalTriggerCell > &trigCellVecInput, std::vector< l1t::HGCalTriggerSums > &trigSumsVecOutput) const