CMS 3D CMS Logo

List of all members | Classes | 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 ()
 

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 16 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 18 of file pfalgo_common_ref.h.

◆ ~PFAlgoEmulatorBase()

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

Member Function Documentation

◆ 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 86 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.

89  {
90  pt_t caloPtMin = track.hwPt - 2 * trackCaloPtErr;
91  if (caloPtMin < 0)
92  caloPtMin = 0;
93  float ptErr = std::max<float>(Scales::INTPT_LSB, Scales::floatPt(trackCaloPtErr));
94  ptscale_t dptscale = float(dR2MAX) / (ptErr * ptErr);
95  int dr2min = 0, ibest = -1;
96  for (int ic = 0, nCAL = calo.size(); ic < nCAL; ++ic) {
97  if (calo[ic].hwPt <= caloPtMin)
98  continue;
99  int dr2 = dr2_int(track.hwEta, track.hwPhi, calo[ic].hwEta, calo[ic].hwPhi);
100  if (dr2 >= dR2MAX)
101  continue;
102  pt_t dpt = track.hwPt - calo[ic].hwPt;
103  dr2 += int((dpt * dpt) * dptscale);
104  if (ibest == -1 || dr2 < dr2min) {
105  dr2min = dr2;
106  ibest = ic;
107  }
108  }
109  return ibest;
110 }
int dr2_int(eta_t eta1, phi_t phi1, eta_t eta2, phi_t phi2)
Definition: datatypes.h:219
constexpr float INTPT_LSB
Definition: datatypes.h:151
float floatPt(pt_t pt)
Definition: datatypes.h:161
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:27
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 113 of file pfalgo_common_ref.h.

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

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

◆ 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 42 of file pfalgo_common_ref.h.

References debug, and debug_.

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

Member Data Documentation

◆ debug_

bool l1ct::PFAlgoEmulatorBase::debug_
protected

Definition at line 64 of file pfalgo_common_ref.h.

Referenced by setDebug().

◆ dR2MAX_TK_CALO_

unsigned int l1ct::PFAlgoEmulatorBase::dR2MAX_TK_CALO_
protected

Definition at line 54 of file pfalgo_common_ref.h.

◆ dR2MAX_TK_MU_

unsigned int l1ct::PFAlgoEmulatorBase::dR2MAX_TK_MU_
protected

Definition at line 53 of file pfalgo_common_ref.h.

◆ nCALO_

unsigned int l1ct::PFAlgoEmulatorBase::nCALO_
protected

Definition at line 51 of file pfalgo_common_ref.h.

◆ nMU_

unsigned int l1ct::PFAlgoEmulatorBase::nMU_
protected

Definition at line 51 of file pfalgo_common_ref.h.

◆ nSELCALO_

unsigned int l1ct::PFAlgoEmulatorBase::nSELCALO_
protected

Definition at line 52 of file pfalgo_common_ref.h.

◆ nTRACK_

unsigned int l1ct::PFAlgoEmulatorBase::nTRACK_
protected

Definition at line 51 of file pfalgo_common_ref.h.

◆ ptErrBins_

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

Definition at line 62 of file pfalgo_common_ref.h.

◆ tk_MAXINVPT_LOOSE_

pt_t l1ct::PFAlgoEmulatorBase::tk_MAXINVPT_LOOSE_
protected

Definition at line 55 of file pfalgo_common_ref.h.

◆ tk_MAXINVPT_TIGHT_

pt_t l1ct::PFAlgoEmulatorBase::tk_MAXINVPT_TIGHT_
protected

Definition at line 55 of file pfalgo_common_ref.h.