Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

MadChi2Calc.h

Go to the documentation of this file.
00001 #ifndef madchi2calc_h
00002 #define madchi2calc_h
00003 #include <iostream>
00004 #include "TH1.h"
00005 #include "TH2.h"
00006 #include "TMatrix.h"
00007 
00008 class MadChi2Calc {
00009 
00010  public:
00011   
00012   MadChi2Calc(int ct=0);
00013   ~MadChi2Calc();
00014   
00015   void SetCalcType(int ct) {calcType = ct;}
00016   int GetCalcType() {return calcType;}
00017 
00018   double GetChi2(TH1F *,TH1F *,TH1F *,double);
00019   double GetChi2(TH2F *,TH2F *,TH2F *,double);
00020   double GetChi2(int,double*,double*,double*,double,double Min = 0,
00021                  double Max = 20);
00022   
00023   void SetFluxMap(TH2F *hist = 0);
00024   void SetSysErrors(double,double,double*,double);
00025 
00026   void SetNormalisationError(double err) {NormErr = err;}
00027   double GetNormalisationError() {return NormErr;}
00028 
00029   void SetBinToBinError(double err) {BinErr = err;}
00030   double GetBinToBinError() {return BinErr;}
00031 
00032   void SetBinHeightError(double *err) {HeightErr = err;}
00033   double *GetBinHeightError() {return HeightErr;}
00034   
00035   void SetBkdXSecError(double err) {BkdXSecErr = err;}
00036   double GetBkdXSecError() {return BkdXSecErr;}
00037 
00038  protected:
00039 
00040   double SumChi2(int,double*,double*,double*,double,double,double);
00041   double BasicChi2(double sig,double mc,double bkd=0);
00042   double PoisDistChi2(double sig,double mc,double bkd=0);
00043   double WithSysErrChi2(int,double*,double*,double*,double,double,double);
00044   double WithSysErrLoopsChi2(int,double *,double *,double *,double);
00045 
00046   int calcType; //determines which method to use to calculate chi2
00047                 // 1 = BasicChi2; 2 = WithSysErrChi2; 3 = WithSysErrLoopsChi2;
00048                 // default = PoisDistChi2
00049 
00050   TH2F *FluxMapHist; //No flux map used by default
00051 
00052   //bin to bin errors:
00053   double BinErr; //2% by default
00054 
00055   //Energy dependent bin height errors:
00056   double *HeightErr; //2% by default - assumes binning is same as histo binning
00057 
00058   //Overall normalisation error:
00059   double NormErr; //2% by default
00060   
00061   //Uncertainty in cross-section of Background:
00062   double BkdXSecErr; //5% by default
00063 
00064   // Combination of NormErr and BkdXSecErr allow uncertainties 
00065   // in signal and bkd cross-sections to be accounted for
00066   // Note!! Not all errors are included in every Chi2Calc method
00067 
00068 };
00069 #endif // #ifdef madchi2calc_h

Generated on Mon Feb 15 11:06:54 2010 for loon by  doxygen 1.3.9.1