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

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

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00039 
00040 
00041 
00042 
00043 
00044 
00045 
00046 
00047 
00048 
00049 
00050 
00051 
00052 #ifndef _JESUNCERTAINTYPROVIDER_
00053 #define _JESUNCERTAINTYPROVIDER_
00054 
00055 #include "TNamed.h"
00056 #include "TFile.h"
00057 #include "TH2D.h"
00058 #include <iostream>
00059 #include <string>
00060 #include <sstream>
00061 #include <cmath>
00062 #include <map>
00063 using std::cout;
00064 using std::map;
00065 
00066 class JESUncertaintyProvider : public TNamed
00067 {
00068 
00069 public:
00070 
00071   enum Components { 
00072     // Basic components
00073     CALORIMETER = 1,                  // Calorimeter uncertainty from single particle propagation
00074     NOISETHRESHOLDS = 2,              // Use topocluster noise thresholds from data
00075     PERUGIATUNE = 4,                  // Perugia 2010 Pythia tune 
00076     ALPGENHERWIGJIMMY = 8,            // Alpgen+Herwig+Jimmy
00077     ETAINTERCALIBRATION = 16,         // Uncertainty due to intercalibration (endcap wrt central region)
00078     CLOSURE = 32,                     // Non-closure of numerical inversion constants
00079     PILEUP = 64,                      // Uncertainty due to in-time pile-up
00080     
00081     // Suggested combinations 
00082     NOCLOSURE = 95,                   // Allow users to include their own non-closure
00083     NOPILEUP = 63,                    // For data with no pile-up
00084     NOPILEUPNOCLOSURE = 31,           // Data with no pile-up, no non-closure
00085     ALL = 127                         // Everything
00086   }; 
00087   
00088 
00089   // Constructors, destructor
00090   JESUncertaintyProvider(std::string CollectionName="AntiKt6H1TopoJets", std::string FileName="JESUncertainty.root");
00091    ~JESUncertaintyProvider();
00092   
00093   // Read the uncertainties off of the graph - By default, no Pile-Up term!
00094   double getRelUncert(double pT, double Eta, Components UncertComps = JESUncertaintyProvider::NOPILEUP, unsigned int nVtx=1);
00095   double getAbsUncert(double pT, double Eta, Components UncertComps = JESUncertaintyProvider::NOPILEUP, unsigned int nVtx=1);
00096   
00097   // Pass a pointer to the correct graph
00098   TH2D* getUncGraphCopy(Components UncertComps = JESUncertaintyProvider::NOPILEUP, unsigned int nVtx=1);
00099 
00100   // Initialize the provider
00101   virtual void init();
00102 
00103   // Open input file
00104   virtual TFile* openInputFile(std::string FileName = "JESUncertainty.root");
00105 
00106         #ifdef JES_STANDALONE
00107         ClassDef(JESUncertaintyProvider,1);
00108         #endif //JES_STANDALONE
00109 
00110  protected:
00111 
00112   // Change the inputCollection
00113   bool setInputCollection(std::string CollectionName);
00114   
00115   // Maximum number of components
00116   static const unsigned int m_nUncertainties = 7;
00117   
00118   // Maximum number of vertices available
00119   static const unsigned int m_nVertices = 7;
00120   
00121   // For standalone compatibility
00122   const double m_GeV;
00123   
00124   // Pointers to the uncertainty histograms 
00125   map<int,TH2D*> m_uncGraph;
00126 
00127   // Pointers to the pileup histograms
00128   map<int,TH2D*> m_pileupUncGraph;
00129 
00130   // Input File
00131   TFile* m_inputFile; 
00132 
00133   // Helper function to check requested components
00134   double getComponents(int currentBin, Components UncertComps, unsigned int nVtx = 1);
00135 
00136   // Name of jet collection
00137   std::string m_collectionName;
00138 
00139   // Name of file
00140   std::string m_fileName; 
00141 
00142   // Initialization flag
00143   bool m_isInit;
00144   
00145 };
00146 
00147 
00148 #endif

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