1 #ifndef PFTKEGALGO_REF_H 2 #define PFTKEGALGO_REF_H 47 ap_int<z0_t::width + 1>
dZ;
76 unsigned int nTrack_in,
77 unsigned int nEmCalo_in,
88 const std::vector<double> &
dEtaValues = {0.015, 0.01},
89 const std::vector<double> &
dPhiValues = {0.07, 0.07},
102 const CompIDParameters &
compIDparams = {-4, 0.214844,
"compositeID.json"},
161 void link_emCalo2emCalo(
const std::vector<EmCaloObjEmu> &emcalo, std::vector<int> &emCalo2emCalo)
const;
164 const std::vector<EmCaloObjEmu> &emcalo,
165 const std::vector<TkObjEmu> &
track,
166 std::vector<int> &emCalo2tk)
const;
169 const std::vector<EmCaloObjEmu> &emcalo,
170 const std::vector<TkObjEmu> &
track,
171 std::vector<int> &emCalo2tk,
172 std::vector<float> &emCaloTkBdtScore)
const;
181 const std::vector<EmCaloObjEmu> &emcalo,
182 const std::vector<TkObjEmu> &
track,
186 float deltaPhi(
float phi1,
float phi2)
const;
189 const std::vector<EmCaloObjEmu> &emcalo,
190 std::vector<EmCaloObjEmu> &emcalo_sel)
const;
193 const std::vector<EmCaloObjEmu> &emcalo,
194 const std::vector<TkObjEmu> &
track,
195 const std::vector<int> &emCalo2emCalo,
196 const std::vector<int> &emCalo2tk,
197 const std::vector<float> &emCaloTkBdtScore,
198 std::vector<EGObjEmu> &egstas,
199 std::vector<EGIsoObjEmu> &egobjs,
200 std::vector<EGIsoEleObjEmu> &egeleobjs)
const;
203 std::vector<EGIsoObjEmu> &egobjs,
204 std::vector<EGIsoEleObjEmu> &egeleobjs,
205 const std::vector<EmCaloObjEmu> &emcalo,
206 const std::vector<TkObjEmu> &
track,
208 const unsigned int hwQual,
211 const float bdtScore,
212 const std::vector<unsigned int> &
components = {})
const;
216 const unsigned int hwQual,
218 const std::vector<unsigned int> &
components)
const;
222 const unsigned int hwQual,
223 const pt_t ptCorr)
const;
228 const unsigned int hwQual,
230 const float bdtScore)
const;
233 template <
typename T>
236 for (
int iout = 0; iout <
nOut; ++iout) {
239 for (
int it = 0; it <
nIn; ++it) {
240 for (
int iout = 0; iout <
nOut; ++iout) {
252 template <
typename T>
255 return dr2_int(charged.hwVtxEta(), charged.hwVtxPhi(), egphoton.
hwEta, egphoton.
hwPhi);
258 template <
typename T>
272 template <
typename T>
274 ap_int<z0_t::width + 1>
delta = charged.hwZ0 - z0;
280 template <
typename T>
282 ap_int<z0_t::width + 1>
delta = charged.hwZ0 - egele.
hwZ0;
288 template <
typename TCH,
typename TEG>
291 const std::vector<TCH> &
objects,
292 unsigned int nMaxObj,
296 for (
unsigned int itk = 0; itk < std::min<unsigned>(
objects.size(), nMaxObj); ++itk) {
313 template <
typename TEG>
316 const std::vector<PFNeutralObjEmu> &
objects,
317 unsigned int nMaxObj,
321 for (
unsigned int itk = 0; itk < std::min<unsigned>(
objects.size(), nMaxObj); ++itk) {
338 const std::vector<TkObjEmu> &
objects,
342 const std::vector<TkObjEmu> &
objects,
346 const std::vector<PFChargedObjEmu> &charged,
347 const std::vector<PFNeutralObjEmu> &neutrals,
351 const std::vector<PFChargedObjEmu> &charged,
352 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()
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)
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
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