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 () noexcept(false) 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
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::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 31 of file HiggsTo2GammaSkim.cc.

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

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

Definition at line 47 of file HiggsTo2GammaSkim.cc.

References nEvents.

47  {
48  edm::LogVerbatim("HiggsTo2GammaSkim") << " Number_events_read " << nEvents << " Number_events_kept "
49  << nSelectedEvents << " Efficiency "
50  << ((double)nSelectedEvents) / ((double)nEvents + 0.01) << std::endl;
51 }

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

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

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

Member Data Documentation

bool HiggsTo2GammaSkim::debug
private
int HiggsTo2GammaSkim::nEvents
private

Definition at line 39 of file HiggsTo2GammaSkim.h.

Referenced by looper.Looper::loop().

int HiggsTo2GammaSkim::nPhotonMin
private

Definition at line 44 of file HiggsTo2GammaSkim.h.

int HiggsTo2GammaSkim::nSelectedEvents
private

Definition at line 39 of file HiggsTo2GammaSkim.h.

float HiggsTo2GammaSkim::photon1MinPt
private

Definition at line 42 of file HiggsTo2GammaSkim.h.

float HiggsTo2GammaSkim::photon2MinPt
private

Definition at line 43 of file HiggsTo2GammaSkim.h.

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

Definition at line 47 of file HiggsTo2GammaSkim.h.