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

#include <HiggsTo2GammaSkim.h>

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

Public Member Functions

virtual bool filter (edm::Event &, const edm::EventSetup &)
 Get event properties to send to builder to fill seed collection. More...
 
 HiggsTo2GammaSkim (const edm::ParameterSet &)
 
 ~HiggsTo2GammaSkim ()
 
- 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

bool debug
 
int nEvents
 
int nPhotonMin
 
int nSelectedEvents
 
float photon1MinPt
 
float photon2MinPt
 
edm::InputTag thePhotonLabel
 

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

Definition at line 26 of file HiggsTo2GammaSkim.h.

Constructor & Destructor Documentation

HiggsTo2GammaSkim::HiggsTo2GammaSkim ( const edm::ParameterSet pset)
explicit

Definition at line 34 of file HiggsTo2GammaSkim.cc.

References debug, edm::ParameterSet::getParameter(), and nEvents.

34  {
35 
36  // Local Debug flag
37  debug = pset.getParameter<bool>("DebugHiggsTo2GammaSkim");
38 
39  // Reconstructed objects
40  thePhotonLabel = pset.getParameter<edm::InputTag>("PhotonCollectionLabel");
41 
42  // Minimum Pt for photons for skimming
43  photon1MinPt = pset.getParameter<double>("photon1MinimumPt");
44  nPhotonMin = pset.getParameter<int>("nPhotonMinimum");
45 
46 
47  nEvents = 0;
48  nSelectedEvents = 0;
49 
50 }
T getParameter(std::string const &) const
edm::InputTag thePhotonLabel
HiggsTo2GammaSkim::~HiggsTo2GammaSkim ( )

Definition at line 54 of file HiggsTo2GammaSkim.cc.

References nEvents.

54  {
55 
56  edm::LogVerbatim("HiggsTo2GammaSkim")
57  << " Number_events_read " << nEvents
58  << " Number_events_kept " << nSelectedEvents
59  << " Efficiency " << ((double)nSelectedEvents)/((double) nEvents + 0.01) << std::endl;
60 }

Member Function Documentation

bool HiggsTo2GammaSkim::filter ( edm::Event event,
const edm::EventSetup setup 
)
virtual

Get event properties to send to builder to fill seed collection.

Implements edm::EDFilter.

Definition at line 65 of file HiggsTo2GammaSkim.cc.

References edm::HandleBase::isValid(), nEvents, ExpressReco_HICollisions_FallBack::photons, and edm::Handle< T >::product().

65  {
66 
67  nEvents++;
68 
70 
71  bool keepEvent = false;
72  int nPhotons = 0;
73 
74  // Look at photons:
75 
76  // Get the photon collection from the event
78 
79  event.getByLabel(thePhotonLabel.label(),photonHandle);
80 
81  if ( photonHandle.isValid() ) {
82 
83  const reco::PhotonCollection* phoCollection = photonHandle.product();
84 
85  reco::PhotonCollection::const_iterator photons;
86 
87  // Loop over photon collections and count how many photons there are,
88  // and how many are above the thresholds
89 
90  // Question: do we need to take the reconstructed primary vertex at this point?
91  // Here, I assume that the et is taken with respect to the nominal vertex (0,0,0).
92  for ( photons = phoCollection->begin(); photons != phoCollection->end(); ++photons ) {
93  float et_p = photons->et();
94  if ( et_p > photon1MinPt) nPhotons++;
95  }
96  }
97 
98  // Make decision:
99  if ( nPhotons >= nPhotonMin ) keepEvent = true;
100 
101  if (keepEvent) nSelectedEvents++;
102 
103  return keepEvent;
104 }
bool isValid() const
Definition: HandleBase.h:76
edm::InputTag thePhotonLabel
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
T const * product() const
Definition: Handle.h:74
std::string const & label() const
Definition: InputTag.h:25

Member Data Documentation

bool HiggsTo2GammaSkim::debug
private

Definition at line 43 of file HiggsTo2GammaSkim.h.

int HiggsTo2GammaSkim::nEvents
private

Definition at line 40 of file HiggsTo2GammaSkim.h.

int HiggsTo2GammaSkim::nPhotonMin
private

Definition at line 46 of file HiggsTo2GammaSkim.h.

int HiggsTo2GammaSkim::nSelectedEvents
private

Definition at line 40 of file HiggsTo2GammaSkim.h.

float HiggsTo2GammaSkim::photon1MinPt
private

Definition at line 44 of file HiggsTo2GammaSkim.h.

float HiggsTo2GammaSkim::photon2MinPt
private

Definition at line 45 of file HiggsTo2GammaSkim.h.

edm::InputTag HiggsTo2GammaSkim::thePhotonLabel
private

Definition at line 49 of file HiggsTo2GammaSkim.h.