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

00001 // copied from Reconstruction/Jet/JetUncertainties/tags/JetUncertainties-00-03-04
00002 #ifndef _MULTIJETJESUNCERTAINTYPROVIDER_
00003 #define _MULTIJETJESUNCERTAINTYPROVIDER_
00004 
00005 #include "topUtils/JESUncertaintyProvider.h"
00006 
00007 class MultijetJESUncertaintyProvider : public JESUncertaintyProvider{
00008 
00009  public:
00010 
00011   // Constructors, destructor
00012   MultijetJESUncertaintyProvider(std::string CollectionName="AntiKt6TopoJetsEM", std::string AnalysisFileName="JESUncertainty.root", std::string FileName="JESUncertainty.root");
00013    ~MultijetJESUncertaintyProvider();
00014  
00015 
00016   // Initialize the provider
00017   virtual void init();
00018   void includeFlavorComposition(bool include = true);
00019 
00020   // Open input file
00021   //virtual void openInputFile(std::string FileName);
00022 
00023 
00024 
00025 
00026   // Relative positive uncertainty - by default no pile-up term, no close-by jets systematic (dR = 3.0)
00027   double getRelPosUncert(double pT, double Eta, double dRmin=3.0, Components UncertComps = JESUncertaintyProvider::NOPILEUP, unsigned int nVtx=1);
00028   // Absolute positive uncertainty - by default no pile-up term, no close-by jets systematic (dR = 3.0)
00029   double getAbsPosUncert(double pT, double Eta, double dRmin=3.0, Components UncertComps = JESUncertaintyProvider::NOPILEUP, unsigned int nVtx=1);
00030   // Relative negative uncertainty - by default no pile-up term, no close-by jets systematic (dR = 3.0)
00031   double getRelNegUncert(double pT, double Eta, double dRmin=3.0, Components UncertComps = JESUncertaintyProvider::NOPILEUP, unsigned int nVtx=1);
00032   // Absolute negative uncertainty - by default no pile-up term, no close-by jets systematic (dR = 3.0)
00033   double getAbsNegUncert(double pT, double Eta, double dRmin=3.0, Components UncertComps = JESUncertaintyProvider::NOPILEUP, unsigned int nVtx=1);
00034 
00035   // Relative uncertainty - by default no pile-up term, no close-by jets systematic (dR = 3.0)
00036   // isUp = true if relative positive uncertainty is requested
00037   // isUp = false if relative negative uncertainty is requested
00038   double getRelUncert(double pT, double Eta, double dRmin, bool isUp, Components UncertComps = JESUncertaintyProvider::NOPILEUP, unsigned int nVtx=1);
00039 
00040   // Get a copy of the 2D Graph containing the Uncertainties
00041   // isUp = true if relative positive uncertainty is requested
00042   // isUp = false if relative negative uncertainty is requested
00043   // to be implemented
00044 //  TH2D* getUncGraphCopy(bool isUp, Components UncertComps, unsigned int nVtx);
00045 
00046         #ifdef JES_STANDALONE
00047         ClassDef(MultijetJESUncertaintyProvider,1);
00048         #endif //JES_STANDALONE
00049 
00050   private:
00051   
00052   //Pointers to the flavor composition histograms
00053   TH2D*  m_flavorCompGluGraph; 
00054   TH2D*  m_flavorCompLightGraph; 
00055 
00056   //Pointer to the deltaR histogram
00057   TH2D*  m_deltaRGraph; 
00058 
00059   //Pointers to the sample related histograms
00060   //Pointer to the gluon fraction histogram
00061   TH2D*  m_gluonFraction; 
00062   //Pointer to the gluon fraction error histogram
00063   TH2D*  m_gluonFractionError; 
00064   //Pointer to the response histogram
00065   TH2D*  m_responseSample; 
00066 
00067 
00068   // Input File with sample related histograms(gluon fraction, gluon fraction error, sample response)
00069   TFile* m_analysisInputFile; 
00070 
00071   // Name of analysis file
00072   std::string m_analysisFileName;
00073   
00074   // Decide whether to include the flavor compositio term
00075   bool m_includeFlavorComp;
00076   
00077 
00078   // Count how often error message is printed
00079   static int m_counter;
00080 
00081   // Helper function to increment m_counter
00082   static void incrementCounter(){
00083   m_counter++;
00084  }
00085 
00086   // Change the inputCollection
00087   virtual bool setInputCollection(std::string CollectionName);
00088 
00089   // Helper function to check requested components (global uncertainty from JESUncertaintyProvider) and adding sample specific flavor composition uncertainty on top of it
00090   double getComponents(double pT, double Eta, double dRmin, bool isUp, Components UncertComps, unsigned int nVtx);
00091 
00092   // Helper function to calculate prefactor alphaC
00093   double getAlphaC(int currentBin, bool isUp);
00094 
00095   // Helper function to calculate prefactor alphaR
00096   double getAlphaR(int currentBin, bool isUp, double alphaC, double avgResponse);
00097 
00098   // Helper funtion to return average response - protect against r_avg>1+Delta+ and r_avg < 1-Delta-
00099   double getResponseSample(int currentBin);
00100 
00101 };
00102 
00103 
00104 #endif

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