CMS 3D CMS Logo

EgammaPhotonTkIsolationProducer Class Reference

#include <EgammaAnalysis/EgammaIsolationProducers/interface/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

bool absolut_
edm::ParameterSet conf_
double extRadius_
double intRadius_
double maxVtxDist_
edm::InputTag photonProducer_
double ptMin_
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 25 of file EgammaPhotonTkIsolationProducer.cc.

References absolut_, conf_, extRadius_, edm::ParameterSet::getParameter(), intRadius_, maxVtxDist_, photonProducer_, ptMin_, and trackProducer_.

00025                                                                                               : conf_(config)
00026 {
00027  // use configuration file to setup input/output collection names
00028   photonProducer_               = conf_.getParameter<edm::InputTag>("photonProducer");
00029   
00030   trackProducer_           = conf_.getParameter<edm::InputTag>("trackProducer");
00031 
00032   ptMin_                = conf_.getParameter<double>("ptMin");
00033   intRadius_            = conf_.getParameter<double>("intRadius");
00034   extRadius_            = conf_.getParameter<double>("extRadius");
00035   maxVtxDist_           = conf_.getParameter<double>("maxVtxDist");
00036   absolut_              = conf_.getParameter<bool>("absolut");
00037 
00038   //register your products
00039   produces < reco::CandViewDoubleAssociations >();
00040 }

EgammaPhotonTkIsolationProducer::~EgammaPhotonTkIsolationProducer (  ) 

Definition at line 43 of file EgammaPhotonTkIsolationProducer.cc.

00043 {}


Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 52 of file EgammaPhotonTkIsolationProducer.cc.

References absolut_, funct::exp(), extRadius_, edm::Ref< C, T, F >::get(), edm::Event::getByLabel(), PhotonTkIsolation::getPtTracks(), i, intRadius_, maxVtxDist_, photonProducer_, edm::Handle< T >::product(), ptMin_, edm::Event::put(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::setValue(), funct::sin(), trackProducer_, and tracks.

00053 {
00054   
00055   // Get the  filtered objects
00056   edm::Handle< edm::View<reco::Candidate> > photonHandle;
00057   iEvent.getByLabel(photonProducer_,photonHandle);
00058   
00059   //get the tracks
00060   edm::Handle<reco::TrackCollection> tracks;
00061   iEvent.getByLabel(trackProducer_,tracks);
00062   const reco::TrackCollection* trackCollection = tracks.product();
00063 
00064   reco::CandViewDoubleAssociations* isoMap = new reco::CandViewDoubleAssociations( reco::CandidateBaseRefProd( photonHandle ) );
00065 
00066   PhotonTkIsolation myTkIsolation (extRadius_,intRadius_,ptMin_,maxVtxDist_,trackCollection) ;
00067 
00068   for(unsigned int i = 0 ; i < photonHandle->size(); ++i ){
00069     double isoValue = myTkIsolation.getPtTracks(&(photonHandle->at(i)));
00070     if(absolut_==true){
00071       isoMap->setValue(i,isoValue);
00072     }
00073     else{
00074       reco::SuperClusterRef sc = (photonHandle->at(i)).get<reco::SuperClusterRef>();
00075       double et = sc.get()->energy()*sin(2*atan(exp(-sc.get()->eta())));
00076       isoMap->setValue(i,isoValue/et);
00077     }
00078   }
00079    
00080 
00081 
00082   std::auto_ptr<reco::CandViewDoubleAssociations> isolMap(isoMap);
00083   iEvent.put(isolMap);
00084 
00085 }


Member Data Documentation

bool EgammaPhotonTkIsolationProducer::absolut_ [private]

Definition at line 36 of file EgammaPhotonTkIsolationProducer.h.

Referenced by EgammaPhotonTkIsolationProducer(), and produce().

edm::ParameterSet EgammaPhotonTkIsolationProducer::conf_ [private]

Definition at line 38 of file EgammaPhotonTkIsolationProducer.h.

Referenced by EgammaPhotonTkIsolationProducer().

double EgammaPhotonTkIsolationProducer::extRadius_ [private]

Definition at line 33 of file EgammaPhotonTkIsolationProducer.h.

Referenced by EgammaPhotonTkIsolationProducer(), and produce().

double EgammaPhotonTkIsolationProducer::intRadius_ [private]

Definition at line 32 of file EgammaPhotonTkIsolationProducer.h.

Referenced by EgammaPhotonTkIsolationProducer(), and produce().

double EgammaPhotonTkIsolationProducer::maxVtxDist_ [private]

Definition at line 34 of file EgammaPhotonTkIsolationProducer.h.

Referenced by EgammaPhotonTkIsolationProducer(), and produce().

edm::InputTag EgammaPhotonTkIsolationProducer::photonProducer_ [private]

Definition at line 28 of file EgammaPhotonTkIsolationProducer.h.

Referenced by EgammaPhotonTkIsolationProducer(), and produce().

double EgammaPhotonTkIsolationProducer::ptMin_ [private]

Definition at line 31 of file EgammaPhotonTkIsolationProducer.h.

Referenced by EgammaPhotonTkIsolationProducer(), and produce().

edm::InputTag EgammaPhotonTkIsolationProducer::trackProducer_ [private]

Definition at line 29 of file EgammaPhotonTkIsolationProducer.h.

Referenced by EgammaPhotonTkIsolationProducer(), and produce().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:20:11 2009 for CMSSW by  doxygen 1.5.4