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
 
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 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::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

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 42 of file Skim_MonoPhotonSkimmer.cc.

Constructor & Destructor Documentation

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

Definition at line 95 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().

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

Definition at line 133 of file Skim_MonoPhotonSkimmer.cc.

134 {
135 
136  // do anything here that needs to be done at desctruction time
137  // (e.g. close files, deallocate resources etc.)
138 
139 }

Member Function Documentation

void MonoPhotonSkimmer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDFilter.

Definition at line 199 of file Skim_MonoPhotonSkimmer.cc.

200 {
201 }
void MonoPhotonSkimmer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDFilter.

Definition at line 205 of file Skim_MonoPhotonSkimmer.cc.

References DEFINE_FWK_MODULE.

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

Definition at line 148 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(), nano_cff::photons, and edm::Handle< T >::product().

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

Member Data Documentation

double MonoPhotonSkimmer::_ecalisoOffsetEB
private

Definition at line 57 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_ecalisoOffsetEE
private

Definition at line 73 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_ecalisoSlopeEB
private

Definition at line 58 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_ecalisoSlopeEE
private

Definition at line 74 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_etawidthEB
private

Definition at line 71 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_etawidthEE
private

Definition at line 81 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_hadoveremEB
private

Definition at line 64 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_hadoveremEE
private

Definition at line 77 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_hcalisoOffsetEB
private

Definition at line 61 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_hcalisoOffsetEE
private

Definition at line 75 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_hcalisoSlopeEB
private

Definition at line 62 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_hcalisoSlopeEE
private

Definition at line 76 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_minPhoEtEB
private

Definition at line 66 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_minPhoEtEE
private

Definition at line 78 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

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

Definition at line 53 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

bool MonoPhotonSkimmer::_selectEE
private

Definition at line 54 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_trackisoOffsetEB
private

Definition at line 68 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_trackisoOffsetEE
private

Definition at line 79 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_trackisoSlopeEB
private

Definition at line 69 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

double MonoPhotonSkimmer::_trackisoSlopeEE
private

Definition at line 80 of file Skim_MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().