CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
l1ct::PFAlgoEmulatorBase Class Referenceabstract

#include <pfalgo_common_ref.h>

Inheritance diagram for l1ct::PFAlgoEmulatorBase:
l1ct::PFAlgo2HGCEmulator l1ct::PFAlgo3Emulator l1ct::PFAlgoDummyEmulator

Classes

struct  ptErrBin
 

Public Member Functions

void loadPtErrBins (unsigned int nbins, const float absetas[], const float scales[], const float offs[], bool verbose=false)
 
void loadPtErrBins (const edm::ParameterSet &iConfig)
 
virtual void mergeNeutrals (OutputRegion &out) const =0
 moves all objects from out.pfphoton to the beginning of out.pfneutral More...
 
 PFAlgoEmulatorBase (unsigned int nTrack, unsigned int nCalo, unsigned int nMu, unsigned int nSelCalo, unsigned int dR2Max_Tk_Mu, unsigned int dR2Max_Tk_Calo, pt_t tk_MaxInvPt_Loose, pt_t tk_MaxInvPt_Tight)
 
virtual void run (const PFInputRegion &in, OutputRegion &out) const =0
 
void setDebug (bool debug=true)
 
virtual ~PFAlgoEmulatorBase ()
 

Static Public Member Functions

static void addCaloResolutionParameterSetDescription (edm::ParameterSetDescription &to)
 

Protected Member Functions

template<typename COV >
int best_match_with_pt_ref (int dR2MAX, const COV &calo, const TkObjEmu &track, const pt_t &trackCaloPtErr) const
 
void fillPFCand (const TkObjEmu &track, PFChargedObjEmu &pf, bool isMu, bool isEle) const
 
void fillPFCand (const HadCaloObjEmu &calo, PFNeutralObjEmu &pf, bool isPhoton=false) const
 
void fillPFCand (const EmCaloObjEmu &calo, PFNeutralObjEmu &pf, bool isPhoton=true) const
 
void pfalgo_mu_ref (const PFInputRegion &in, OutputRegion &out, std::vector< int > &iMu) const
 
pt_t ptErr_ref (const PFRegionEmu &region, const TkObjEmu &track) const
 
template<typename TV >
void ptsort_ref (int nIn, int nOut, const TV &in, TV &out) const
 

Protected Attributes

bool debug_
 
unsigned int dR2MAX_TK_CALO_
 
unsigned int dR2MAX_TK_MU_
 
unsigned int nCALO_
 
unsigned int nMU_
 
unsigned int nSELCALO_
 
unsigned int nTRACK_
 
std::vector< ptErrBinptErrBins_
 
pt_t tk_MAXINVPT_LOOSE_
 
pt_t tk_MAXINVPT_TIGHT_
 

Detailed Description

Definition at line 17 of file pfalgo_common_ref.h.

Constructor & Destructor Documentation

◆ PFAlgoEmulatorBase()

l1ct::PFAlgoEmulatorBase::PFAlgoEmulatorBase ( unsigned int  nTrack,
unsigned int  nCalo,
unsigned int  nMu,
unsigned int  nSelCalo,
unsigned int  dR2Max_Tk_Mu,
unsigned int  dR2Max_Tk_Calo,
pt_t  tk_MaxInvPt_Loose,
pt_t  tk_MaxInvPt_Tight 
)
inline

Definition at line 19 of file pfalgo_common_ref.h.

◆ ~PFAlgoEmulatorBase()

virtual l1ct::PFAlgoEmulatorBase::~PFAlgoEmulatorBase ( )
virtual

Member Function Documentation

◆ addCaloResolutionParameterSetDescription()

static void l1ct::PFAlgoEmulatorBase::addCaloResolutionParameterSetDescription ( edm::ParameterSetDescription to)
static

◆ best_match_with_pt_ref()

template<typename COV >
int l1ct::PFAlgoEmulatorBase::best_match_with_pt_ref ( int  dR2MAX,
const COV &  calo,
const TkObjEmu track,
const pt_t trackCaloPtErr 
) const
protected

Definition at line 88 of file pfalgo_common_ref.h.

References l1ct::dr2_int(), nano_mu_digi_cff::float, l1ct::Scales::floatPt(), l1trig_cff::hwPt, createfilelist::int, l1ct::Scales::INTPT_LSB, muons_cff::ptErr, and HLT_2023v12_cff::track.

91  {
92  pt_t caloPtMin = track.hwPt - 2 * trackCaloPtErr;
93  if (caloPtMin < 0)
94  caloPtMin = 0;
95  float ptErr = std::max<float>(Scales::INTPT_LSB, Scales::floatPt(trackCaloPtErr));
96  ptscale_t dptscale = float(dR2MAX) / (ptErr * ptErr);
97  int dr2min = 0, ibest = -1;
98  for (int ic = 0, nCAL = calo.size(); ic < nCAL; ++ic) {
99  if (calo[ic].hwPt <= caloPtMin)
100  continue;
101  int dr2 = dr2_int(track.hwEta, track.hwPhi, calo[ic].hwEta, calo[ic].hwPhi);
102  if (dr2 >= dR2MAX)
103  continue;
104  pt_t dpt = track.hwPt - calo[ic].hwPt;
105  dr2 += int((dpt * dpt) * dptscale);
106  if (ibest == -1 || dr2 < dr2min) {
107  dr2min = dr2;
108  ibest = ic;
109  }
110  }
111  return ibest;
112 }
int dr2_int(eta_t eta1, phi_t phi1, eta_t eta2, phi_t phi2)
Definition: datatypes.h:218
constexpr float INTPT_LSB
Definition: datatypes.h:143
float floatPt(pt_t pt)
Definition: datatypes.h:153
ap_ufixed< 17, 17 - 4, AP_TRN, AP_SAT > ptscale_t
Definition: pfalgo_types.h:8
ap_ufixed< 16, 14 > pt_t
Definition: TauNNIdHW.h:13
Definition: Common.h:9

◆ fillPFCand() [1/3]

void l1ct::PFAlgoEmulatorBase::fillPFCand ( const TkObjEmu track,
PFChargedObjEmu pf,
bool  isMu,
bool  isEle 
) const
protected

◆ fillPFCand() [2/3]

void l1ct::PFAlgoEmulatorBase::fillPFCand ( const HadCaloObjEmu calo,
PFNeutralObjEmu pf,
bool  isPhoton = false 
) const
protected

◆ fillPFCand() [3/3]

void l1ct::PFAlgoEmulatorBase::fillPFCand ( const EmCaloObjEmu calo,
PFNeutralObjEmu pf,
bool  isPhoton = true 
) const
protected

◆ loadPtErrBins() [1/2]

void l1ct::PFAlgoEmulatorBase::loadPtErrBins ( unsigned int  nbins,
const float  absetas[],
const float  scales[],
const float  offs[],
bool  verbose = false 
)

◆ loadPtErrBins() [2/2]

void l1ct::PFAlgoEmulatorBase::loadPtErrBins ( const edm::ParameterSet iConfig)

◆ mergeNeutrals()

virtual void l1ct::PFAlgoEmulatorBase::mergeNeutrals ( OutputRegion out) const
pure virtual

moves all objects from out.pfphoton to the beginning of out.pfneutral

Implemented in l1ct::PFAlgo3Emulator, l1ct::PFAlgo2HGCEmulator, and l1ct::PFAlgoDummyEmulator.

◆ pfalgo_mu_ref()

void l1ct::PFAlgoEmulatorBase::pfalgo_mu_ref ( const PFInputRegion in,
OutputRegion out,
std::vector< int > &  iMu 
) const
protected

◆ ptErr_ref()

pt_t l1ct::PFAlgoEmulatorBase::ptErr_ref ( const PFRegionEmu region,
const TkObjEmu track 
) const
protected

◆ ptsort_ref()

template<typename TV >
void l1ct::PFAlgoEmulatorBase::ptsort_ref ( int  nIn,
int  nOut,
const TV &  in,
TV &  out 
) const
protected

Definition at line 115 of file pfalgo_common_ref.h.

References l1trig_cff::hwPt, testProducerWithPsetDescEmpty_cfi::i2, recoMuon::in, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, l1ctLayer1_cff::nIn, l1ctLayer1_cff::nOut, and MillePedeFileConverter_cfg::out.

115  {
116  out.resize(nOut);
117  for (int iout = 0; iout < nOut; ++iout) {
118  out[iout].clear();
119  }
120  for (int it = 0; it < nIn; ++it) {
121  for (int iout = 0; iout < nOut; ++iout) {
122  if (in[it].hwPt >= out[iout].hwPt) {
123  for (int i2 = nOut - 1; i2 > iout; --i2) {
124  out[i2] = out[i2 - 1];
125  }
126  out[iout] = in[it];
127  break;
128  }
129  }
130  }
131 }

◆ run()

virtual void l1ct::PFAlgoEmulatorBase::run ( const PFInputRegion in,
OutputRegion out 
) const
pure virtual

◆ setDebug()

void l1ct::PFAlgoEmulatorBase::setDebug ( bool  debug = true)
inline

Definition at line 44 of file pfalgo_common_ref.h.

References debug, and debug_.

44 { debug_ = debug; }
#define debug
Definition: HDRShower.cc:19

Member Data Documentation

◆ debug_

bool l1ct::PFAlgoEmulatorBase::debug_
protected

Definition at line 66 of file pfalgo_common_ref.h.

Referenced by setDebug().

◆ dR2MAX_TK_CALO_

unsigned int l1ct::PFAlgoEmulatorBase::dR2MAX_TK_CALO_
protected

Definition at line 56 of file pfalgo_common_ref.h.

◆ dR2MAX_TK_MU_

unsigned int l1ct::PFAlgoEmulatorBase::dR2MAX_TK_MU_
protected

Definition at line 55 of file pfalgo_common_ref.h.

◆ nCALO_

unsigned int l1ct::PFAlgoEmulatorBase::nCALO_
protected

Definition at line 53 of file pfalgo_common_ref.h.

◆ nMU_

unsigned int l1ct::PFAlgoEmulatorBase::nMU_
protected

Definition at line 53 of file pfalgo_common_ref.h.

◆ nSELCALO_

unsigned int l1ct::PFAlgoEmulatorBase::nSELCALO_
protected

Definition at line 54 of file pfalgo_common_ref.h.

◆ nTRACK_

unsigned int l1ct::PFAlgoEmulatorBase::nTRACK_
protected

Definition at line 53 of file pfalgo_common_ref.h.

◆ ptErrBins_

std::vector<ptErrBin> l1ct::PFAlgoEmulatorBase::ptErrBins_
protected

Definition at line 64 of file pfalgo_common_ref.h.

◆ tk_MAXINVPT_LOOSE_

pt_t l1ct::PFAlgoEmulatorBase::tk_MAXINVPT_LOOSE_
protected

Definition at line 57 of file pfalgo_common_ref.h.

◆ tk_MAXINVPT_TIGHT_

pt_t l1ct::PFAlgoEmulatorBase::tk_MAXINVPT_TIGHT_
protected

Definition at line 57 of file pfalgo_common_ref.h.