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 private:
23  double Hx, Hy;
24 
25 public:
26  int njet;
27  TVector2 v;
28  double ScalarSum;
29 
30  typedef typename edm::Handle<T> Handler;
31  HT(Handler jetcoll, double ptThreshold, double maxAbsEta) : Hx(0), Hy(0), ScalarSum(0) {
32  typedef typename T::const_iterator Iter;
33  for (Iter jet = jetcoll->begin(); jet != jetcoll->end(); ++jet) {
34  if ((jet->pt() > ptThreshold) && (std::fabs(jet->eta()) < maxAbsEta)) {
35  njet++;
36  Hx += jet->px();
37  Hy += jet->py();
38  ScalarSum += jet->pt();
39  }
40  }
41  v = TVector2(Hx, Hy);
42  }
43 };
44 
45 #endif
ewkMuLumiMonitorDQM_cfi.ptThreshold
ptThreshold
Definition: ewkMuLumiMonitorDQM_cfi.py:13
CaloJetCollection.h
Handle.h
CaloJet.h
PFJet.h
PFJetCollection.h
edm::Handle
Definition: AssociativeIterator.h:50
HT
Definition: HT.h:21
HT::ScalarSum
double ScalarSum
Definition: HT.h:28
HT::njet
int njet
Definition: HT.h:26
JPTJetCollection.h
SUSYDQMAnalyzer_cfi.maxAbsEta
maxAbsEta
Definition: SUSYDQMAnalyzer_cfi.py:14
HT::v
TVector2 v
Definition: HT.h:27
HT::Handler
edm::Handle< T > Handler
Definition: HT.h:30
HT::Hy
double Hy
Definition: HT.h:23
HT::HT
HT(Handler jetcoll, double ptThreshold, double maxAbsEta)
Definition: HT.h:31
metsig::jet
Definition: SignAlgoResolutions.h:47
HT::Hx
double Hx
Definition: HT.h:23
JPTJet.h