Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tau spring24 update #44349

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions DataFormats/L1TParticleFlow/interface/PFTau.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ namespace l1t {
static constexpr float PFTAU_NN_SLOPE = 0.2;
static constexpr float PFTAU_NN_OVERALL_SCALE = 1. / 20.1;

static constexpr float PFTAU_NN_LOOSE_CUT = 0.28;
static constexpr float PFTAU_NN_TIGHT_CUT = 0.25;
static constexpr float PFTAU_NN_LOOSE_CUT = 0.22;
static constexpr float PFTAU_NN_TIGHT_CUT = 0.4;

static constexpr float PFTAU_PF_LOOSE_CUT = 10.0;
static constexpr float PFTAU_PF_TIGHT_CUT = 5.0;
Expand Down Expand Up @@ -63,10 +63,7 @@ namespace l1t {
return passLooseNN();
}
bool passLoosePF() const { return fullIso_ < PFTAU_PF_LOOSE_CUT; }
bool passTightNN() const {
return iso_ * (PFTAU_NN_OFFSET + PFTAU_NN_SLOPE * (min(pt(), PFTAU_NN_PT_CUTOFF))) * PFTAU_NN_OVERALL_SCALE >
PFTAU_NN_TIGHT_CUT;
}
bool passTightNN() const { return iso_ > PFTAU_NN_TIGHT_CUT; }
bool passTightNNMass() const {
if (!passMass())
return false;
Expand Down
10 changes: 5 additions & 5 deletions L1Trigger/Phase2L1ParticleFlow/interface/taus/TauNNIdHW.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ namespace L1TauEmu {
//This way, the least significant bit of etaphi_t is exactly 0.01
//Even though 0.01 is not a power of 2
static constexpr float etaphi_base = 100. / 64;
typedef ap_ufixed<16, 14> pt_t; // 1 unit = 0.25 GeV;
typedef ap_fixed<10, 4> etaphi_t; // 1 unit = 0.01;
typedef ap_fixed<12, 6> detaphi_t; // type for the difference between etas or phis
typedef ap_fixed<18, 9> detaphi2_t; // type for detaphi_t squared
typedef ap_fixed<22, 16> pt_etaphi_t; // type for product of pt with deta or phi
typedef ap_ufixed<14, 12, AP_TRN, AP_SAT> pt_t; // 1 unit = 0.25 GeV;
typedef ap_fixed<10, 4> etaphi_t; // 1 unit = 0.01;
typedef ap_fixed<12, 6> detaphi_t; // type for the difference between etas or phis
typedef ap_fixed<18, 9> detaphi2_t; // type for detaphi_t squared
typedef ap_fixed<22, 16> pt_etaphi_t; // type for product of pt with deta or phi
typedef ap_int<8> dxy_t;
typedef ap_int<10> z0_t;
typedef ap_uint<5> count_t; // type for multiplicity
Expand Down
2 changes: 1 addition & 1 deletion L1Trigger/Phase2L1ParticleFlow/interface/taus/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#define N_LAYER_20 1

// hls-fpga-machine-learning insert layer-precision
typedef ap_fixed<16, 6> input_t;
typedef ap_fixed<16, 10> input_t;
typedef ap_fixed<24, 12> input2_t;
typedef ap_fixed<16, 6> model_default_t;
typedef ap_fixed<16, 6> layer2_t;
Expand Down
4 changes: 0 additions & 4 deletions L1Trigger/Phase2L1ParticleFlow/plugins/L1NNTauProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ void L1NNTauProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup)
process_SW(*l1PFCandidates, lTaus);
}

if (lTaus->empty()) {
Duchstf marked this conversation as resolved.
Show resolved Hide resolved
PFTau dummy;
lTaus->push_back(dummy);
}
std::sort(lTaus->begin(), lTaus->end(), [](l1t::PFTau i, l1t::PFTau j) { return (i.pt() > j.pt()); });
iEvent.put(std::move(lTaus), "L1PFTausNN");
}
Expand Down