/afs/hep.man.ac.uk/u/markowen/ATLAS/SFrameProof/2011EPS/topUtils/topUtils/JESUncertaintyProvider.h

00001 // copied from Reconstruction/Jet/JetUncertainties/tags/JetUncertainties-00-03-04
00053 #ifndef _JESUNCERTAINTYPROVIDER_
00054 #define _JESUNCERTAINTYPROVIDER_
00055 
00056 #include "TNamed.h"
00057 #include "TFile.h"
00058 #include "TH2D.h"
00059 #include <iostream>
00060 #include <string>
00061 #include <sstream>
00062 #include <cmath>
00063 #include <map>
00064 using std::cout;
00065 using std::map;
00066 
00067 class JESUncertaintyProvider : public TNamed
00068 {
00069 
00070 public:
00071 
00072   enum Components { 
00073     // Basic components
00074     CALORIMETER = 1,                  // Calorimeter uncertainty from single particle propagation
00075     NOISETHRESHOLDS = 2,              // Use topocluster noise thresholds from data
00076     PERUGIATUNE = 4,                  // Perugia 2010 Pythia tune 
00077     ALPGENHERWIGJIMMY = 8,            // Alpgen+Herwig+Jimmy
00078     ETAINTERCALIBRATION = 16,         // Uncertainty due to intercalibration (endcap wrt central region)
00079     CLOSURE = 32,                     // Non-closure of numerical inversion constants
00080     PILEUP = 64,                      // Uncertainty due to in-time pile-up
00081     
00082     // Suggested combinations 
00083     NOCLOSURE = 95,                   // Allow users to include their own non-closure
00084     NOPILEUP = 63,                    // For data with no pile-up
00085     NOPILEUPNOCLOSURE = 31,           // Data with no pile-up, no non-closure
00086     ALL = 127                         // Everything
00087   }; 
00088   
00089 
00090   // Constructors, destructor
00091   JESUncertaintyProvider(std::string CollectionName="AntiKt6TopoJetsEM", std::string FileName="JESUncertainty.root");
00092    ~JESUncertaintyProvider();
00093   
00094   // Read the uncertainties off of the graph - By default, no Pile-Up term!
00095   double getRelUncert(double pT, double Eta, Components UncertComps = JESUncertaintyProvider::NOPILEUP, unsigned int nVtx=1);
00096   double getAbsUncert(double pT, double Eta, Components UncertComps = JESUncertaintyProvider::NOPILEUP, unsigned int nVtx=1);
00097   
00098   // Pass a pointer to the correct graph
00099   //TH2D* getUncGraphCopy(Components UncertComps = JESUncertaintyProvider::NOPILEUP, unsigned int nVtx=1);
00100 
00101   // Initialize the provider
00102   virtual void init();
00103 
00104   // Open input file
00105   virtual TFile* openInputFile(std::string FileName = "JESUncertainty.root");
00106 
00107         #ifdef JES_STANDALONE
00108         ClassDef(JESUncertaintyProvider,1);
00109         #endif //JES_STANDALONE
00110 
00111  protected:
00112 
00113   // Change the inputCollection
00114   bool setInputCollection(std::string CollectionName);
00115     
00116   // Maximum number of components
00117   static const unsigned int m_nUncertainties_EMJES = 7;
00118   static const unsigned int m_nUncertainties_inSitu = 2;
00119   
00120   // Maximum number of vertices available
00121   static const unsigned int m_nVertices = 7;
00122   
00123   // For standalone compatibility
00124   const double m_GeV;
00125   
00126   // Pointers to the uncertainty histograms 
00127   map<int,TH2D*> m_uncGraph;
00128 
00129   // Pointers to the pileup histograms
00130   map<int,TH2D*> m_pileupUncGraph;
00131 
00132   // Input File
00133   TFile* m_inputFile; 
00134 
00135   // Helper function to check requested components
00136   double getComponents(int currentBin, Components UncertComps, unsigned int nVtx = 1);
00137 
00138   // Name of jet collection
00139   std::string m_collectionName;
00140 
00141   // Name of file
00142   std::string m_fileName; 
00143   
00144   // Initialization flag
00145   bool m_isInit;
00146   
00147   // Deal with in-situ uncertainties (temporary)
00148   bool m_doInSitu;
00149 
00150   
00151 };
00152 
00153 
00154 #endif

Generated on Thu Jun 30 11:40:04 2011 for manTreeSFrame by  doxygen 1.4.7