CMS 3D CMS Logo

EgammaTowerIsolationProducer Class Reference

#include <EgammaAnalysis/EgammaIsolationProducers/interface/EgammaTowerIsolationProducer.h>

Inheritance diagram for EgammaTowerIsolationProducer:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

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

Private Attributes

bool absolut_
edm::ParameterSet conf_
double egHcalIsoConeSizeIn_
double egHcalIsoConeSizeOut_
double egHcalIsoPtMin_
edm::InputTag emObjectProducer_
edm::InputTag towerProducer_


Detailed Description

Definition at line 34 of file EgammaTowerIsolationProducer.h.


Constructor & Destructor Documentation

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

Definition at line 24 of file EgammaTowerIsolationProducer.cc.

References absolut_, conf_, egHcalIsoConeSizeIn_, egHcalIsoConeSizeOut_, egHcalIsoPtMin_, emObjectProducer_, edm::ParameterSet::getParameter(), and towerProducer_.

00024                                                                                         : conf_(config)
00025 {
00026  // use configuration file to setup input/output collection names
00027   emObjectProducer_               = conf_.getParameter<edm::InputTag>("emObjectProducer");
00028 
00029   towerProducer_           = conf_.getParameter<edm::InputTag>("towerProducer");
00030 
00031   egHcalIsoPtMin_               = conf_.getParameter<double>("etMin");
00032   egHcalIsoConeSizeIn_            = conf_.getParameter<double>("intRadius");
00033   egHcalIsoConeSizeOut_            = conf_.getParameter<double>("extRadius");
00034 
00035   absolut_ = conf_.getParameter<bool>("absolut");
00036 
00037   //register your products
00038   produces < reco::CandViewDoubleAssociations >();
00039 }

EgammaTowerIsolationProducer::~EgammaTowerIsolationProducer (  ) 

Definition at line 42 of file EgammaTowerIsolationProducer.cc.

00042 {}


Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 51 of file EgammaTowerIsolationProducer.cc.

References absolut_, egHcalIsoConeSizeIn_, egHcalIsoConeSizeOut_, egHcalIsoPtMin_, emObjectProducer_, funct::exp(), edm::Ref< C, T, F >::get(), edm::Event::getByLabel(), EgammaTowerIsolation::getTowerEtSum(), i, edm::Handle< T >::product(), edm::Event::put(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::setValue(), funct::sin(), and towerProducer_.

00052 {
00053   
00054   // Get the  filtered objects
00055   edm::Handle< edm::View<reco::Candidate> > emObjectHandle;
00056   iEvent.getByLabel(emObjectProducer_,emObjectHandle);
00057   
00058   // Get the barrel hcal hits
00059   edm::Handle<CaloTowerCollection> towerHandle;
00060   iEvent.getByLabel(towerProducer_, towerHandle);
00061   
00062   const CaloTowerCollection* towers = towerHandle.product();
00063 
00064   reco::CandViewDoubleAssociations* isoMap = new reco::CandViewDoubleAssociations( reco::CandidateBaseRefProd( emObjectHandle ) );
00065 
00066 
00067   EgammaTowerIsolation myHadIsolation(egHcalIsoConeSizeOut_,
00068                               egHcalIsoConeSizeIn_,
00069                               egHcalIsoPtMin_,
00070                               towers) ;
00071 
00072   
00073   for( size_t i = 0 ; i < emObjectHandle->size(); ++i) {
00074     double isoValue = myHadIsolation.getTowerEtSum(&(emObjectHandle->at(i)));
00075     if(absolut_==true){
00076       isoMap->setValue(i,isoValue);
00077     }
00078     else{
00079       reco::SuperClusterRef sc = (emObjectHandle->at(i)).get<reco::SuperClusterRef>();
00080       double et = sc.get()->energy()*sin(2*atan(exp(-sc.get()->eta())));
00081       isoMap->setValue(i,isoValue/et);
00082     }
00083   }
00084 
00085 
00086 
00087   std::auto_ptr<reco::CandViewDoubleAssociations> isolMap(isoMap);
00088   iEvent.put(isolMap);
00089 
00090 }


Member Data Documentation

bool EgammaTowerIsolationProducer::absolut_ [private]

Definition at line 52 of file EgammaTowerIsolationProducer.h.

Referenced by EgammaTowerIsolationProducer(), and produce().

edm::ParameterSet EgammaTowerIsolationProducer::conf_ [private]

Definition at line 54 of file EgammaTowerIsolationProducer.h.

Referenced by EgammaTowerIsolationProducer().

double EgammaTowerIsolationProducer::egHcalIsoConeSizeIn_ [private]

Definition at line 49 of file EgammaTowerIsolationProducer.h.

Referenced by EgammaTowerIsolationProducer(), and produce().

double EgammaTowerIsolationProducer::egHcalIsoConeSizeOut_ [private]

Definition at line 48 of file EgammaTowerIsolationProducer.h.

Referenced by EgammaTowerIsolationProducer(), and produce().

double EgammaTowerIsolationProducer::egHcalIsoPtMin_ [private]

Definition at line 47 of file EgammaTowerIsolationProducer.h.

Referenced by EgammaTowerIsolationProducer(), and produce().

edm::InputTag EgammaTowerIsolationProducer::emObjectProducer_ [private]

Definition at line 44 of file EgammaTowerIsolationProducer.h.

Referenced by EgammaTowerIsolationProducer(), and produce().

edm::InputTag EgammaTowerIsolationProducer::towerProducer_ [private]

Definition at line 45 of file EgammaTowerIsolationProducer.h.

Referenced by EgammaTowerIsolationProducer(), 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