Comparator Class Reference

#include <Comparator.h>

List of all members.

Public Member Functions

 Comparator (std::string)
 ~Comparator ()
void AddBackground (Background::Background_t bg)
void AddSysFile (Systematic::Systematic_t, string)
Bool_t ExtractDataHists (TFile *)
void ComputeAll ()
void DrawAll (Int_t)
void DrawAll (Int_t, Int_t)
void DrawPrediction (Int_t whichSys)
void DrawPrediction (Int_t whichSys, Int_t whichBG)
void DrawRatio (Int_t whichSys)
void DrawRatio (Int_t whichSys, Int_t whichBG)
void DrawIntegral (Int_t whichSys)
void DrawIntegral (Int_t whichSys, Int_t whichBG)
void DrawSummary ()
TGraph * GetSummary (Int_t bg=-1)
void DoPrint (Bool_t doPrint)
void SetOscSysString (string oss)

Protected Member Functions

std::map< NueSystematic *, TH1D * > GetPredictions (Systematic::Systematic_t, Background::Background_t)
Double_t GetFDSpectrumIntegral (Background::Background_t, Systematic::Systematic_t, Double_t)
Bool_t InBGVector (Background::Background_t)
void DeletePredictionsForDrawing ()
void DeleteRatiosForDrawing ()
void DeleteIntegralsForDrawing ()
void DeleteSummaryForDrawing ()

Protected Attributes

Double_t fNDDataPOT
Double_t fFDDataPOT
std::string fHistType
char fSelection [256]
Int_t fColourArray [20]
Bool_t fDoPrint
std::string fOscSysString
std::map
< Systematic::Systematic_t,
string > 
fFileMap
std::vector
< Background::Background_t
fBgVec
std::map< Detector::Detector_t,
std::map
< Background::Background_t,
NueBackground * > > 
fDataHists
std::map
< Background::Background_t,
std::map
< Systematic::Systematic_t,
std::map< NueSystematic
*, TH1D * > > > 
fPredictionMap
TCanvas * fCanvasForPredictions
TCanvas * fCanvasForRatios
TCanvas * fCanvasForIntegrals
TCanvas * fCanvasForSummary
THStack * fPredictionsForDrawing
THStack * fRatiosForDrawing
TMultiGraph * fIntegralsForDrawing
TMultiGraph * fSummaryForDrawing

Detailed Description

Definition at line 24 of file Comparator.h.


Constructor & Destructor Documentation

Comparator::Comparator ( std::string   ) 
Comparator::~Comparator (  ) 

Definition at line 36 of file Comparator.cxx.

References DeleteIntegralsForDrawing(), DeletePredictionsForDrawing(), DeleteRatiosForDrawing(), DeleteSummaryForDrawing(), fCanvasForIntegrals, fCanvasForPredictions, fCanvasForRatios, fCanvasForSummary, fDataHists, fFileMap, fIntegralsForDrawing, fPredictionMap, fPredictionsForDrawing, fRatiosForDrawing, fSummaryForDrawing, Detector::kFar, and Detector::kNear.

00037 {
00038   //delete predictions:
00039   std::map<Background::Background_t,NueBackground*>::iterator dataBeg = 
00040     fDataHists[Detector::kNear].begin();
00041   std::map<Background::Background_t,NueBackground*>::iterator dataEnd = 
00042     fDataHists[Detector::kNear].end();
00043   while(dataBeg!=dataEnd){
00044     std::map<Systematic::Systematic_t,std::string>::iterator fileBeg = fFileMap.begin();
00045     std::map<Systematic::Systematic_t,std::string>::iterator fileEnd = fFileMap.end();
00046     while(fileBeg!=fileEnd){
00047       std::map<NueSystematic*,TH1D*>::iterator histBeg = 
00048         fPredictionMap[dataBeg->first][fileBeg->first].begin();
00049       std::map<NueSystematic*,TH1D*>::iterator histEnd = 
00050         fPredictionMap[dataBeg->first][fileBeg->first].end();
00051       while(histBeg!=histEnd){
00052         delete histBeg->first;
00053         delete histBeg->second;
00054         histBeg++;
00055       }
00056       fileBeg++;
00057     }
00058     dataBeg++;
00059   }
00060 
00061   //delete data hists:
00062   dataBeg = fDataHists[Detector::kNear].begin();
00063   while(dataBeg!=dataEnd) {
00064     delete dataBeg->second;
00065     dataBeg++;
00066   }
00067   dataBeg = fDataHists[Detector::kFar].begin();
00068   dataEnd = fDataHists[Detector::kFar].end(); 
00069   while(dataBeg!=dataEnd) {
00070     delete dataBeg->second;
00071     dataBeg++;
00072   }
00073 
00074   //delete histos/graphs held for plotting:
00075   this->DeletePredictionsForDrawing();
00076   this->DeleteRatiosForDrawing();
00077   this->DeleteIntegralsForDrawing();
00078   this->DeleteSummaryForDrawing();
00079   delete fPredictionsForDrawing;
00080   delete fRatiosForDrawing;
00081   delete fIntegralsForDrawing;
00082   delete fSummaryForDrawing;
00083   delete fCanvasForPredictions;
00084   delete fCanvasForRatios;
00085   delete fCanvasForIntegrals;
00086   delete fCanvasForSummary;
00087 }


Member Function Documentation

void Comparator::AddBackground ( Background::Background_t  bg  )  [inline]

Definition at line 32 of file Comparator.h.

References fBgVec.

Referenced by NueGui::StartComparator().

00032 {fBgVec.push_back(bg);}  

void Comparator::AddSysFile ( Systematic::Systematic_t  sys,
string  fname 
)

Definition at line 89 of file Comparator.cxx.

References ExtractDataHists(), fDataHists, and fFileMap.

Referenced by NueGui::StartComparator().

00090 {  
00091   fFileMap[sys] = fname;
00092   if(fDataHists.begin()==fDataHists.end()) {
00093     TFile *f = new TFile(fname.c_str(),"READ");
00094     if(!this->ExtractDataHists(f)) 
00095       std::cout << "Error: Could not extract data histograms from file: " 
00096                 << fname << endl;
00097     delete f;
00098   }
00099 }

void Comparator::ComputeAll (  ) 

Definition at line 146 of file Comparator.cxx.

References fDataHists, fFileMap, fPredictionMap, GetPredictions(), and Detector::kNear.

Referenced by NueGui::StartComparator().

00147 {
00148   std::map<Background::Background_t,NueBackground*>::iterator dataBeg = 
00149     fDataHists[Detector::kNear].begin();
00150   std::map<Background::Background_t,NueBackground*>::iterator dataEnd = 
00151     fDataHists[Detector::kNear].end();
00152   while(dataBeg!=dataEnd){
00153     std::map<Systematic::Systematic_t,std::string>::iterator fileBeg = fFileMap.begin();
00154     std::map<Systematic::Systematic_t,std::string>::iterator fileEnd = fFileMap.end();
00155     while(fileBeg!=fileEnd){
00156       fPredictionMap[dataBeg->first][fileBeg->first] = GetPredictions(fileBeg->first,
00157                                                                       dataBeg->first);
00158       fileBeg++;
00159     }
00160     dataBeg++;
00161   }
00162 }

void Comparator::DeleteIntegralsForDrawing (  )  [protected]

Definition at line 871 of file Comparator.cxx.

References fIntegralsForDrawing, and it.

Referenced by DrawIntegral(), and ~Comparator().

00872 {
00873   if(fIntegralsForDrawing->GetListOfGraphs()){
00874     TIter it(fIntegralsForDrawing->GetListOfGraphs()->MakeIterator());
00875     TObject *ob = 0;
00876     while((ob = it())) delete ob;
00877   }
00878 }

void Comparator::DeletePredictionsForDrawing (  )  [protected]

Definition at line 853 of file Comparator.cxx.

References fPredictionsForDrawing, and it.

Referenced by DrawPrediction(), and ~Comparator().

00854 {
00855   if(fPredictionsForDrawing->GetHists()) {
00856     TIter it(fPredictionsForDrawing->GetHists()->MakeIterator());
00857     TObject *ob = 0;
00858     while((ob = it())) delete ob;
00859   }
00860 }

void Comparator::DeleteRatiosForDrawing (  )  [protected]

Definition at line 862 of file Comparator.cxx.

References fRatiosForDrawing, and it.

Referenced by DrawRatio(), and ~Comparator().

00863 {
00864   if(fRatiosForDrawing->GetHists()) {
00865     TIter it(fRatiosForDrawing->GetHists()->MakeIterator());
00866     TObject *ob = 0;
00867     while((ob = it())) delete ob;
00868   }
00869 }

void Comparator::DeleteSummaryForDrawing (  )  [protected]

Definition at line 880 of file Comparator.cxx.

References fSummaryForDrawing, and it.

Referenced by DrawSummary(), and ~Comparator().

00881 {
00882   if(fSummaryForDrawing->GetListOfGraphs()){
00883     TIter it(fSummaryForDrawing->GetListOfGraphs()->MakeIterator());
00884     TObject *ob = 0;
00885     while((ob = it())) delete ob;
00886   }
00887 }

void Comparator::DoPrint ( Bool_t  doPrint  )  [inline]

Definition at line 54 of file Comparator.h.

References fDoPrint.

Referenced by NueGui::ProcessMessage(), and NueGui::StartComparator().

00054 {fDoPrint = doPrint;}

void Comparator::DrawAll ( Int_t  whichSys,
Int_t  whichBG 
)

Definition at line 193 of file Comparator.cxx.

References DrawIntegral(), DrawPrediction(), and DrawRatio().

00194 {
00195   this->DrawPrediction(whichSys,whichBG);
00196   this->DrawRatio(whichSys,whichBG);
00197   this->DrawIntegral(whichSys,whichBG);
00198 }

void Comparator::DrawAll ( Int_t  whichSys  ) 

Definition at line 186 of file Comparator.cxx.

References DrawIntegral(), DrawPrediction(), and DrawRatio().

Referenced by NueGui::ProcessMessage().

00187 {
00188   this->DrawPrediction(whichSys);
00189   this->DrawRatio(whichSys);
00190   this->DrawIntegral(whichSys);
00191 }

void Comparator::DrawIntegral ( Int_t  whichSys,
Int_t  whichBG 
)

Definition at line 608 of file Comparator.cxx.

References Background::AsString(), Systematic::AsString(), DeleteIntegralsForDrawing(), fCanvasForIntegrals, fDataHists, fDoPrint, fFileMap, fIntegralsForDrawing, fOscSysString, fPredictionMap, fSelection, GetFDSpectrumIntegral(), InBGVector(), Detector::kFar, Systematic::kOscProb, and n.

00609 {
00610   //delete previous TGraphs
00611   this->DeleteIntegralsForDrawing();
00612   //get/make TLegend
00613   fCanvasForIntegrals->cd();  
00614   TLegend *leg = (TLegend*) fCanvasForIntegrals->FindObject("CFILeg");
00615   if(leg) leg->Clear();
00616   else {
00617     leg = new TLegend(0.2,0.2,0.4,0.4);
00618     leg->SetName("CFILeg");
00619     leg->SetBorderSize(0);
00620   }
00621   fCanvasForIntegrals->Clear();
00622 
00623   Int_t n = 0;
00624   Double_t sysValues[100] = {0}; //unfeasibly large...
00625   Double_t mcIntegValues[100] = {0};
00626   Double_t extrapIntegValues[100] = {0};
00627   Systematic::Systematic_t sys = Systematic::ESystematic(whichSys);
00628   Background::Background_t bg = Background::EBackground(whichBG);
00629   if(!this->InBGVector(bg)) return;
00630   if(fFileMap.find(sys)==fFileMap.end()) return;
00631   std::map<NueSystematic*,TH1D*>::iterator predBeg = fPredictionMap[bg][sys].begin();
00632   std::map<NueSystematic*,TH1D*>::iterator predEnd = fPredictionMap[bg][sys].end();
00633   while(predBeg!=predEnd) {
00634     if(sys==Systematic::kOscProb) {
00635       TString ts(predBeg->first->GetName());
00636       if(!ts.Contains(fOscSysString)) { predBeg++; continue;}
00637       Double_t tmpDub, theta23, delta23;
00638       Int_t tmpInt;
00639       predBeg->first->GetOscParams(tmpDub,theta23,tmpDub,tmpDub,delta23,tmpDub,tmpInt); 
00640       if(ts.Contains("Theta23")) sysValues[n] = theta23;
00641       else if(ts.Contains("Delta23")) sysValues[n] = delta23;
00642     }
00643     else sysValues[n] = predBeg->first->GetSysValue(sys);
00644     //if(sysValues[n]<-9998) sysValues[n] = 0;
00645     Double_t dataTot = fDataHists[Detector::kFar][bg]->GetHist()->Integral();
00646     extrapIntegValues[n] = predBeg->second->Integral();
00647     mcIntegValues[n] = this->GetFDSpectrumIntegral(bg,sys,sysValues[n]);
00648     if(dataTot>0){
00649       extrapIntegValues[n]/=dataTot;
00650       mcIntegValues[n]/=dataTot;
00651     }
00652     predBeg++;
00653     n++;
00654   }
00655   TGraph *extrapGr = new TGraph(n,sysValues,extrapIntegValues);
00656   TGraph *mcGr = new TGraph(n,sysValues,mcIntegValues);
00657   extrapGr->SetMarkerColor(4);
00658   mcGr->SetMarkerColor(2);
00659   fIntegralsForDrawing->Add(extrapGr,"P");
00660   fIntegralsForDrawing->Add(mcGr,"P");
00661   leg->AddEntry(extrapGr,"Data_{ND}#times(F/N)_{sys}/Data_{FD}","p");
00662   leg->AddEntry(mcGr,"MC^{sys}_{FD}/Data_{FD}","p");
00663 
00664   fIntegralsForDrawing->Draw("A");
00665   string title = "FD Spectrum Integral Ratios for " + string(Background::AsString(bg)) + 
00666     " with " + string(fSelection) + " and Tweaks in " + string(Systematic::AsString(sys));
00667   fIntegralsForDrawing->SetTitle(title.c_str());  
00668   leg->Draw();
00669   gROOT->ProcessLine("SortOutStats(gPad,0.3,0.075,1,0.7,0.09);STS(0.04);");
00670   if(fDoPrint) {
00671     string printName = "FD_Integral_" + string(Background::AsString(bg)) + "_" + 
00672       string(fSelection) + "_" + string(Systematic::AsString(sys)) + ".gif";
00673     fCanvasForIntegrals->Print(printName.c_str());
00674   }
00675 }

void Comparator::DrawIntegral ( Int_t  whichSys  ) 

Definition at line 514 of file Comparator.cxx.

References Systematic::AsString(), DeleteIntegralsForDrawing(), MuELoss::e, fCanvasForIntegrals, fDataHists, fDoPrint, fFileMap, fIntegralsForDrawing, fOscSysString, fPredictionMap, fSelection, GetFDSpectrumIntegral(), Detector::kFar, Detector::kNear, Systematic::kOscProb, and n.

Referenced by DrawAll(), and GetSummary().

00515 {
00516   //delete previous TGraphs
00517   this->DeleteIntegralsForDrawing();
00518   //get/make TLegend
00519   fCanvasForIntegrals->cd();
00520   TLegend *leg = (TLegend*) fCanvasForIntegrals->FindObject("CFILeg");
00521   if(leg) leg->Clear();
00522   else {
00523     leg = new TLegend(0.2,0.2,0.4,0.4);
00524     leg->SetName("CFILeg");
00525     leg->SetBorderSize(0);
00526   }
00527   fCanvasForIntegrals->Clear();
00528 
00529   Int_t n = 0;
00530   Double_t sysValues[100] = {0}; //unfeasibly large...
00531   Double_t mcIntegValues[100] = {0};
00532   Double_t extrapIntegValues[100] = {0};
00533   Double_t dataTot = 0;
00534   Bool_t firstPass = true;
00535   Systematic::Systematic_t sys = Systematic::ESystematic(whichSys);
00536   if(fFileMap.find(sys)==fFileMap.end()) return;
00537 
00538   std::map<Background::Background_t,NueBackground*>::iterator dataBeg = 
00539     fDataHists[Detector::kNear].begin();
00540   std::map<Background::Background_t,NueBackground*>::iterator dataEnd = 
00541     fDataHists[Detector::kNear].end();
00542   while(dataBeg!=dataEnd){
00543     Background::Background_t bg = dataBeg->first;
00544     std::map<NueSystematic*,TH1D*>::iterator predBeg = fPredictionMap[bg][sys].begin();
00545     std::map<NueSystematic*,TH1D*>::iterator predEnd = fPredictionMap[bg][sys].end();    
00546     while(predBeg!=predEnd){
00547       Double_t theVal = 0;
00548       if(sys==Systematic::kOscProb) {
00549         TString ts(predBeg->first->GetName());
00550         if(!ts.Contains(fOscSysString)) { predBeg++; continue;}
00551         Double_t tmpDub, theta23, delta23;
00552         Int_t tmpInt;
00553         predBeg->first->GetOscParams(tmpDub,theta23,tmpDub,tmpDub,delta23,tmpDub,tmpInt);       
00554         if(ts.Contains("Theta23")) theVal = theta23;
00555         else if(ts.Contains("Delta23")) theVal = delta23;
00556       }
00557       else theVal = predBeg->first->GetSysValue(sys);
00558       if(firstPass) {
00559         sysValues[n] = theVal;
00560         extrapIntegValues[n] += predBeg->second->Integral();
00561         mcIntegValues[n] += this->GetFDSpectrumIntegral(bg,sys,sysValues[n]);
00562         n++;
00563       }
00564       else {
00565         for(int i=0;i<n;i++) {
00566           if(TMath::Abs(sysValues[i]-theVal)<1e-6) {
00567             extrapIntegValues[i] += predBeg->second->Integral();
00568             mcIntegValues[i] += this->GetFDSpectrumIntegral(bg,sys,sysValues[i]);
00569             break;
00570           }
00571         }
00572       }
00573       predBeg++;
00574     }
00575     dataTot += fDataHists[Detector::kFar][bg]->GetHist()->Integral();
00576     firstPass = false;
00577     dataBeg++;
00578   }
00579   if(dataTot>0){
00580     for(int i=0;i<n;i++){
00581       mcIntegValues[i]/=dataTot;
00582       extrapIntegValues[i]/=dataTot;
00583     }
00584   }
00585 
00586   TGraph *extrapGr = new TGraph(n,sysValues,extrapIntegValues);
00587   TGraph *mcGr = new TGraph(n,sysValues,mcIntegValues);
00588   extrapGr->SetMarkerColor(4);
00589   mcGr->SetMarkerColor(2);
00590   fIntegralsForDrawing->Add(extrapGr,"P");
00591   fIntegralsForDrawing->Add(mcGr,"P");
00592   leg->AddEntry(extrapGr,"Data_{ND}#times(F/N)_{sys}/Data_{FD}","p");
00593   leg->AddEntry(mcGr,"MC^{sys}_{FD}/Data_{FD}","p");
00594 
00595   fIntegralsForDrawing->Draw("A");
00596   string title = "FD Total Spectrum Integral Ratios with " + string(fSelection) + 
00597     " and Tweaks in " + string(Systematic::AsString(sys));
00598   fIntegralsForDrawing->SetTitle(title.c_str());  
00599   leg->Draw();
00600   gROOT->ProcessLine("SortOutStats(gPad,0.3,0.075,1,0.7,0.09);STS(0.04);");
00601   if(fDoPrint) {
00602     string printName = "FD_Integral_" + string(fSelection) + "_" + 
00603       string(Systematic::AsString(sys)) + ".gif";
00604     fCanvasForIntegrals->Print(printName.c_str());
00605   }
00606 }

void Comparator::DrawPrediction ( Int_t  whichSys,
Int_t  whichBG 
)

Definition at line 292 of file Comparator.cxx.

References Background::AsString(), Systematic::AsString(), DeletePredictionsForDrawing(), fCanvasForPredictions, fColourArray, fDataHists, fDoPrint, fFileMap, fOscSysString, fPredictionMap, fPredictionsForDrawing, fSelection, NueSystematic::GetName(), NueSystematic::GetOscParams(), NueSystematic::GetSysValue(), InBGVector(), Detector::kFar, and Systematic::kOscProb.

00293 {
00294   //delete previously made/drawn histograms  
00295   this->DeletePredictionsForDrawing();
00296  
00297   //get/make TLegend
00298   fCanvasForPredictions->cd();  
00299   TLegend *leg = 0;
00300   if((leg = (TLegend*) fCanvasForPredictions->FindObject("CFPLeg"))) leg->Clear();
00301   else {
00302     leg = new TLegend(0.2,0.2,0.4,0.4);
00303     leg->SetName("CFPLeg");
00304     leg->SetBorderSize(1);
00305   }
00306 
00307   Int_t colCounter = 0;
00308   Systematic::Systematic_t sys = Systematic::ESystematic(whichSys);
00309   Background::Background_t bg = Background::EBackground(whichBG);
00310   if(!this->InBGVector(bg)) return;
00311   if(fFileMap.find(sys)==fFileMap.end()) return;
00312   std::map<NueSystematic*,TH1D*>::iterator predBeg = fPredictionMap[bg][sys].begin();
00313   std::map<NueSystematic*,TH1D*>::iterator predEnd = fPredictionMap[bg][sys].end();
00314   char label[256];
00315   while(predBeg!=predEnd) {
00316     NueSystematic *tmpSys = predBeg->first;
00317     if(sys==Systematic::kOscProb) {
00318       TString ts(tmpSys->GetName());
00319       if(!ts.Contains(fOscSysString)) { predBeg++; continue;}
00320       Double_t tmpDub, theta23, delta23;
00321       Int_t tmpInt;
00322       tmpSys->GetOscParams(tmpDub,theta23,tmpDub,tmpDub,delta23,tmpDub,tmpInt);
00323       if(ts.Contains("Theta23")) sprintf(label,"%s = %.4f",tmpSys->GetName(),theta23);
00324       else if(ts.Contains("Delta23")) sprintf(label,"%s = %.4f",tmpSys->GetName(),delta23);
00325     }
00326     else sprintf(label,"%s = %.2f",Systematic::AsString(sys),tmpSys->GetSysValue(sys));
00327     TH1D *tmpPred = (TH1D*) predBeg->second->
00328       Clone(string(string(predBeg->second->GetName())+string("_copy")).c_str());
00329     tmpPred->SetLineColor(fColourArray[colCounter]);
00330     tmpPred->SetMarkerColor(fColourArray[colCounter]);
00331     tmpPred->SetAxisRange(0,10);
00332     fPredictionsForDrawing->Add(tmpPred,"hist");
00333     leg->AddEntry(tmpPred,label,"lp");
00334     colCounter++;
00335     predBeg++;
00336   }
00337 
00338   //Draw:
00339   fPredictionsForDrawing->Draw("nostack");
00340   fPredictionsForDrawing->GetXaxis()->SetRangeUser(0,10);
00341   TH1D *dataHist = 
00342         (TH1D*) fDataHists[Detector::kFar][bg]->GetHist()->Clone("DataHist");
00343   dataHist->SetAxisRange(0,10);
00344   dataHist->Draw("same");
00345   leg->AddEntry(dataHist,"Pseudo-Data","lp");
00346   string title = "FD Prediction for " + string(Background::AsString(bg)) + " with " + 
00347     string(fSelection) + " and Tweaks in " + string(Systematic::AsString(sys));
00348   fPredictionsForDrawing->SetTitle(title.c_str());
00349   leg->Draw();
00350   gROOT->ProcessLine("SortOutStats(gPad,0.25,0.6,1,0.98,0.81);STS(0.04);");
00351   if(fDoPrint) {
00352     string printName = "FD_Prediction_" + string(Background::AsString(bg)) + "_" +
00353       string(fSelection) + "_" + string(Systematic::AsString(sys)) + ".gif";
00354     fCanvasForPredictions->Print(printName.c_str());
00355   }
00356 }

void Comparator::DrawPrediction ( Int_t  whichSys  ) 

Definition at line 200 of file Comparator.cxx.

References Systematic::AsString(), DeletePredictionsForDrawing(), fCanvasForPredictions, fColourArray, fDataHists, fDoPrint, fFileMap, fOscSysString, fPredictionMap, fPredictionsForDrawing, fSelection, Detector::kFar, Detector::kNear, and Systematic::kOscProb.

Referenced by DrawAll().

00201 {
00202   //delete previously made/drawn histograms
00203   this->DeletePredictionsForDrawing();
00204 
00205   //get/make TLegend
00206   fCanvasForPredictions->cd();
00207   TLegend *leg = 0;
00208   if((leg = (TLegend*) fCanvasForPredictions->FindObject("CFPLeg"))) leg->Clear();
00209   else {
00210     leg = new TLegend(0.2,0.2,0.4,0.4);
00211     leg->SetName("CFPLeg");
00212     leg->SetBorderSize(1);
00213   }
00214 
00215   Systematic::Systematic_t sys = Systematic::ESystematic(whichSys);
00216   if(fFileMap.find(sys)==fFileMap.end()) return;
00217   std::map<string,TH1D*> summedMap;
00218   TH1D *dataHist = NULL;
00219 
00220   std::map<Background::Background_t,NueBackground*>::iterator dataBeg = 
00221     fDataHists[Detector::kNear].begin();
00222   std::map<Background::Background_t,NueBackground*>::iterator dataEnd = 
00223     fDataHists[Detector::kNear].end();
00224   while(dataBeg!=dataEnd){
00225     Background::Background_t bg = dataBeg->first;
00226     std::map<NueSystematic*,TH1D*>::iterator predBeg = fPredictionMap[bg][sys].begin();
00227     std::map<NueSystematic*,TH1D*>::iterator predEnd = fPredictionMap[bg][sys].end();
00228     Int_t colCounter = 0;
00229     char label[256];
00230     while(predBeg!=predEnd){
00231       string sysNom = predBeg->first->GetName();
00232       Double_t sysVal = predBeg->first->GetSysValue(sys);
00233       if(sys==Systematic::kOscProb) {
00234         TString ts(sysNom);
00235         if(!ts.Contains(fOscSysString)) { predBeg++; continue;}
00236         Double_t tmpDub, theta23, delta23;
00237         Int_t tmpInt;
00238         predBeg->first->GetOscParams(tmpDub,theta23,tmpDub,tmpDub,delta23,tmpDub,tmpInt);       
00239         if(ts.Contains("Theta23")) sysVal = theta23;
00240         else if(ts.Contains("Delta23")) sysVal = delta23;
00241       }
00242       if(summedMap.find(sysNom)!=summedMap.end()) {
00243         summedMap[sysNom]->Add(predBeg->second);
00244       }
00245       else {
00246         string name = "FD_Total_Prediction_" + string(fSelection) + "_" + 
00247           string(Systematic::AsString(sys));
00248         summedMap[sysNom] = (TH1D*) predBeg->second->Clone(name.c_str());
00249         summedMap[sysNom]->SetLineColor(fColourArray[colCounter]);
00250         summedMap[sysNom]->SetMarkerColor(fColourArray[colCounter]);
00251         if(sys!=Systematic::kOscProb) sprintf(label,"%s = %.2f",
00252                                               Systematic::AsString(sys),sysVal);
00253         else sprintf(label,"%s = %.4f",fOscSysString.c_str(),sysVal);
00254         leg->AddEntry(summedMap[sysNom],label,"l");
00255         colCounter++;
00256       }
00257       predBeg++;
00258     }
00259     if(dataHist==0) {
00260       dataHist = (TH1D*) fDataHists[Detector::kFar][dataBeg->first]->
00261         GetHist()->Clone("DataHist");
00262       leg->AddEntry(dataHist,"Pseudo-Data","lp");
00263     }
00264     else dataHist->Add(fDataHists[Detector::kFar][dataBeg->first]->GetHist());
00265     dataBeg++;
00266   }
00267 
00268   std::map<string,TH1D*>::iterator sumBeg = summedMap.begin();
00269   std::map<string,TH1D*>::iterator sumEnd = summedMap.end();
00270   while(sumBeg!=sumEnd){
00271     sumBeg->second->SetAxisRange(0,10);
00272     fPredictionsForDrawing->Add(sumBeg->second,"hist");
00273     sumBeg++;
00274   }
00275   fPredictionsForDrawing->Add(dataHist);
00276 
00277   //draw:
00278   fPredictionsForDrawing->Draw("nostack");
00279   fPredictionsForDrawing->GetXaxis()->SetRangeUser(0,10);
00280   string title = "FD Total Prediction with " + 
00281     string(fSelection) + " and Tweaks in " + string(Systematic::AsString(sys));
00282   fPredictionsForDrawing->SetTitle(title.c_str());
00283   leg->Draw();
00284   gROOT->ProcessLine("SortOutStats(gPad,0.25,0.6,1,0.98,0.81);STS(0.04);");
00285   if(fDoPrint) {
00286     string printName = "FD_Total_Prediction_" + 
00287       string(fSelection) + "_" + string(Systematic::AsString(sys)) + ".gif";
00288     fCanvasForPredictions->Print(printName.c_str());
00289   }
00290 }

void Comparator::DrawRatio ( Int_t  whichSys,
Int_t  whichBG 
)

Definition at line 451 of file Comparator.cxx.

References Background::AsString(), Systematic::AsString(), DeleteRatiosForDrawing(), fCanvasForRatios, fColourArray, fDataHists, fDoPrint, fFDDataPOT, fFileMap, fNDDataPOT, fOscSysString, fPredictionMap, fRatiosForDrawing, fSelection, NueSystematic::GetName(), NueSystematic::GetOscParams(), NueSystematic::GetSysValue(), InBGVector(), Detector::kNear, and Systematic::kOscProb.

00452 {
00453   //delete previously made/drawn histograms  
00454   this->DeleteRatiosForDrawing();
00455   
00456   //get/make TLegend
00457   fCanvasForRatios->cd();  
00458   TLegend *leg = 0;
00459   if((leg = (TLegend*) fCanvasForRatios->FindObject("CFRLeg"))) leg->Clear();
00460   else {
00461     leg = new TLegend(0.2,0.2,0.4,0.4);
00462     leg->SetName("CFRLeg");
00463     leg->SetBorderSize(1);
00464   }
00465  
00466   Systematic::Systematic_t sys = Systematic::ESystematic(whichSys);
00467   Background::Background_t bg = Background::EBackground(whichBG);
00468   if(!this->InBGVector(bg)) return;
00469   if(fFileMap.find(sys)==fFileMap.end()) return;
00470   std::map<NueSystematic*,TH1D*>::iterator predBeg = fPredictionMap[bg][sys].begin();
00471   std::map<NueSystematic*,TH1D*>::iterator predEnd = fPredictionMap[bg][sys].end();
00472   Int_t colCounter = 0;
00473   char label[256];
00474   while(predBeg!=predEnd) {
00475     NueSystematic *tmpSys = predBeg->first;
00476     if(sys==Systematic::kOscProb) {
00477       TString ts(tmpSys->GetName());
00478       if(!ts.Contains(fOscSysString)) { predBeg++; continue;}
00479       Double_t tmpDub, theta23, delta23;
00480       Int_t tmpInt;
00481       tmpSys->GetOscParams(tmpDub,theta23,tmpDub,tmpDub,delta23,tmpDub,tmpInt);
00482       if(ts.Contains("Theta23")) sprintf(label,"%s = %.4f",fOscSysString.c_str(),theta23);
00483       else if(ts.Contains("Delta23")) sprintf(label,"%s = %.4f",fOscSysString.c_str(),delta23);
00484     }
00485     else sprintf(label,"%s = %.2f",Systematic::AsString(sys),tmpSys->GetSysValue(sys));
00486     TH1D *tmpPred = (TH1D*) predBeg->second->Clone(string(predBeg->second->GetName() + 
00487                                                           string("_Copy")).c_str());
00488     tmpPred->Divide(fDataHists[Detector::kNear][bg]->GetHist());
00489     tmpPred->Scale(fNDDataPOT/fFDDataPOT);
00490     tmpPred->SetLineColor(fColourArray[colCounter]);
00491     tmpPred->SetMarkerColor(fColourArray[colCounter]);
00492     tmpPred->SetAxisRange(0,10);
00493     fRatiosForDrawing->Add(tmpPred,"hist");
00494     leg->AddEntry(tmpPred,label,"lp");
00495     colCounter++;
00496     predBeg++;
00497   }
00498 
00499   //draw:
00500   fRatiosForDrawing->Draw("nostack");
00501   fRatiosForDrawing->GetXaxis()->SetRangeUser(0,10);
00502   string title = "F/N Ratio for " + string(Background::AsString(bg)) + " with " + 
00503     string(fSelection) + " and Tweaks in " + string(Systematic::AsString(sys));
00504   fRatiosForDrawing->SetTitle(title.c_str());
00505   leg->Draw();
00506   gROOT->ProcessLine("SortOutStats(gPad,0.25,0.6,1,0.98,0.81);STS(0.04);");
00507   if(fDoPrint) {
00508     string printName = "FN_Ratio_" + string(Background::AsString(bg)) + "_" + 
00509       string(fSelection) + "_" + string(Systematic::AsString(sys)) + ".gif";
00510     fCanvasForRatios->Print(printName.c_str());
00511   }
00512 }

void Comparator::DrawRatio ( Int_t  whichSys  ) 

Definition at line 358 of file Comparator.cxx.

References Systematic::AsString(), DeleteRatiosForDrawing(), fCanvasForRatios, fColourArray, fDataHists, fDoPrint, fFDDataPOT, fFileMap, fNDDataPOT, fOscSysString, fPredictionMap, fRatiosForDrawing, fSelection, Detector::kNear, and Systematic::kOscProb.

Referenced by DrawAll().

00359 {
00360   //delete previously made/drawn histograms
00361   this->DeleteRatiosForDrawing();
00362   
00363   //get/make TLegend
00364   fCanvasForRatios->cd();  
00365   TLegend *leg = 0;
00366   if((leg = (TLegend*) fCanvasForRatios->FindObject("CFRLeg"))) leg->Clear();
00367   else {
00368     leg = new TLegend(0.2,0.2,0.4,0.4);
00369     leg->SetName("CFRLeg");
00370     leg->SetBorderSize(1);
00371   }
00372 
00373   Systematic::Systematic_t sys = Systematic::ESystematic(whichSys);
00374   if(fFileMap.find(sys)==fFileMap.end()) return;
00375   std::map<string,TH1D*> summedMap;
00376   TH1D *dataHist = NULL;
00377 
00378   std::map<Background::Background_t,NueBackground*>::iterator dataBeg = 
00379     fDataHists[Detector::kNear].begin();
00380   std::map<Background::Background_t,NueBackground*>::iterator dataEnd = 
00381     fDataHists[Detector::kNear].end();
00382   while(dataBeg!=dataEnd){
00383     Background::Background_t bg = dataBeg->first;
00384     std::map<NueSystematic*,TH1D*>::iterator predBeg = fPredictionMap[bg][sys].begin();
00385     std::map<NueSystematic*,TH1D*>::iterator predEnd = fPredictionMap[bg][sys].end();
00386     Int_t colCounter = 0;
00387     char label[256];
00388     while(predBeg!=predEnd){
00389       Double_t sysVal = predBeg->first->GetSysValue(sys);
00390       string sysNom = predBeg->first->GetName();
00391       if(sys==Systematic::kOscProb) {
00392         TString ts(sysNom);
00393         if(!ts.Contains(fOscSysString)) { predBeg++; continue;}
00394         Double_t tmpDub, theta23, delta23;
00395         Int_t tmpInt;
00396         predBeg->first->GetOscParams(tmpDub,theta23,tmpDub,tmpDub,delta23,tmpDub,tmpInt);
00397         if(ts.Contains("Theta23")) sysVal = theta23;
00398         else if(ts.Contains("Delta23")) sysVal = delta23;
00399       }
00400       if(summedMap.find(sysNom)!=summedMap.end()) 
00401         summedMap[sysNom]->Add(predBeg->second);
00402       else {
00403         string name = "FN_Total_Ratio_" + string(fSelection) + "_" + 
00404           string(Systematic::AsString(sys));
00405         summedMap[sysNom] = (TH1D*) predBeg->second->Clone(name.c_str());
00406         summedMap[sysNom]->SetLineColor(fColourArray[colCounter]);
00407         summedMap[sysNom]->SetMarkerColor(fColourArray[colCounter]);
00408         if(sys!=Systematic::kOscProb) sprintf(label,"%s = %.2f",
00409                                               Systematic::AsString(sys),sysVal);
00410         else sprintf(label,"%s = %.4f",fOscSysString.c_str(),sysVal);
00411         leg->AddEntry(summedMap[sysNom],label,"lp");
00412         colCounter++;
00413       }
00414       predBeg++;
00415     }
00416     if(dataHist==0) {
00417       dataHist = (TH1D*) fDataHists[Detector::kNear][dataBeg->first]
00418         ->GetHist()->Clone("tmpHist");
00419       //leg->AddEntry(dataHist,"Pseudo-Data","lp");
00420     }
00421     else dataHist->Add(fDataHists[Detector::kNear][dataBeg->first]->GetHist());
00422     dataBeg++;
00423   }
00424 
00425   std::map<string,TH1D*>::iterator sumBeg = summedMap.begin();
00426   std::map<string,TH1D*>::iterator sumEnd = summedMap.end();
00427   while(sumBeg!=sumEnd){
00428     sumBeg->second->Divide(dataHist);
00429     sumBeg->second->Scale(fNDDataPOT/fFDDataPOT);
00430     sumBeg->second->SetAxisRange(0,10);
00431     fRatiosForDrawing->Add(sumBeg->second,"hist");
00432     sumBeg++;
00433   }
00434   delete dataHist;
00435 
00436   //draw:
00437   fRatiosForDrawing->Draw("nostack");
00438   fRatiosForDrawing->GetXaxis()->SetRangeUser(0,10);
00439   string title = "F/N Total Ratio with " + string(fSelection) + 
00440     " and Tweaks in " + string(Systematic::AsString(sys));
00441   fRatiosForDrawing->SetTitle(title.c_str());
00442   leg->Draw();
00443   gROOT->ProcessLine("SortOutStats(gPad,0.25,0.6,1,0.98,0.81);STS(0.04);");
00444   if(fDoPrint) {
00445     string printName = "FN_Total_Ratio_" + string(fSelection) + "_" + 
00446       string(Systematic::AsString(sys)) + ".gif";
00447     fCanvasForRatios->Print(printName.c_str());
00448   }
00449 }

void Comparator::DrawSummary (  ) 

Definition at line 713 of file Comparator.cxx.

References Background::AsString(), Systematic::AsString(), DeleteSummaryForDrawing(), fCanvasForSummary, fDataHists, fDoPrint, fSelection, fSummaryForDrawing, GetSummary(), it, and Detector::kNear.

Referenced by NueGui::ProcessMessage().

00714 {
00715   this->DeleteSummaryForDrawing();
00716   fCanvasForSummary->cd();  
00717   TLegend *leg = (TLegend*) fCanvasForSummary->FindObject("CFSLeg");
00718   if(leg) leg->Clear();
00719   else {
00720     leg = new TLegend(0.2,0.2,0.4,0.4);
00721     leg->SetName("CFSLeg");
00722     leg->SetBorderSize(1);
00723   }
00724   fCanvasForSummary->Clear();
00725     
00726   TGraph *tot_min_sum = this->GetSummary();
00727   leg->AddEntry(tot_min_sum,"Total","p");
00728   TIter it(fSummaryForDrawing->GetListOfGraphs()->MakeIterator());
00729   TGraph *tot_max_sum = 0;
00730   while((tot_max_sum = (TGraph*) it())) {
00731     if(tot_min_sum != tot_max_sum) break;
00732   }
00733   
00734   Double_t min_sys = 0;
00735   Double_t max_sys = 0;
00736   for(int i=0;i<tot_min_sum->GetN();i++) {
00737     min_sys += TMath::Power(1-tot_min_sum->GetY()[i],2);
00738     max_sys += TMath::Power(tot_max_sum->GetY()[i]-1,2);
00739   }
00740   min_sys = 100*TMath::Sqrt(min_sys);
00741   max_sys = 100*TMath::Sqrt(max_sys);
00742   
00743   std::map<Background::Background_t,NueBackground*>::iterator dataBeg = 
00744     fDataHists[Detector::kNear].begin();
00745   std::map<Background::Background_t,NueBackground*>::iterator dataEnd = 
00746     fDataHists[Detector::kNear].end();
00747   while(dataBeg!=dataEnd){
00748     leg->AddEntry(this->GetSummary(Int_t(dataBeg->first)),
00749                   Background::AsString(dataBeg->first),"p");
00750     dataBeg++;
00751   }
00752 
00753   fCanvasForSummary->Clear();  
00754   fSummaryForDrawing->Draw("A");
00755   for(int i=0;i<tot_min_sum->GetN();i++){
00756     Systematic::Systematic_t sys = Systematic::ESystematic((int)tot_min_sum->GetX()[i]);
00757     fSummaryForDrawing->GetXaxis()->SetBinLabel(fSummaryForDrawing->GetXaxis()->
00758                                                 FindBin(tot_min_sum->GetX()[i]),
00759                                                 Systematic::AsString(sys));
00760   }
00761   leg->Draw();
00762 
00763   char tex_string[100]; sprintf(tex_string,"Total Systematic = +%.1f%% -%.1f%%",max_sys,min_sys);
00764   TLatex *tex = new TLatex(0.015,0.9,tex_string);
00765   tex->SetNDC();
00766   tex->SetTextSize(0.045);
00767   tex->Draw();
00768 
00769   gROOT->ProcessLine("SortOutStats(gPad,0.2,0.2,1,0.98,0.98);STS(0.04);");
00770   if(fDoPrint) {
00771     string printName = "SystematicSummary_" + string(fSelection) + ".gif";
00772     fCanvasForSummary->Print(printName.c_str());
00773   }
00774 }

Bool_t Comparator::ExtractDataHists ( TFile *  file  ) 

Definition at line 101 of file Comparator.cxx.

References Background::AsString(), fBgVec, fDataHists, fFDDataPOT, fHistType, fNDDataPOT, fSelection, Detector::kFar, Detector::kNear, Background::kNueCC, Background::kNuMuCC, Background::kNuTauCC, and Selection::StringToEnum().

Referenced by AddSysFile().

00102 {
00103   std::cout << "Extracting Data Hists" << std::endl;
00104   if(!file) return false;
00105  
00106   TTree *tree = (TTree*) file->Get("energytree");
00107   if(!tree) return false;
00108   
00109   tree->SetBranchAddress("nearPOT",&fNDDataPOT);
00110   tree->SetBranchAddress("farPOT",&fFDDataPOT);
00111   tree->SetBranchAddress("Selection",fSelection);
00112   tree->GetEvent(0);
00113   tree->ResetBranchAddresses();
00114 
00115   std::vector<Background::Background_t>::iterator bgBeg = fBgVec.begin();
00116   std::vector<Background::Background_t>::iterator bgEnd = fBgVec.end();
00117   while(bgBeg!=bgEnd){
00118     string histname = string(Background::AsString(*bgBeg)) + "_Standard/ND_" + fHistType;
00119     if((*bgBeg)==Background::kNuTauCC || (*bgBeg)==Background::kNueCC) {
00120       histname = string(Background::AsString(Background::kNuMuCC)) + 
00121         "_Standard/ND_" + fHistType;
00122     }
00123     TH1D *hist = (TH1D*) file->Get(histname.c_str());
00124     if(!hist) return false;
00125     string nuename = "ND_" + fHistType + "_" + string(fSelection) + "_" + 
00126       string(Background::AsString(*bgBeg)) + "_DATA";
00127     NueBackground *nbg = new NueBackground(nuename,hist,Detector::kNear,
00128                                            (*bgBeg),Selection::StringToEnum(fSelection),
00129                                            fNDDataPOT);
00130     fDataHists[Detector::kNear][*bgBeg] = nbg;
00131 
00132     histname = string(Background::AsString(*bgBeg)) + "_Standard/FD_" + fHistType;
00133     hist = (TH1D*) file->Get(histname.c_str());
00134     if(!hist) return false;
00135     nuename = "FD_" + fHistType + "_" + string(fSelection) + "_" + 
00136       string(Background::AsString(*bgBeg)) + "_DATA";
00137     NueBackground *fbg = new NueBackground(nuename,hist,Detector::kFar,
00138                                            (*bgBeg),Selection::StringToEnum(fSelection),
00139                                            fFDDataPOT);
00140     fDataHists[Detector::kFar][*bgBeg] = fbg;
00141     bgBeg++;
00142   }
00143   return true;
00144 }

Double_t Comparator::GetFDSpectrumIntegral ( Background::Background_t  bg,
Systematic::Systematic_t  sys,
Double_t  inputVal 
) [protected]

Definition at line 677 of file Comparator.cxx.

References Background::AsString(), Systematic::AsString(), MuELoss::e, fFDDataPOT, fFileMap, fHistType, fOscSysString, and Systematic::kOscProb.

Referenced by DrawIntegral().

00679 {
00680   TFile *f = new TFile(fFileMap[sys].c_str(),"READ");
00681   TTree *tree = (TTree*) f->Get("energytree");  
00682   Double_t sysVal = 0;
00683   tree->SetBranchAddress(Systematic::AsString(sys),&sysVal);
00684   char sysname[256];
00685   tree->SetBranchAddress("SysName",sysname);
00686   Double_t farPOT = 0;
00687   tree->SetBranchAddress("farPOT",&farPOT);
00688   Double_t theta23,delta23;
00689   tree->SetBranchAddress("Theta23",&theta23); 
00690   tree->SetBranchAddress("DeltaMSq23",&delta23);
00691   for(int i=0;i<tree->GetEntries();i++){
00692     tree->GetEntry(i);
00693     if(sys==Systematic::kOscProb) {
00694       TString ts(sysname);
00695       if(!ts.Contains(fOscSysString)) continue;
00696       if(ts.Contains("Theta23")) {
00697         if(TMath::Abs(theta23-inputVal)<1e-6) break;
00698       }
00699       else if(ts.Contains("Delta23")) {
00700         if(TMath::Abs(delta23-inputVal)<1e-6) break;
00701       }
00702     }
00703    else if(TMath::Abs(sysVal-inputVal)<1e-6) break;
00704   }
00705   string hname = string(Background::AsString(bg)) + "_" + string(sysname) + "/FD_" + fHistType;
00706   TH1D *hist = (TH1D*) f->Get(hname.c_str());
00707   Double_t integ = hist->Integral()*(fFDDataPOT/farPOT);
00708   f->Close();
00709   delete f;
00710   return integ;
00711 }

std::map< NueSystematic *, TH1D * > Comparator::GetPredictions ( Systematic::Systematic_t  sysType,
Background::Background_t  bgType 
) [protected]

Definition at line 164 of file Comparator.cxx.

References bfld::AsString(), extra(), fDataHists, fFDDataPOT, fFileMap, NueFNExtrapolation::GetCurrentSystematic(), NueFNExtrapolation::GetMaxTreeEntry(), NueSystematic::GetName(), NueExtrapolation::GetSpectrum(), Detector::kFar, Detector::kNear, and NueFNExtrapolation::UseTreeEntry().

Referenced by ComputeAll().

00166 {
00167   cout << "Getting Predictions for " << Systematic::AsString(sysType) << " and "
00168        << Background::AsString(bgType) << endl;
00169   std::map<NueSystematic*,TH1D*> histVec;
00170   NueFNExtrapolation *extra = new NueFNExtrapolation(fFileMap[sysType]);
00171   Int_t max_sys = extra->GetMaxTreeEntry();
00172   for(int i=0;i<max_sys;i++){
00173     extra->UseTreeEntry(i);
00174     NueSystematic *nueSys = extra->GetCurrentSystematic();
00175     TH1D *histo = (TH1D*) extra->GetSpectrum(Detector::kFar,fFDDataPOT,
00176                                              fDataHists[Detector::kNear][bgType] );
00177     string nomus = string(histo->GetName()) + "_" + string(nueSys->GetName());
00178     histo->SetName(nomus.c_str());
00179     histo->SetDirectory(0);
00180     histVec[nueSys] = histo;
00181   }
00182   delete extra;
00183   return histVec;
00184 }

TGraph * Comparator::GetSummary ( Int_t  bg = -1  ) 

Definition at line 776 of file Comparator.cxx.

References bfld::AsString(), DrawIntegral(), fColourArray, fFileMap, fIntegralsForDrawing, fOscSysString, fSummaryForDrawing, it, Systematic::kOscProb, n, one(), and zero().

Referenced by DrawSummary().

00777 {
00778 
00779   Int_t n = 0;
00780   Double_t one[100] = {0};
00781   Double_t zero[100] = {0};
00782   Double_t sysNum[100] = {0};
00783   Double_t sysMin[100] = {0};
00784   Double_t sysMax[100] = {0};
00785 
00786   //hold current value of OscSysString. Will do Theta23 first then Delta23.
00787   string oscSt = fOscSysString;
00788   fOscSysString = "Theta23";
00789 
00790   std::map<Systematic::Systematic_t,std::string>::iterator fileBeg = 
00791     fFileMap.begin();
00792   std::map<Systematic::Systematic_t,std::string>::iterator fileEnd = 
00793     fFileMap.end();
00794   while(fileBeg!=fileEnd){
00795     if(whichBG<0) this->DrawIntegral(Int_t(fileBeg->first));
00796     else this->DrawIntegral(Int_t(fileBeg->first),whichBG);
00797     TGraph *gr = 0;
00798     if(fIntegralsForDrawing->GetListOfGraphs()){
00799       TIter it(fIntegralsForDrawing->GetListOfGraphs()->MakeIterator());
00800       while((gr = (TGraph*) it())) {
00801         if(gr->GetMarkerColor()==4) break;
00802       }
00803     }
00804     if(gr) {      
00805       sysNum[n] = Int_t(fileBeg->first);
00806       Double_t x=0,y=0;
00807       for(int i=0;i<gr->GetN();i++){
00808         gr->GetPoint(i,x,y);
00809         if(i==0 || y>sysMax[n]) sysMax[n] = y;
00810         if(i==0 || y<sysMin[n]) sysMin[n] = y;
00811       }
00812     }
00813     one[n] = 1;
00814     zero[n] = 0;
00815     n++;
00816 
00817     //if we are doing OscProb, and fOscSysString is Theta23, 
00818     //then do Delta23, otherwise move onto the next systematic
00819     if(fileBeg->first==Systematic::kOscProb && 
00820        fOscSysString!="Delta23") fOscSysString = "Delta23";
00821     else fileBeg++;
00822   }
00823 
00824   //revert back to original value of fOscSysString
00825   fOscSysString = oscSt;
00826 
00827   TGraph *minGr = new TGraph(n,sysNum,sysMin);
00828   TGraph *maxGr = new TGraph(n,sysNum,sysMax);
00829   if(whichBG<0) cout << "Summary info for Total background" << endl;
00830   else {
00831     Background::Background_t bg = Background::EBackground(whichBG);
00832     cout << "Summary info for " << Background::AsString(bg) << endl;;
00833   }
00834   for(int i=0;i<n;i++){
00835     Systematic::Systematic_t sys = Systematic::ESystematic((int)sysNum[i]);
00836     cout << Systematic::AsString(sys) << " " 
00837          << sysMin[i] << " " << sysMax[i] << endl;
00838   }
00839   if(whichBG>0){
00840     minGr->SetMarkerColor(fColourArray[whichBG+1]);
00841     maxGr->SetMarkerColor(fColourArray[whichBG+1]);
00842     minGr->SetMarkerStyle(24); //open circles
00843     maxGr->SetMarkerStyle(24);
00844     minGr->SetMarkerSize(1); //open circles
00845     maxGr->SetMarkerSize(1);
00846   }
00847   fSummaryForDrawing->Add(minGr,"P");
00848   fSummaryForDrawing->Add(maxGr,"P");
00849   return minGr;
00850 }

Bool_t Comparator::InBGVector ( Background::Background_t  bg  )  [protected]

Definition at line 889 of file Comparator.cxx.

References fBgVec.

Referenced by DrawIntegral(), DrawPrediction(), and DrawRatio().

00890 {
00891   std::vector<Background::Background_t>::iterator beg = fBgVec.begin();
00892   std::vector<Background::Background_t>::iterator end = fBgVec.end();
00893   while(beg!=end) {
00894     if((*beg)==bg) return true;
00895     beg++;
00896   }
00897   return false;
00898 }

void Comparator::SetOscSysString ( string  oss  )  [inline]

Definition at line 55 of file Comparator.h.

References fOscSysString.

Referenced by NueGui::ProcessMessage(), and NueGui::StartComparator().

00055 {fOscSysString = oss;}


Member Data Documentation

std::vector<Background::Background_t> Comparator::fBgVec [protected]

Definition at line 72 of file Comparator.h.

Referenced by AddBackground(), ExtractDataHists(), and InBGVector().

TCanvas* Comparator::fCanvasForIntegrals [protected]

Definition at line 91 of file Comparator.h.

Referenced by DrawIntegral(), and ~Comparator().

TCanvas* Comparator::fCanvasForPredictions [protected]

Definition at line 89 of file Comparator.h.

Referenced by DrawPrediction(), and ~Comparator().

TCanvas* Comparator::fCanvasForRatios [protected]

Definition at line 90 of file Comparator.h.

Referenced by DrawRatio(), and ~Comparator().

TCanvas* Comparator::fCanvasForSummary [protected]

Definition at line 92 of file Comparator.h.

Referenced by DrawSummary(), and ~Comparator().

Int_t Comparator::fColourArray[20] [protected]

Definition at line 64 of file Comparator.h.

Referenced by DrawPrediction(), DrawRatio(), and GetSummary().

Bool_t Comparator::fDoPrint [protected]

Definition at line 65 of file Comparator.h.

Referenced by DoPrint(), DrawIntegral(), DrawPrediction(), DrawRatio(), and DrawSummary().

Double_t Comparator::fFDDataPOT [protected]

Definition at line 61 of file Comparator.h.

Referenced by DrawRatio(), ExtractDataHists(), GetFDSpectrumIntegral(), and GetPredictions().

std::map<Systematic::Systematic_t,string> Comparator::fFileMap [protected]
std::string Comparator::fHistType [protected]

Definition at line 62 of file Comparator.h.

Referenced by ExtractDataHists(), and GetFDSpectrumIntegral().

TMultiGraph* Comparator::fIntegralsForDrawing [protected]

Definition at line 101 of file Comparator.h.

Referenced by DeleteIntegralsForDrawing(), DrawIntegral(), GetSummary(), and ~Comparator().

Double_t Comparator::fNDDataPOT [protected]

Definition at line 60 of file Comparator.h.

Referenced by DrawRatio(), and ExtractDataHists().

std::string Comparator::fOscSysString [protected]

Definition at line 80 of file Comparator.h.

Referenced by ComputeAll(), DrawIntegral(), DrawPrediction(), DrawRatio(), and ~Comparator().

THStack* Comparator::fPredictionsForDrawing [protected]

Definition at line 99 of file Comparator.h.

Referenced by DeletePredictionsForDrawing(), DrawPrediction(), and ~Comparator().

THStack* Comparator::fRatiosForDrawing [protected]

Definition at line 100 of file Comparator.h.

Referenced by DeleteRatiosForDrawing(), DrawRatio(), and ~Comparator().

char Comparator::fSelection[256] [protected]

Definition at line 63 of file Comparator.h.

Referenced by DrawIntegral(), DrawPrediction(), DrawRatio(), DrawSummary(), and ExtractDataHists().

TMultiGraph* Comparator::fSummaryForDrawing [protected]

Definition at line 102 of file Comparator.h.

Referenced by DeleteSummaryForDrawing(), DrawSummary(), GetSummary(), and ~Comparator().


The documentation for this class was generated from the following files:

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1