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
NJetsMC Class Reference

#include <NJetsMC.cc>

Inheritance diagram for NJetsMC:
edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 NJetsMC (const edm::ParameterSet &)
 
 ~NJetsMC ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

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

Private Attributes

edm::InputTag GenHandle_
 
double minpt_
 
Int_t njets_
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
typedef WorkerT< EDFilterWorkerType
 
- 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)
 
- Protected Member Functions inherited from edm::EDFilter
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Description: Filter for DPS MC generation.

Implementation: [Notes on implementation]

Definition at line 51 of file NJetsMC.cc.

Constructor & Destructor Documentation

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

Definition at line 70 of file NJetsMC.cc.

70  :
71  GenHandle_(iConfig.getUntrackedParameter<InputTag>("GenTag")),
72  njets_(iConfig.getParameter<int32_t>("Njets")),
73  minpt_(iConfig.getParameter<double>("MinPt"))
74 {
75 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag GenHandle_
Definition: NJetsMC.cc:64
double minpt_
Definition: NJetsMC.cc:66
Int_t njets_
Definition: NJetsMC.cc:65
NJetsMC::~NJetsMC ( )

Definition at line 78 of file NJetsMC.cc.

79 {
80 }

Member Function Documentation

void NJetsMC::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDFilter.

Definition at line 105 of file NJetsMC.cc.

106 {
107 }
void NJetsMC::endJob ( void  )
privatevirtual

Reimplemented from edm::EDFilter.

Definition at line 109 of file NJetsMC.cc.

110 {
111 }
bool NJetsMC::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDFilter.

Definition at line 82 of file NJetsMC.cc.

References prof2calltree::count, GenHandle_, jetmet_cfg::GenJets, edm::Event::getByLabel(), minpt_, njets_, reco::LeafCandidate::pt(), and query::result.

83 {
84  using namespace edm;
85 
87  iEvent.getByLabel(GenHandle_, GenJets);
88 
89  Int_t count = 0;
90  bool result = false;
91 
92  for(GenJetCollection::const_iterator iJet = GenJets->begin(); iJet != GenJets->end(); ++iJet)
93  {
94  reco::GenJet myJet = reco::GenJet(*iJet);
95 
96  if(myJet.pt() > minpt_) ++count;
97  }
98 
99  if( count >= njets_ )
100  result = true;
101 
102  return result;
103 }
edm::InputTag GenHandle_
Definition: NJetsMC.cc:64
tuple result
Definition: query.py:137
Jets made from MC generator particles.
Definition: GenJet.h:25
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
tuple GenJets
Definition: jetmet_cfg.py:40
virtual double pt() const
transverse momentum
double minpt_
Definition: NJetsMC.cc:66
Int_t njets_
Definition: NJetsMC.cc:65

Member Data Documentation

edm::InputTag NJetsMC::GenHandle_
private

Definition at line 64 of file NJetsMC.cc.

Referenced by filter().

double NJetsMC::minpt_
private

Definition at line 66 of file NJetsMC.cc.

Referenced by filter().

Int_t NJetsMC::njets_
private

Definition at line 65 of file NJetsMC.cc.

Referenced by filter().