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 Attributes
ptHatFilter Class Reference

#include <ptHatFilter.h>

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

Public Member Functions

virtual void beginJob ()
 
virtual void endJob ()
 
virtual bool filter (edm::Event &e, edm::EventSetup const &iSetup)
 
 ptHatFilter (const edm::ParameterSet &)
 
virtual ~ptHatFilter ()
 
- 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 Attributes

int acceptedEvents
 
double ptHatLowerCut
 
double ptHatUpperCut
 
int totalEvents
 

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)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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

Definition at line 8 of file ptHatFilter.h.

Constructor & Destructor Documentation

ptHatFilter::ptHatFilter ( const edm::ParameterSet cfg)

Definition at line 17 of file ptHatFilter.cc.

References edm::ParameterSet::getParameter().

18 {
19  ptHatLowerCut = cfg.getParameter<double> ("ptHatLowerCut");
20  ptHatUpperCut = cfg.getParameter<double> ("ptHatUpperCut");
21 }
T getParameter(std::string const &) const
double ptHatUpperCut
Definition: ptHatFilter.h:18
double ptHatLowerCut
Definition: ptHatFilter.h:17
ptHatFilter::~ptHatFilter ( )
virtual

Definition at line 30 of file ptHatFilter.cc.

30  {
31 }

Member Function Documentation

void ptHatFilter::beginJob ( void  )
virtual

Reimplemented from edm::EDFilter.

Definition at line 23 of file ptHatFilter.cc.

24 {
25  totalEvents=0;
27 }
int acceptedEvents
Definition: ptHatFilter.h:20
int totalEvents
Definition: ptHatFilter.h:19
void ptHatFilter::endJob ( void  )
virtual

Reimplemented from edm::EDFilter.

Definition at line 50 of file ptHatFilter.cc.

References gather_cfg::cout.

51 {
52  std::cout << "Total Events = " << totalEvents << std::endl;
53  std::cout << "Accepted Events = " << acceptedEvents << std::endl;
54 }
tuple cout
Definition: gather_cfg.py:121
int acceptedEvents
Definition: ptHatFilter.h:20
int totalEvents
Definition: ptHatFilter.h:19
bool ptHatFilter::filter ( edm::Event e,
edm::EventSetup const &  iSetup 
)
virtual

Implements edm::EDFilter.

Definition at line 34 of file ptHatFilter.cc.

References edm::Event::getByLabel(), and query::result.

35 {
36 
37  bool result = false;
38  totalEvents++;
39  edm::Handle< double > genEventScale;
40  evt.getByLabel("genEventScale", genEventScale );
41  double pt_hat = *genEventScale;
42  if(pt_hat>ptHatLowerCut && pt_hat<ptHatUpperCut)
43  {
45  result = true;
46  }
47  return result;
48 }
double ptHatUpperCut
Definition: ptHatFilter.h:18
double ptHatLowerCut
Definition: ptHatFilter.h:17
tuple result
Definition: query.py:137
int acceptedEvents
Definition: ptHatFilter.h:20
int totalEvents
Definition: ptHatFilter.h:19

Member Data Documentation

int ptHatFilter::acceptedEvents
private

Definition at line 20 of file ptHatFilter.h.

double ptHatFilter::ptHatLowerCut
private

Definition at line 17 of file ptHatFilter.h.

double ptHatFilter::ptHatUpperCut
private

Definition at line 18 of file ptHatFilter.h.

int ptHatFilter::totalEvents
private

Definition at line 19 of file ptHatFilter.h.