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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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 19 of file CaloJetSlimmer.cc.

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

Definition at line 27 of file CaloJetSlimmer.cc.

27 {}

Member Function Documentation

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

Definition at line 29 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_.

29  {
30 
31  auto caloJets = std::make_unique<reco::CaloJetCollection>();
32 
34  iEvent.getByToken( srcToken_, h_jets);
35 
36  for (auto const& ijet : *h_jets){
37  if( selector_(ijet) ){
38  reco::CaloJet::Specific tmp_specific;
39  const reco::Candidate::Point orivtx(0,0,0);
40  tmp_specific.mEnergyFractionEm = ijet.emEnergyFraction();
41  tmp_specific.mEnergyFractionHadronic = ijet.energyFractionHadronic();
42  reco::CaloJet newCaloJet(ijet.p4(), orivtx, tmp_specific);
43  float jetArea = ijet.jetArea();
44  newCaloJet.setJetArea(jetArea);
45  caloJets->push_back(newCaloJet);
46  }
47 
48 
49  }
50  iEvent.put(std::move(caloJets), "");
51  }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
Jets made from CaloTowers.
Definition: CaloJet.h:29
float mEnergyFractionHadronic
Hadronic energy fraction.
Definition: CaloJet.h:71
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
float mEnergyFractionEm
Em energy fraction.
Definition: CaloJet.h:73
const StringCutObjectSelector< reco::Jet > selector_
virtual float jetArea() const
get jet area
Definition: Jet.h:105
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 56 of file CaloJetSlimmer.cc.

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

Definition at line 57 of file CaloJetSlimmer.cc.

Referenced by produce().

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

Definition at line 55 of file CaloJetSlimmer.cc.

Referenced by produce().