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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 15 of file CaloJetSlimmer.cc.

Constructor & Destructor Documentation

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

Definition at line 24 of file CaloJetSlimmer.cc.

24 {}

Member Function Documentation

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

Definition at line 26 of file CaloJetSlimmer.cc.

References isolatedTracks_cfi::caloJets, edm::Event::getByToken(), reco::Jet::jetArea(), reco::CaloJet::Specific::mEnergyFractionEm, reco::CaloJet::Specific::mEnergyFractionHadronic, eostools::move(), edm::Event::put(), 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  }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
Jets made from CaloTowers.
Definition: CaloJet.h:27
float mEnergyFractionHadronic
Hadronic energy fraction.
Definition: CaloJet.h:66
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
float mEnergyFractionEm
Em energy fraction.
Definition: CaloJet.h:68
const StringCutObjectSelector< reco::Jet > selector_
virtual float jetArea() const
get jet area
Definition: Jet.h:103
const edm::EDGetTokenT< edm::View< reco::CaloJet > > srcToken_
math::XYZPoint Point
point in the space
Definition: Candidate.h:41
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

const std::string CaloJetSlimmer::cut_
protected

Definition at line 49 of file CaloJetSlimmer.cc.

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

Definition at line 50 of file CaloJetSlimmer.cc.

Referenced by produce().

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

Definition at line 48 of file CaloJetSlimmer.cc.

Referenced by produce().