ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/auterman/PhysicsTools/IsolationUtils/interface/TrkCalIsolationAlgo.h
Revision: 1.1.1.1 (vendor branch)
Committed: Wed May 23 17:29:36 2007 UTC (17 years, 11 months ago) by auterman
Content type: text/plain
Branch: tex, PatCrossCleaner, Demo, SusyScan, scripts, IsolationUtils, MAIN
CVS Tags: start, HEAD
Changes since 1.1: +0 -0 lines
Error occurred while calculating annotation data.
Log Message:

File Contents

# Content
1 #ifndef IsolationUtils_TrkCalIsolationAlgo_h
2 #define IsolationUtils_TrkCalIsolationAlgo_h
3
4 #include "PhysicsTools/Utilities/interface/Math.h"
5
6 template <typename T1, typename C2>
7 class TrkCalIsolationAlgo {
8 public:
9 typedef double value_type;
10 TrkCalIsolationAlgo( );
11 TrkCalIsolationAlgo( double dRMin, double dRMax) : dRMin_( dRMin ), dRMax_( dRMax ) { }
12 ~TrkCalIsolationAlgo() { }
13 double operator()(const T1 &, const C2 &) const;
14
15 private:
16 double dRMin_, dRMax_;
17 };
18
19 //This source (track) already has defined outer eta and phi.
20 //This is the track's end point in the tracker, this should be close
21 //the tracks entry into the calorimeter.
22 //A specialized template operator () for tracks in the CalIsolationAlgo class is not
23 //feasable, since the () operator cannot be overloaded.
24 template <typename T1, typename C2> double TrkCalIsolationAlgo<T1,C2>::
25 operator()(const T1 & cand, const C2 & elements) const {
26 double etSum = 0;
27 for( typename C2::const_iterator elem = elements.begin();
28 elem != elements.end(); ++elem ) {
29 double dR = deltaR( elem->eta(), elem->phi(),
30 cand.outerEta(), cand.outerPhi() );
31 if ( dR < dRMax_ && dR > dRMin_ ) {
32 etSum += elem->et();
33 }
34 }
35 return etSum;
36 }
37
38 #endif