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::EDConsumerBase 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 ()
 
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 Attributes

bool debug
 
int nEvents
 
int nPhotonMin
 
int nSelectedEvents
 
float photon1MinPt
 
float photon2MinPt
 
edm::EDGetTokenT
< reco::PhotonCollection
thePhotonToken
 

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

Definition at line 27 of file HiggsTo2GammaSkim.h.

Constructor & Destructor Documentation

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

Definition at line 33 of file HiggsTo2GammaSkim.cc.

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

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

Definition at line 53 of file HiggsTo2GammaSkim.cc.

References nEvents.

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

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 64 of file HiggsTo2GammaSkim.cc.

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

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

Member Data Documentation

bool HiggsTo2GammaSkim::debug
private

Definition at line 44 of file HiggsTo2GammaSkim.h.

Referenced by rrapi.RRApi::dprint(), and rrapi.RRApi::get().

int HiggsTo2GammaSkim::nEvents
private

Definition at line 41 of file HiggsTo2GammaSkim.h.

Referenced by looper.Looper::loop().

int HiggsTo2GammaSkim::nPhotonMin
private

Definition at line 47 of file HiggsTo2GammaSkim.h.

int HiggsTo2GammaSkim::nSelectedEvents
private

Definition at line 41 of file HiggsTo2GammaSkim.h.

float HiggsTo2GammaSkim::photon1MinPt
private

Definition at line 45 of file HiggsTo2GammaSkim.h.

float HiggsTo2GammaSkim::photon2MinPt
private

Definition at line 46 of file HiggsTo2GammaSkim.h.

edm::EDGetTokenT<reco::PhotonCollection> HiggsTo2GammaSkim::thePhotonToken
private

Definition at line 50 of file HiggsTo2GammaSkim.h.