24 ~L1BJetProducer()
override =
default;
27 static std::unique_ptr<BJetTFCache> initializeGlobalCache(
const edm::ParameterSet&);
45 fUseRawPt_(
cfg.getParameter<
bool>(
"useRawPt")),
46 fMinPt_(
cfg.getParameter<double>(
"minPt")),
47 fMaxEta_(
cfg.getParameter<double>(
"maxEta")),
48 fMaxJets_(
cfg.getParameter<
int>(
"maxJets")),
49 fNParticles_(
cfg.getParameter<
int>(
"nParticles")),
53 produces<edm::ValueMap<float>>(
"L1PFBJets");
57 auto cache = std::make_unique<BJetTFCache>(
fp.fullPath());
68 iEvent.getByToken(fVtxEmu_, vtxEmuHandle);
69 for (
const auto&
vtx : *vtxEmuHandle) {
70 if (ptsum == 0 ||
vtx.pt() > ptsum) {
76 std::vector<float> bScores;
78 for (
const auto& srcjet : *
jets) {
79 if (((fUseRawPt_ ? srcjet.rawPt() : srcjet.pt()) < fMinPt_) ||
std::abs(srcjet.eta()) > fMaxEta_ ||
80 bScores.size() >= fMaxJets_) {
81 bScores.push_back(-1.);
84 float NN = fBJetId_->compute(srcjet,
vz, fUseRawPt_);
85 bScores.push_back(
NN);
88 auto outT = std::make_unique<edm::ValueMap<float>>();
90 fillerT.insert(
jets, bScores.begin(), bScores.end());
100 desc.add<
bool>(
"useRawPt",
true);
102 edm::FileInPath(
"L1Trigger/Phase2L1ParticleFlow/data/modelTT_PUP_Off_dXY_XYCut_Graph.pb"));
105 desc.add<
int>(
"maxJets", 10);
106 desc.add<
int>(
"nParticles", 10);
107 desc.add<
double>(
"minPt", 20);
108 desc.add<
double>(
"maxEta", 2.4);
110 descriptions.
add(
"L1BJetProducer",
desc);
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
edm::EDGetTokenT< edm::View< l1t::PFJet > > const jets_
constexpr Matriplex::idx_t NN
Abs< T >::type abs(const T &t)
unsigned int const fMaxJets_
#define DEFINE_FWK_MODULE(type)
static std::unique_ptr< BJetTFCache > initializeGlobalCache(const edm::ParameterSet &)
L1BJetProducer(const edm::ParameterSet &, const BJetTFCache *)
edm::EDGetTokenT< std::vector< l1t::VertexWord > > const fVtxEmu_
std::unique_ptr< BJetId > fBJetId_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static void globalEndJob(const BJetTFCache *)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)