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  }

◆ ~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.

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  }

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

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().

reco::CaloJet
Jets made from CaloTowers.
Definition: CaloJet.h:27
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
reco::CaloJet::Specific::mEnergyFractionEm
float mEnergyFractionEm
Em energy fraction.
Definition: CaloJet.h:68
edm::Handle
Definition: AssociativeIterator.h:50
reco::CaloJet::Specific::mEnergyFractionHadronic
float mEnergyFractionHadronic
Hadronic energy fraction.
Definition: CaloJet.h:66
isolatedTracks_cfi.caloJets
caloJets
Definition: isolatedTracks_cfi.py:33
CaloJetSlimmer::selector_
const StringCutObjectSelector< reco::Jet > selector_
Definition: CaloJetSlimmer.cc:50
reco::Jet::jetArea
virtual float jetArea() const
get jet area
Definition: Jet.h:103
edm::View
Definition: CaloClusterFwd.h:14
iEvent
int iEvent
Definition: GenABIO.cc:224
CaloJetSlimmer::srcToken_
const edm::EDGetTokenT< edm::View< reco::CaloJet > > srcToken_
Definition: CaloJetSlimmer.cc:48
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
eostools.move
def move(src, dest)
Definition: eostools.py:511
CaloJetSlimmer::cut_
const std::string cut_
Definition: CaloJetSlimmer.cc:49
reco::Candidate::Point
math::XYZPoint Point
point in the space
Definition: Candidate.h:40
reco::CaloJet::Specific
Definition: CaloJet.h:32
edm::InputTag
Definition: InputTag.h:15