CMS 3D CMS Logo

Public Member Functions | Private Attributes

EgammaPhotonTkIsolationProducer Class Reference

#include <EgammaPhotonTkIsolationProducer.h>

Inheritance diagram for EgammaPhotonTkIsolationProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 EgammaPhotonTkIsolationProducer (const edm::ParameterSet &)
virtual void produce (edm::Event &, const edm::EventSetup &)
 ~EgammaPhotonTkIsolationProducer ()

Private Attributes

edm::InputTag beamspotProducer_
edm::ParameterSet conf_
double drb_
double extRadius_
double intRadiusBarrel_
double intRadiusEndcap_
double maxVtxDist_
edm::InputTag photonProducer_
double ptMin_
double stripBarrel_
double stripEndcap_
edm::InputTag trackProducer_

Detailed Description

Definition at line 20 of file EgammaPhotonTkIsolationProducer.h.


Constructor & Destructor Documentation

EgammaPhotonTkIsolationProducer::EgammaPhotonTkIsolationProducer ( const edm::ParameterSet config) [explicit]

Definition at line 26 of file EgammaPhotonTkIsolationProducer.cc.

References beamspotProducer_, conf_, drb_, extRadius_, edm::ParameterSet::getParameter(), intRadiusBarrel_, intRadiusEndcap_, maxVtxDist_, photonProducer_, ptMin_, stripBarrel_, stripEndcap_, and trackProducer_.

                                                                                              : conf_(config)
{
 // use configuration file to setup input/output collection names
  photonProducer_               = conf_.getParameter<edm::InputTag>("photonProducer");
  
  trackProducer_           = conf_.getParameter<edm::InputTag>("trackProducer");
  beamspotProducer_        = conf_.getParameter<edm::InputTag>("BeamspotProducer");

  ptMin_                = conf_.getParameter<double>("ptMin");
  intRadiusBarrel_      = conf_.getParameter<double>("intRadiusBarrel");
  intRadiusEndcap_      = conf_.getParameter<double>("intRadiusEndcap");
  stripBarrel_          = conf_.getParameter<double>("stripBarrel");
  stripEndcap_          = conf_.getParameter<double>("stripEndcap");
  extRadius_            = conf_.getParameter<double>("extRadius");
  maxVtxDist_           = conf_.getParameter<double>("maxVtxDist");
  drb_                  = conf_.getParameter<double>("maxVtxDistXY");

  //register your products
  produces < edm::ValueMap<double> >();
}
EgammaPhotonTkIsolationProducer::~EgammaPhotonTkIsolationProducer ( )

Definition at line 48 of file EgammaPhotonTkIsolationProducer.cc.

{}

Member Function Documentation

void EgammaPhotonTkIsolationProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [virtual]

Implements edm::EDProducer.

Definition at line 57 of file EgammaPhotonTkIsolationProducer.cc.

References beamspotProducer_, drb_, extRadius_, edm::helper::Filler< Map >::fill(), edm::Event::getByLabel(), i, edm::helper::Filler< Map >::insert(), intRadiusBarrel_, intRadiusEndcap_, maxVtxDist_, photonProducer_, edm::Handle< T >::product(), ptMin_, edm::Event::put(), stripBarrel_, stripEndcap_, trackProducer_, and testEve_cfg::tracks.

{
  
  // Get the  filtered objects
  edm::Handle< edm::View<reco::Candidate> > photonHandle;
  iEvent.getByLabel(photonProducer_,photonHandle);
  
  //get the tracks
  edm::Handle<reco::TrackCollection> tracks;
  iEvent.getByLabel(trackProducer_,tracks);
  const reco::TrackCollection* trackCollection = tracks.product();

  edm::Handle<reco::BeamSpot> beamSpotH;
  iEvent.getByLabel(beamspotProducer_,beamSpotH);
  reco::TrackBase::Point beamspot = beamSpotH->position();

  //prepare product
  std::auto_ptr<edm::ValueMap<double> > isoMap(new edm::ValueMap<double>());
  edm::ValueMap<double>::Filler filler(*isoMap);
  std::vector<double> retV(photonHandle->size(),0);

  PhotonTkIsolation myTkIsolation (extRadius_,intRadiusBarrel_,intRadiusEndcap_,stripBarrel_,stripEndcap_,ptMin_,maxVtxDist_,drb_,trackCollection,beamspot) ;

  for(unsigned int i = 0 ; i < photonHandle->size(); ++i ){
    double isoValue = myTkIsolation.getPtTracks(&(photonHandle->at(i)));
    retV[i] = isoValue;
  }
   
  //fill and insert valuemap
  filler.insert(photonHandle,retV.begin(),retV.end());
  filler.fill();
  iEvent.put(isoMap);

}

Member Data Documentation

Definition at line 30 of file EgammaPhotonTkIsolationProducer.h.

Referenced by EgammaPhotonTkIsolationProducer(), and produce().

Definition at line 41 of file EgammaPhotonTkIsolationProducer.h.

Referenced by EgammaPhotonTkIsolationProducer().

Definition at line 39 of file EgammaPhotonTkIsolationProducer.h.

Referenced by EgammaPhotonTkIsolationProducer(), and produce().

Definition at line 37 of file EgammaPhotonTkIsolationProducer.h.

Referenced by EgammaPhotonTkIsolationProducer(), and produce().

Definition at line 33 of file EgammaPhotonTkIsolationProducer.h.

Referenced by EgammaPhotonTkIsolationProducer(), and produce().

Definition at line 34 of file EgammaPhotonTkIsolationProducer.h.

Referenced by EgammaPhotonTkIsolationProducer(), and produce().

Definition at line 38 of file EgammaPhotonTkIsolationProducer.h.

Referenced by EgammaPhotonTkIsolationProducer(), and produce().

Definition at line 28 of file EgammaPhotonTkIsolationProducer.h.

Referenced by EgammaPhotonTkIsolationProducer(), and produce().

Definition at line 32 of file EgammaPhotonTkIsolationProducer.h.

Referenced by EgammaPhotonTkIsolationProducer(), and produce().

Definition at line 35 of file EgammaPhotonTkIsolationProducer.h.

Referenced by EgammaPhotonTkIsolationProducer(), and produce().

Definition at line 36 of file EgammaPhotonTkIsolationProducer.h.

Referenced by EgammaPhotonTkIsolationProducer(), and produce().

Definition at line 29 of file EgammaPhotonTkIsolationProducer.h.

Referenced by EgammaPhotonTkIsolationProducer(), and produce().