CMS 3D CMS Logo

EgammaTowerIsolation Class Reference

#include <RecoEgamma/EgammaIsolationAlgos/interface/EgammaTowerIsolation.h>

List of all members.

Public Member Functions

 EgammaTowerIsolation (double extRadius, double intRadius, double etLow, const CaloTowerCollection *)
int getNumberTracks (const reco::Candidate *) const
double getTowerEtSum (const reco::Candidate *) const
 ~EgammaTowerIsolation ()

Private Attributes

double etLow_
double extRadius_
double intRadius_
const CaloTowerCollectiontowercollection_


Detailed Description

Definition at line 23 of file EgammaTowerIsolation.h.


Constructor & Destructor Documentation

EgammaTowerIsolation::EgammaTowerIsolation ( double  extRadius,
double  intRadius,
double  etLow,
const CaloTowerCollection towercollection 
)

Definition at line 28 of file EgammaTowerIsolation.cc.

00031                                                                                     :
00032   extRadius_(extRadius),
00033   intRadius_(intRadius),
00034   etLow_(etLow),
00035   towercollection_(towercollection)  
00036 {
00037 }

EgammaTowerIsolation::~EgammaTowerIsolation (  ) 

Definition at line 39 of file EgammaTowerIsolation.cc.

00040 {
00041 }


Member Function Documentation

int EgammaTowerIsolation::getNumberTracks ( const reco::Candidate  )  const

double EgammaTowerIsolation::getTowerEtSum ( const reco::Candidate photon  )  const

Definition at line 46 of file EgammaTowerIsolation.cc.

References edm::SortedCollection< T, SORT >::begin(), deltaPhi(), edm::SortedCollection< T, SORT >::end(), etLow_, extRadius_, reco::Candidate::get(), edm::Ref< C, T, F >::get(), intRadius_, towercollection_, and Geom::twoPi().

Referenced by EgammaTowerIsolationProducer::produce().

00047 {
00048   double ptSum =0.;
00049 
00050 
00051   //Take the SC position
00052   reco::SuperClusterRef sc = photon->get<reco::SuperClusterRef>();
00053   math::XYZPoint theCaloPosition = sc.get()->position();
00054   double candEta=sc.get()->eta();
00055   double candPhi=sc.get()->phi();
00056 
00057   //loop over tracks
00058   for(CaloTowerCollection::const_iterator trItr = towercollection_->begin(); trItr != towercollection_->end(); ++trItr){
00059     
00060     double this_pt  = trItr->hadEt();
00061     if ( this_pt < etLow_ ) 
00062       continue ;  
00063     
00064     double towerEta=trItr->eta();
00065     double towerPhi=trItr->phi();
00066     double twoPi= 2*M_PI;
00067     if(towerPhi<0) towerPhi+=twoPi;
00068     if(candPhi<0) candPhi+=twoPi;
00069     double deltaPhi=fabs(towerPhi-candPhi);
00070     if(deltaPhi>twoPi) deltaPhi-=twoPi;
00071     if(deltaPhi>M_PI) deltaPhi=twoPi-deltaPhi;
00072     double deltaEta = towerEta - candEta;
00073 
00074       
00075     double dr = deltaEta*deltaEta + deltaPhi*deltaPhi;
00076     if( dr < extRadius_*extRadius_ &&
00077         dr >= intRadius_*intRadius_ )
00078       {
00079         ptSum += this_pt;
00080       }
00081     
00082   }//end loop over tracks
00083 
00084   return ptSum;
00085 }


Member Data Documentation

double EgammaTowerIsolation::etLow_ [private]

Definition at line 43 of file EgammaTowerIsolation.h.

Referenced by getTowerEtSum().

double EgammaTowerIsolation::extRadius_ [private]

Definition at line 41 of file EgammaTowerIsolation.h.

Referenced by getTowerEtSum().

double EgammaTowerIsolation::intRadius_ [private]

Definition at line 42 of file EgammaTowerIsolation.h.

Referenced by getTowerEtSum().

const CaloTowerCollection* EgammaTowerIsolation::towercollection_ [private]

Definition at line 45 of file EgammaTowerIsolation.h.

Referenced by getTowerEtSum().


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