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

Comparator.h

Go to the documentation of this file.
00001 #ifndef COMPARATOR_H
00002 #define COMPARATOR_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 Comparator
00025 {
00026 
00027  public:
00028   
00029   Comparator(std::string);  //contructor take hist type as string (RecoEnergy/TrueEnergy)
00030   ~Comparator();
00031 
00032   void AddBackground(Background::Background_t bg) {fBgVec.push_back(bg);}  
00033   void AddSysFile(Systematic::Systematic_t,string);  //add file name and associated systematic
00034   Bool_t ExtractDataHists(TFile *);  //extract "Standard" histograms from 
00035                                      //first file passed to use as data
00036   void ComputeAll();
00037 
00038   //draw predictions, ratios, integrals for total prediction or individual backgrounds
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  protected:
00058 
00059   //general information about the files/hists:
00060   Double_t fNDDataPOT;
00061   Double_t fFDDataPOT;
00062   std::string fHistType;
00063   char fSelection[256];
00064   Int_t fColourArray[20];
00065   Bool_t fDoPrint;
00066   std::string fOscSysString;
00067   
00068   //structure to hold systematic<->filename mapping
00069   std::map<Systematic::Systematic_t,string> fFileMap;
00070 
00071   //structure to hold which backgrounds to consider here:
00072   std::vector<Background::Background_t> fBgVec;
00073 
00074   //structure to hold data histograms based on detector and background
00075   //data histograms held as NueBackground objects since these have POT info, etc.
00076   std::map<Detector::Detector_t,std::map<Background::Background_t,NueBackground*> > fDataHists;
00077 
00078   //map to hold Predictions for all backgrounds and systematics
00079   std::map<Background::Background_t,std::map<Systematic::Systematic_t,
00080     std::map<NueSystematic*,TH1D*> > > fPredictionMap;
00081   
00082   //function to extract predictions for a specific background and specific systematic
00083   std::map<NueSystematic*,TH1D*> GetPredictions(Systematic::Systematic_t,
00084                                                 Background::Background_t);
00085 
00086   Double_t GetFDSpectrumIntegral(Background::Background_t,Systematic::Systematic_t, Double_t);
00087   Bool_t InBGVector(Background::Background_t);
00088 
00089   TCanvas *fCanvasForPredictions;
00090   TCanvas *fCanvasForRatios;
00091   TCanvas *fCanvasForIntegrals;
00092   TCanvas *fCanvasForSummary;
00093 
00094   void DeletePredictionsForDrawing();
00095   void DeleteRatiosForDrawing();
00096   void DeleteIntegralsForDrawing();
00097   void DeleteSummaryForDrawing();
00098 
00099   THStack *fPredictionsForDrawing;
00100   THStack *fRatiosForDrawing;  
00101   TMultiGraph *fIntegralsForDrawing;
00102   TMultiGraph *fSummaryForDrawing;
00103 
00104 };
00105 #endif //COMPARATOR_H

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