Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:24:04

0001 //
0002 //
0003 
0004 #ifndef PhysicsTools_PatUtils_ObjectResolutionCalc_h
0005 #define PhysicsTools_PatUtils_ObjectResolutionCalc_h
0006 
0007 /**
0008   \class    pat::ObjectResolutionCalc ObjectResolutionCalc.h "PhysicsTools/PatUtils/interface/ObjectResolutionCalc.h"
0009   \brief    Class to calculate MC resolutions for pat objects
0010 
0011   \author   Jan Heyninck, Petra Van Mulders, Christophe Delaere
0012   \version  $Id: ObjectResolutionCalc.h,v 1.5 2008/10/08 19:19:25 gpetrucc Exp $
0013 */
0014 
0015 #include "DataFormats/PatCandidates/interface/Electron.h"
0016 #include "DataFormats/PatCandidates/interface/Muon.h"
0017 #include "DataFormats/PatCandidates/interface/Tau.h"
0018 #include "DataFormats/PatCandidates/interface/MET.h"
0019 #include "DataFormats/PatCandidates/interface/Jet.h"
0020 
0021 #include "TF1.h"
0022 #include "TFile.h"
0023 #include "TMultiLayerPerceptron.h"
0024 #include "TString.h"
0025 
0026 namespace pat {
0027 
0028   class ObjectResolutionCalc {
0029   public:
0030     ObjectResolutionCalc();
0031     ObjectResolutionCalc(const TString& resopath, bool useNN);
0032     ~ObjectResolutionCalc();
0033 
0034     float obsRes(int obs, int eta, float eT);
0035     int etaBin(float eta);
0036 
0037 #ifdef OBSOLETE
0038     void operator()(Electron& obj);
0039     void operator()(Muon& obj);
0040     void operator()(Tau& obj);
0041     void operator()(Jet& obj);
0042     void operator()(MET& obj);
0043 #else
0044     // WORKAROUND
0045     template <typename T>
0046     void operator()(T& obj) {}
0047 #endif
0048 
0049   private:
0050     TFile* resoFile_;
0051     std::vector<float> etaBinVals_;
0052     TF1 fResVsEt_[10][10];
0053     TMultiLayerPerceptron* network_[10];
0054     bool useNN_;
0055   };
0056 
0057 }  // namespace pat
0058 
0059 #endif