CMS 3D CMS Logo

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

Public Member Functions

 CaloJetSlimmer (edm::ParameterSet const &params)
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 ~CaloJetSlimmer () override
 
- 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
 

Protected Attributes

const std::string cut_
 
const StringCutObjectSelector< reco::Jetselector_
 
const edm::EDGetTokenT< edm::View< reco::CaloJet > > srcToken_
 

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 15 of file CaloJetSlimmer.cc.

Constructor & Destructor Documentation

◆ CaloJetSlimmer()

CaloJetSlimmer::CaloJetSlimmer ( edm::ParameterSet const &  params)
inline

Definition at line 17 of file CaloJetSlimmer.cc.

18  : srcToken_(consumes<edm::View<reco::CaloJet> >(params.getParameter<edm::InputTag>("src"))),
19  cut_(params.getParameter<std::string>("cut")),
20  selector_(cut_) {
21  produces<reco::CaloJetCollection>();
22  }
const std::string cut_
const StringCutObjectSelector< reco::Jet > selector_
const edm::EDGetTokenT< edm::View< reco::CaloJet > > srcToken_

◆ ~CaloJetSlimmer()

CaloJetSlimmer::~CaloJetSlimmer ( )
inlineoverride

Definition at line 24 of file CaloJetSlimmer.cc.

24 {}

Member Function Documentation

◆ produce()

void CaloJetSlimmer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
inlineoverride

Definition at line 26 of file CaloJetSlimmer.cc.

References isolatedTracks_cfi::caloJets, iEvent, run3scouting_cff::jetArea, reco::CaloJet::Specific::mEnergyFractionEm, reco::CaloJet::Specific::mEnergyFractionHadronic, eostools::move(), selector_, and srcToken_.

26  {
27  auto caloJets = std::make_unique<reco::CaloJetCollection>();
28 
30  iEvent.getByToken(srcToken_, h_jets);
31 
32  for (auto const& ijet : *h_jets) {
33  if (selector_(ijet)) {
34  reco::CaloJet::Specific tmp_specific;
35  const reco::Candidate::Point orivtx(0, 0, 0);
36  tmp_specific.mEnergyFractionEm = ijet.emEnergyFraction();
37  tmp_specific.mEnergyFractionHadronic = ijet.energyFractionHadronic();
38  reco::CaloJet newCaloJet(ijet.p4(), orivtx, tmp_specific);
39  float jetArea = ijet.jetArea();
40  newCaloJet.setJetArea(jetArea);
41  caloJets->push_back(newCaloJet);
42  }
43  }
44  iEvent.put(std::move(caloJets), "");
45  }
Jets made from CaloTowers.
Definition: CaloJet.h:27
float mEnergyFractionHadronic
Hadronic energy fraction.
Definition: CaloJet.h:66
int iEvent
Definition: GenABIO.cc:224
float mEnergyFractionEm
Em energy fraction.
Definition: CaloJet.h:68
const StringCutObjectSelector< reco::Jet > selector_
const edm::EDGetTokenT< edm::View< reco::CaloJet > > srcToken_
math::XYZPoint Point
point in the space
Definition: Candidate.h:40
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ cut_

const std::string CaloJetSlimmer::cut_
protected

Definition at line 49 of file CaloJetSlimmer.cc.

◆ selector_

const StringCutObjectSelector<reco::Jet> CaloJetSlimmer::selector_
protected

Definition at line 50 of file CaloJetSlimmer.cc.

Referenced by produce().

◆ srcToken_

const edm::EDGetTokenT<edm::View<reco::CaloJet> > CaloJetSlimmer::srcToken_
protected

Definition at line 48 of file CaloJetSlimmer.cc.

Referenced by produce().