test
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
SelectZmumuevents Class Reference

#include <MyAna/SelectZmumuevents/src/SelectZmumuevents.cc>

Inheritance diagram for SelectZmumuevents:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 SelectZmumuevents (const edm::ParameterSet &)
 
 ~SelectZmumuevents ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
 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
 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

Private Attributes

double _etaMax
 
edm::InputTag _pfColl
 
double _ptMin
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- 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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 39 of file SelectZmumuevents.cc.

Constructor & Destructor Documentation

SelectZmumuevents::SelectZmumuevents ( const edm::ParameterSet iConfig)
explicit

Definition at line 66 of file SelectZmumuevents.cc.

67  : _etaMax(iConfig.getUntrackedParameter<double>("etaMax")),
68  _ptMin(iConfig.getUntrackedParameter<double>("ptMin")),
70 {
71 
72 }
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag _pfColl
SelectZmumuevents::~SelectZmumuevents ( )

Definition at line 75 of file SelectZmumuevents.cc.

76 {
77 
78  // do anything here that needs to be done at desctruction time
79  // (e.g. close files, deallocate resources etc.)
80 }

Member Function Documentation

void SelectZmumuevents::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDFilter.

Definition at line 111 of file SelectZmumuevents.cc.

112 {
113 }
void SelectZmumuevents::endJob ( void  )
privatevirtual

Reimplemented from edm::EDFilter.

Definition at line 117 of file SelectZmumuevents.cc.

117  {
118 }
bool SelectZmumuevents::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDFilter.

Definition at line 89 of file SelectZmumuevents.cc.

References _etaMax, _pfColl, _ptMin, funct::abs(), and edm::Event::getByLabel().

90 {
91  using namespace edm;
93  iEvent.getByLabel(_pfColl, genParts);
94 
95  int cnt = 0;
96  for( edm::View<reco::Candidate>::const_iterator it = genParts->begin(); it != genParts->end(); it++ )
97  {
98  if (std::abs(it->pdgId()) == 13
99  && std::abs(it->eta()) < _etaMax
100  && it->pt() > _ptMin )
101  {
102  ++cnt;
103  }
104  }
105 
106  return cnt>1;
107 }
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
edm::InputTag _pfColl

Member Data Documentation

double SelectZmumuevents::_etaMax
private

Definition at line 50 of file SelectZmumuevents.cc.

Referenced by filter().

edm::InputTag SelectZmumuevents::_pfColl
private

Definition at line 52 of file SelectZmumuevents.cc.

Referenced by filter().

double SelectZmumuevents::_ptMin
private

Definition at line 51 of file SelectZmumuevents.cc.

Referenced by filter().