CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
TopDecayChannelFilter< S > Class Template Reference

#include <TopDecayChannelFilter.h>

Inheritance diagram for TopDecayChannelFilter< S >:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 TopDecayChannelFilter (const edm::ParameterSet &)
 
 ~TopDecayChannelFilter ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual bool filter (edm::Event &, const edm::EventSetup &)
 

Private Attributes

bool checkedSrcType_
 
edm::EDGetTokenT< TtGenEventgenEvt_
 
edm::EDGetTokenT
< reco::GenParticleCollection
parts_
 
S sel_
 
edm::InputTag src_
 
bool useTtGenEvent_
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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

template<typename S>
class TopDecayChannelFilter< S >

Definition at line 9 of file TopDecayChannelFilter.h.

Constructor & Destructor Documentation

template<typename S >
TopDecayChannelFilter< S >::TopDecayChannelFilter ( const edm::ParameterSet cfg)

Definition at line 25 of file TopDecayChannelFilter.h.

25  :
26  src_( cfg.template getParameter<edm::InputTag>( "src" ) ),
27  genEvt_( mayConsume<TtGenEvent>( src_ ) ),
28  parts_( mayConsume<reco::GenParticleCollection>( src_ ) ),
29  sel_( cfg ),
31 { }
edm::EDGetTokenT< reco::GenParticleCollection > parts_
edm::EDGetTokenT< TtGenEvent > genEvt_
template<typename S >
TopDecayChannelFilter< S >::~TopDecayChannelFilter ( )

Definition at line 34 of file TopDecayChannelFilter.h.

35 { }

Member Function Documentation

template<typename S >
bool TopDecayChannelFilter< S >::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDFilter.

Definition at line 39 of file TopDecayChannelFilter.h.

References TtGenEvtProducer_cfi::genEvt, genEvt_(), edm::Event::getByToken(), and contentValuesFiles::parts.

40 {
43 
44  if(!checkedSrcType_) {
45  checkedSrcType_ = true;
46  if(iEvent.getByToken( genEvt_, genEvt )) {
47  useTtGenEvent_ = true;
48  return sel_( genEvt->particles(), src_.label() );
49  }
50  }
51  else {
52  if(useTtGenEvent_) {
53  iEvent.getByToken( genEvt_, genEvt );
54  return sel_( genEvt->particles(), src_.label() );
55  }
56  }
57  iEvent.getByToken( parts_, parts );
58  return sel_( *parts, src_.label() );
59 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
edm::EDGetTokenT< reco::GenParticleCollection > parts_
std::string const & label() const
Definition: InputTag.h:43
edm::EDGetTokenT< TtGenEvent > genEvt_

Member Data Documentation

template<typename S >
bool TopDecayChannelFilter< S >::checkedSrcType_
private

Definition at line 20 of file TopDecayChannelFilter.h.

template<typename S >
edm::EDGetTokenT<TtGenEvent> TopDecayChannelFilter< S >::genEvt_
private

Definition at line 17 of file TopDecayChannelFilter.h.

template<typename S >
edm::EDGetTokenT<reco::GenParticleCollection> TopDecayChannelFilter< S >::parts_
private

Definition at line 18 of file TopDecayChannelFilter.h.

template<typename S >
S TopDecayChannelFilter< S >::sel_
private

Definition at line 19 of file TopDecayChannelFilter.h.

template<typename S >
edm::InputTag TopDecayChannelFilter< S >::src_
private

Definition at line 16 of file TopDecayChannelFilter.h.

template<typename S >
bool TopDecayChannelFilter< S >::useTtGenEvent_
private

Definition at line 21 of file TopDecayChannelFilter.h.