CMS 3D CMS Logo

HT.h
Go to the documentation of this file.
1 //author: Francesco Costanza (DESY)
2 //date: 05/05/11
3 
4 #ifndef HT_H
5 #define HT_H
6 
14 
15 #include "TVector2.h"
16 #include <vector>
17 #include <iostream>
18 #include <cmath>
19 
20 template<class T>
21 class HT {
22 
23 private:
24  double Hx,Hy;
25 
26  public:
27  int njet;
28  TVector2 v;
29  double ScalarSum;
30 
31  typedef typename edm::Handle< T > Handler;
32  HT( Handler jetcoll, double ptThreshold, double maxAbsEta):
33  Hx(0),
34  Hy(0),
35  ScalarSum(0)
36  {
37  typedef typename T::const_iterator Iter;
38  for (Iter jet = jetcoll->begin(); jet!=jetcoll->end(); ++jet){
39  if ((jet->pt()>ptThreshold) && (std::fabs(jet->eta())<maxAbsEta)){
40  njet++;
41  Hx += jet->px();
42  Hy += jet->py();
43  ScalarSum += jet->pt();
44  }
45  }
46  v=TVector2(Hx,Hy);
47  }
48 };
49 
50 #endif
double ScalarSum
Definition: HT.h:29
HT(Handler jetcoll, double ptThreshold, double maxAbsEta)
Definition: HT.h:32
edm::Handle< T > Handler
Definition: HT.h:31
double Hx
Definition: HT.h:24
double Hy
Definition: HT.h:24
int njet
Definition: HT.h:27
TVector2 v
Definition: HT.h:28
Definition: HT.h:21