CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
L1BJetProducer Class Reference
Inheritance diagram for L1BJetProducer:
edm::stream::EDProducer< edm::GlobalCache< BJetTFCache > >

Public Member Functions

 L1BJetProducer (const edm::ParameterSet &, const BJetTFCache *)
 
 ~L1BJetProducer () override=default
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< BJetTFCache > >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
static void globalEndJob (const BJetTFCache *)
 
static std::unique_ptr< BJetTFCacheinitializeGlobalCache (const edm::ParameterSet &)
 

Private Member Functions

void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 

Private Attributes

std::unique_ptr< JetIdfBJetId_
 
double const fMaxEta_
 
unsigned int const fMaxJets_
 
double const fMinPt_
 
int const fNParticles_
 
bool const fUseRawPt_
 
edm::EDGetTokenT< std::vector< l1t::VertexWord > > const fVtxEmu_
 
edm::EDGetTokenT< edm::View< l1t::PFJet > > const jets_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< BJetTFCache > >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 21 of file L1BJetProducer.cc.

Constructor & Destructor Documentation

◆ L1BJetProducer()

L1BJetProducer::L1BJetProducer ( const edm::ParameterSet cfg,
const BJetTFCache cache 
)
explicit

Definition at line 43 of file L1BJetProducer.cc.

References utilities::cache(), looper::cfg, fBJetId_, fNParticles_, and AlCaHLTBitMon_QueryRunRegistry::string.

44  : jets_(consumes<edm::View<l1t::PFJet>>(cfg.getParameter<edm::InputTag>("jets"))),
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")),
50  fVtxEmu_(consumes<std::vector<l1t::VertexWord>>(cfg.getParameter<edm::InputTag>("vtx"))) {
51  fBJetId_ = std::make_unique<JetId>(
52  cfg.getParameter<std::string>("NNInput"), cfg.getParameter<std::string>("NNOutput"), cache, fNParticles_);
53  produces<edm::ValueMap<float>>("L1PFBJets");
54 }
int const fNParticles_
double const fMaxEta_
bool const fUseRawPt_
edm::EDGetTokenT< edm::View< l1t::PFJet > > const jets_
unsigned int const fMaxJets_
double const fMinPt_
edm::EDGetTokenT< std::vector< l1t::VertexWord > > const fVtxEmu_
def cache(function)
Definition: utilities.py:3
std::unique_ptr< JetId > fBJetId_

◆ ~L1BJetProducer()

L1BJetProducer::~L1BJetProducer ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

void L1BJetProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 96 of file L1BJetProducer.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

96  {
97  // L1BJetProducer
99  desc.add<edm::InputTag>("jets", edm::InputTag("scPFL1Puppi"));
100  desc.add<bool>("useRawPt", true);
101  desc.add<edm::FileInPath>("NNFileName",
102  edm::FileInPath("L1Trigger/Phase2L1ParticleFlow/data/modelTT_PUP_Off_dXY_XYCut_Graph.pb"));
103  desc.add<std::string>("NNInput", "input:0");
104  desc.add<std::string>("NNOutput", "sequential/dense_2/Sigmoid");
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);
109  desc.add<edm::InputTag>("vtx", edm::InputTag("L1VertexFinderEmulator", "L1VerticesEmulation"));
110  descriptions.add("L1BJetProducer", desc);
111 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ globalEndJob()

void L1BJetProducer::globalEndJob ( const BJetTFCache cache)
static

Definition at line 60 of file L1BJetProducer.cc.

60 {}

◆ initializeGlobalCache()

std::unique_ptr< BJetTFCache > L1BJetProducer::initializeGlobalCache ( const edm::ParameterSet cfg)
static

Definition at line 55 of file L1BJetProducer.cc.

References utilities::cache(), looper::cfg, and personalPlayback::fp.

55  {
56  edm::FileInPath fp(cfg.getParameter<edm::FileInPath>("NNFileName"));
57  auto cache = std::make_unique<BJetTFCache>(fp.fullPath());
58  return cache;
59 }
def cache(function)
Definition: utilities.py:3

◆ produce()

void L1BJetProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 61 of file L1BJetProducer.cc.

References funct::abs(), iEvent, PDWG_EXODelayedJetMET_cff::jets, eostools::move(), mkfit::NN, L1BJetProducer_cff::vtx, and run3scouting_cff::vz.

61  {
63  iEvent.getByToken(jets_, jets);
64 
65  float vz = 0.;
66  double ptsum = 0;
68  iEvent.getByToken(fVtxEmu_, vtxEmuHandle);
69  for (const auto& vtx : *vtxEmuHandle) {
70  if (ptsum == 0 || vtx.pt() > ptsum) {
71  ptsum = vtx.pt();
72  vz = vtx.z0();
73  }
74  }
75 
76  std::vector<float> bScores;
77 
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.);
82  continue;
83  }
84  float NN = fBJetId_->compute(srcjet, vz, fUseRawPt_);
85  bScores.push_back(NN);
86  }
87 
88  auto outT = std::make_unique<edm::ValueMap<float>>();
89  edm::ValueMap<float>::Filler fillerT(*outT);
90  fillerT.insert(jets, bScores.begin(), bScores.end());
91  fillerT.fill();
92 
93  iEvent.put(std::move(outT), "L1PFBJets");
94 }
double const fMaxEta_
bool const fUseRawPt_
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< edm::View< l1t::PFJet > > const jets_
constexpr Matriplex::idx_t NN
Definition: Matrix.h:43
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
unsigned int const fMaxJets_
double const fMinPt_
edm::EDGetTokenT< std::vector< l1t::VertexWord > > const fVtxEmu_
std::unique_ptr< JetId > fBJetId_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ fBJetId_

std::unique_ptr<JetId> L1BJetProducer::fBJetId_
private

Definition at line 31 of file L1BJetProducer.cc.

Referenced by L1BJetProducer().

◆ fMaxEta_

double const L1BJetProducer::fMaxEta_
private

Definition at line 37 of file L1BJetProducer.cc.

◆ fMaxJets_

unsigned int const L1BJetProducer::fMaxJets_
private

Definition at line 38 of file L1BJetProducer.cc.

◆ fMinPt_

double const L1BJetProducer::fMinPt_
private

Definition at line 36 of file L1BJetProducer.cc.

◆ fNParticles_

int const L1BJetProducer::fNParticles_
private

Definition at line 39 of file L1BJetProducer.cc.

Referenced by L1BJetProducer().

◆ fUseRawPt_

bool const L1BJetProducer::fUseRawPt_
private

Definition at line 35 of file L1BJetProducer.cc.

◆ fVtxEmu_

edm::EDGetTokenT<std::vector<l1t::VertexWord> > const L1BJetProducer::fVtxEmu_
private

Definition at line 40 of file L1BJetProducer.cc.

◆ jets_

edm::EDGetTokenT<edm::View<l1t::PFJet> > const L1BJetProducer::jets_
private

Definition at line 34 of file L1BJetProducer.cc.