1 #ifndef PFTKEGALGO_REF_H 2 #define PFTKEGALGO_REF_H 48 ap_int<z0_t::width + 1>
dZ;
79 unsigned int nTrack_in,
80 unsigned int nEmCalo_in,
91 const std::vector<double> &
dEtaValues = {0.015, 0.01},
92 const std::vector<double> &
dPhiValues = {0.07, 0.07},
105 const CompIDParameters &
compIDparams = {-4, 0.214844,
"compositeID.json"},
166 void link_emCalo2emCalo(
const std::vector<EmCaloObjEmu> &emcalo, std::vector<int> &emCalo2emCalo)
const;
169 const std::vector<EmCaloObjEmu> &emcalo,
170 const std::vector<TkObjEmu> &
track,
171 std::vector<int> &emCalo2tk)
const;
174 const std::vector<EmCaloObjEmu> &emcalo,
175 const std::vector<TkObjEmu> &
track,
176 std::vector<int> &emCalo2tk,
177 std::vector<float> &emCaloTkBdtScore)
const;
186 const std::vector<EmCaloObjEmu> &emcalo,
187 const std::vector<TkObjEmu> &
track,
191 float deltaPhi(
float phi1,
float phi2)
const;
194 const std::vector<EmCaloObjEmu> &emcalo,
195 std::vector<EmCaloObjEmu> &emcalo_sel)
const;
198 const std::vector<EmCaloObjEmu> &emcalo,
199 const std::vector<TkObjEmu> &
track,
200 const std::vector<int> &emCalo2emCalo,
201 const std::vector<int> &emCalo2tk,
202 const std::vector<float> &emCaloTkBdtScore,
203 std::vector<EGObjEmu> &egstas,
204 std::vector<EGIsoObjEmu> &egobjs,
205 std::vector<EGIsoEleObjEmu> &egeleobjs)
const;
208 std::vector<EGIsoObjEmu> &egobjs,
209 std::vector<EGIsoEleObjEmu> &egeleobjs,
210 const std::vector<EmCaloObjEmu> &emcalo,
211 const std::vector<TkObjEmu> &
track,
213 const unsigned int hwQual,
216 const float bdtScore,
217 const std::vector<unsigned int> &
components = {})
const;
221 const unsigned int hwQual,
223 const std::vector<unsigned int> &
components)
const;
227 const unsigned int hwQual,
228 const pt_t ptCorr)
const;
233 const unsigned int hwQual,
235 const float bdtScore)
const;
238 template <
typename T>
241 for (
int iout = 0; iout <
nOut; ++iout) {
244 for (
int it = 0; it <
nIn; ++it) {
245 for (
int iout = 0; iout <
nOut; ++iout) {
257 template <
typename T>
260 return dr2_int(charged.hwVtxEta(), charged.hwVtxPhi(), egphoton.
hwEta, egphoton.
hwPhi);
263 template <
typename T>
277 template <
typename T>
279 ap_int<z0_t::width + 1>
delta = charged.hwZ0 - z0;
285 template <
typename T>
287 ap_int<z0_t::width + 1>
delta = charged.hwZ0 - egele.
hwZ0;
293 template <
typename TCH,
typename TEG>
296 const std::vector<TCH> &
objects,
297 unsigned int nMaxObj,
301 for (
unsigned int itk = 0; itk < std::min<unsigned>(
objects.size(), nMaxObj); ++itk) {
318 template <
typename TEG>
321 const std::vector<PFNeutralObjEmu> &
objects,
322 unsigned int nMaxObj,
326 for (
unsigned int itk = 0; itk < std::min<unsigned>(
objects.size(), nMaxObj); ++itk) {
343 const std::vector<TkObjEmu> &
objects,
347 const std::vector<TkObjEmu> &
objects,
351 const std::vector<PFChargedObjEmu> &charged,
352 const std::vector<PFNeutralObjEmu> &neutrals,
356 const std::vector<PFChargedObjEmu> &charged,
357 const std::vector<PFNeutralObjEmu> &neutrals,
void addEgObjsToPF(std::vector< EGObjEmu > &egstas, std::vector< EGIsoObjEmu > &egobjs, std::vector< EGIsoEleObjEmu > &egeleobjs, const std::vector< EmCaloObjEmu > &emcalo, const std::vector< TkObjEmu > &track, const int calo_idx, const unsigned int hwQual, const pt_t ptCorr, const int tk_idx, const float bdtScore, const std::vector< unsigned int > &components={}) const
void sel_emCalo(unsigned int nmax_sel, const std::vector< EmCaloObjEmu > &emcalo, std::vector< EmCaloObjEmu > &emcalo_sel) const
virtual ~PFTkEGAlgoEmulator()
static edm::ParameterSetDescription getParameterSetDescription()
PFTkEGAlgoEmuConfig(const edm::ParameterSet &iConfig)
void setDebug(int verbose)
int deltaR2(const T &charged, const EGIsoEleObjEmu &egele) const
int dr2_int(eta_t eta1, phi_t phi1, eta_t eta2, phi_t phi2)
float deltaPhi(float phi1, float phi2) const
CompIDParameters(const edm::ParameterSet &)
IsoParameters tkIsoParams_tkEle
void compute_sumPt(iso_t &sumPt, iso_t &sumPtPV, const std::vector< PFNeutralObjEmu > &objects, unsigned int nMaxObj, const TEG &egobj, const PFTkEGAlgoEmuConfig::IsoParameters ¶ms, z0_t z0) const
ap_int< z0_t::width+1 > deltaZ0(const T &charged, const EGIsoObjEmu &egphoton, z0_t z0) const
bool writeBeforeBremRecovery
IsoParameters(float tkQualityPtMin, float dZ, float dRMin, float dRMax)
ap_fixed< 12, 3, AP_RND_CONV, AP_SAT > bdt_score_t
pt_t makePtFromFloat(float pt)
static edm::ParameterSetDescription getParameterSetDescription()
IsoParameters tkIsoParams_tkEm
const std::string conifer_model
IsoParameters(const edm::ParameterSet &)
EGObjEmu & addEGStaToPF(std::vector< EGObjEmu > &egobjs, const EmCaloObjEmu &calo, const unsigned int hwQual, const pt_t ptCorr, const std::vector< unsigned int > &components) const
void runIso(const PFInputRegion &in, const std::vector< l1ct::PVObjEmu > &pvs, OutputRegion &out) const
int makeDR2FromFloatDR(float dr)
const double bdtScore_loose_wp
static edm::ParameterSetDescription getParameterSetDescription()
ap_ufixed< 11, 9, AP_TRN, AP_SAT > iso_t
void toFirmware(const PFInputRegion &in, PFRegion ®ion, EmCaloObj calo[], TkObj track[]) const
PFTkEGAlgoEmulator(const PFTkEGAlgoEmuConfig &config)
void link_emCalo2tk_elliptic(const PFRegionEmu &r, const std::vector< EmCaloObjEmu > &emcalo, const std::vector< TkObjEmu > &track, std::vector< int > &emCalo2tk) const
conifer::BDT< bdt_feature_t, ap_fixed< 12, 3, AP_RND_CONV, AP_SAT >, false > * composite_bdt_
ap_int< z0_t::width+1 > deltaZ0(const T &charged, const EGIsoEleObjEmu &egele, z0_t z0) const
float compute_composite_score(CompositeCandidate &cand, const std::vector< EmCaloObjEmu > &emcalo, const std::vector< TkObjEmu > &track, const PFTkEGAlgoEmuConfig::CompIDParameters ¶ms) const
IsoParameters pfIsoParams_tkEm
void run(const PFInputRegion &in, OutputRegion &out) const
std::vector< double > dEtaValues
ap_fixed< 21, 12, AP_RND_CONV, AP_SAT > bdt_feature_t
int deltaR2(const PFNeutralObjEmu &neutral, const EGIsoObjEmu &egphoton) const
void eg_algo(const PFRegionEmu ®ion, const std::vector< EmCaloObjEmu > &emcalo, const std::vector< TkObjEmu > &track, const std::vector< int > &emCalo2emCalo, const std::vector< int > &emCalo2tk, const std::vector< float > &emCaloTkBdtScore, std::vector< EGObjEmu > &egstas, std::vector< EGIsoObjEmu > &egobjs, std::vector< EGIsoEleObjEmu > &egeleobjs) const
void compute_isolation(std::vector< EGIsoObjEmu > &egobjs, const std::vector< TkObjEmu > &objects, const PFTkEGAlgoEmuConfig::IsoParameters ¶ms, z0_t z0) const
void link_emCalo2tk_composite(const PFRegionEmu &r, const std::vector< EmCaloObjEmu > &emcalo, const std::vector< TkObjEmu > &track, std::vector< int > &emCalo2tk, std::vector< float > &emCaloTkBdtScore) const
EGIsoObjEmu & addEGIsoToPF(std::vector< EGIsoObjEmu > &egobjs, const EmCaloObjEmu &calo, const unsigned int hwQual, const pt_t ptCorr) const
int deltaR2(const PFNeutralObjEmu &neutral, const EGIsoEleObjEmu &egele) const
ap_ufixed< 14, 12, AP_TRN, AP_SAT > pt_t
ap_int< z0_t::width+1 > dZ
int deltaR2(const T &charged, const EGIsoObjEmu &egphoton) const
EGIsoEleObjEmu::IsoType hwIsoTypeTkEle
CompIDParameters compIDparams
unsigned int nCompCandPerCluster
IsoParameters pfIsoParams_tkEle
PFTkEGAlgoEmuConfig(unsigned int nTrack, unsigned int nTrack_in, unsigned int nEmCalo_in, unsigned int nEmOut, bool filterHwQuality, bool doBremRecovery, bool writeBeforeBremRecovery=false, int caloHwQual=4, bool doEndcapHwQual=false, float emClusterPtMin=2., float dEtaMaxBrem=0.02, float dPhiMaxBrem=0.1, const std::vector< double > &absEtaBoundaries={0.0, 1.5}, const std::vector< double > &dEtaValues={0.015, 0.01}, const std::vector< double > &dPhiValues={0.07, 0.07}, float trkQualityPtMin=10., bool doCompositeTkEle=false, unsigned int nCompCandPerCluster=4, bool writeEgSta=false, const IsoParameters &tkIsoParams_tkEle={2., 0.6, 0.03, 0.2}, const IsoParameters &tkIsoParams_tkEm={2., 0.6, 0.07, 0.3}, const IsoParameters &pfIsoParams_tkEle={1., 0.6, 0.03, 0.2}, const IsoParameters &pfIsoParams_tkEm={1., 0.6, 0.07, 0.3}, bool doTkIso=true, bool doPfIso=false, EGIsoEleObjEmu::IsoType hwIsoTypeTkEle=EGIsoEleObjEmu::IsoType::TkIso, EGIsoObjEmu::IsoType hwIsoTypeTkEm=EGIsoObjEmu::IsoType::TkIsoPV, const CompIDParameters &compIDparams={-4, 0.214844, "compositeID.json"}, int debug=0)
std::vector< double > dPhiValues
const double bdtScore_tight_wp
EGIsoEleObjEmu & addEGIsoEleToPF(std::vector< EGIsoEleObjEmu > &egobjs, const EmCaloObjEmu &calo, const TkObjEmu &track, const unsigned int hwQual, const pt_t ptCorr, const float bdtScore) const
void link_emCalo2emCalo(const std::vector< EmCaloObjEmu > &emcalo, std::vector< int > &emCalo2emCalo) const
std::vector< double > absEtaBoundaries
void ptsort_ref(int nIn, int nOut, const std::vector< T > &in, std::vector< T > &out) const
CompIDParameters(double bdtScore_loose_wp, double bdtScore_tight_wp, const std::string &model)
EGIsoObjEmu::IsoType hwIsoTypeTkEm
void compute_sumPt(iso_t &sumPt, iso_t &sumPtPV, const std::vector< TCH > &objects, unsigned int nMaxObj, const TEG &egobj, const PFTkEGAlgoEmuConfig::IsoParameters ¶ms, z0_t z0) const
unsigned int nEMCALO_EGIN