CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch2/src/DQMOffline/JetMET/interface/SusyDQM/HT.h

Go to the documentation of this file.
00001 //author:  Francesco Costanza (DESY)
00002 //date:    05/05/11
00003 
00004 #ifndef HT_H
00005 #define HT_H
00006 
00007 #include "DataFormats/Common/interface/Handle.h"
00008 #include "DataFormats/JetReco/interface/CaloJet.h"
00009 #include "DataFormats/JetReco/interface/CaloJetCollection.h"
00010 #include "DataFormats/JetReco/interface/PFJet.h"
00011 #include "DataFormats/JetReco/interface/PFJetCollection.h"
00012 #include "DataFormats/JetReco/interface/JPTJet.h"
00013 #include "DataFormats/JetReco/interface/JPTJetCollection.h"
00014 
00015 #include "TVector2.h"
00016 #include <vector>
00017 #include <iostream>
00018 
00019 template<class T>
00020 class HT {
00021 
00022 private:
00023   double Hx,Hy;
00024 
00025  public:
00026   int njet;
00027   TVector2 v;
00028   double ScalarSum;
00029 
00030   typedef typename edm::Handle< T > Handler;
00031   HT( Handler jetcoll, double ptThreshold, double maxAbsEta):
00032     Hx(0),
00033     Hy(0),
00034     ScalarSum(0)  
00035   {
00036     typedef typename T::const_iterator Iter;
00037     for (Iter jet = jetcoll->begin(); jet!=jetcoll->end(); ++jet){
00038       if ((jet->pt()>ptThreshold) && (abs(jet->eta())<maxAbsEta)){
00039         njet++;
00040         Hx += jet->px();
00041         Hy += jet->py();
00042         ScalarSum += jet->pt();
00043       }
00044     }
00045     v=TVector2(Hx,Hy);
00046   }
00047 };
00048 
00049 
00050 
00051 
00052 
00053 
00054 
00055 #endif