CMS 3D CMS Logo

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

Public Member Functions

 TOoLLiPProducer (const edm::ParameterSet &)
 
 ~TOoLLiPProducer () override=default
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 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)
 

Private Member Functions

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

Private Attributes

std::unique_ptr< JetIdfJetId_
 
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_
 
hls4mlEmulator::ModelLoader loader
 
std::shared_ptr< hls4mlEmulator::Model > model
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
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 25 of file TOoLLiPProducer.cc.

Constructor & Destructor Documentation

◆ TOoLLiPProducer()

TOoLLiPProducer::TOoLLiPProducer ( const edm::ParameterSet cfg)
explicit

Definition at line 48 of file TOoLLiPProducer.cc.

References looper::cfg, fJetId_, fNParticles_, loader, ReggeGribovPartonMC_EposLHC_2760GeV_PbPb_cfi::model, model, and AlCaHLTBitMon_QueryRunRegistry::string.

49  : jets_(consumes<edm::View<l1t::PFJet>>(cfg.getParameter<edm::InputTag>("jets"))),
50  fUseRawPt_(cfg.getParameter<bool>("useRawPt")),
51  fMinPt_(cfg.getParameter<double>("minPt")),
52  fMaxEta_(cfg.getParameter<double>("maxEta")),
53  fMaxJets_(cfg.getParameter<int>("maxJets")),
54  fNParticles_(cfg.getParameter<int>("nParticles")),
55  fVtxEmu_(consumes<std::vector<l1t::VertexWord>>(cfg.getParameter<edm::InputTag>("vtx"))),
56  loader(hls4mlEmulator::ModelLoader(cfg.getParameter<string>("TOoLLiPVersion"))) {
57  model = loader.load_model();
58  fJetId_ = std::make_unique<JetId>(
59  cfg.getParameter<std::string>("NNInput"), cfg.getParameter<std::string>("NNOutput"), model, fNParticles_);
60  produces<edm::ValueMap<float>>("L1PFLLPJets");
61 }
hls4mlEmulator::ModelLoader loader
double const fMinPt_
std::shared_ptr< hls4mlEmulator::Model > model
int const fNParticles_
unsigned int const fMaxJets_
edm::EDGetTokenT< edm::View< l1t::PFJet > > const jets_
double const fMaxEta_
std::unique_ptr< JetId > fJetId_
bool const fUseRawPt_
edm::EDGetTokenT< std::vector< l1t::VertexWord > > const fVtxEmu_

◆ ~TOoLLiPProducer()

TOoLLiPProducer::~TOoLLiPProducer ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 96 of file TOoLLiPProducer.cc.

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

96  {
98  desc.add<edm::InputTag>("jets", edm::InputTag("scPFL1Puppi"));
99  desc.add<bool>("useRawPt", true);
100  desc.add<std::string>("TOoLLiPVersion", std::string("TOoLLiP_v1"));
101  desc.add<std::string>("NNInput", "input:0");
102  desc.add<std::string>("NNOutput", "sequential/dense_2/Sigmoid");
103  desc.add<int>("maxJets", 10);
104  desc.add<int>("nParticles", 10);
105  desc.add<double>("minPt", 20);
106  desc.add<double>("maxEta", 2.4);
107  desc.add<edm::InputTag>("vtx", edm::InputTag("L1VertexFinderEmulator", "L1VerticesEmulation"));
108  descriptions.add("TOoLLiPProducer", desc);
109 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Definition at line 63 of file TOoLLiPProducer.cc.

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

63  {
65  iEvent.getByToken(jets_, jets);
66  float vz = 0.;
67  double ptsum = 0;
69  iEvent.getByToken(fVtxEmu_, vtxEmuHandle);
70  for (const auto& vtx : *vtxEmuHandle) {
71  if (ptsum == 0 || vtx.pt() > ptsum) {
72  ptsum = vtx.pt();
73  vz = vtx.z0();
74  }
75  }
76 
77  std::vector<float> LLPScores;
78  for (const auto& srcjet : *jets) {
79  if (((fUseRawPt_ ? srcjet.rawPt() : srcjet.pt()) < fMinPt_) || std::abs(srcjet.eta()) > fMaxEta_ ||
80  LLPScores.size() >= fMaxJets_) {
81  LLPScores.push_back(-1.);
82  continue;
83  }
84  ap_fixed<16, 6> LLPScore = fJetId_->computeFixed(srcjet, vz, fUseRawPt_);
85  LLPScores.push_back(LLPScore);
86  }
87 
88  auto outT = std::make_unique<edm::ValueMap<float>>();
89  edm::ValueMap<float>::Filler fillerT(*outT);
90  fillerT.insert(jets, LLPScores.begin(), LLPScores.end());
91  fillerT.fill();
92 
93  iEvent.put(std::move(outT), "L1PFLLPJets");
94 }
double const fMinPt_
unsigned int const fMaxJets_
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< edm::View< l1t::PFJet > > const jets_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double const fMaxEta_
std::unique_ptr< JetId > fJetId_
bool const fUseRawPt_
edm::EDGetTokenT< std::vector< l1t::VertexWord > > const fVtxEmu_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ fJetId_

std::unique_ptr<JetId> TOoLLiPProducer::fJetId_
private

Definition at line 33 of file TOoLLiPProducer.cc.

Referenced by TOoLLiPProducer().

◆ fMaxEta_

double const TOoLLiPProducer::fMaxEta_
private

Definition at line 39 of file TOoLLiPProducer.cc.

◆ fMaxJets_

unsigned int const TOoLLiPProducer::fMaxJets_
private

Definition at line 40 of file TOoLLiPProducer.cc.

◆ fMinPt_

double const TOoLLiPProducer::fMinPt_
private

Definition at line 38 of file TOoLLiPProducer.cc.

◆ fNParticles_

int const TOoLLiPProducer::fNParticles_
private

Definition at line 41 of file TOoLLiPProducer.cc.

Referenced by TOoLLiPProducer().

◆ fUseRawPt_

bool const TOoLLiPProducer::fUseRawPt_
private

Definition at line 37 of file TOoLLiPProducer.cc.

◆ fVtxEmu_

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

Definition at line 42 of file TOoLLiPProducer.cc.

◆ jets_

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

Definition at line 36 of file TOoLLiPProducer.cc.

◆ loader

hls4mlEmulator::ModelLoader TOoLLiPProducer::loader
private

Definition at line 44 of file TOoLLiPProducer.cc.

Referenced by TOoLLiPProducer().

◆ model

std::shared_ptr<hls4mlEmulator::Model> TOoLLiPProducer::model
private

Definition at line 45 of file TOoLLiPProducer.cc.

Referenced by querying.connection::search_everything(), and TOoLLiPProducer().