CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

MonoPhotonSkimmer Class Reference

#include <MonoPhotonSkimmer/MonoPhotonSkimmer/src/MonoPhotonSkimmer.cc>

Inheritance diagram for MonoPhotonSkimmer:
edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 MonoPhotonSkimmer (const edm::ParameterSet &)
 ~MonoPhotonSkimmer ()

Private Member Functions

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

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::InputTag _phoTag
bool _selectEE
double _trackisoOffsetEB
double _trackisoOffsetEE
double _trackisoSlopeEB
double _trackisoSlopeEE

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 43 of file MonoPhotonSkimmer.cc.


Constructor & Destructor Documentation

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

Definition at line 96 of file MonoPhotonSkimmer.cc.

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

{
   //now do what ever initialization is needed
  _phoTag = iConfig.getParameter<edm::InputTag>("phoTag");
   _selectEE = iConfig.getParameter<bool>("selectEE");
 
  _ecalisoOffsetEB = iConfig.getParameter<double>("ecalisoOffsetEB");
  _ecalisoSlopeEB = iConfig.getParameter<double>("ecalisoSlopeEB");

  _hcalisoOffsetEB = iConfig.getParameter<double>("hcalisoOffsetEB");
  _hcalisoSlopeEB  = iConfig.getParameter<double>("hcalisoSlopeEB");

  _hadoveremEB = iConfig.getParameter<double>("hadoveremEB");
  _minPhoEtEB = iConfig.getParameter<double>("minPhoEtEB");


  _trackisoOffsetEB= iConfig.getParameter<double>("trackIsoOffsetEB");
  _trackisoSlopeEB= iConfig.getParameter<double>("trackIsoSlopeEB");
  _etawidthEB=iConfig.getParameter<double>("etaWidthEB");
                          
  _ecalisoOffsetEE = iConfig.getParameter<double>("ecalisoOffsetEE");
  _ecalisoSlopeEE = iConfig.getParameter<double>("ecalisoSlopeEE");

  _hcalisoOffsetEE = iConfig.getParameter<double>("hcalisoOffsetEE");
  _hcalisoSlopeEE  = iConfig.getParameter<double>("hcalisoSlopeEE");

  _hadoveremEE = iConfig.getParameter<double>("hadoveremEE");
  _minPhoEtEE = iConfig.getParameter<double>("minPhoEtEE");


  _trackisoOffsetEE= iConfig.getParameter<double>("trackIsoOffsetEE");
  _trackisoSlopeEE= iConfig.getParameter<double>("trackIsoSlopeEE");

  _etawidthEE= iConfig.getParameter<double>("etaWidthEE");

}
MonoPhotonSkimmer::~MonoPhotonSkimmer ( )

Definition at line 134 of file MonoPhotonSkimmer.cc.

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

}

Member Function Documentation

void MonoPhotonSkimmer::beginJob ( void  ) [private, virtual]

Reimplemented from edm::EDFilter.

Definition at line 200 of file MonoPhotonSkimmer.cc.

{
}
void MonoPhotonSkimmer::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDFilter.

Definition at line 206 of file MonoPhotonSkimmer.cc.

                          {
}
bool MonoPhotonSkimmer::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

Implements edm::EDFilter.

Definition at line 149 of file MonoPhotonSkimmer.cc.

References _ecalisoOffsetEB, _ecalisoOffsetEE, _ecalisoSlopeEB, _ecalisoSlopeEE, _etawidthEB, _etawidthEE, _hadoveremEB, _hadoveremEE, _hcalisoOffsetEB, _hcalisoOffsetEE, _hcalisoSlopeEB, _hcalisoSlopeEE, _minPhoEtEB, _minPhoEtEE, _phoTag, _selectEE, _trackisoOffsetEB, _trackisoOffsetEE, _trackisoSlopeEB, _trackisoSlopeEE, edm::Event::getByLabel(), and interactiveExample::photons.

{
   using namespace edm;
 Handle<reco::PhotonCollection> photonColl;
  iEvent.getByLabel(_phoTag, photonColl);
  const reco::PhotonCollection *photons = photonColl.product();  
  //Iterate over photon collection.
//  std::vector<reco::Photon> PreselPhotons;
  int PreselPhotons=0;
  reco::PhotonCollection::const_iterator pho;
  for (pho = (*photons).begin(); pho!= (*photons).end(); pho++){  
    if (!pho->isEB() && !_selectEE) continue;
    
    double ecalisocut = 0;
    double hcalisocut = 0;
    double hadoverem  = 0;
    double minphoet   = 0;
    double trackiso   = 0;
    double etawidth   = 0;
    if (pho->isEB()){
      ecalisocut = _ecalisoOffsetEB + _ecalisoSlopeEB * pho->pt();
      hcalisocut = _hcalisoOffsetEB + _hcalisoSlopeEB * pho->pt();
      hadoverem  = _hadoveremEB;
      minphoet   = _minPhoEtEB;
      trackiso   = _trackisoOffsetEB + _trackisoSlopeEB * pho->pt();
      etawidth   = _etawidthEB;
    }
    else{
      ecalisocut = _ecalisoOffsetEE + _ecalisoSlopeEE * pho->pt();
      hcalisocut = _hcalisoOffsetEE + _hcalisoSlopeEE * pho->pt();
      hadoverem  = _hadoveremEE;
      minphoet   = _minPhoEtEE;
      trackiso   = _trackisoOffsetEE + _trackisoSlopeEE * pho->pt();
      etawidth   = _etawidthEE;
   }
    
    if (pho->ecalRecHitSumEtConeDR04() < ecalisocut
        && pho->hcalTowerSumEtConeDR04() < hcalisocut
        && pho->hadronicOverEm() < hadoverem
        && pho->pt() > minphoet
        && pho->trkSumPtHollowConeDR04()<trackiso
        && pho->sigmaIetaIeta() <etawidth
       ) PreselPhotons++;
   
  }//Loop over Photons 
  if (PreselPhotons > 0 ) return true;
  return false;
}

Member Data Documentation

Definition at line 58 of file MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

Definition at line 74 of file MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

Definition at line 59 of file MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

Definition at line 75 of file MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

Definition at line 72 of file MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

Definition at line 82 of file MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

Definition at line 65 of file MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

Definition at line 78 of file MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

Definition at line 62 of file MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

Definition at line 76 of file MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

Definition at line 63 of file MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

Definition at line 77 of file MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

Definition at line 67 of file MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

Definition at line 79 of file MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

Definition at line 54 of file MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

Definition at line 55 of file MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

Definition at line 69 of file MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

Definition at line 80 of file MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

Definition at line 70 of file MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().

Definition at line 81 of file MonoPhotonSkimmer.cc.

Referenced by filter(), and MonoPhotonSkimmer().