CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
MonoPhotonSkimmer Class Reference
Inheritance diagram for MonoPhotonSkimmer:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 MonoPhotonSkimmer (const edm::ParameterSet &)
 
 ~MonoPhotonSkimmer () 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 Member Functions

void beginJob () override
 
void endJob () override
 
bool filter (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

double _ecalisoOffsetEB
 
double _ecalisoOffsetEE
 
double _ecalisoSlopeEB
 
double _ecalisoSlopeEE
 
double _etawidthEB
 
double _etawidthEE
 
double _hadoveremEB
 
double _hadoveremEE
 
double _hcalisoOffsetEB
 
double _hcalisoOffsetEE
 
double _hcalisoSlopeEB
 
double _hcalisoSlopeEE
 
double _minPhoEtEB
 
double _minPhoEtEE
 
edm::EDGetTokenT< reco::PhotonCollection_phoToken
 
bool _selectEE
 
double _trackisoOffsetEB
 
double _trackisoOffsetEE
 
double _trackisoSlopeEB
 
double _trackisoSlopeEE
 

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

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 41 of file Skim_MonoPhotonSkimmer.cc.

Constructor & Destructor Documentation

MonoPhotonSkimmer::MonoPhotonSkimmer ( const edm::ParameterSet iConfig)
explicit

Definition at line 94 of file Skim_MonoPhotonSkimmer.cc.

References _ecalisoOffsetEB, _ecalisoOffsetEE, _ecalisoSlopeEB, _ecalisoSlopeEE, _etawidthEB, _etawidthEE, _hadoveremEB, _hadoveremEE, _hcalisoOffsetEB, _hcalisoOffsetEE, _hcalisoSlopeEB, _hcalisoSlopeEE, _minPhoEtEB, _minPhoEtEE, _phoToken, _selectEE, _trackisoOffsetEB, _trackisoOffsetEE, _trackisoSlopeEB, _trackisoSlopeEE, and edm::ParameterSet::getParameter().

94  {
95  //now do what ever initialization is needed
96  _phoToken = consumes<reco::PhotonCollection>(iConfig.getParameter<edm::InputTag>("phoTag"));
97  _selectEE = iConfig.getParameter<bool>("selectEE");
98 
99  _ecalisoOffsetEB = iConfig.getParameter<double>("ecalisoOffsetEB");
100  _ecalisoSlopeEB = iConfig.getParameter<double>("ecalisoSlopeEB");
101 
102  _hcalisoOffsetEB = iConfig.getParameter<double>("hcalisoOffsetEB");
103  _hcalisoSlopeEB = iConfig.getParameter<double>("hcalisoSlopeEB");
104 
105  _hadoveremEB = iConfig.getParameter<double>("hadoveremEB");
106  _minPhoEtEB = iConfig.getParameter<double>("minPhoEtEB");
107 
108  _trackisoOffsetEB = iConfig.getParameter<double>("trackIsoOffsetEB");
109  _trackisoSlopeEB = iConfig.getParameter<double>("trackIsoSlopeEB");
110  _etawidthEB = iConfig.getParameter<double>("etaWidthEB");
111 
112  _ecalisoOffsetEE = iConfig.getParameter<double>("ecalisoOffsetEE");
113  _ecalisoSlopeEE = iConfig.getParameter<double>("ecalisoSlopeEE");
114 
115  _hcalisoOffsetEE = iConfig.getParameter<double>("hcalisoOffsetEE");
116  _hcalisoSlopeEE = iConfig.getParameter<double>("hcalisoSlopeEE");
117 
118  _hadoveremEE = iConfig.getParameter<double>("hadoveremEE");
119  _minPhoEtEE = iConfig.getParameter<double>("minPhoEtEE");
120 
121  _trackisoOffsetEE = iConfig.getParameter<double>("trackIsoOffsetEE");
122  _trackisoSlopeEE = iConfig.getParameter<double>("trackIsoSlopeEE");
123 
124  _etawidthEE = iConfig.getParameter<double>("etaWidthEE");
125 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::PhotonCollection > _phoToken
MonoPhotonSkimmer::~MonoPhotonSkimmer ( )
override

Definition at line 127 of file Skim_MonoPhotonSkimmer.cc.

127  {
128  // do anything here that needs to be done at desctruction time
129  // (e.g. close files, deallocate resources etc.)
130 }

Member Function Documentation

void MonoPhotonSkimmer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDFilter.

Definition at line 184 of file Skim_MonoPhotonSkimmer.cc.

184 {}
void MonoPhotonSkimmer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDFilter.

Definition at line 187 of file Skim_MonoPhotonSkimmer.cc.

References DEFINE_FWK_MODULE.

187 {}
bool MonoPhotonSkimmer::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 137 of file Skim_MonoPhotonSkimmer.cc.

References _ecalisoOffsetEB, _ecalisoOffsetEE, _ecalisoSlopeEB, _ecalisoSlopeEE, _etawidthEB, _etawidthEE, _hadoveremEB, _hadoveremEE, _hcalisoOffsetEB, _hcalisoOffsetEE, _hcalisoSlopeEB, _hcalisoSlopeEE, _minPhoEtEB, _minPhoEtEE, _phoToken, _selectEE, _trackisoOffsetEB, _trackisoOffsetEE, _trackisoSlopeEB, _trackisoSlopeEE, edm::Event::getByToken(), BPHMonitor_cfi::photons, and edm::Handle< T >::product().

137  {
138  using namespace edm;
140  iEvent.getByToken(_phoToken, photonColl);
141  const reco::PhotonCollection* photons = photonColl.product();
142  //Iterate over photon collection.
143  // std::vector<reco::Photon> PreselPhotons;
144  int PreselPhotons = 0;
145  reco::PhotonCollection::const_iterator pho;
146  for (pho = (*photons).begin(); pho != (*photons).end(); pho++) {
147  if (!pho->isEB() && !_selectEE)
148  continue;
149 
150  double ecalisocut = 0;
151  double hcalisocut = 0;
152  double hadoverem = 0;
153  double minphoet = 0;
154  double trackiso = 0;
155  double etawidth = 0;
156  if (pho->isEB()) {
157  ecalisocut = _ecalisoOffsetEB + _ecalisoSlopeEB * pho->pt();
158  hcalisocut = _hcalisoOffsetEB + _hcalisoSlopeEB * pho->pt();
159  hadoverem = _hadoveremEB;
160  minphoet = _minPhoEtEB;
161  trackiso = _trackisoOffsetEB + _trackisoSlopeEB * pho->pt();
162  etawidth = _etawidthEB;
163  } else {
164  ecalisocut = _ecalisoOffsetEE + _ecalisoSlopeEE * pho->pt();
165  hcalisocut = _hcalisoOffsetEE + _hcalisoSlopeEE * pho->pt();
166  hadoverem = _hadoveremEE;
167  minphoet = _minPhoEtEE;
168  trackiso = _trackisoOffsetEE + _trackisoSlopeEE * pho->pt();
169  etawidth = _etawidthEE;
170  }
171 
172  if (pho->ecalRecHitSumEtConeDR04() < ecalisocut && pho->hcalTowerSumEtConeDR04() < hcalisocut &&
173  pho->hadronicOverEm() < hadoverem && pho->pt() > minphoet && pho->trkSumPtHollowConeDR04() < trackiso &&
174  pho->sigmaIetaIeta() < etawidth)
175  PreselPhotons++;
176 
177  } //Loop over Photons
178  if (PreselPhotons > 0)
179  return true;
180  return false;
181 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
edm::EDGetTokenT< reco::PhotonCollection > _phoToken
T const * product() const
Definition: Handle.h:69
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
HLT enums.

Member Data Documentation

double MonoPhotonSkimmer::_ecalisoOffsetEB
private

Definition at line 56 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_ecalisoOffsetEE
private

Definition at line 72 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_ecalisoSlopeEB
private

Definition at line 57 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_ecalisoSlopeEE
private

Definition at line 73 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_etawidthEB
private

Definition at line 70 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_etawidthEE
private

Definition at line 80 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_hadoveremEB
private

Definition at line 63 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_hadoveremEE
private

Definition at line 76 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_hcalisoOffsetEB
private

Definition at line 60 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_hcalisoOffsetEE
private

Definition at line 74 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_hcalisoSlopeEB
private

Definition at line 61 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_hcalisoSlopeEE
private

Definition at line 75 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_minPhoEtEB
private

Definition at line 65 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_minPhoEtEE
private

Definition at line 77 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

edm::EDGetTokenT<reco::PhotonCollection> MonoPhotonSkimmer::_phoToken
private

Definition at line 52 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

bool MonoPhotonSkimmer::_selectEE
private

Definition at line 53 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_trackisoOffsetEB
private

Definition at line 67 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_trackisoOffsetEE
private

Definition at line 78 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_trackisoSlopeEB
private

Definition at line 68 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_trackisoSlopeEE
private

Definition at line 79 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().