• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

/Users/jmonk/Physics/ForIA/ForIA/AnalysisTools/JERProvider.hh

Go to the documentation of this file.
00001 
00030 #ifndef _JERPROVIDER_
00031 #define _JERPROVIDER_
00032 
00033 #include "TNamed.h"
00034 #include "TFile.h"
00035 #include "TF1.h"
00036 #include "TGraphErrors.h"
00037 #include <TRandom.h>
00038 #include <iostream>
00039 //#include <stream.h>
00040 #include <cmath>
00041 #include <map>
00042 
00043 using std::cout;
00044 using std::endl;
00045 using std::map;
00046 
00047 class JERProvider : public TNamed
00048 {
00049 
00050  public: 
00051 
00052   // Constructor, destructor
00053   JERProvider() { }
00054   JERProvider(std::string CollectionName, std::string MethodName = "Truth", std::string FileName="JERProviderPlots.root");
00055   virtual ~JERProvider();
00056   
00057   // filename -- only allowed before initialisation
00058   void setFileName(std::string fileName);
00059 
00060   //initialization
00061   void init();
00062 
00063   // Read the parametrization
00064   TF1* getParam(double y);
00065  
00066   // Read the offset from data/MC
00067   TGraphErrors* getOffset(double y);
00068   
00069   // Read the error from data/MC
00070   TGraphErrors* getSyst(double y);
00071   // Read sigma
00072   
00073   float getSigma(double pt, double y);
00074 
00075   // Read the uncertainty
00076   float getUncert(double pt, double y);
00077 
00078   // inputCollection 
00079   void setInputCollection(std::string CollectionName, std::string MethodName);
00080   
00081 #ifdef JER_STANDALONE
00082         ClassDef(JERProvider,1);
00083 #endif
00084 
00085  private:
00086   
00087   static const int m_nParam = 6;
00088   //static const double m_GeV = 1000.;
00089   static const int m_nY = 6;
00090 
00091   // strings
00092   std::string m_collectionName;
00093   std::string m_methodName;
00094   std::string m_fileName;
00095   
00096   //initialization flag
00097   bool m_isInit;
00098 
00099   // Input file
00100   TFile* m_inputFile; 
00101 
00102   // Pointer to the correct graph
00103   map<int,TF1*> m_jerFunc;
00104 
00105   // Parameters and their errors
00106   map<int,float> m_param;
00107 
00108   // Pointer to the correct graph
00109   map<int,TGraphErrors*> m_jerOffset;
00110   
00111   // Pointer to the correct graph
00112   map<int,TGraphErrors*> m_jerSyst;
00113   
00114   // Uncertainty from Data/MC comparison
00115   float m_uncert;
00116 
00117   // Offset from Data/MC comparison
00118   float m_offset;
00119 
00120   // Systematics
00121   float m_syst;
00122 
00123 
00124 };
00125 
00126 #endif

Generated on Mon Jul 30 2012 16:56:35 for ForIA by  doxygen 1.7.2