CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TrkCalIsolationAlgo.h
Go to the documentation of this file.
1 #ifndef IsolationUtils_TrkCalIsolationAlgo_h
2 #define IsolationUtils_TrkCalIsolationAlgo_h
3 /* \class TrkCalIsolationAlgo<T1, C2>
4  *
5  * \author Christian Autermann, U Hamburg
6  */
8 
9 template <typename T1, typename C2>
11 public:
12  typedef double value_type;
14  TrkCalIsolationAlgo(double dRMin, double dRMax) : dRMin_(dRMin), dRMax_(dRMax) {}
16  double operator()(const T1 &, const C2 &) const;
17 
18 private:
19  double dRMin_, dRMax_;
20 };
21 
22 //This source (track) already has defined outer eta and phi.
23 //This is the track's end point in the tracker, this should be close
24 //the tracks entry into the calorimeter.
25 //A specialized template operator () for tracks in the CalIsolationAlgo class is not
26 //feasable, since the () operator cannot be overloaded.
27 template <typename T1, typename C2>
28 double TrkCalIsolationAlgo<T1, C2>::operator()(const T1 &cand, const C2 &elements) const {
29  double etSum = 0;
30  for (typename C2::const_iterator elem = elements.begin(); elem != elements.end(); ++elem) {
31  double dR = deltaR(elem->eta(), elem->phi(), cand.outerEta(), cand.outerPhi());
32  if (dR < dRMax_ && dR > dRMin_) {
33  etSum += elem->et();
34  }
35  }
36  return etSum;
37 }
38 
39 #endif
dictionary elements
double operator()(const T1 &, const C2 &) const
TrkCalIsolationAlgo(double dRMin, double dRMax)