CMS 3D CMS Logo

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

bool filter (edm::Event &, const edm::EventSetup &) override
 Get event properties to send to builder to fill seed collection. More...
 
 HiggsTo2GammaSkim (const edm::ParameterSet &)
 
 ~HiggsTo2GammaSkim () override
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilter () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 ( )
override

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 
)
override

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

Definition at line 64 of file HiggsTo2GammaSkim.cc.

References edm::HandleBase::isValid(), nEvents, nano_cff::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:74
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.