CMS 3D CMS Logo

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

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
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
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:136
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:519
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:510

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