00001 #ifndef JBCOMPARATOR_H
00002 #define JBCOMPARATOR_H
00003 #include "NueAna/NueAnaTools/Selection.h"
00004 #include "NueAna/Extrapolation/Background.h"
00005 #include "NueAna/Extrapolation/NuePrediction.h"
00006 #include "NueAna/Extrapolation/NueFNExtrapolation.h"
00007 #include "NueAna/Extrapolation/NueBackground.h"
00008 #include "Conventions/Detector.h"
00009 #include "THStack.h"
00010 #include "TTree.h"
00011 #include "TCanvas.h"
00012 #include "TGraph.h"
00013 #include "TMultiGraph.h"
00014 #include "TGraphAsymmErrors.h"
00015 #include "TFile.h"
00016 #include "TString.h"
00017 #include "TH1D.h"
00018 #include "TLegend.h"
00019 #include "TStyle.h"
00020 #include <string>
00021 #include <vector>
00022 #include <iostream>
00023
00024 class JBComparator
00025 {
00026
00027 public:
00028
00029 JBComparator(std::string);
00030 ~JBComparator();
00031
00032 void AddBackground(Background::Background_t bg) {fBgVec.push_back(bg);}
00033 void AddSysFile(Systematic::Systematic_t,string);
00034 Bool_t ExtractDataHists(TFile *);
00035
00036 void ComputeAll();
00037
00038
00039 void DrawAll(Int_t);
00040 void DrawAll(Int_t,Int_t);
00041
00042 void DrawPrediction(Int_t whichSys);
00043 void DrawPrediction(Int_t whichSys,Int_t whichBG);
00044
00045 void DrawRatio(Int_t whichSys);
00046 void DrawRatio(Int_t whichSys,Int_t whichBG);
00047
00048 void DrawIntegral(Int_t whichSys);
00049 void DrawIntegral(Int_t whichSys,Int_t whichBG);
00050
00051 void DrawSummary();
00052 TGraph *GetSummary(Int_t bg=-1);
00053
00054 void DoPrint(Bool_t doPrint) {fDoPrint = doPrint;}
00055 void SetOscSysString(string oss) {fOscSysString = oss;}
00056
00057 void GetError(Int_t whichSys, double* error, double* minerr, TH1D* Base);
00058 void DetermineError();
00059
00060 protected:
00061
00062
00063 Double_t fNDDataPOT;
00064 Double_t fFDDataPOT;
00065 std::string fHistType;
00066 char fSelection[256];
00067 Int_t fColourArray[20];
00068 Bool_t fDoPrint;
00069 std::string fOscSysString;
00070
00071
00072 std::map<Systematic::Systematic_t,string> fFileMap;
00073
00074
00075 std::vector<Background::Background_t> fBgVec;
00076
00077
00078
00079 std::map<Detector::Detector_t,std::map<Background::Background_t,NueBackground*> > fDataHists;
00080
00081
00082 std::map<Background::Background_t,std::map<Systematic::Systematic_t,
00083 std::map<NueSystematic*,TH1D*> > > fPredictionMap;
00084
00085
00086 std::map<NueSystematic*,TH1D*> GetPredictions(Systematic::Systematic_t,
00087 Background::Background_t);
00088
00089 Double_t GetFDSpectrumIntegral(Background::Background_t,Systematic::Systematic_t, Double_t);
00090 Bool_t InBGVector(Background::Background_t);
00091
00092 TCanvas *fCanvasForPredictions;
00093 TCanvas *fCanvasForRatios;
00094 TCanvas *fCanvasForIntegrals;
00095 TCanvas *fCanvasForSummary;
00096
00097 void DeletePredictionsForDrawing();
00098 void DeleteRatiosForDrawing();
00099 void DeleteIntegralsForDrawing();
00100 void DeleteSummaryForDrawing();
00101
00102 THStack *fPredictionsForDrawing;
00103 THStack *fRatiosForDrawing;
00104 TMultiGraph *fIntegralsForDrawing;
00105 TMultiGraph *fSummaryForDrawing;
00106
00107 TFile *fRatioFile;
00108
00109 };
00110 #endif //COMPARATOR_H