test
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 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 ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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
std::vector< ConsumesInfoconsumesInfo () const
 
 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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void beginJob () override
 
virtual void endJob () override
 
virtual 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
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 &)
 
- 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 ( )

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.

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

Implements edm::EDFilter.

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(), and interactiveExample::photons.

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:462
edm::EDGetTokenT< reco::PhotonCollection > _phoToken
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9

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().