CMS 3D CMS Logo

Classes | Namespaces | Typedefs | Functions | Variables
L1PFHtEmulator.h File Reference
#include "DataFormats/L1TParticleFlow/interface/jets.h"
#include "DataFormats/L1TParticleFlow/interface/sums.h"
#include "L1Trigger/Phase2L1ParticleFlow/interface/dbgPrintf.h"
#include "L1Trigger/Phase2L1ParticleFlow/interface/jetmet/L1SeedConePFJetEmulator.h"
#include "hls_math.h"
#include <vector>
#include <numeric>
#include <algorithm>
#include "ap_int.h"
#include "ap_fixed.h"

Go to the source code of this file.

Classes

class  P2L1HTMHTEmu::PtPxPy
 

Namespaces

 P2L1HTMHTEmu
 
 P2L1HTMHTEmu::Scales
 

Typedefs

typedef ap_fixed< 9, 2 > P2L1HTMHTEmu::cossin_t
 
typedef l1ct::glbeta_t P2L1HTMHTEmu::etaphi_t
 
typedef l1ct::pt_t P2L1HTMHTEmu::pt_t
 
typedef ap_fixed< 16, 13 > P2L1HTMHTEmu::pxy_t
 
typedef ap_fixed< 12, 3 > P2L1HTMHTEmu::radians_t
 

Functions

l1ct::Sum htmht (std::vector< l1ct::Jet > jets)
 
template<class data_T , class table_T , int N>
void P2L1HTMHTEmu::init_sinphi_table (table_T table_out[N])
 
PtPxPy P2L1HTMHTEmu::mht_compute (l1ct::Jet jet)
 
etaphi_t P2L1HTMHTEmu::phi_cordic (pxy_t y, pxy_t x)
 
template<class in_t , class table_t , int N>
table_t P2L1HTMHTEmu::sine_with_conversion (etaphi_t hwPhi)
 

Variables

static constexpr int P2L1HTMHTEmu::N_TABLE = 2048
 
const ap_fixed< 12, -4 > P2L1HTMHTEmu::Scales::scale_degToRad = M_PI / 180.
 

Function Documentation

◆ htmht()

l1ct::Sum htmht ( std::vector< l1ct::Jet jets)
inline

Definition at line 108 of file L1PFHtEmulator.h.

References metsig::jet, PDWG_EXODelayedJetMET_cff::jets, P2L1HTMHTEmu::mht_compute(), P2L1HTMHTEmu::phi_cordic(), mathSSE::sqrt(), and HcalDetIdTransform::transform().

Referenced by L1MhtPfProducer::produce(), HLTCaloTowerHtMhtProducer::produce(), and HLTHtMhtProducer::produce().

108  {
109  // compute jet px, py
110  std::vector<P2L1HTMHTEmu::PtPxPy> ptpxpy;
111  ptpxpy.resize(jets.size());
113  jets.begin(), jets.end(), ptpxpy.begin(), [](const l1ct::Jet& jet) { return P2L1HTMHTEmu::mht_compute(jet); });
114 
115  // Sum pt, px, py over jets
116  P2L1HTMHTEmu::PtPxPy hthxhy = std::accumulate(ptpxpy.begin(), ptpxpy.end(), P2L1HTMHTEmu::PtPxPy());
117 
118  // Compute the MHT magnitude and direction
119  l1ct::Sum ht;
120  ht.hwSumPt = hthxhy.pt;
121 #ifdef CMSSW_GIT_HASH
122  ht.hwPt =
123  sqrt(((hthxhy.px * hthxhy.px) + (hthxhy.py * hthxhy.py)).to_double()); // hls_math.h not available yet in CMSSW
124 #else
125  ht.hwPt = hls::sqrt(((hthxhy.px * hthxhy.px) + (hthxhy.py * hthxhy.py)));
126 #endif
127  ht.hwPhi = P2L1HTMHTEmu::phi_cordic(hthxhy.py, hthxhy.px);
128  return ht;
129 }
Definition: jets.h:12
etaphi_t phi_cordic(pxy_t y, pxy_t x)
T sqrt(T t)
Definition: SSEVec.h:19
PtPxPy mht_compute(l1ct::Jet jet)
Definition: sums.h:10
unsigned transform(const HcalDetId &id, unsigned transformCode)