Extrapolate2D Class Reference

#include <Extrapolate2D.h>

Inheritance diagram for Extrapolate2D:
Extrapolate2D_Simple

List of all members.

Public Types

enum  OscType {
  qNC = 0, qNuMuToNuMu = 1, qBNueToNuMu = 2, qBNueToBNue = 3,
  qNuMuToNue = 4, qNuMuToNuTau = 5, qBNueToNuTau = 6, qNuMuNC = 7,
  qBNueNC = 8
}
typedef enum Extrapolate2D::OscType OscType_t

Public Member Functions

 Extrapolate2D ()
virtual ~Extrapolate2D ()
void GetPrediction ()
virtual void OscillatePrediction ()
void SetRecoBins (Int_t n, Double_t *e)
void SetPIDBins (Int_t n, Double_t *e)
void SetTrueBins (Int_t n, Double_t *e)
void SetNearPOT (double pot=1e19)
void SetFarPOT (double pot=7e20)
void SetOutputFile (string filename)
void SetPID (string pid="ANN11")
void SetNDDataPID (string pid="ANN11")
void SetFNforBeamNue ()
void SetRunPeriod (int run=1)
void SetReadExtrapFromFile (string s)
void SetPrintResult ()
void SetOscPar (OscPar::OscPar_t par, double val)
void SetSinSq2Th13 (double val)
void SetSinSq2Th14 (double val)
void SetSinSqTh14 (double val)
void SetSinSqTh24 (double val)
void SetDeltaCP (double val)
void InvertMassHierarchy ()
void SetNDDataFile (string s)
void SetFNFile (string s)
void SetMREFile (string s)
void SetXSecFile (string s)
int GetNPID ()
int GetNReco ()
int GetNTrue ()
double GetNearPOT ()
double GetFarPOT ()
string GetPID ()
string GetNDDataPID ()
bool GetFNforBeamNue ()
int GetRunPeriod ()
TH2D * GetPredHist (Background::Background_t bg)
bool GetOscFlag ()
void SetEps_ee (double val)
void SetEps_emu (double val)
void SetEps_etau (double val)
void SetEps_mumu (double val)
void SetEps_mutau (double val)
void SetEps_tautau (double val)
void SetDelta_emu (double val)
void SetDelta_etau (double val)
void SetDelta_mutau (double val)
void SetTheta14 (double val)
void SetTheta24 (double val)
void SetTheta34 (double val)
void SetDm41 (double val)
void SetDelta14 (double val)
void SetDelta24 (double val)
void SetOscMethod (int m=0)

Public Attributes

std::map< OscType_t, TH3D * > Pred_3D
std::map< OscType_t, TH3D * > Pred_Nu_3D
std::map< OscType_t, TH3D * > Pred_NuBar_3D
std::map
< Background::Background_t,
TH2D * > 
Pred
TH2D * Pred_NueCCSignal
TH2D * Pred_NueBarCCSignal
TH2D * Pred_TotalBkgd
TH1D * Pred_CC_Fid
TH1D * Pred_NuMuCC_Fid
TH1D * Pred_NuMuBarCC_Fid
TH1D * Pred_TotalBkgd_VsBinNumber
TH1D * Pred_Signal_VsBinNumber
std::map
< Background::Background_t,
TH2D * > 
FNRatio
std::map
< Background::Background_t,
TH2D * > 
NDData
TH2D * NDData_Total
TH1D * NDData_Reco_CClike
TH1D * NDData_Reco_CClike_Pos
TH1D * NDData_Reco_CClike_Neg
std::map
< Background::Background_t,
TH2D * > 
NDMC
std::map
< Background::Background_t,
TH2D * > 
FDMC

Protected Member Functions

virtual void ReadNDDataFile ()
virtual void ReadFNFile ()
void ReadMREFile ()
void ReadXSecFile ()
virtual void ReadFiles ()
void ReadExtrap ()
void InitializeOscCalc ()
virtual void SetupPredHists ()
void GetNoOscCCPrediction ()
virtual void FarNearPred (Background::Background_t bg)
virtual void AppearancePred (Background::Background_t bg)
virtual void BeamNuePred ()
void SetNominalOscProb ()
void Set1DPredHists ()
virtual void RebinInputHists ()
void WriteToFile ()
void OscillatePrediction_SepNuNuBar ()
void OscillatePrediction_NoSep ()

Protected Attributes

string PID
string PID_NDData
string outFileName
int nReco
int nTrue
int nPID
int nRecoCC
vector< double > RecoEdges
vector< double > PIDEdges
vector< double > TrueEdges
vector< double > RecoCCEdges
Bool_t RebinE
Bool_t RebinP
Double_t nPOTNear
Double_t nPOTFar
vector< Background::Background_tFDComponents
Bool_t FNforBeamNue
Int_t RunPeriod
MultiBinAnaHelper MBH
OscCalc osc
string NDData_infile
string FN_infile
string MRE_infile
string XSec_infile
bool ReadMREFromFile
map< OscType_t, TH3D * > FD_TrueVsRecoVsPID
map< OscType_t, TH3D * > FD_Nu_TrueVsRecoVsPID
map< OscType_t, TH3D * > FD_NuBar_TrueVsRecoVsPID
TH2D * FD_TrueVsReco_Fid
TH2D * FD_TrueVsReco_Fid_NuMuCC
TH2D * FD_TrueVsReco_Fid_NuMuBarCC
TH2D * FD_TrueVsReco_CClike
TH2D * FD_TrueVsReco_CClike_Pos
TH2D * FD_TrueVsReco_CClike_Neg
TH2D * FD_TrueVsReco_CClike_NuMuCC
TH2D * FD_TrueVsReco_CClike_Pos_NuMuBarCC
TH2D * FD_TrueVsReco_CClike_Neg_NuMuCC
TH2D * FD_TrueVsReco_Fid_NueCC
TH2D * FD_TrueVsReco_Fid_NuTauCC
TH1D * FD_True_Fid_NueCC
TH1D * FD_True_Fid_NuTauCC
TH2D * FD_TrueVsReco_Fid_NueBarCC
TH2D * FD_TrueVsReco_Fid_NuTauBarCC
TH1D * FD_True_Fid_NueBarCC
TH1D * FD_True_Fid_NuTauBarCC
map< OscType_t, TH3D * > ND_TrueVsRecoVsPID
TH2D * ND_TrueVsReco_Fid
TH2D * ND_TrueVsReco_Fid_NuMuCC
TH2D * ND_TrueVsReco_Fid_NuMuBarCC
TH2D * ND_TrueVsReco_CClike
TH2D * ND_TrueVsReco_CClike_Pos
TH2D * ND_TrueVsReco_CClike_Neg
TH2D * ND_TrueVsReco_CClike_NuMuCC
TH2D * ND_TrueVsReco_CClike_Pos_NuMuBarCC
TH2D * ND_TrueVsReco_CClike_Neg_NuMuCC
std::map
< Background::Background_t,
TH2D * > 
ND_DataOverMC_RecoVsPID
TH1D * ND_Reco_CClike
TH1D * ND_Reco_CClike_Pos
TH1D * ND_Reco_CClike_Neg
TH1D * FD_Reco_CClike
TH1D * FD_Reco_CClike_Pos
TH1D * FD_Reco_CClike_Neg
TH2D * FD_Reco2True_CClike
TH2D * FD_Reco2True_CClike_Pos
TH2D * FD_Reco2True_CClike_Neg
TH1D * FD_Purity_CC
TH1D * FD_Eff_CC
TH1D * FD_Purity_NuMuCC_Neg
TH1D * FD_Eff_NuMuCC_Neg
TH1D * FD_Purity_NuMuBarCC_Pos
TH1D * FD_Eff_NuMuBarCC_Pos
std::map
< Background::Background_t,
TH2D * > 
FD_True2Reco_Fid
std::map
< Background::Background_t,
TH2D * > 
FD_Eff
std::map
< Background::Background_t,
TH2D * > 
FD_True2Reco_NuBar_Fid
std::map
< Background::Background_t,
TH2D * > 
FD_Eff_NuBar
TH2D * MREEffRatio
TH1F * fNuMuCCXSec [5]
TH1F * fNuTauCCXSec [5]
TH1F * fNueCCXSec [5]
TH1F * fNuMuBarCCXSec [5]
TH1F * fNuTauBarCCXSec [5]
TH1F * fNueBarCCXSec [5]
std::map
< Background::Background_t,
TH1D * > 
XSecWeight
std::map
< Background::Background_t,
TH1D * > 
XSecWeight_NuBar
Double_t Theta13
Double_t Theta12
Double_t Theta23
Double_t DeltaMSq23
Double_t DeltaMSq12
Double_t DeltaCP
Double_t Eps_ee
Double_t Eps_emu
Double_t Eps_etau
Double_t Eps_mumu
Double_t Eps_mutau
Double_t Eps_tautau
Double_t Delta_emu
Double_t Delta_etau
Double_t Delta_mutau
Double_t Theta14
Double_t Theta24
Double_t Theta34
Double_t Dm41
Double_t Delta14
Double_t Delta24
int OscMethod
std::map< OscType_t, TH1D * > NominalOscProb
std::map< OscType_t, TH1D * > NominalOscProb_NuBar
Bool_t ReadExtrapFromFile
string inFileName
bool PrintResult
bool WriteOutput
bool Init
bool ReadError
TFile * ExtrapFile
bool Oscillated
bool UseSeparateNuNuBar
TH3D * FD_TrueVsRecoVsPID_NC_NueFrac
TH3D * FD_TrueVsRecoVsPID_NC_NueBarFrac
TH3D * FD_TrueVsRecoVsPID_NC_NuMuFrac
TH3D * FD_TrueVsRecoVsPID_NC_NuMuBarFrac

Detailed Description

Definition at line 22 of file Extrapolate2D.h.


Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
qNC 
qNuMuToNuMu 
qBNueToNuMu 
qBNueToBNue 
qNuMuToNue 
qNuMuToNuTau 
qBNueToNuTau 
qNuMuNC 
qBNueNC 

Definition at line 27 of file Extrapolate2D.h.

00027                          {
00028       qNC = 0,
00029       qNuMuToNuMu = 1,
00030       qBNueToNuMu = 2,
00031       qBNueToBNue = 3,
00032       qNuMuToNue = 4,
00033       qNuMuToNuTau = 5,
00034       qBNueToNuTau = 6,
00035       qNuMuNC = 7,
00036       qBNueNC = 8
00037     } OscType_t;


Constructor & Destructor Documentation

Extrapolate2D::Extrapolate2D (  ) 

Definition at line 5 of file Extrapolate2D.cxx.

References Delta14, Delta24, Delta_emu, Delta_etau, Delta_mutau, DeltaCP, DeltaMSq12, DeltaMSq23, Dm41, Eps_ee, Eps_emu, Eps_etau, Eps_mumu, Eps_mutau, Eps_tautau, FDComponents, FNforBeamNue, Init, InitializeOscCalc(), Background::kBNueCC, Background::kNC, Background::kNueCC, Background::kNuMuCC, Background::kNuTauCC, MRE_infile, nPID, nReco, nRecoCC, nTrue, Oscillated, PIDEdges, PrintResult, ReadError, ReadExtrapFromFile, ReadMREFromFile, RebinE, RebinP, RecoCCEdges, RecoEdges, SetFarPOT(), SetNearPOT(), SetRunPeriod(), Theta12, Theta13, Theta14, Theta23, Theta24, Theta34, TrueEdges, UseSeparateNuNuBar, and WriteOutput.

00006 {
00007   int i;
00008   
00009   nReco = 100;
00010   nRecoCC = 100;
00011   for(i=0;i<nReco+1;i++)
00012   {
00013     RecoEdges.push_back(i*1.);
00014     RecoCCEdges.push_back(i*1.);
00015   }
00016   nTrue = 1200;
00017   for(i=0;i<nTrue+1;i++)
00018   {
00019     TrueEdges.push_back(i*0.1);
00020   }
00021   nPID = 20;
00022   for(i=0;i<nPID+1;i++)
00023   {
00024     PIDEdges.push_back(i*0.05);
00025   }
00026   
00027   SetNearPOT();
00028   SetFarPOT();
00029   FNforBeamNue = false;
00030   SetRunPeriod();
00031   InitializeOscCalc();
00032   
00033   FDComponents.clear();
00034   FDComponents.push_back(Background::kNC);
00035   FDComponents.push_back(Background::kNuMuCC);
00036   FDComponents.push_back(Background::kNuTauCC);
00037   FDComponents.push_back(Background::kNueCC);
00038   FDComponents.push_back(Background::kBNueCC);
00039 //   FDComponents.push_back(Background::kNuMuNC);
00040 //   FDComponents.push_back(Background::kBNueNC);
00041   
00042   Theta13=0;
00043   Theta12=0;
00044   Theta23=0;
00045   DeltaMSq23=0;
00046   DeltaMSq12=0;
00047   DeltaCP=0;
00048   //
00049   Eps_ee=0;
00050   Eps_emu=0;
00051   Eps_etau=0;
00052   Eps_mumu=0;
00053   Eps_mutau=0;
00054   Eps_tautau=0;
00055   Delta_emu=0;
00056   Delta_etau=0;
00057   Delta_mutau=0;
00058   //
00059   Theta14=0;
00060   Theta24=0;
00061   Theta34=0;
00062   Dm41=0;
00063   Delta14=0;
00064   Delta24=0;
00065 
00066   ReadExtrapFromFile = false;
00067   
00068   MRE_infile = "NULL";
00069   ReadMREFromFile = false;
00070   
00071   RebinE = false;
00072   RebinP = false;
00073   
00074   PrintResult = false;
00075   
00076   WriteOutput = false;
00077   
00078   Init = false;//ie haven't called GetPrediction() yet
00079   
00080   ReadError = false;
00081   
00082   Oscillated = false;//haven't called OscillatePrediction() yet
00083   
00084   UseSeparateNuNuBar=false;
00085   
00086   return;
00087 }

Extrapolate2D::~Extrapolate2D (  )  [virtual]

Definition at line 88 of file Extrapolate2D.cxx.

References ExtrapFile, and WriteOutput.

00089 {
00090   if(WriteOutput) ExtrapFile->Close();
00091 }


Member Function Documentation

void Extrapolate2D::AppearancePred ( Background::Background_t  bg  )  [protected, virtual]

Reimplemented in Extrapolate2D_Simple.

Definition at line 1768 of file Extrapolate2D.cxx.

References FD_Eff, FD_Eff_NuBar, FD_Nu_TrueVsRecoVsPID, FD_NuBar_TrueVsRecoVsPID, FD_True2Reco_Fid, FD_True2Reco_NuBar_Fid, FD_TrueVsRecoVsPID, it, Background::kNueCC, Background::kNuTauCC, NominalOscProb, NominalOscProb_NuBar, nPID, nReco, nTrue, Pred, Pred_3D, Pred_CC_Fid, Pred_Nu_3D, Pred_NuBar_3D, Pred_NueBarCCSignal, Pred_NueCCSignal, Pred_NuMuBarCC_Fid, Pred_NuMuCC_Fid, qBNueToNuTau, qNuMuToNue, qNuMuToNuTau, UseSeparateNuNuBar, XSecWeight, and XSecWeight_NuBar.

Referenced by GetPrediction().

01769 {
01770   if(bg!=Background::kNueCC && bg!=Background::kNuTauCC)
01771   {
01772     cout<<"Can only use AppearancePred() for taus and signal nues"<<endl;
01773     return;
01774   }
01775   
01776   int ip,ir,it;
01777   double temp,sum,sumnu,sumnubar;
01778   double nu,nubar;
01779   for(ip=0;ip<nPID;ip++)
01780   {
01781     for(ir=0;ir<nReco;ir++)
01782     {
01783       sum=0;
01784       sumnu=0;
01785       sumnubar=0;
01786       
01787       for(it=0;it<nTrue;it++)
01788       {
01789         if(UseSeparateNuNuBar)
01790         {
01791           nu = Pred_NuMuCC_Fid->GetBinContent(it+1)*XSecWeight[bg]->GetBinContent(it+1)*FD_True2Reco_Fid[bg]->GetBinContent(ir+1,it+1)*FD_Eff[bg]->GetBinContent(ip+1,ir+1);
01792           
01793           nubar = Pred_NuMuBarCC_Fid->GetBinContent(it+1)*XSecWeight_NuBar[bg]->GetBinContent(it+1)*FD_True2Reco_NuBar_Fid[bg]->GetBinContent(ir+1,it+1)*FD_Eff_NuBar[bg]->GetBinContent(ip+1,ir+1);
01794         }
01795         else
01796         {
01797           temp = Pred_CC_Fid->GetBinContent(it+1)*XSecWeight[bg]->GetBinContent(it+1)*FD_True2Reco_Fid[bg]->GetBinContent(ir+1,it+1)*FD_Eff[bg]->GetBinContent(ip+1,ir+1);
01798         }
01799         
01800         if(bg==Background::kNueCC)
01801         {
01802           if(UseSeparateNuNuBar)
01803           {
01804             nu*=NominalOscProb[qNuMuToNue]->GetBinContent(it+1);
01805             Pred_Nu_3D[qNuMuToNue]->SetBinContent(ip+1,ir+1,it+1,nu);
01806             
01807             nubar*=NominalOscProb_NuBar[qNuMuToNue]->GetBinContent(it+1);
01808             Pred_NuBar_3D[qNuMuToNue]->SetBinContent(ip+1,ir+1,it+1,nubar);
01809             
01810             Pred_3D[qNuMuToNue]->SetBinContent(ip+1,ir+1,it+1,nu+nubar);
01811           }
01812           else
01813           {
01814             temp*=NominalOscProb[qNuMuToNue]->GetBinContent(it+1);
01815             Pred_3D[qNuMuToNue]->SetBinContent(ip+1,ir+1,it+1,temp);
01816           }
01817         }
01818         if(bg==Background::kNuTauCC)
01819         {
01820           if(UseSeparateNuNuBar)
01821           {
01822             nu*=NominalOscProb[qNuMuToNuTau]->GetBinContent(it+1);
01823             Pred_Nu_3D[qNuMuToNuTau]->SetBinContent(ip+1,ir+1,it+1,nu);
01824 
01825             nubar*=NominalOscProb_NuBar[qNuMuToNuTau]->GetBinContent(it+1);
01826             Pred_NuBar_3D[qNuMuToNuTau]->SetBinContent(ip+1,ir+1,it+1,nubar);
01827             
01828             Pred_3D[qNuMuToNuTau]->SetBinContent(ip+1,ir+1,it+1,nu+nubar);
01829             
01830             nu += FD_Nu_TrueVsRecoVsPID[qBNueToNuTau]->GetBinContent(ip+1,ir+1,it+1);
01831             Pred_Nu_3D[qBNueToNuTau]->SetBinContent(ip+1,ir+1,it+1,FD_Nu_TrueVsRecoVsPID[qBNueToNuTau]->GetBinContent(ip+1,ir+1,it+1));
01832             
01833             nubar += FD_NuBar_TrueVsRecoVsPID[qBNueToNuTau]->GetBinContent(ip+1,ir+1,it+1);
01834             Pred_NuBar_3D[qBNueToNuTau]->SetBinContent(ip+1,ir+1,it+1,FD_NuBar_TrueVsRecoVsPID[qBNueToNuTau]->GetBinContent(ip+1,ir+1,it+1));
01835             
01836             Pred_3D[qBNueToNuTau]->SetBinContent(ip+1,ir+1,it+1,FD_Nu_TrueVsRecoVsPID[qBNueToNuTau]->GetBinContent(ip+1,ir+1,it+1)+FD_NuBar_TrueVsRecoVsPID[qBNueToNuTau]->GetBinContent(ip+1,ir+1,it+1));
01837           }
01838           else
01839           {
01840             temp*=NominalOscProb[qNuMuToNuTau]->GetBinContent(it+1);
01841             Pred_3D[qNuMuToNuTau]->SetBinContent(ip+1,ir+1,it+1,temp);
01842             
01843             temp += FD_TrueVsRecoVsPID[qBNueToNuTau]->GetBinContent(ip+1,ir+1,it+1);//adds in contributino fron nue->nutau
01844             Pred_3D[qBNueToNuTau]->SetBinContent(ip+1,ir+1,it+1,FD_TrueVsRecoVsPID[qBNueToNuTau]->GetBinContent(ip+1,ir+1,it+1));
01845           }
01846           
01847         }
01848         
01849         if(UseSeparateNuNuBar)
01850         {
01851           sum += (nu+nubar);
01852           sumnu += nu;
01853           sumnubar += nubar;
01854         }
01855         else 
01856         {
01857           sum+=temp;
01858         }
01859       }
01860       Pred[bg]->SetBinContent(ip+1,ir+1,sum);
01861       if(UseSeparateNuNuBar && bg==Background::kNueCC)
01862       {
01863         Pred_NueCCSignal->SetBinContent(ip+1,ir+1,sumnu);
01864         Pred_NueBarCCSignal->SetBinContent(ip+1,ir+1,sumnubar);
01865       }
01866     }
01867   }
01868   
01869   
01870   return;
01871 }

void Extrapolate2D::BeamNuePred (  )  [protected, virtual]

Reimplemented in Extrapolate2D_Simple.

Definition at line 1872 of file Extrapolate2D.cxx.

References FarNearPred(), FD_TrueVsRecoVsPID, FNforBeamNue, it, Background::kBNueCC, nPID, nReco, nTrue, Pred, Pred_3D, Pred_Nu_3D, Pred_NuBar_3D, qBNueToBNue, and UseSeparateNuNuBar.

Referenced by GetPrediction().

01873 {
01874   Background::Background_t bg = Background::kBNueCC;
01875   int ip,ir,it;
01876   double temp,sum;
01877   
01878   if(FNforBeamNue)
01879   {
01880     cout<<"using F/N method for beam nues (based on ND data)"<<endl;
01881     FarNearPred(bg);
01882   }
01883   else
01884   {
01885     cout<<"using far MC method for beam nues"<<endl;
01886     
01887     for(ip=0;ip<nPID;ip++)
01888     {
01889       for(ir=0;ir<nReco;ir++)
01890       {
01891         sum=0;
01892         for(it=0;it<nTrue;it++)
01893         {
01894           temp = FD_TrueVsRecoVsPID[qBNueToBNue]->GetBinContent(ip+1,ir+1,it+1);
01895           Pred_3D[qBNueToBNue]->SetBinContent(ip+1,ir+1,it+1,temp);
01896           sum+=temp;
01897           
01898           if(UseSeparateNuNuBar)
01899           {
01900             Pred_Nu_3D[qBNueToBNue]->SetBinContent(ip+1,ir+1,it+1,temp);
01901             Pred_NuBar_3D[qBNueToBNue]->SetBinContent(ip+1,ir+1,it+1,temp);
01902           }
01903         }
01904         Pred[bg]->SetBinContent(ip+1,ir+1,sum);
01905       }
01906     }
01907   }
01908   
01909   return;
01910 }

void Extrapolate2D::FarNearPred ( Background::Background_t  bg  )  [protected, virtual]

Reimplemented in Extrapolate2D_Simple.

Definition at line 1687 of file Extrapolate2D.cxx.

References FD_Nu_TrueVsRecoVsPID, FD_NuBar_TrueVsRecoVsPID, FD_TrueVsRecoVsPID, it, Background::kBNueCC, Background::kNC, Background::kNuMuCC, ND_DataOverMC_RecoVsPID, nPID, nReco, nTrue, Pred, Pred_3D, Pred_Nu_3D, Pred_NuBar_3D, qBNueToBNue, qBNueToNuMu, qNC, qNuMuToNuMu, and UseSeparateNuNuBar.

Referenced by BeamNuePred(), and GetPrediction().

01688 {
01689   if(bg!=Background::kNuMuCC && bg!=Background::kNC && bg!=Background::kBNueCC)
01690   {
01691     cout<<"Can only use FarNearPred() for cc numu, nc and beam nues"<<endl;
01692     return;
01693   }
01694   
01695   int ip,ir,it;
01696   double temp,sum;
01697   
01698   for(ip=0;ip<nPID;ip++)
01699   {
01700     for(ir=0;ir<nReco;ir++)
01701     {
01702       sum=0;
01703       for(it=0;it<nTrue;it++)
01704       {
01705         if(bg==Background::kNC)
01706         {
01707           temp = FD_TrueVsRecoVsPID[qNC]->GetBinContent(ip+1,ir+1,it+1)*ND_DataOverMC_RecoVsPID[bg]->GetBinContent(ip+1,ir+1);
01708           Pred_3D[qNC]->SetBinContent(ip+1,ir+1,it+1,temp);
01709           sum+=temp;
01710           
01711           if(UseSeparateNuNuBar)
01712           {
01713             temp = FD_Nu_TrueVsRecoVsPID[qNC]->GetBinContent(ip+1,ir+1,it+1)*ND_DataOverMC_RecoVsPID[bg]->GetBinContent(ip+1,ir+1);
01714             Pred_Nu_3D[qNC]->SetBinContent(ip+1,ir+1,it+1,temp);
01715             
01716             temp = FD_NuBar_TrueVsRecoVsPID[qNC]->GetBinContent(ip+1,ir+1,it+1)*ND_DataOverMC_RecoVsPID[bg]->GetBinContent(ip+1,ir+1);
01717             Pred_NuBar_3D[qNC]->SetBinContent(ip+1,ir+1,it+1,temp);
01718           }
01719         }
01720         if(bg==Background::kNuMuCC)
01721         {
01722           temp = FD_TrueVsRecoVsPID[qNuMuToNuMu]->GetBinContent(ip+1,ir+1,it+1)*ND_DataOverMC_RecoVsPID[bg]->GetBinContent(ip+1,ir+1);
01723           Pred_3D[qNuMuToNuMu]->SetBinContent(ip+1,ir+1,it+1,temp);
01724           sum+=temp;
01725           
01726           temp = FD_TrueVsRecoVsPID[qBNueToNuMu]->GetBinContent(ip+1,ir+1,it+1)*ND_DataOverMC_RecoVsPID[bg]->GetBinContent(ip+1,ir+1);
01727           Pred_3D[qBNueToNuMu]->SetBinContent(ip+1,ir+1,it+1,temp);
01728           sum+=temp;
01729           
01730           if(UseSeparateNuNuBar)
01731           {
01732             temp = FD_Nu_TrueVsRecoVsPID[qNuMuToNuMu]->GetBinContent(ip+1,ir+1,it+1)*ND_DataOverMC_RecoVsPID[bg]->GetBinContent(ip+1,ir+1);
01733             Pred_Nu_3D[qNuMuToNuMu]->SetBinContent(ip+1,ir+1,it+1,temp);
01734             
01735             temp = FD_Nu_TrueVsRecoVsPID[qBNueToNuMu]->GetBinContent(ip+1,ir+1,it+1)*ND_DataOverMC_RecoVsPID[bg]->GetBinContent(ip+1,ir+1);
01736             Pred_Nu_3D[qBNueToNuMu]->SetBinContent(ip+1,ir+1,it+1,temp);
01737             
01738             temp = FD_NuBar_TrueVsRecoVsPID[qNuMuToNuMu]->GetBinContent(ip+1,ir+1,it+1)*ND_DataOverMC_RecoVsPID[bg]->GetBinContent(ip+1,ir+1);
01739             Pred_NuBar_3D[qNuMuToNuMu]->SetBinContent(ip+1,ir+1,it+1,temp);
01740             
01741             temp = FD_NuBar_TrueVsRecoVsPID[qBNueToNuMu]->GetBinContent(ip+1,ir+1,it+1)*ND_DataOverMC_RecoVsPID[bg]->GetBinContent(ip+1,ir+1);
01742             Pred_NuBar_3D[qBNueToNuMu]->SetBinContent(ip+1,ir+1,it+1,temp);
01743           }
01744         }
01745         if(bg==Background::kBNueCC)
01746         {
01747           temp = FD_TrueVsRecoVsPID[qBNueToBNue]->GetBinContent(ip+1,ir+1,it+1)*ND_DataOverMC_RecoVsPID[bg]->GetBinContent(ip+1,ir+1);
01748           Pred_3D[qBNueToBNue]->SetBinContent(ip+1,ir+1,it+1,temp);
01749           sum+=temp;
01750           
01751           if(UseSeparateNuNuBar)
01752           {
01753             temp = FD_Nu_TrueVsRecoVsPID[qBNueToBNue]->GetBinContent(ip+1,ir+1,it+1)*ND_DataOverMC_RecoVsPID[bg]->GetBinContent(ip+1,ir+1);
01754             Pred_Nu_3D[qBNueToBNue]->SetBinContent(ip+1,ir+1,it+1,temp);
01755             
01756             temp = FD_NuBar_TrueVsRecoVsPID[qBNueToBNue]->GetBinContent(ip+1,ir+1,it+1)*ND_DataOverMC_RecoVsPID[bg]->GetBinContent(ip+1,ir+1);
01757             Pred_NuBar_3D[qBNueToBNue]->SetBinContent(ip+1,ir+1,it+1,temp);
01758           }
01759         }
01760         
01761       }
01762       Pred[bg]->SetBinContent(ip+1,ir+1,sum);
01763     }
01764   }
01765   
01766   return;
01767 }

double Extrapolate2D::GetFarPOT (  )  [inline]

Definition at line 72 of file Extrapolate2D.h.

References nPOTFar.

00072 { return nPOTFar; };

bool Extrapolate2D::GetFNforBeamNue (  )  [inline]

Definition at line 75 of file Extrapolate2D.h.

References FNforBeamNue.

00075 { return FNforBeamNue; };

string Extrapolate2D::GetNDDataPID (  )  [inline]

Definition at line 74 of file Extrapolate2D.h.

References PID_NDData.

00074 { return PID_NDData; };

double Extrapolate2D::GetNearPOT (  )  [inline]

Definition at line 71 of file Extrapolate2D.h.

References nPOTNear.

00071 { return nPOTNear; };

void Extrapolate2D::GetNoOscCCPrediction (  )  [protected]

Definition at line 2467 of file Extrapolate2D.cxx.

References FD_Eff_CC, FD_Eff_NuMuBarCC_Pos, FD_Eff_NuMuCC_Neg, FD_Purity_CC, FD_Purity_NuMuBarCC_Pos, FD_Purity_NuMuCC_Neg, FD_Reco2True_CClike, FD_Reco2True_CClike_Neg, FD_Reco2True_CClike_Pos, FD_Reco_CClike, FD_Reco_CClike_Neg, FD_Reco_CClike_Pos, it, ND_Reco_CClike, ND_Reco_CClike_Neg, ND_Reco_CClike_Pos, NDData_Reco_CClike, NDData_Reco_CClike_Neg, NDData_Reco_CClike_Pos, nRecoCC, nTrue, Pred_CC_Fid, Pred_NuMuBarCC_Fid, Pred_NuMuCC_Fid, and UseSeparateNuNuBar.

Referenced by GetPrediction().

02468 {
02469   //get FD CC prediction for use in tau/nue prediction
02470   int ir,it;
02471   double sum;
02472   double pos,neg;
02473   
02474   if(UseSeparateNuNuBar)
02475   {
02476     for(it=0;it<nTrue;it++)
02477     {
02478       pos=0.0;
02479       neg=0.0;
02480       for(ir=0;ir<nRecoCC;ir++)
02481       {
02482         if(ND_Reco_CClike_Pos->GetBinContent(ir+1)>0)
02483         {
02484           pos += (NDData_Reco_CClike_Pos->GetBinContent(ir+1)*(FD_Reco_CClike_Pos->GetBinContent(ir+1)/ND_Reco_CClike_Pos->GetBinContent(ir+1))*FD_Reco2True_CClike_Pos->GetBinContent(ir+1,it+1));
02485         }
02486         if(ND_Reco_CClike_Neg->GetBinContent(ir+1)>0)
02487         {
02488           neg += (NDData_Reco_CClike_Neg->GetBinContent(ir+1)*(FD_Reco_CClike_Neg->GetBinContent(ir+1)/ND_Reco_CClike_Neg->GetBinContent(ir+1))*FD_Reco2True_CClike_Neg->GetBinContent(ir+1,it+1));
02489         }
02490       }
02491       
02492       if(FD_Eff_NuMuBarCC_Pos->GetBinContent(it+1)>0)
02493       {
02494         pos = pos*FD_Purity_NuMuBarCC_Pos->GetBinContent(it+1)/FD_Eff_NuMuBarCC_Pos->GetBinContent(it+1);
02495       }
02496       else
02497       {
02498         pos=0.0;
02499       }
02500       Pred_NuMuBarCC_Fid->SetBinContent(it+1,pos);
02501       
02502       if(FD_Eff_NuMuCC_Neg->GetBinContent(it+1)>0)
02503       {
02504         neg = neg*FD_Purity_NuMuCC_Neg->GetBinContent(it+1)/FD_Eff_NuMuCC_Neg->GetBinContent(it+1);
02505       }
02506       else
02507       {
02508         neg=0.0;
02509       }
02510       Pred_NuMuCC_Fid->SetBinContent(it+1,neg);
02511     }
02512     
02513     Pred_CC_Fid->Add(Pred_NuMuCC_Fid);
02514     Pred_CC_Fid->Add(Pred_NuMuBarCC_Fid);
02515   }
02516   else
02517   {
02518     for(it=0;it<nTrue;it++)
02519     {
02520       sum=0.0;
02521       for(ir=0;ir<nRecoCC;ir++)
02522       {
02523         if(ND_Reco_CClike->GetBinContent(ir+1)>0)
02524         {
02525           sum += (NDData_Reco_CClike->GetBinContent(ir+1)*(FD_Reco_CClike->GetBinContent(ir+1)/ND_Reco_CClike->GetBinContent(ir+1))*FD_Reco2True_CClike->GetBinContent(ir+1,it+1));
02526         }
02527       }
02528       if(FD_Eff_CC->GetBinContent(it+1)>0)
02529       {
02530         sum = sum*FD_Purity_CC->GetBinContent(it+1)/FD_Eff_CC->GetBinContent(it+1);
02531       }
02532       else
02533       {
02534         sum=0.0;
02535       }
02536       Pred_CC_Fid->SetBinContent(it+1,sum);
02537     }
02538   }
02539   
02540   return;
02541 }

int Extrapolate2D::GetNPID (  )  [inline]

Definition at line 68 of file Extrapolate2D.h.

References nPID.

00068 { return nPID; };

int Extrapolate2D::GetNReco (  )  [inline]

Definition at line 69 of file Extrapolate2D.h.

References nReco.

00069 { return nReco; };

int Extrapolate2D::GetNTrue (  )  [inline]

Definition at line 70 of file Extrapolate2D.h.

References nTrue.

00070 { return nTrue; };

bool Extrapolate2D::GetOscFlag (  )  [inline]

Definition at line 78 of file Extrapolate2D.h.

00078 { return Oscillated; };

string Extrapolate2D::GetPID (  )  [inline]

Definition at line 73 of file Extrapolate2D.h.

References PID.

00073 { return PID; };

TH2D* Extrapolate2D::GetPredHist ( Background::Background_t  bg  )  [inline]

Definition at line 77 of file Extrapolate2D.h.

References Pred.

00077 { return Pred[bg]; };

void Extrapolate2D::GetPrediction (  ) 

Definition at line 1615 of file Extrapolate2D.cxx.

References AppearancePred(), BeamNuePred(), FarNearPred(), FDComponents, GetNoOscCCPrediction(), OscCalc::GetOscParam(), Init, Background::kBNueCC, Background::kNC, Background::kNueCC, Background::kNuMuCC, Background::kNuTauCC, OscPar::kTh13, osc, Pred, Pred_TotalBkgd, PrintResult, ReadError, ReadExtrap(), ReadExtrapFromFile, ReadFiles(), Set1DPredHists(), SetupPredHists(), WriteOutput, and WriteToFile().

01616 {
01617   if(Init)
01618   {
01619 //     cout<<"You only need to call GetPrediction() once!"<<endl;
01620     return;
01621   }
01622   
01623   if(ReadExtrapFromFile)
01624   {
01625     ReadExtrap();
01626     if(ReadError) return;
01627     
01628     Init = true;
01629     
01630     return;
01631   }
01632   
01633   SetupPredHists();
01634   cout << "Setup Hists" << endl;
01635   ReadFiles();
01636   cout << "Read Files" << endl;
01637   if(ReadError) return;
01638   GetNoOscCCPrediction();
01639   cout << "Got No Osc Pred" << endl;
01640   
01641   for(unsigned int i=0;i<FDComponents.size();i++)
01642   {
01643     if(FDComponents[i]==Background::kNuMuCC || FDComponents[i]==Background::kNC)
01644     {
01645       FarNearPred(FDComponents[i]);
01646     }
01647     else if(FDComponents[i]==Background::kNueCC || FDComponents[i]==Background::kNuTauCC)
01648     {
01649       AppearancePred(FDComponents[i]);
01650     }
01651     else if(FDComponents[i]==Background::kBNueCC)
01652     {
01653       BeamNuePred();
01654     }
01655     else
01656     {
01657       cout<<"Unknown component"<<endl;
01658     }
01659     if(FDComponents[i]!=Background::kNueCC)
01660     {
01661       Pred_TotalBkgd->Add(Pred[FDComponents[i]]);
01662     }
01663   }
01664   cout << "Survived for loop" << endl;  
01665 
01666   Set1DPredHists();
01667   cout << "Set 1D Pred Hists" << endl;
01668   if(PrintResult)
01669   {
01670     cout.precision(4);
01671     cout<<fixed;
01672     cout<<"sin^2(2Th13) = "<<TMath::Sin(2.*osc.GetOscParam(OscPar::kTh13))*TMath::Sin(2.*osc.GetOscParam(OscPar::kTh13))<<endl;
01673     cout<<"NC: "<<Pred[Background::kNC]->Integral()<<endl;
01674     cout<<"NuMuCC: "<<Pred[Background::kNuMuCC]->Integral()<<endl;
01675     cout<<"BNueCC: "<<Pred[Background::kBNueCC]->Integral()<<endl;
01676     cout<<"NuTauCC: "<<Pred[Background::kNuTauCC]->Integral()<<endl;
01677     cout<<"Total: "<<Pred_TotalBkgd->Integral()<<endl;
01678     cout<<"NueCC: "<<Pred[Background::kNueCC]->Integral()<<endl;
01679   }
01680   
01681   if(WriteOutput) WriteToFile();
01682   
01683   Init = true;
01684   
01685   return;
01686 }

int Extrapolate2D::GetRunPeriod (  )  [inline]

Definition at line 76 of file Extrapolate2D.h.

References RunPeriod.

00076 { return RunPeriod; };

void Extrapolate2D::InitializeOscCalc (  )  [protected]

Definition at line 173 of file Extrapolate2D.cxx.

References OscPar::kDelta, OscPar::kDelta14, OscPar::kDelta24, OscPar::kDelta_emu, OscPar::kDelta_etau, OscPar::kDelta_mutau, OscPar::kDeltaM12, OscPar::kDeltaM23, OscPar::kDensity, OscPar::kDm41, OscPar::kEps_ee, OscPar::kEps_emu, OscPar::kEps_etau, OscPar::kEps_mumu, OscPar::kEps_mutau, OscPar::kEps_tautau, OscPar::kL, OscPar::kNuAntiNu, OscPar::kTh12, OscPar::kTh13, OscPar::kTh14, OscPar::kTh23, OscPar::kTh24, OscPar::kTh34, osc, and OscCalc::SetOscParam().

Referenced by Extrapolate2D(), and Extrapolate2D_Simple::Extrapolate2D_Simple().

00174 {
00175   Double_t dm2_12 = 7.59e-5;  // updated 2014
00176   Double_t dm2_23 = 2.41e-3;
00177   Double_t par[24] = {0};
00178   par[OscPar::kL] = 735.0;
00179   par[OscPar::kTh23] = 3.1415926/4.0;
00180   par[OscPar::kTh12] = 0.59365;    // Sin2(2Th12) = 0.86
00181   par[OscPar::kTh13] = 0.147;  // Daya Bay Neutrino 2014
00182   par[OscPar::kDeltaM23] = dm2_23; //normal heirarchy
00183   par[OscPar::kDeltaM12] = dm2_12;
00184   par[OscPar::kDensity] = 2.75; //standard rock density
00185   par[OscPar::kDelta] = 0;
00186   par[OscPar::kNuAntiNu] = 1;
00187   
00188   // Initialize NSI parameters:
00189   par[OscPar::kEps_ee] =  0;
00190   par[OscPar::kEps_emu] =  0;
00191   par[OscPar::kEps_etau] =  0;
00192   par[OscPar::kEps_mumu] =  0;
00193   par[OscPar::kEps_mutau] = 0; 
00194   par[OscPar::kEps_tautau] = 0; 
00195   par[OscPar::kDelta_emu] = 0;
00196   par[OscPar::kDelta_etau] = 0;
00197   par[OscPar::kDelta_mutau] = 0;
00198   
00199   par[OscPar::kTh14] = 0;
00200   par[OscPar::kTh24] = 0;
00201   par[OscPar::kTh34] = 0;
00202   par[OscPar::kDm41] = 0;
00203   par[OscPar::kDelta14] = 0;
00204   par[OscPar::kDelta24] = 0;
00205   osc.SetOscParam(par);
00206   
00207   return;
00208 }

void Extrapolate2D::InvertMassHierarchy (  ) 

Definition at line 270 of file Extrapolate2D.cxx.

References OscCalc::GetOscParam(), OscPar::kDeltaM23, osc, and OscCalc::SetOscParam().

00271 {
00272   double temp = -1.*osc.GetOscParam(OscPar::kDeltaM23);
00273   osc.SetOscParam(OscPar::kDeltaM23,temp);
00274   return;
00275 }

void Extrapolate2D::OscillatePrediction (  )  [virtual]

Reimplemented in Extrapolate2D_Simple.

Definition at line 2014 of file Extrapolate2D.cxx.

References OscCalc::GetOscParam(), Init, Background::kBNueCC, Background::kNC, Background::kNueCC, Background::kNuMuCC, Background::kNuTauCC, OscPar::kTh13, osc, Oscillated, OscillatePrediction_NoSep(), OscillatePrediction_SepNuNuBar(), Pred, Pred_TotalBkgd, PrintResult, and UseSeparateNuNuBar.

02015 {
02016   if(!Init)
02017   {
02018     cout<<"Can't call OscillatePrediction(): The prediction wasn't properly initialized with GetPrediction()."<<endl;
02019     return;
02020   }
02021   
02022   if(UseSeparateNuNuBar)
02023   {
02024     OscillatePrediction_SepNuNuBar();
02025   }
02026   else
02027   {
02028     OscillatePrediction_NoSep();
02029   }
02030   
02031   if(PrintResult)
02032   {
02033     cout.precision(4);
02034     cout<<fixed;
02035     cout<<"sin^2(2Th13) = "<<TMath::Sin(2.*osc.GetOscParam(OscPar::kTh13))*TMath::Sin(2.*osc.GetOscParam(OscPar::kTh13))<<endl;
02036     cout<<"NC: "<<Pred[Background::kNC]->Integral()<<endl;
02037     cout<<"NuMuCC: "<<Pred[Background::kNuMuCC]->Integral()<<endl;
02038     cout<<"BNueCC: "<<Pred[Background::kBNueCC]->Integral()<<endl;
02039     cout<<"NuTauCC: "<<Pred[Background::kNuTauCC]->Integral()<<endl;
02040     cout<<"Total: "<<Pred_TotalBkgd->Integral()<<endl;
02041     cout<<"NueCC: "<<Pred[Background::kNueCC]->Integral()<<endl;
02042   }
02043   
02044   Oscillated=true;
02045   
02046   return;
02047 }

void Extrapolate2D::OscillatePrediction_NoSep (  )  [protected]

Reimplemented in Extrapolate2D_Simple.

Definition at line 2248 of file Extrapolate2D.cxx.

References MuELoss::e, OscCalc::ElecToElec(), OscCalc::ElecToMu(), OscCalc::ElecToTau(), FD_TrueVsRecoVsPID_NC_NueBarFrac, FD_TrueVsRecoVsPID_NC_NueFrac, FD_TrueVsRecoVsPID_NC_NuMuBarFrac, FD_TrueVsRecoVsPID_NC_NuMuFrac, FDComponents, it, Background::kBNueCC, Background::kNC, OscPar::kNuAntiNu, Background::kNueCC, Background::kNuMuCC, Background::kNuTauCC, OscCalc::MuToElec(), OscCalc::MuToMu(), OscCalc::MuToTau(), NominalOscProb, nPID, nReco, nTrue, osc, OscCalc::Oscillate(), OscCalc::OscillateLSND(), OscCalc::OscillateNSI(), OscMethod, Pred, Pred_3D, Pred_TotalBkgd, qBNueToBNue, qBNueToNuMu, qBNueToNuTau, qNC, qNuMuToNue, qNuMuToNuMu, qNuMuToNuTau, Set1DPredHists(), and OscCalc::SetOscParam().

Referenced by OscillatePrediction().

02249 {
02250   //will use Pred_3D to reweight Pred for oscillation
02251   
02252   for(unsigned int i=0;i<FDComponents.size();i++)
02253   {
02254     Pred[FDComponents[i]]->Reset();
02255   }
02256   Pred_TotalBkgd->Reset();
02257   
02258   int it,ir,ip;
02259   double E;
02260   double temp,sum;
02261   
02262   osc.SetOscParam(OscPar::kNuAntiNu,1);//this function assumes neutrino probabilites
02263   
02264   for(unsigned int i=0;i<FDComponents.size();i++)
02265   {
02266     Background::Background_t bg = FDComponents[i];
02267     for(ip=0;ip<nPID;ip++)
02268     {
02269       for(ir=0;ir<nReco;ir++)
02270       {
02271         sum=0;
02272         for(it=0;it<nTrue;it++)
02273         {
02274           E = Pred_3D[qNC]->GetZaxis()->GetBinCenter(it+1);
02275           
02276           temp=0;
02277           
02278           if(bg==Background::kNuMuCC)
02279           {
02280             if(NominalOscProb[qNuMuToNuMu]->GetBinContent(it+1)>1e-20)
02281             { 
02282               if(OscMethod == 3){temp += Pred_3D[qNuMuToNuMu]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateLSND(14,14,E)/NominalOscProb[qNuMuToNuMu]->GetBinContent(it+1);}
02283               else if(OscMethod == 2){temp += Pred_3D[qNuMuToNuMu]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateNSI(14,14,E)/NominalOscProb[qNuMuToNuMu]->GetBinContent(it+1);}
02284               else if(OscMethod == 1){temp += Pred_3D[qNuMuToNuMu]->GetBinContent(ip+1,ir+1,it+1)*osc.Oscillate(14,14,E)/NominalOscProb[qNuMuToNuMu]->GetBinContent(it+1);}
02285               else{temp += Pred_3D[qNuMuToNuMu]->GetBinContent(ip+1,ir+1,it+1)*osc.MuToMu(E)/NominalOscProb[qNuMuToNuMu]->GetBinContent(it+1);}
02286             }
02287             if(NominalOscProb[qBNueToNuMu]->GetBinContent(it+1)>1e-20)
02288             {
02289               if(OscMethod == 3){temp += Pred_3D[qBNueToNuMu]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateLSND(14,12,E)/NominalOscProb[qBNueToNuMu]->GetBinContent(it+1);}
02290               else if(OscMethod == 2){temp += Pred_3D[qBNueToNuMu]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateNSI(14,12,E)/NominalOscProb[qBNueToNuMu]->GetBinContent(it+1);}
02291               else if(OscMethod == 1){temp += Pred_3D[qBNueToNuMu]->GetBinContent(ip+1,ir+1,it+1)*osc.Oscillate(14,12,E)/NominalOscProb[qBNueToNuMu]->GetBinContent(it+1);}
02292               else{temp += Pred_3D[qBNueToNuMu]->GetBinContent(ip+1,ir+1,it+1)*osc.ElecToMu(E)/NominalOscProb[qBNueToNuMu]->GetBinContent(it+1);}
02293             }
02294           }
02295           if(bg==Background::kBNueCC)
02296           {
02297             if(NominalOscProb[qBNueToBNue]->GetBinContent(it+1)>1e-20)
02298             {
02299               if(OscMethod == 3){temp = Pred_3D[qBNueToBNue]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateLSND(12,12,E)/NominalOscProb[qBNueToBNue]->GetBinContent(it+1);}
02300               else if(OscMethod == 2){temp = Pred_3D[qBNueToBNue]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateNSI(12,12,E)/NominalOscProb[qBNueToBNue]->GetBinContent(it+1);}
02301               else if(OscMethod == 1){temp = Pred_3D[qBNueToBNue]->GetBinContent(ip+1,ir+1,it+1)*osc.Oscillate(12,12,E)/NominalOscProb[qBNueToBNue]->GetBinContent(it+1);}
02302               else{temp = Pred_3D[qBNueToBNue]->GetBinContent(ip+1,ir+1,it+1)*osc.ElecToElec(E)/NominalOscProb[qBNueToBNue]->GetBinContent(it+1);}
02303             }
02304           }
02305           if(bg==Background::kNueCC)
02306           {
02307             if(NominalOscProb[qNuMuToNue]->GetBinContent(it+1)>1e-20)
02308             {
02309               if(OscMethod == 3){temp = Pred_3D[qNuMuToNue]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateLSND(12,14,E)/NominalOscProb[qNuMuToNue]->GetBinContent(it+1);}
02310               else if(OscMethod == 2){temp = Pred_3D[qNuMuToNue]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateNSI(12,14,E)/NominalOscProb[qNuMuToNue]->GetBinContent(it+1);}
02311               else if(OscMethod == 1){temp = Pred_3D[qNuMuToNue]->GetBinContent(ip+1,ir+1,it+1)*osc.Oscillate(12,14,E)/NominalOscProb[qNuMuToNue]->GetBinContent(it+1);}
02312               else{temp = Pred_3D[qNuMuToNue]->GetBinContent(ip+1,ir+1,it+1)*osc.MuToElec(E)/NominalOscProb[qNuMuToNue]->GetBinContent(it+1);}
02313             }
02314           }
02315           if(bg==Background::kNuTauCC)
02316           {
02317             if(NominalOscProb[qNuMuToNuTau]->GetBinContent(it+1)>1e-20)
02318             {
02319               if(OscMethod == 3){temp += Pred_3D[qNuMuToNuTau]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateLSND(16,14,E)/NominalOscProb[qNuMuToNuTau]->GetBinContent(it+1);}
02320               else if(OscMethod == 2){temp += Pred_3D[qNuMuToNuTau]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateNSI(16,14,E)/NominalOscProb[qNuMuToNuTau]->GetBinContent(it+1);}
02321               else if(OscMethod == 1){temp += Pred_3D[qNuMuToNuTau]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateNSI(16,14,E)/NominalOscProb[qNuMuToNuTau]->GetBinContent(it+1);}
02322               else{temp += Pred_3D[qNuMuToNuTau]->GetBinContent(ip+1,ir+1,it+1)*osc.MuToTau(E)/NominalOscProb[qNuMuToNuTau]->GetBinContent(it+1);}
02323             }
02324             if(NominalOscProb[qBNueToNuTau]->GetBinContent(it+1)>1e-20)
02325             {
02326               if(OscMethod == 3){temp += Pred_3D[qBNueToNuTau]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateLSND(16,12,E)/NominalOscProb[qBNueToNuTau]->GetBinContent(it+1);}
02327               else if(OscMethod == 2){temp += Pred_3D[qBNueToNuTau]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateNSI(16,12,E)/NominalOscProb[qBNueToNuTau]->GetBinContent(it+1);}
02328               else if(OscMethod == 1){temp += Pred_3D[qBNueToNuTau]->GetBinContent(ip+1,ir+1,it+1)*osc.Oscillate(16,12,E)/NominalOscProb[qBNueToNuTau]->GetBinContent(it+1);}
02329               else{temp += Pred_3D[qBNueToNuTau]->GetBinContent(ip+1,ir+1,it+1)*osc.ElecToTau(E)/NominalOscProb[qBNueToNuTau]->GetBinContent(it+1);}
02330             }
02331           }
02332           if(bg==Background::kNC)
02333           {
02334             if(OscMethod == 3)
02335             {
02336               osc.SetOscParam(OscPar::kNuAntiNu,1);
02337               temp = FD_TrueVsRecoVsPID_NC_NueFrac->GetBinContent(ip+1,ir+1,it+1)*(1-osc.OscillateLSND(18,12,E)) + FD_TrueVsRecoVsPID_NC_NuMuFrac->GetBinContent(ip+1,ir+1,it+1)*(1-osc.OscillateLSND(18,14,E));
02338               osc.SetOscParam(OscPar::kNuAntiNu,-1);
02339               temp += (FD_TrueVsRecoVsPID_NC_NueBarFrac->GetBinContent(ip+1,ir+1,it+1)*(1-osc.OscillateLSND(-18,-12,E)) + FD_TrueVsRecoVsPID_NC_NuMuBarFrac->GetBinContent(ip+1,ir+1,it+1)*(1-osc.OscillateLSND(-18,-14,E)));
02340               temp *= Pred_3D[qNC]->GetBinContent(ip+1,ir+1,it+1);
02341             }
02342             else {temp = Pred_3D[qNC]->GetBinContent(ip+1,ir+1,it+1);}
02343           }
02344           sum+=temp;
02345         }
02346         Pred[bg]->SetBinContent(ip+1,ir+1,sum);
02347       }
02348     }
02349     if(FDComponents[i]!=Background::kNueCC)
02350     {
02351       Pred_TotalBkgd->Add(Pred[bg]);
02352     }
02353   }
02354   
02355   Set1DPredHists();
02356   
02357   return;
02358 }

void Extrapolate2D::OscillatePrediction_SepNuNuBar (  )  [protected]

Reimplemented in Extrapolate2D_Simple.

Definition at line 2048 of file Extrapolate2D.cxx.

References MuELoss::e, OscCalc::ElecToElec(), OscCalc::ElecToMu(), OscCalc::ElecToTau(), FD_TrueVsRecoVsPID_NC_NueBarFrac, FD_TrueVsRecoVsPID_NC_NueFrac, FD_TrueVsRecoVsPID_NC_NuMuBarFrac, FD_TrueVsRecoVsPID_NC_NuMuFrac, FDComponents, it, Background::kBNueCC, Background::kNC, OscPar::kNuAntiNu, Background::kNueCC, Background::kNuMuCC, Background::kNuTauCC, OscCalc::MuToElec(), OscCalc::MuToMu(), OscCalc::MuToTau(), NominalOscProb, NominalOscProb_NuBar, nPID, nReco, nTrue, osc, OscCalc::Oscillate(), OscCalc::OscillateLSND(), OscCalc::OscillateNSI(), OscMethod, Pred, Pred_3D, Pred_Nu_3D, Pred_NuBar_3D, Pred_NueBarCCSignal, Pred_NueCCSignal, Pred_TotalBkgd, qBNueToBNue, qBNueToNuMu, qBNueToNuTau, qNC, qNuMuToNue, qNuMuToNuMu, qNuMuToNuTau, Set1DPredHists(), and OscCalc::SetOscParam().

Referenced by OscillatePrediction().

02049 {
02050   //will use Pred_Nu_3D and Pred_NuBar_3D to reweight Pred for oscillation
02051   
02052   for(unsigned int i=0;i<FDComponents.size();i++)
02053   {
02054     Pred[FDComponents[i]]->Reset();
02055   }
02056   Pred_TotalBkgd->Reset();
02057   Pred_NueCCSignal->Reset();
02058   Pred_NueBarCCSignal->Reset();
02059   
02060   int it,ir,ip;
02061   double E;
02062   double temp,sum,sumnu,sumnubar;
02063   
02064   for(unsigned int i=0;i<FDComponents.size();i++)
02065   {
02066     Background::Background_t bg = FDComponents[i];
02067     for(ip=0;ip<nPID;ip++)
02068     {
02069       for(ir=0;ir<nReco;ir++)
02070       {
02071         sum=0;
02072         sumnu=0;
02073         sumnubar=0;
02074         for(it=0;it<nTrue;it++)
02075         {
02076           E = Pred_3D[qNC]->GetZaxis()->GetBinCenter(it+1);
02077           
02078           temp=0;
02079           
02080           if(bg==Background::kNuMuCC)
02081           {
02082             //nu
02083             osc.SetOscParam(OscPar::kNuAntiNu,1);
02084             if(NominalOscProb[qNuMuToNuMu]->GetBinContent(it+1)>1e-20)
02085             {
02086               if(OscMethod == 3){temp += (Pred_Nu_3D[qNuMuToNuMu]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateLSND(14,14,E)/NominalOscProb[qNuMuToNuMu]->GetBinContent(it+1));}
02087               else if(OscMethod == 2){temp += (Pred_Nu_3D[qNuMuToNuMu]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateNSI(14,14,E)/NominalOscProb[qNuMuToNuMu]->GetBinContent(it+1));}
02088               else if(OscMethod == 1){temp += (Pred_Nu_3D[qNuMuToNuMu]->GetBinContent(ip+1,ir+1,it+1)*osc.Oscillate(14,14,E)/NominalOscProb[qNuMuToNuMu]->GetBinContent(it+1));}
02089               else{temp += (Pred_Nu_3D[qNuMuToNuMu]->GetBinContent(ip+1,ir+1,it+1)*osc.MuToMu(E)/NominalOscProb[qNuMuToNuMu]->GetBinContent(it+1));}
02090             }
02091             if(NominalOscProb[qBNueToNuMu]->GetBinContent(it+1)>1e-20)
02092             {
02093               if(OscMethod == 3){temp += (Pred_Nu_3D[qBNueToNuMu]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateLSND(14,12,E)/NominalOscProb[qBNueToNuMu]->GetBinContent(it+1));}
02094               else if(OscMethod == 2){temp += (Pred_Nu_3D[qBNueToNuMu]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateNSI(14,12,E)/NominalOscProb[qBNueToNuMu]->GetBinContent(it+1));}
02095               else if(OscMethod == 1){temp += (Pred_Nu_3D[qBNueToNuMu]->GetBinContent(ip+1,ir+1,it+1)*osc.Oscillate(14,12,E)/NominalOscProb[qBNueToNuMu]->GetBinContent(it+1));}
02096               else{temp += (Pred_Nu_3D[qBNueToNuMu]->GetBinContent(ip+1,ir+1,it+1)*osc.ElecToMu(E)/NominalOscProb[qBNueToNuMu]->GetBinContent(it+1));}
02097             }
02098             //nubar
02099             osc.SetOscParam(OscPar::kNuAntiNu,-1);
02100             if(NominalOscProb_NuBar[qNuMuToNuMu]->GetBinContent(it+1)>1e-20)
02101             {
02102               if(OscMethod == 3){temp += (Pred_NuBar_3D[qNuMuToNuMu]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateLSND(-14,-14,E)/NominalOscProb_NuBar[qNuMuToNuMu]->GetBinContent(it+1));}
02103               else if(OscMethod == 2){temp += (Pred_NuBar_3D[qNuMuToNuMu]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateNSI(-14,-14,E)/NominalOscProb_NuBar[qNuMuToNuMu]->GetBinContent(it+1));}
02104               else if(OscMethod == 1){temp += (Pred_NuBar_3D[qNuMuToNuMu]->GetBinContent(ip+1,ir+1,it+1)*osc.Oscillate(-14,-14,E)/NominalOscProb_NuBar[qNuMuToNuMu]->GetBinContent(it+1));}
02105               else{temp += (Pred_NuBar_3D[qNuMuToNuMu]->GetBinContent(ip+1,ir+1,it+1)*osc.MuToMu(E)/NominalOscProb_NuBar[qNuMuToNuMu]->GetBinContent(it+1));}
02106             }
02107             if(NominalOscProb_NuBar[qBNueToNuMu]->GetBinContent(it+1)>1e-20)
02108             {
02109               if(OscMethod == 3){temp += (Pred_NuBar_3D[qBNueToNuMu]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateLSND(-14,-12,E)/NominalOscProb_NuBar[qBNueToNuMu]->GetBinContent(it+1));}
02110               else if(OscMethod == 2){temp += (Pred_NuBar_3D[qBNueToNuMu]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateNSI(-14,-12,E)/NominalOscProb_NuBar[qBNueToNuMu]->GetBinContent(it+1));}
02111               else if(OscMethod == 1){temp += (Pred_NuBar_3D[qBNueToNuMu]->GetBinContent(ip+1,ir+1,it+1)*osc.Oscillate(-14,-12,E)/NominalOscProb_NuBar[qBNueToNuMu]->GetBinContent(it+1));}
02112               else{temp += (Pred_NuBar_3D[qBNueToNuMu]->GetBinContent(ip+1,ir+1,it+1)*osc.ElecToMu(E)/NominalOscProb_NuBar[qBNueToNuMu]->GetBinContent(it+1));}
02113             }
02114           }
02115           if(bg==Background::kBNueCC)
02116           {
02117             //nu
02118             osc.SetOscParam(OscPar::kNuAntiNu,1);
02119             if(NominalOscProb[qBNueToBNue]->GetBinContent(it+1)>1e-20)
02120             {
02121               if(OscMethod == 3){temp += (Pred_Nu_3D[qBNueToBNue]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateLSND(12,12,E)/NominalOscProb[qBNueToBNue]->GetBinContent(it+1));}
02122               else if(OscMethod == 2){temp += (Pred_Nu_3D[qBNueToBNue]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateNSI(12,12,E)/NominalOscProb[qBNueToBNue]->GetBinContent(it+1));}
02123               else if(OscMethod == 1){temp += (Pred_Nu_3D[qBNueToBNue]->GetBinContent(ip+1,ir+1,it+1)*osc.Oscillate(12,12,E)/NominalOscProb[qBNueToBNue]->GetBinContent(it+1));}
02124               else{temp += (Pred_Nu_3D[qBNueToBNue]->GetBinContent(ip+1,ir+1,it+1)*osc.ElecToElec(E)/NominalOscProb[qBNueToBNue]->GetBinContent(it+1));}
02125             }
02126             //nubar
02127             osc.SetOscParam(OscPar::kNuAntiNu,-1);
02128             if(NominalOscProb_NuBar[qBNueToBNue]->GetBinContent(it+1)>1e-20)
02129             {
02130               if(OscMethod == 3){temp += (Pred_NuBar_3D[qBNueToBNue]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateLSND(-12,-12,E)/NominalOscProb_NuBar[qBNueToBNue]->GetBinContent(it+1));}
02131               else if(OscMethod == 2){temp += (Pred_NuBar_3D[qBNueToBNue]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateNSI(-12,-12,E)/NominalOscProb_NuBar[qBNueToBNue]->GetBinContent(it+1));}
02132               else if(OscMethod == 1){temp += (Pred_NuBar_3D[qBNueToBNue]->GetBinContent(ip+1,ir+1,it+1)*osc.Oscillate(-12,-12,E)/NominalOscProb_NuBar[qBNueToBNue]->GetBinContent(it+1));}
02133               else{temp += (Pred_NuBar_3D[qBNueToBNue]->GetBinContent(ip+1,ir+1,it+1)*osc.ElecToElec(E)/NominalOscProb_NuBar[qBNueToBNue]->GetBinContent(it+1));}
02134             }
02135           }
02136           if(bg==Background::kNueCC)
02137           {
02138             //nu
02139             osc.SetOscParam(OscPar::kNuAntiNu,1);
02140             if(NominalOscProb[qNuMuToNue]->GetBinContent(it+1)>1e-20)
02141             {
02142               if(OscMethod == 3){
02143               temp += (Pred_Nu_3D[qNuMuToNue]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateLSND(12,14,E)/NominalOscProb[qNuMuToNue]->GetBinContent(it+1));
02144               sumnu += (Pred_Nu_3D[qNuMuToNue]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateLSND(12,14,E)/NominalOscProb[qNuMuToNue]->GetBinContent(it+1));
02145               }
02146               else if(OscMethod == 2){
02147               temp += (Pred_Nu_3D[qNuMuToNue]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateNSI(12,14,E)/NominalOscProb[qNuMuToNue]->GetBinContent(it+1));
02148               sumnu += (Pred_Nu_3D[qNuMuToNue]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateNSI(12,14,E)/NominalOscProb[qNuMuToNue]->GetBinContent(it+1));
02149               }
02150               else if(OscMethod == 1){
02151               temp += (Pred_Nu_3D[qNuMuToNue]->GetBinContent(ip+1,ir+1,it+1)*osc.Oscillate(12,14,E)/NominalOscProb[qNuMuToNue]->GetBinContent(it+1));
02152               sumnu += (Pred_Nu_3D[qNuMuToNue]->GetBinContent(ip+1,ir+1,it+1)*osc.Oscillate(12,14,E)/NominalOscProb[qNuMuToNue]->GetBinContent(it+1));
02153               }
02154               else{
02155               temp += (Pred_Nu_3D[qNuMuToNue]->GetBinContent(ip+1,ir+1,it+1)*osc.MuToElec(E)/NominalOscProb[qNuMuToNue]->GetBinContent(it+1));
02156               sumnu += (Pred_Nu_3D[qNuMuToNue]->GetBinContent(ip+1,ir+1,it+1)*osc.MuToElec(E)/NominalOscProb[qNuMuToNue]->GetBinContent(it+1));
02157               }
02158             }
02159              //nubar
02160             osc.SetOscParam(OscPar::kNuAntiNu,-1);
02161             if(NominalOscProb_NuBar[qNuMuToNue]->GetBinContent(it+1)>1e-20)
02162             {
02163               if(OscMethod == 3){
02164               temp += (Pred_NuBar_3D[qNuMuToNue]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateLSND(-12,-14,E)/NominalOscProb_NuBar[qNuMuToNue]->GetBinContent(it+1));
02165               sumnubar += (Pred_NuBar_3D[qNuMuToNue]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateLSND(-12,-14,E)/NominalOscProb_NuBar[qNuMuToNue]->GetBinContent(it+1));
02166               }
02167               else if(OscMethod == 2){
02168               temp += (Pred_NuBar_3D[qNuMuToNue]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateNSI(-12,-14,E)/NominalOscProb_NuBar[qNuMuToNue]->GetBinContent(it+1));
02169               sumnubar += (Pred_NuBar_3D[qNuMuToNue]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateNSI(-12,-14,E)/NominalOscProb_NuBar[qNuMuToNue]->GetBinContent(it+1));
02170               }
02171               else if(OscMethod == 1){
02172               temp += (Pred_NuBar_3D[qNuMuToNue]->GetBinContent(ip+1,ir+1,it+1)*osc.Oscillate(-12,-14,E)/NominalOscProb_NuBar[qNuMuToNue]->GetBinContent(it+1));
02173               sumnubar += (Pred_NuBar_3D[qNuMuToNue]->GetBinContent(ip+1,ir+1,it+1)*osc.Oscillate(-12,-14,E)/NominalOscProb_NuBar[qNuMuToNue]->GetBinContent(it+1));
02174               }
02175               else{
02176               temp += (Pred_NuBar_3D[qNuMuToNue]->GetBinContent(ip+1,ir+1,it+1)*osc.MuToElec(E)/NominalOscProb_NuBar[qNuMuToNue]->GetBinContent(it+1));
02177               sumnubar += (Pred_NuBar_3D[qNuMuToNue]->GetBinContent(ip+1,ir+1,it+1)*osc.MuToElec(E)/NominalOscProb_NuBar[qNuMuToNue]->GetBinContent(it+1));
02178               }
02179             }
02180           }
02181           if(bg==Background::kNuTauCC)
02182           {
02183             //nu
02184             osc.SetOscParam(OscPar::kNuAntiNu,1);
02185             if(NominalOscProb[qNuMuToNuTau]->GetBinContent(it+1)>1e-20)
02186             {
02187               if(OscMethod == 3){temp += Pred_Nu_3D[qNuMuToNuTau]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateLSND(16,14,E)/NominalOscProb[qNuMuToNuTau]->GetBinContent(it+1);}
02188               else if(OscMethod == 2){temp += Pred_Nu_3D[qNuMuToNuTau]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateNSI(16,14,E)/NominalOscProb[qNuMuToNuTau]->GetBinContent(it+1);}
02189               else if(OscMethod == 1){temp += Pred_Nu_3D[qNuMuToNuTau]->GetBinContent(ip+1,ir+1,it+1)*osc.Oscillate(16,14,E)/NominalOscProb[qNuMuToNuTau]->GetBinContent(it+1);}
02190               else{temp += Pred_Nu_3D[qNuMuToNuTau]->GetBinContent(ip+1,ir+1,it+1)*osc.MuToTau(E)/NominalOscProb[qNuMuToNuTau]->GetBinContent(it+1);}
02191             }
02192             if(NominalOscProb[qBNueToNuTau]->GetBinContent(it+1)>1e-20)
02193             {
02194               if(OscMethod == 3){temp += Pred_Nu_3D[qBNueToNuTau]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateLSND(16,12,E)/NominalOscProb[qBNueToNuTau]->GetBinContent(it+1);}
02195               else if(OscMethod == 2){temp += Pred_Nu_3D[qBNueToNuTau]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateNSI(16,12,E)/NominalOscProb[qBNueToNuTau]->GetBinContent(it+1);}
02196               else if(OscMethod == 1){temp += Pred_Nu_3D[qBNueToNuTau]->GetBinContent(ip+1,ir+1,it+1)*osc.Oscillate(16,12,E)/NominalOscProb[qBNueToNuTau]->GetBinContent(it+1);}
02197               else{temp += Pred_Nu_3D[qBNueToNuTau]->GetBinContent(ip+1,ir+1,it+1)*osc.ElecToTau(E)/NominalOscProb[qBNueToNuTau]->GetBinContent(it+1);}
02198             }
02199             //nubar
02200             osc.SetOscParam(OscPar::kNuAntiNu,-1);
02201             if(NominalOscProb_NuBar[qNuMuToNuTau]->GetBinContent(it+1)>1e-20)
02202             {
02203               if(OscMethod == 3){temp += Pred_NuBar_3D[qNuMuToNuTau]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateLSND(-16,-14,E)/NominalOscProb_NuBar[qNuMuToNuTau]->GetBinContent(it+1);}
02204               else if(OscMethod == 2){temp += Pred_NuBar_3D[qNuMuToNuTau]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateNSI(-16,-14,E)/NominalOscProb_NuBar[qNuMuToNuTau]->GetBinContent(it+1);}
02205               else if(OscMethod == 1){temp += Pred_NuBar_3D[qNuMuToNuTau]->GetBinContent(ip+1,ir+1,it+1)*osc.Oscillate(-16,-14,E)/NominalOscProb_NuBar[qNuMuToNuTau]->GetBinContent(it+1);}
02206               else{temp += Pred_NuBar_3D[qNuMuToNuTau]->GetBinContent(ip+1,ir+1,it+1)*osc.MuToTau(E)/NominalOscProb_NuBar[qNuMuToNuTau]->GetBinContent(it+1);}
02207             }
02208             if(NominalOscProb_NuBar[qBNueToNuTau]->GetBinContent(it+1)>1e-20)
02209             {
02210               if(OscMethod == 3){temp += Pred_NuBar_3D[qBNueToNuTau]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateLSND(-16,-12,E)/NominalOscProb_NuBar[qBNueToNuTau]->GetBinContent(it+1);}
02211               else if(OscMethod == 2){temp += Pred_NuBar_3D[qBNueToNuTau]->GetBinContent(ip+1,ir+1,it+1)*osc.OscillateNSI(-16,-12,E)/NominalOscProb_NuBar[qBNueToNuTau]->GetBinContent(it+1);}
02212               else if(OscMethod == 1){temp += Pred_NuBar_3D[qBNueToNuTau]->GetBinContent(ip+1,ir+1,it+1)*osc.Oscillate(-16,-12,E)/NominalOscProb_NuBar[qBNueToNuTau]->GetBinContent(it+1);}
02213               else{temp += Pred_NuBar_3D[qBNueToNuTau]->GetBinContent(ip+1,ir+1,it+1)*osc.ElecToTau(E)/NominalOscProb_NuBar[qBNueToNuTau]->GetBinContent(it+1);}
02214             }
02215           }
02216           if(bg==Background::kNC)
02217           {
02218             if(OscMethod == 3)
02219             {
02220               osc.SetOscParam(OscPar::kNuAntiNu,1);
02221               temp = FD_TrueVsRecoVsPID_NC_NueFrac->GetBinContent(ip+1,ir+1,it+1)*(1-osc.OscillateLSND(18,12,E)) + FD_TrueVsRecoVsPID_NC_NuMuFrac->GetBinContent(ip+1,ir+1,it+1)*(1-osc.OscillateLSND(18,14,E));
02222               osc.SetOscParam(OscPar::kNuAntiNu,-1);
02223               temp += (FD_TrueVsRecoVsPID_NC_NueBarFrac->GetBinContent(ip+1,ir+1,it+1)*(1-osc.OscillateLSND(-18,-12,E)) + FD_TrueVsRecoVsPID_NC_NuMuBarFrac->GetBinContent(ip+1,ir+1,it+1)*(1-osc.OscillateLSND(-18,-14,E)));
02224               temp *= Pred_3D[qNC]->GetBinContent(ip+1,ir+1,it+1);
02225             }
02226             else{ temp = Pred_3D[qNC]->GetBinContent(ip+1,ir+1,it+1);}
02227           }
02228           sum+=temp;
02229         }
02230         Pred[bg]->SetBinContent(ip+1,ir+1,sum);
02231         if(bg==Background::kNueCC)
02232         {
02233           Pred_NueCCSignal->SetBinContent(ip+1,ir+1,sumnu);
02234           Pred_NueBarCCSignal->SetBinContent(ip+1,ir+1,sumnubar);
02235         }
02236       }
02237     }
02238     if(FDComponents[i]!=Background::kNueCC)
02239     {
02240       Pred_TotalBkgd->Add(Pred[bg]);
02241     }
02242   }
02243   
02244   Set1DPredHists();
02245   
02246   return;
02247 }

void Extrapolate2D::ReadExtrap (  )  [protected]

Definition at line 1379 of file Extrapolate2D.cxx.

References Background::AsString(), Delta14, Delta24, Delta_emu, Delta_etau, Delta_mutau, DeltaCP, DeltaMSq12, DeltaMSq23, Dm41, Eps_ee, Eps_emu, Eps_etau, Eps_mumu, Eps_mutau, Eps_tautau, FD_TrueVsRecoVsPID_NC_NueBarFrac, FD_TrueVsRecoVsPID_NC_NueFrac, FD_TrueVsRecoVsPID_NC_NuMuBarFrac, FD_TrueVsRecoVsPID_NC_NuMuFrac, FDComponents, FNRatio, Form(), OscCalc::GetOscParam(), gSystem(), inFileName, Background::kBNueCC, OscPar::kDelta, OscPar::kDelta14, OscPar::kDelta24, OscPar::kDelta_emu, OscPar::kDelta_etau, OscPar::kDelta_mutau, OscPar::kDeltaM12, OscPar::kDeltaM23, OscPar::kDm41, OscPar::kEps_ee, OscPar::kEps_emu, OscPar::kEps_etau, OscPar::kEps_mumu, OscPar::kEps_mutau, OscPar::kEps_tautau, Background::kNC, Background::kNueCC, Background::kNuMuCC, Background::kNuTauCC, OscPar::kTh12, OscPar::kTh13, OscPar::kTh14, OscPar::kTh23, OscPar::kTh24, OscPar::kTh34, NDData, NDData_Reco_CClike, NDData_Reco_CClike_Neg, NDData_Reco_CClike_Pos, nPID, nReco, osc, PID, PID_NDData, Pred, Pred_3D, Pred_CC_Fid, Pred_Nu_3D, Pred_NuBar_3D, Pred_NueBarCCSignal, Pred_NueCCSignal, Pred_NuMuBarCC_Fid, Pred_NuMuCC_Fid, Pred_Signal_VsBinNumber, Pred_TotalBkgd, Pred_TotalBkgd_VsBinNumber, PrintResult, qBNueToBNue, qBNueToNuMu, qBNueToNuTau, qNC, qNuMuToNue, qNuMuToNuMu, qNuMuToNuTau, ReadError, RunPeriod, Set1DPredHists(), SetFarPOT(), SetNearPOT(), SetNominalOscProb(), OscCalc::SetOscParam(), SetPIDBins(), SetRecoBins(), SetTrueBins(), Theta12, Theta13, Theta14, Theta23, Theta24, Theta34, and UseSeparateNuNuBar.

Referenced by GetPrediction().

01380 {
01381   Pred_3D.clear();
01382   Pred_Nu_3D.clear();
01383   Pred_NuBar_3D.clear();
01384   Pred.clear();
01385   FNRatio.clear();
01386   Pred_TotalBkgd = NULL;
01387   Pred_NueCCSignal = NULL;
01388   Pred_NueBarCCSignal = NULL;
01389   Pred_CC_Fid = NULL;
01390   Pred_NuMuCC_Fid = NULL;
01391   Pred_NuMuBarCC_Fid = NULL;
01392   Pred_TotalBkgd_VsBinNumber = NULL;
01393   Pred_Signal_VsBinNumber = NULL;
01394   
01395   if(gSystem->AccessPathName(gSystem->ExpandPathName(inFileName.c_str())))
01396   {
01397     cout<<"Failure to read extrap input file."<<endl;
01398     ReadError = true;
01399     return;
01400   }
01401   
01402   TFile *f = new TFile(gSystem->ExpandPathName(inFileName.c_str()),"READ");
01403   
01404   double npot,fpot;
01405   TTree *tree = (TTree*)f->Get("paramtree");
01406   tree->SetBranchAddress("nearPOT",&npot);
01407   tree->SetBranchAddress("farPOT",&fpot);
01408   tree->SetBranchAddress("Theta12",&Theta12);
01409   tree->SetBranchAddress("Theta13",&Theta13);
01410   tree->SetBranchAddress("Theta23",&Theta23);
01411   tree->SetBranchAddress("DeltaMSq23",&DeltaMSq23);
01412   tree->SetBranchAddress("DeltaMSq12",&DeltaMSq12);
01413   tree->SetBranchAddress("DeltaCP",&DeltaCP);
01414 //   //NSI
01415    tree->SetBranchAddress("Eps_ee",&Eps_ee);
01416    tree->SetBranchAddress("Eps_emu",&Eps_emu);
01417    tree->SetBranchAddress("Eps_etau",&Eps_etau);
01418    tree->SetBranchAddress("Eps_mumu",&Eps_mumu);
01419    tree->SetBranchAddress("Eps_mutau",&Eps_mutau);
01420    tree->SetBranchAddress("Eps_tautau",&Eps_tautau);
01421 // 
01422    tree->SetBranchAddress("Delta_emu",&Delta_emu);
01423    tree->SetBranchAddress("Delta_etau",&Delta_etau);
01424    tree->SetBranchAddress("Delta_mutau",&Delta_mutau);
01425 //   //LSND
01426    tree->SetBranchAddress("Theta14",&Theta14);
01427    tree->SetBranchAddress("Theta24",&Theta24);
01428    tree->SetBranchAddress("Theta34",&Theta34);
01429    tree->SetBranchAddress("Dm41",&Dm41);
01430    tree->SetBranchAddress("Delta14",&Delta14);
01431    tree->SetBranchAddress("Delta24",&Delta24);  
01432   //
01433   
01434    /*
01435   //these parameters not incorporated into extrap file yet
01436   Eps_ee=0;
01437   Eps_emu=0;
01438   Eps_etau=0;
01439   Eps_mumu=0;
01440   Eps_mutau=0;
01441   Eps_tautau=0;
01442   
01443   Delta_emu=0;
01444   Delta_etau=0;
01445   Delta_mutau=0;
01446   
01447   Theta14=0;
01448   Theta24=0;
01449   Theta34=0;
01450   Dm41=0;
01451   Delta14=0;
01452   Delta24=0;
01453 */  
01454 
01455   tree->GetEntry(0);
01456   
01457   SetNearPOT(npot);
01458   SetFarPOT(fpot);
01459   
01460   osc.SetOscParam(OscPar::kTh12,Theta12);
01461   osc.SetOscParam(OscPar::kTh13,Theta13);
01462   osc.SetOscParam(OscPar::kTh23,Theta23);
01463   osc.SetOscParam(OscPar::kDeltaM23,DeltaMSq23);
01464   osc.SetOscParam(OscPar::kDeltaM12,DeltaMSq12);
01465   osc.SetOscParam(OscPar::kDelta,DeltaCP);
01466   //NSI
01467   osc.SetOscParam(OscPar::kEps_ee,Eps_ee);
01468   osc.SetOscParam(OscPar::kEps_emu,Eps_emu);
01469   osc.SetOscParam(OscPar::kEps_etau,Eps_etau);
01470   osc.SetOscParam(OscPar::kEps_mumu,Eps_mumu);
01471   osc.SetOscParam(OscPar::kEps_mutau,Eps_mutau);
01472   osc.SetOscParam(OscPar::kEps_tautau,Eps_tautau);
01473 
01474   osc.SetOscParam(OscPar::kDelta_emu,Delta_emu);
01475   osc.SetOscParam(OscPar::kDelta_etau,Delta_etau);
01476   osc.SetOscParam(OscPar::kDelta_mutau,Delta_mutau);
01477   //LSND
01478   osc.SetOscParam(OscPar::kTh14,Theta14);
01479   osc.SetOscParam(OscPar::kTh24,Theta24);
01480   osc.SetOscParam(OscPar::kTh34,Theta34);
01481   osc.SetOscParam(OscPar::kDm41,Dm41);
01482   osc.SetOscParam(OscPar::kDelta14,Delta14);
01483   osc.SetOscParam(OscPar::kDelta24,Delta24);
01484   //
01485   SetNominalOscProb();
01486   
01487   TH2D *h2;
01488   Background::Background_t bg;
01489   
01490   for(unsigned int i=0;i<FDComponents.size();i++)
01491   {
01492     bg = FDComponents[i];
01493     string st = string(Background::AsString(bg));
01494     
01495     h2 = (TH2D*)f->Get(Form("Pred_%s",st.c_str()));
01496     Pred[bg] = h2;
01497   }
01498   
01499   Pred_3D[qNC] = (TH3D*)f->Get("Pred_3D_NC");
01500   Pred_3D[qNuMuToNuMu] = (TH3D*)f->Get("Pred_3D_NuMuToNuMu");
01501   Pred_3D[qBNueToNuMu] = (TH3D*)f->Get("Pred_3D_BNueToNuMu");
01502   Pred_3D[qBNueToBNue] = (TH3D*)f->Get("Pred_3D_BNueToBNue");
01503   Pred_3D[qNuMuToNue] = (TH3D*)f->Get("Pred_3D_NuMuToNue");
01504   Pred_3D[qNuMuToNuTau] = (TH3D*)f->Get("Pred_3D_NuMuToNuTau");
01505   Pred_3D[qBNueToNuTau] = (TH3D*)f->Get("Pred_3D_BNueToNuTau");
01506   
01507   if(f->Read("Pred_Nu_3D_NC")!=0)
01508   {
01509     UseSeparateNuNuBar=true;
01510   }
01511   else
01512   {
01513     cout<<"Warning: Pred_Nu_3D or Pred_NuBar_3D histograms not found in input file, so nus and nubars will be combined."<<endl;
01514   }
01515   
01516   if(UseSeparateNuNuBar)
01517   {
01518     Pred_Nu_3D[qNC] = (TH3D*)f->Get("Pred_Nu_3D_NC");
01519     Pred_Nu_3D[qNuMuToNuMu] = (TH3D*)f->Get("Pred_Nu_3D_NuMuToNuMu");
01520     Pred_Nu_3D[qBNueToNuMu] = (TH3D*)f->Get("Pred_Nu_3D_BNueToNuMu");
01521     Pred_Nu_3D[qBNueToBNue] = (TH3D*)f->Get("Pred_Nu_3D_BNueToBNue");
01522     Pred_Nu_3D[qNuMuToNue] = (TH3D*)f->Get("Pred_Nu_3D_NuMuToNue");
01523     Pred_Nu_3D[qNuMuToNuTau] = (TH3D*)f->Get("Pred_Nu_3D_NuMuToNuTau");
01524     Pred_Nu_3D[qBNueToNuTau] = (TH3D*)f->Get("Pred_Nu_3D_BNueToNuTau");
01525     
01526     Pred_NuBar_3D[qNC] = (TH3D*)f->Get("Pred_NuBar_3D_NC");
01527     Pred_NuBar_3D[qNuMuToNuMu] = (TH3D*)f->Get("Pred_NuBar_3D_NuMuToNuMu");
01528     Pred_NuBar_3D[qBNueToNuMu] = (TH3D*)f->Get("Pred_NuBar_3D_BNueToNuMu");
01529     Pred_NuBar_3D[qBNueToBNue] = (TH3D*)f->Get("Pred_NuBar_3D_BNueToBNue");
01530     Pred_NuBar_3D[qNuMuToNue] = (TH3D*)f->Get("Pred_NuBar_3D_NuMuToNue");
01531     Pred_NuBar_3D[qNuMuToNuTau] = (TH3D*)f->Get("Pred_NuBar_3D_NuMuToNuTau");
01532     Pred_NuBar_3D[qBNueToNuTau] = (TH3D*)f->Get("Pred_NuBar_3D_BNueToNuTau");
01533   }
01534   
01535   FNRatio[Background::kNC] = (TH2D*)f->Get("FNRatio_NC");
01536   FNRatio[Background::kNuMuCC] = (TH2D*)f->Get("FNRatio_NuMuCC");
01537   FNRatio[Background::kBNueCC] = (TH2D*)f->Get("FNRatio_BNueCC");
01538   
01539   Pred_TotalBkgd = (TH2D*)f->Get("Pred_TotalBkgd");
01540   if(UseSeparateNuNuBar)
01541   {
01542     Pred_NueCCSignal = (TH2D*)f->Get("Pred_NueCCSignal");
01543     Pred_NueBarCCSignal = (TH2D*)f->Get("Pred_NueBarCCSignal");
01544   }
01545   
01546   Pred_CC_Fid = (TH1D*)f->Get("Pred_CC_Fid");
01547   if(UseSeparateNuNuBar)
01548   {
01549     Pred_NuMuCC_Fid = (TH1D*)f->Get("Pred_NuMuCC_Fid");
01550     Pred_NuMuBarCC_Fid = (TH1D*)f->Get("Pred_NuMuBarCC_Fid");
01551   }
01552   
01553   NDData[Background::kNC] = (TH2D*)f->Get(Form("NDData_NC_%s_Run%i",PID_NDData.c_str(),RunPeriod));
01554   NDData[Background::kNuMuCC] = (TH2D*)f->Get(Form("NDData_NuMuCC_%s_Run%i",PID_NDData.c_str(),RunPeriod));
01555   NDData[Background::kBNueCC] = (TH2D*)f->Get(Form("NDData_BNueCC_%s_Run%i",PID_NDData.c_str(),RunPeriod));
01556   NDData_Reco_CClike = (TH1D*)f->Get("Reco_CClike");
01557   if(UseSeparateNuNuBar)
01558   {
01559     NDData_Reco_CClike_Neg = (TH1D*)f->Get("Reco_CClike_Neg");
01560     NDData_Reco_CClike_Pos = (TH1D*)f->Get("Reco_CClike_Pos");
01561   }
01562   
01563   Int_t j;
01564   Int_t np = Pred_3D[qNC]->GetNbinsX();
01565   Int_t nr = Pred_3D[qNC]->GetNbinsY();
01566   Int_t nt = Pred_3D[qNC]->GetNbinsZ();
01567   double *p = new double[np+1];
01568   double *r = new double[nr+1];
01569   double *t = new double[nt+1];
01570   for(j=0;j<np+1;j++)
01571   {
01572     p[j] = Pred_3D[qNC]->GetXaxis()->GetBinLowEdge(j+1);
01573   }
01574   for(j=0;j<nr+1;j++)
01575   {
01576     r[j] = Pred_3D[qNC]->GetYaxis()->GetBinLowEdge(j+1);
01577   }
01578   for(j=0;j<nt+1;j++)
01579   {
01580     t[j] = Pred_3D[qNC]->GetZaxis()->GetBinLowEdge(j+1);
01581   }
01582   SetPIDBins(np,p);
01583   SetRecoBins(nr,r);
01584   SetTrueBins(nt,t);
01585   
01586   int totbin = nReco*nPID;
01587   Pred_TotalBkgd_VsBinNumber = new TH1D("Pred_TotalBkgd_VsBinNumber","",totbin,-0.5,totbin-0.5);
01588   Pred_Signal_VsBinNumber = new TH1D("Pred_Signal_VsBinNumber","",totbin,-0.5,totbin-0.5);
01589   Set1DPredHists();
01590   
01591   FD_TrueVsRecoVsPID_NC_NueFrac = (TH3D*)f->Get(Form("FD_TrueVsRecoVs%s_NC_NueFrac",PID.c_str()));
01592   FD_TrueVsRecoVsPID_NC_NueBarFrac = (TH3D*)f->Get(Form("FD_TrueVsRecoVs%s_NC_NueBarFrac",PID.c_str()));
01593   FD_TrueVsRecoVsPID_NC_NuMuFrac = (TH3D*)f->Get(Form("FD_TrueVsRecoVs%s_NC_NuMuFrac",PID.c_str()));
01594   FD_TrueVsRecoVsPID_NC_NuMuBarFrac = (TH3D*)f->Get(Form("FD_TrueVsRecoVs%s_NC_NuMuBarFrac",PID.c_str()));
01595   
01596   if(PrintResult)
01597   {
01598     cout.precision(4);
01599     cout<<fixed;
01600     cout<<"sin^2(2Th13) = "<<TMath::Sin(2.*osc.GetOscParam(OscPar::kTh13))*TMath::Sin(2.*osc.GetOscParam(OscPar::kTh13))<<endl;
01601     cout<<"NC: "<<Pred[Background::kNC]->Integral()<<endl;
01602     cout<<"NuMuCC: "<<Pred[Background::kNuMuCC]->Integral()<<endl;
01603     cout<<"BNueCC: "<<Pred[Background::kBNueCC]->Integral()<<endl;
01604     cout<<"NuTauCC: "<<Pred[Background::kNuTauCC]->Integral()<<endl;
01605     cout<<"Total: "<<Pred_TotalBkgd->Integral()<<endl;
01606     cout<<"NueCC: "<<Pred[Background::kNueCC]->Integral()<<endl;
01607   }
01608   
01609   delete [] p;
01610   delete [] r;
01611   delete [] t;
01612   
01613   return;
01614 }

void Extrapolate2D::ReadFiles (  )  [protected, virtual]

Reimplemented in Extrapolate2D_Simple.

Definition at line 1366 of file Extrapolate2D.cxx.

References ReadFNFile(), ReadMREFile(), ReadNDDataFile(), and ReadXSecFile().

Referenced by GetPrediction().

01367 {
01368   ReadNDDataFile();
01369   cout << "ND Data File" << endl;
01370   ReadMREFile();
01371   cout << "MRE Data File" << endl;
01372   ReadFNFile();
01373   cout << "FN File" << endl;
01374   ReadXSecFile();
01375   cout << "Xsec File" << endl;
01376   
01377   return;
01378 }

void Extrapolate2D::ReadFNFile (  )  [protected, virtual]

Reimplemented in Extrapolate2D_Simple.

Definition at line 524 of file Extrapolate2D.cxx.

References Delta14, Delta24, Delta_emu, Delta_etau, Delta_mutau, DeltaCP, DeltaMSq12, DeltaMSq23, Dm41, Eps_ee, Eps_emu, Eps_etau, Eps_mumu, Eps_mutau, Eps_tautau, FD_Eff, FD_Eff_CC, FD_Eff_NuBar, FD_Eff_NuMuBarCC_Pos, FD_Eff_NuMuCC_Neg, FD_Nu_TrueVsRecoVsPID, FD_NuBar_TrueVsRecoVsPID, FD_Purity_CC, FD_Purity_NuMuBarCC_Pos, FD_Purity_NuMuCC_Neg, FD_Reco2True_CClike, FD_Reco2True_CClike_Neg, FD_Reco2True_CClike_Pos, FD_Reco_CClike, FD_Reco_CClike_Neg, FD_Reco_CClike_Pos, FD_True2Reco_Fid, FD_True2Reco_NuBar_Fid, FD_True_Fid_NueBarCC, FD_True_Fid_NueCC, FD_True_Fid_NuTauBarCC, FD_True_Fid_NuTauCC, FD_TrueVsReco_CClike, FD_TrueVsReco_CClike_Neg, FD_TrueVsReco_CClike_Neg_NuMuCC, FD_TrueVsReco_CClike_NuMuCC, FD_TrueVsReco_CClike_Pos, FD_TrueVsReco_CClike_Pos_NuMuBarCC, FD_TrueVsReco_Fid, FD_TrueVsReco_Fid_NueBarCC, FD_TrueVsReco_Fid_NueCC, FD_TrueVsReco_Fid_NuMuBarCC, FD_TrueVsReco_Fid_NuMuCC, FD_TrueVsReco_Fid_NuTauBarCC, FD_TrueVsReco_Fid_NuTauCC, FD_TrueVsRecoVsPID, FD_TrueVsRecoVsPID_NC_NueBarFrac, FD_TrueVsRecoVsPID_NC_NueFrac, FD_TrueVsRecoVsPID_NC_NuMuBarFrac, FD_TrueVsRecoVsPID_NC_NuMuFrac, FDMC, FN_infile, FNRatio, Form(), gSystem(), it, Background::kBNueCC, OscPar::kDelta, OscPar::kDelta14, OscPar::kDelta24, OscPar::kDelta_emu, OscPar::kDelta_etau, OscPar::kDelta_mutau, OscPar::kDeltaM12, OscPar::kDeltaM23, OscPar::kDm41, OscPar::kEps_ee, OscPar::kEps_emu, OscPar::kEps_etau, OscPar::kEps_mumu, OscPar::kEps_mutau, OscPar::kEps_tautau, Background::kNC, Background::kNueCC, Background::kNuMuCC, Background::kNuTauCC, OscPar::kTh12, OscPar::kTh13, OscPar::kTh14, OscPar::kTh23, OscPar::kTh24, OscPar::kTh34, MREEffRatio, ND_DataOverMC_RecoVsPID, ND_Reco_CClike, ND_Reco_CClike_Neg, ND_Reco_CClike_Pos, ND_TrueVsReco_CClike, ND_TrueVsReco_CClike_Neg, ND_TrueVsReco_CClike_Neg_NuMuCC, ND_TrueVsReco_CClike_NuMuCC, ND_TrueVsReco_CClike_Pos, ND_TrueVsReco_CClike_Pos_NuMuBarCC, ND_TrueVsReco_Fid, ND_TrueVsReco_Fid_NuMuBarCC, ND_TrueVsReco_Fid_NuMuCC, ND_TrueVsRecoVsPID, NDData, NDData_Reco_CClike, NDData_Reco_CClike_Neg, NDData_Reco_CClike_Pos, NDMC, nPID, nPOTFar, nPOTNear, nReco, nRecoCC, nTrue, osc, OscMethod, PID, PIDEdges, qBNueToBNue, qBNueToNuMu, qBNueToNuTau, qNC, qNuMuToNue, qNuMuToNuMu, qNuMuToNuTau, ReadError, ReadMREFromFile, RebinE, RebinInputHists(), RebinP, RecoCCEdges, RecoEdges, SetNominalOscProb(), OscCalc::SetOscParam(), Theta12, Theta13, Theta14, Theta23, Theta24, Theta34, TrueEdges, and UseSeparateNuNuBar.

Referenced by ReadFiles().

00525 {
00526   if(ReadError) return;
00527   
00528   FD_TrueVsRecoVsPID.clear();
00529   ND_DataOverMC_RecoVsPID.clear();
00530   FD_True2Reco_Fid.clear();
00531   FD_True2Reco_NuBar_Fid.clear();
00532   FD_Eff.clear();
00533   FD_Eff_NuBar.clear();
00534   FNRatio.clear();
00535   NDMC.clear();
00536   FDMC.clear();
00537   
00538   if(gSystem->AccessPathName(gSystem->ExpandPathName(FN_infile.c_str())))
00539   {
00540     cout<<"Failure to read F/N file."<<endl;
00541     ReadError = true;
00542     return;
00543   }
00544   
00545   TFile *f = new TFile(gSystem->ExpandPathName(FN_infile.c_str()),"READ");
00546   
00547   double np,fp;
00548   TTree *tree = (TTree*)f->Get("paramtree");
00549   tree->SetBranchAddress("nearPOT",&np);
00550   tree->SetBranchAddress("farPOT",&fp);
00551   tree->SetBranchAddress("Theta12",&Theta12);
00552   tree->SetBranchAddress("Theta13",&Theta13);
00553   tree->SetBranchAddress("Theta23",&Theta23);
00554   tree->SetBranchAddress("DeltaMSq23",&DeltaMSq23);
00555   tree->SetBranchAddress("DeltaMSq12",&DeltaMSq12);
00556   tree->SetBranchAddress("DeltaCP",&DeltaCP);
00557 //   //NSI
00558    tree->SetBranchAddress("Eps_ee",&Eps_ee);
00559    tree->SetBranchAddress("Eps_emu",&Eps_emu);
00560    tree->SetBranchAddress("Eps_etau",&Eps_etau);
00561    tree->SetBranchAddress("Eps_mumu",&Eps_mumu);
00562    tree->SetBranchAddress("Eps_mutau",&Eps_mutau);
00563    tree->SetBranchAddress("Eps_tautau",&Eps_tautau);
00564 // 
00565    tree->SetBranchAddress("Delta_emu",&Delta_emu);
00566    tree->SetBranchAddress("Delta_etau",&Delta_etau);
00567    tree->SetBranchAddress("Delta_mutau",&Delta_mutau);
00568 //   //LSND
00569    tree->SetBranchAddress("Theta14",&Theta14);
00570    tree->SetBranchAddress("Theta24",&Theta24);
00571    tree->SetBranchAddress("Theta34",&Theta34);
00572    tree->SetBranchAddress("Dm41",&Dm41);
00573    tree->SetBranchAddress("Delta14",&Delta14);
00574    tree->SetBranchAddress("Delta24",&Delta24);   
00575    //
00576   
00577   //these parameters not incorporated into extrap file yet
00578   Eps_ee=0;
00579   Eps_emu=0;
00580   Eps_etau=0;
00581   Eps_mumu=0;
00582   Eps_mutau=0;
00583   Eps_tautau=0;
00584   
00585   Delta_emu=0;
00586   Delta_etau=0;
00587   Delta_mutau=0;
00588   
00589   Theta14=0;
00590   Theta24=0;
00591   Theta34=0;
00592   Dm41=0;
00593   Delta14=0;
00594   Delta24=0;
00595   
00596   tree->GetEntry(0);
00597   
00598   osc.SetOscParam(OscPar::kTh12,Theta12);
00599   osc.SetOscParam(OscPar::kTh13,Theta13);
00600   osc.SetOscParam(OscPar::kTh23,Theta23);
00601   osc.SetOscParam(OscPar::kDeltaM23,DeltaMSq23);
00602   osc.SetOscParam(OscPar::kDeltaM12,DeltaMSq12);
00603   osc.SetOscParam(OscPar::kDelta,DeltaCP);
00604   //NSI
00605   osc.SetOscParam(OscPar::kEps_ee,Eps_ee);
00606   osc.SetOscParam(OscPar::kEps_emu,Eps_emu);
00607   osc.SetOscParam(OscPar::kEps_etau,Eps_etau);
00608   osc.SetOscParam(OscPar::kEps_mumu,Eps_mumu);
00609   osc.SetOscParam(OscPar::kEps_mutau,Eps_mutau);
00610   osc.SetOscParam(OscPar::kEps_tautau,Eps_tautau);
00611 
00612   osc.SetOscParam(OscPar::kDelta_emu,Delta_emu);
00613   osc.SetOscParam(OscPar::kDelta_etau,Delta_etau);
00614   osc.SetOscParam(OscPar::kDelta_mutau,Delta_mutau);
00615   //LSND
00616   osc.SetOscParam(OscPar::kTh14,Theta14);
00617   osc.SetOscParam(OscPar::kTh24,Theta24);
00618   osc.SetOscParam(OscPar::kTh34,Theta34);
00619   osc.SetOscParam(OscPar::kDm41,Dm41);
00620   osc.SetOscParam(OscPar::kDelta14,Delta14);
00621   osc.SetOscParam(OscPar::kDelta24,Delta24);
00622   //
00623   SetNominalOscProb();
00624   
00625   //total
00626   FD_TrueVsRecoVsPID[qNC] = (TH3D*)f->Get(Form("FDMC/TrueVsRecoVs%s_NC",PID.c_str()));
00627   FD_TrueVsRecoVsPID[qNuMuToNuMu] = (TH3D*)f->Get(Form("FDMC/TrueVsRecoVs%s_NuMuToNuMu",PID.c_str()));
00628   FD_TrueVsRecoVsPID[qBNueToNuMu] = (TH3D*)f->Get(Form("FDMC/TrueVsRecoVs%s_BNueToNuMu",PID.c_str()));
00629   FD_TrueVsRecoVsPID[qBNueToBNue] = (TH3D*)f->Get(Form("FDMC/TrueVsRecoVs%s_BNueToBNue",PID.c_str()));
00630   FD_TrueVsRecoVsPID[qNuMuToNue] = (TH3D*)f->Get(Form("FDMC/TrueVsRecoVs%s_NuMuToNue",PID.c_str()));
00631   FD_TrueVsRecoVsPID[qNuMuToNuTau] = (TH3D*)f->Get(Form("FDMC/TrueVsRecoVs%s_NuMuToNuTau",PID.c_str()));
00632   FD_TrueVsRecoVsPID[qBNueToNuTau] = (TH3D*)f->Get(Form("FDMC/TrueVsRecoVs%s_BNueToNuTau",PID.c_str()));
00633   
00634   FD_TrueVsRecoVsPID[qNC]->SetName(Form("FD_TrueVsRecoVs%s_NC",PID.c_str()));
00635   FD_TrueVsRecoVsPID[qNuMuToNuMu]->SetName(Form("FD_TrueVsRecoVs%s_NuMuToNuMu",PID.c_str()));
00636   FD_TrueVsRecoVsPID[qBNueToNuMu]->SetName(Form("FD_TrueVsRecoVs%s_BNueToNuMu",PID.c_str()));
00637   FD_TrueVsRecoVsPID[qBNueToBNue]->SetName(Form("FD_TrueVsRecoVs%s_BNueToBNue",PID.c_str()));
00638   FD_TrueVsRecoVsPID[qNuMuToNue]->SetName(Form("FD_TrueVsRecoVs%s_NuMuToNue",PID.c_str()));
00639   FD_TrueVsRecoVsPID[qNuMuToNuTau]->SetName(Form("FD_TrueVsRecoVs%s_NuMuToNuTau",PID.c_str()));
00640   FD_TrueVsRecoVsPID[qBNueToNuTau]->SetName(Form("FD_TrueVsRecoVs%s_BNueToNuTau",PID.c_str()));
00641 
00642   if( OscMethod == 3){
00643   FD_TrueVsRecoVsPID_NC_NueFrac = (TH3D*)f->Get(Form("FDMC/TrueVsRecoVs%s_NC_NoOscNue",PID.c_str()));
00644   FD_TrueVsRecoVsPID_NC_NueBarFrac = (TH3D*)f->Get(Form("FDMC/TrueVsRecoVs%s_NC_NoOscNueBar",PID.c_str()));
00645   FD_TrueVsRecoVsPID_NC_NuMuFrac = (TH3D*)f->Get(Form("FDMC/TrueVsRecoVs%s_NC_NoOscNuMu",PID.c_str()));
00646   FD_TrueVsRecoVsPID_NC_NuMuBarFrac = (TH3D*)f->Get(Form("FDMC/TrueVsRecoVs%s_NC_NoOscNuMuBar",PID.c_str()));
00647   
00648   FD_TrueVsRecoVsPID_NC_NueFrac->SetName(Form("FD_TrueVsRecoVs%s_NC_NueFrac",PID.c_str()));
00649   FD_TrueVsRecoVsPID_NC_NueBarFrac->SetName(Form("FD_TrueVsRecoVs%s_NC_NueBarFrac",PID.c_str()));
00650   FD_TrueVsRecoVsPID_NC_NuMuFrac->SetName(Form("FD_TrueVsRecoVs%s_NC_NuMuFrac",PID.c_str()));
00651   FD_TrueVsRecoVsPID_NC_NuMuBarFrac->SetName(Form("FD_TrueVsRecoVs%s_NC_NuMuBarFrac",PID.c_str()));
00652   }
00653 
00654   if(f->Read("FDMC_Nu")!=0 && f->Read("FDMC_NuBar")!=0)//if these directories exists, then we can do separate nu and nubars
00655   {
00656     UseSeparateNuNuBar = true;
00657   }
00658   else
00659   {
00660     cout<<"Warning: FDMC_Nu and FDMC_NuBar directories not found, so nus and nubars will be combined."<<endl;
00661   }
00662   
00663   if(UseSeparateNuNuBar)
00664   {
00665     //nu only
00666     FD_Nu_TrueVsRecoVsPID[qNC] = (TH3D*)f->Get(Form("FDMC_Nu/TrueVsRecoVs%s_NC",PID.c_str()));
00667     FD_Nu_TrueVsRecoVsPID[qNuMuToNuMu] = (TH3D*)f->Get(Form("FDMC_Nu/TrueVsRecoVs%s_NuMuToNuMu",PID.c_str()));
00668     FD_Nu_TrueVsRecoVsPID[qBNueToNuMu] = (TH3D*)f->Get(Form("FDMC_Nu/TrueVsRecoVs%s_BNueToNuMu",PID.c_str()));
00669     FD_Nu_TrueVsRecoVsPID[qBNueToBNue] = (TH3D*)f->Get(Form("FDMC_Nu/TrueVsRecoVs%s_BNueToBNue",PID.c_str()));
00670     FD_Nu_TrueVsRecoVsPID[qNuMuToNue] = (TH3D*)f->Get(Form("FDMC_Nu/TrueVsRecoVs%s_NuMuToNue",PID.c_str()));
00671     FD_Nu_TrueVsRecoVsPID[qNuMuToNuTau] = (TH3D*)f->Get(Form("FDMC_Nu/TrueVsRecoVs%s_NuMuToNuTau",PID.c_str()));
00672     FD_Nu_TrueVsRecoVsPID[qBNueToNuTau] = (TH3D*)f->Get(Form("FDMC_Nu/TrueVsRecoVs%s_BNueToNuTau",PID.c_str()));
00673     
00674     FD_Nu_TrueVsRecoVsPID[qNC]->SetName(Form("FD_Nu_TrueVsRecoVs%s_NC",PID.c_str()));
00675     FD_Nu_TrueVsRecoVsPID[qNuMuToNuMu]->SetName(Form("FD_Nu_TrueVsRecoVs%s_NuMuToNuMu",PID.c_str()));
00676     FD_Nu_TrueVsRecoVsPID[qBNueToNuMu]->SetName(Form("FD_Nu_TrueVsRecoVs%s_BNueToNuMu",PID.c_str()));
00677     FD_Nu_TrueVsRecoVsPID[qBNueToBNue]->SetName(Form("FD_Nu_TrueVsRecoVs%s_BNueToBNue",PID.c_str()));
00678     FD_Nu_TrueVsRecoVsPID[qNuMuToNue]->SetName(Form("FD_Nu_TrueVsRecoVs%s_NuMuToNue",PID.c_str()));
00679     FD_Nu_TrueVsRecoVsPID[qNuMuToNuTau]->SetName(Form("FD_Nu_TrueVsRecoVs%s_NuMuToNuTau",PID.c_str()));
00680     FD_Nu_TrueVsRecoVsPID[qBNueToNuTau]->SetName(Form("FD_Nu_TrueVsRecoVs%s_BNueToNuTau",PID.c_str()));
00681     
00682     //nubar only
00683     FD_NuBar_TrueVsRecoVsPID[qNC] = (TH3D*)f->Get(Form("FDMC_NuBar/TrueVsRecoVs%s_NC",PID.c_str()));
00684     FD_NuBar_TrueVsRecoVsPID[qNuMuToNuMu] = (TH3D*)f->Get(Form("FDMC_NuBar/TrueVsRecoVs%s_NuMuToNuMu",PID.c_str()));
00685     FD_NuBar_TrueVsRecoVsPID[qBNueToNuMu] = (TH3D*)f->Get(Form("FDMC_NuBar/TrueVsRecoVs%s_BNueToNuMu",PID.c_str()));
00686     FD_NuBar_TrueVsRecoVsPID[qBNueToBNue] = (TH3D*)f->Get(Form("FDMC_NuBar/TrueVsRecoVs%s_BNueToBNue",PID.c_str()));
00687     FD_NuBar_TrueVsRecoVsPID[qNuMuToNue] = (TH3D*)f->Get(Form("FDMC_NuBar/TrueVsRecoVs%s_NuMuToNue",PID.c_str()));
00688     FD_NuBar_TrueVsRecoVsPID[qNuMuToNuTau] = (TH3D*)f->Get(Form("FDMC_NuBar/TrueVsRecoVs%s_NuMuToNuTau",PID.c_str()));
00689     FD_NuBar_TrueVsRecoVsPID[qBNueToNuTau] = (TH3D*)f->Get(Form("FDMC_NuBar/TrueVsRecoVs%s_BNueToNuTau",PID.c_str()));
00690     
00691     FD_NuBar_TrueVsRecoVsPID[qNC]->SetName(Form("FD_NuBar_TrueVsRecoVs%s_NC",PID.c_str()));
00692     FD_NuBar_TrueVsRecoVsPID[qNuMuToNuMu]->SetName(Form("FD_NuBar_TrueVsRecoVs%s_NuMuToNuMu",PID.c_str()));
00693     FD_NuBar_TrueVsRecoVsPID[qBNueToNuMu]->SetName(Form("FD_NuBar_TrueVsRecoVs%s_BNueToNuMu",PID.c_str()));
00694     FD_NuBar_TrueVsRecoVsPID[qBNueToBNue]->SetName(Form("FD_NuBar_TrueVsRecoVs%s_BNueToBNue",PID.c_str()));
00695     FD_NuBar_TrueVsRecoVsPID[qNuMuToNue]->SetName(Form("FD_NuBar_TrueVsRecoVs%s_NuMuToNue",PID.c_str()));
00696     FD_NuBar_TrueVsRecoVsPID[qNuMuToNuTau]->SetName(Form("FD_NuBar_TrueVsRecoVs%s_NuMuToNuTau",PID.c_str()));
00697     FD_NuBar_TrueVsRecoVsPID[qBNueToNuTau]->SetName(Form("FD_NuBar_TrueVsRecoVs%s_BNueToNuTau",PID.c_str()));
00698   }
00699   
00700   FD_TrueVsReco_Fid = (TH2D*)f->Get("FDMC/TrueVsReco_Fid");
00701   FD_TrueVsReco_Fid_NuMuCC = (TH2D*)f->Get("FDMC/TrueVsReco_Fid_NuMuCC");
00702   FD_TrueVsReco_CClike = (TH2D*)f->Get("FDMC/TrueVsReco_CClike");
00703   FD_TrueVsReco_CClike_NuMuCC = (TH2D*)f->Get("FDMC/TrueVsReco_CClike_NuMuCC");
00704   
00705   FD_TrueVsReco_Fid->SetName("FD_TrueVsReco_Fid");
00706   FD_TrueVsReco_Fid_NuMuCC->SetName("FD_TrueVsReco_Fid_NuMuCC");
00707   FD_TrueVsReco_CClike->SetName("FD_TrueVsReco_CClike");
00708   FD_TrueVsReco_CClike_NuMuCC->SetName("FD_TrueVsReco_CClike_NuMuCC");
00709   
00710   if(UseSeparateNuNuBar)
00711   {
00712     FD_TrueVsReco_Fid_NuMuBarCC = (TH2D*)f->Get("FDMC/TrueVsReco_Fid_NuMuBarCC");
00713     FD_TrueVsReco_CClike_Pos = (TH2D*)f->Get("FDMC/TrueVsReco_CClike_Pos");
00714     FD_TrueVsReco_CClike_Pos_NuMuBarCC = (TH2D*)f->Get("FDMC/TrueVsReco_CClike_Pos_NuMuBarCC");
00715     FD_TrueVsReco_CClike_Neg = (TH2D*)f->Get("FDMC/TrueVsReco_CClike_Neg");
00716     FD_TrueVsReco_CClike_Neg_NuMuCC = (TH2D*)f->Get("FDMC/TrueVsReco_CClike_Neg_NuMuCC");
00717     
00718     FD_TrueVsReco_Fid_NuMuBarCC->SetName("FD_TrueVsReco_Fid_NuMuBarCC");
00719     FD_TrueVsReco_CClike_Pos->SetName("FD_TrueVsReco_CClike_Pos");
00720     FD_TrueVsReco_CClike_Pos_NuMuBarCC->SetName("FD_TrueVsReco_CClike_Pos_NuMuBarCC");
00721     FD_TrueVsReco_CClike_Neg->SetName("FD_TrueVsReco_CClike_Neg");
00722     FD_TrueVsReco_CClike_Neg_NuMuCC->SetName("FD_TrueVsReco_CClike_Neg_NuMuCC");
00723   }
00724   
00725   FD_TrueVsReco_Fid_NueCC = (TH2D*)f->Get("FDMC/TrueVsReco_Fid_NueCC");
00726   FD_TrueVsReco_Fid_NuTauCC = (TH2D*)f->Get("FDMC/TrueVsReco_Fid_NuTauCC");
00727   FD_True_Fid_NueCC = (TH1D*)f->Get("FDMC/True_Fid_NueCC");
00728   FD_True_Fid_NuTauCC = (TH1D*)f->Get("FDMC/True_Fid_NuTauCC");
00729   
00730   if(UseSeparateNuNuBar)
00731   {
00732     FD_TrueVsReco_Fid_NueBarCC = (TH2D*)f->Get("FDMC/TrueVsReco_Fid_NueBarCC");
00733     FD_TrueVsReco_Fid_NuTauBarCC = (TH2D*)f->Get("FDMC/TrueVsReco_Fid_NuTauBarCC");
00734     FD_True_Fid_NueBarCC = (TH1D*)f->Get("FDMC/True_Fid_NueBarCC");
00735     FD_True_Fid_NuTauBarCC = (TH1D*)f->Get("FDMC/True_Fid_NuTauBarCC");
00736   }
00737   
00738   ND_TrueVsRecoVsPID[qNC] = (TH3D*)f->Get(Form("NDMC/TrueVsRecoVs%s_NC",PID.c_str()));
00739   ND_TrueVsRecoVsPID[qNuMuToNuMu] = (TH3D*)f->Get(Form("NDMC/TrueVsRecoVs%s_NuMuToNuMu",PID.c_str()));
00740   ND_TrueVsRecoVsPID[qBNueToBNue] = (TH3D*)f->Get(Form("NDMC/TrueVsRecoVs%s_BNueToBNue",PID.c_str()));
00741   
00742   ND_TrueVsRecoVsPID[qNC]->SetName(Form("ND_TrueVsRecoVs%s_NC",PID.c_str()));
00743   ND_TrueVsRecoVsPID[qNuMuToNuMu]->SetName(Form("ND_TrueVsRecoVs%s_NuMuToNuMu",PID.c_str()));
00744   ND_TrueVsRecoVsPID[qBNueToBNue]->SetName(Form("ND_TrueVsRecoVs%s_BNueToBNue",PID.c_str()));
00745   
00746   ND_TrueVsReco_Fid = (TH2D*)f->Get("NDMC/TrueVsReco_Fid");
00747   ND_TrueVsReco_Fid_NuMuCC = (TH2D*)f->Get("NDMC/TrueVsReco_Fid_NuMuCC");
00748   ND_TrueVsReco_CClike = (TH2D*)f->Get("NDMC/TrueVsReco_CClike");
00749   ND_TrueVsReco_CClike_NuMuCC = (TH2D*)f->Get("NDMC/TrueVsReco_CClike_NuMuCC");
00750   
00751   ND_TrueVsReco_Fid->SetName("ND_TrueVsReco_Fid");
00752   ND_TrueVsReco_Fid_NuMuCC->SetName("ND_TrueVsReco_Fid_NuMuCC");
00753   ND_TrueVsReco_CClike->SetName("ND_TrueVsReco_CClike");
00754   ND_TrueVsReco_CClike_NuMuCC->SetName("ND_TrueVsReco_CClike_NuMuCC");
00755   
00756   if(UseSeparateNuNuBar)
00757   {
00758     ND_TrueVsReco_Fid_NuMuBarCC = (TH2D*)f->Get("NDMC/TrueVsReco_Fid_NuMuBarCC");
00759     ND_TrueVsReco_CClike_Pos = (TH2D*)f->Get("NDMC/TrueVsReco_CClike_Pos");
00760     ND_TrueVsReco_CClike_Neg = (TH2D*)f->Get("NDMC/TrueVsReco_CClike_Neg");
00761     ND_TrueVsReco_CClike_Pos_NuMuBarCC = (TH2D*)f->Get("NDMC/TrueVsReco_CClike_Pos_NuMuBarCC");
00762     ND_TrueVsReco_CClike_Neg_NuMuCC = (TH2D*)f->Get("NDMC/TrueVsReco_CClike_Neg_NuMuCC");
00763     
00764     ND_TrueVsReco_Fid_NuMuBarCC->SetName("ND_TrueVsReco_Fid_NuMuBarCC");
00765     ND_TrueVsReco_CClike_Pos->SetName("ND_TrueVsReco_CClike_Pos");
00766     ND_TrueVsReco_CClike_Neg->SetName("ND_TrueVsReco_CClike_Neg");
00767     ND_TrueVsReco_CClike_Pos_NuMuBarCC->SetName("ND_TrueVsReco_CClike_Pos_NuMuBarCC");
00768     ND_TrueVsReco_CClike_Neg_NuMuCC->SetName("ND_TrueVsReco_CClike_Neg_NuMuCC");
00769   }
00770   
00771   NDData_Reco_CClike = (TH1D*)f->Get("NDData/Reco_CClike");
00772   if(UseSeparateNuNuBar)
00773   {
00774     NDData_Reco_CClike_Pos = (TH1D*)f->Get("NDData/Reco_CClike_Pos");
00775     NDData_Reco_CClike_Neg = (TH1D*)f->Get("NDData/Reco_CClike_Neg");
00776   }
00777   
00778   FD_TrueVsRecoVsPID[qNC]->Scale(nPOTFar/fp);
00779   FD_TrueVsRecoVsPID[qNuMuToNuMu]->Scale(nPOTFar/fp);
00780   FD_TrueVsRecoVsPID[qBNueToNuMu]->Scale(nPOTFar/fp);
00781   FD_TrueVsRecoVsPID[qBNueToBNue]->Scale(nPOTFar/fp);
00782   FD_TrueVsRecoVsPID[qNuMuToNue]->Scale(nPOTFar/fp);
00783   FD_TrueVsRecoVsPID[qNuMuToNuTau]->Scale(nPOTFar/fp);
00784   FD_TrueVsRecoVsPID[qBNueToNuTau]->Scale(nPOTFar/fp);
00785   
00786   FD_TrueVsReco_Fid->Scale(nPOTFar/fp);
00787   FD_TrueVsReco_Fid_NuMuCC->Scale(nPOTFar/fp);
00788   FD_TrueVsReco_CClike->Scale(nPOTFar/fp);
00789   FD_TrueVsReco_CClike_NuMuCC->Scale(nPOTFar/fp);
00790   
00791   FD_TrueVsReco_Fid_NueCC->Scale(nPOTFar/fp);
00792   FD_TrueVsReco_Fid_NuTauCC->Scale(nPOTFar/fp);
00793   FD_True_Fid_NueCC->Scale(nPOTFar/fp);
00794   FD_True_Fid_NuTauCC->Scale(nPOTFar/fp);
00795   
00796   ND_TrueVsRecoVsPID[qNC]->Scale(nPOTNear/np);
00797   ND_TrueVsRecoVsPID[qNuMuToNuMu]->Scale(nPOTNear/np);
00798   ND_TrueVsRecoVsPID[qBNueToBNue]->Scale(nPOTNear/np);
00799   
00800   ND_TrueVsReco_Fid->Scale(nPOTNear/np);
00801   ND_TrueVsReco_Fid_NuMuCC->Scale(nPOTNear/np);
00802   ND_TrueVsReco_CClike->Scale(nPOTNear/np);
00803   ND_TrueVsReco_CClike_NuMuCC->Scale(nPOTNear/np);
00804   
00805   NDData_Reco_CClike->Scale(nPOTNear/np);
00806   
00807   if(UseSeparateNuNuBar)
00808   {
00809     FD_Nu_TrueVsRecoVsPID[qNC]->Scale(nPOTFar/fp);
00810     FD_Nu_TrueVsRecoVsPID[qNuMuToNuMu]->Scale(nPOTFar/fp);
00811     FD_Nu_TrueVsRecoVsPID[qBNueToNuMu]->Scale(nPOTFar/fp);
00812     FD_Nu_TrueVsRecoVsPID[qBNueToBNue]->Scale(nPOTFar/fp);
00813     FD_Nu_TrueVsRecoVsPID[qNuMuToNue]->Scale(nPOTFar/fp);
00814     FD_Nu_TrueVsRecoVsPID[qNuMuToNuTau]->Scale(nPOTFar/fp);
00815     FD_Nu_TrueVsRecoVsPID[qBNueToNuTau]->Scale(nPOTFar/fp);
00816     
00817     FD_NuBar_TrueVsRecoVsPID[qNC]->Scale(nPOTFar/fp);
00818     FD_NuBar_TrueVsRecoVsPID[qNuMuToNuMu]->Scale(nPOTFar/fp);
00819     FD_NuBar_TrueVsRecoVsPID[qBNueToNuMu]->Scale(nPOTFar/fp);
00820     FD_NuBar_TrueVsRecoVsPID[qBNueToBNue]->Scale(nPOTFar/fp);
00821     FD_NuBar_TrueVsRecoVsPID[qNuMuToNue]->Scale(nPOTFar/fp);
00822     FD_NuBar_TrueVsRecoVsPID[qNuMuToNuTau]->Scale(nPOTFar/fp);
00823     FD_NuBar_TrueVsRecoVsPID[qBNueToNuTau]->Scale(nPOTFar/fp);
00824     
00825     FD_TrueVsReco_Fid_NuMuBarCC->Scale(nPOTFar/fp);
00826     
00827     FD_TrueVsReco_CClike_Pos->Scale(nPOTFar/fp);
00828     FD_TrueVsReco_CClike_Neg->Scale(nPOTFar/fp);
00829     
00830     FD_TrueVsReco_CClike_Pos_NuMuBarCC->Scale(nPOTFar/fp);
00831     FD_TrueVsReco_CClike_Neg_NuMuCC->Scale(nPOTFar/fp);
00832     
00833     FD_TrueVsReco_Fid_NueBarCC->Scale(nPOTFar/fp);
00834     FD_TrueVsReco_Fid_NuTauBarCC->Scale(nPOTFar/fp);
00835     FD_True_Fid_NueBarCC->Scale(nPOTFar/fp);
00836     FD_True_Fid_NuTauBarCC->Scale(nPOTFar/fp);
00837     
00838     ND_TrueVsReco_Fid_NuMuBarCC->Scale(nPOTNear/np);
00839     
00840     ND_TrueVsReco_CClike_Pos->Scale(nPOTNear/np);
00841     ND_TrueVsReco_CClike_Neg->Scale(nPOTNear/np);
00842     
00843     ND_TrueVsReco_CClike_Pos_NuMuBarCC->Scale(nPOTNear/np);
00844     ND_TrueVsReco_CClike_Neg_NuMuCC->Scale(nPOTNear/np);
00845     
00846     NDData_Reco_CClike_Pos->Scale(nPOTNear/np);
00847     NDData_Reco_CClike_Neg->Scale(nPOTNear/np);
00848   }
00849   
00850   double *r = new double[nReco+1];
00851   double *p = new double[nPID+1];
00852   double *t = new double[nTrue+1];
00853   double *rcc = new double[nRecoCC+1];
00854   int i;
00855   for(i=0;i<nReco+1;i++)
00856   {
00857     r[i] = RecoEdges.at(i);
00858   }
00859   for(i=0;i<nPID+1;i++)
00860   {
00861     p[i] = PIDEdges.at(i);
00862   }
00863   for(i=0;i<nTrue+1;i++)
00864   {
00865     t[i] = TrueEdges.at(i);
00866   }
00867   for(i=0;i<nRecoCC+1;i++)
00868   {
00869     rcc[i] = RecoCCEdges.at(i);
00870   }
00871   
00872   if(FD_TrueVsRecoVsPID[qNC]->GetNbinsX()!=nPID)
00873   {
00874     RebinP = true;
00875   }
00876   if(FD_TrueVsRecoVsPID[qNC]->GetNbinsY()!=nReco)
00877   {
00878     RebinE = true;
00879   }
00880   
00881   if(RebinE || RebinP)
00882   {
00883     cout<<"Warning: F/N input hists don't have correct binning. Rebinning them now..."<<endl;
00884     RebinInputHists();
00885     cout<<"Hists rebinned!"<<endl;
00886   }
00887   
00888   if ( OscMethod == 3){
00889   TH3D *NCTotal = (TH3D*)FD_TrueVsRecoVsPID_NC_NueFrac->Clone("NCTotal");
00890   NCTotal->Add(FD_TrueVsRecoVsPID_NC_NueBarFrac);
00891   NCTotal->Add(FD_TrueVsRecoVsPID_NC_NuMuFrac);
00892   NCTotal->Add(FD_TrueVsRecoVsPID_NC_NuMuBarFrac);
00893   
00894   FD_TrueVsRecoVsPID_NC_NueFrac->Divide(NCTotal);
00895   FD_TrueVsRecoVsPID_NC_NueBarFrac->Divide(NCTotal);
00896   FD_TrueVsRecoVsPID_NC_NuMuFrac->Divide(NCTotal);
00897   FD_TrueVsRecoVsPID_NC_NuMuBarFrac->Divide(NCTotal);
00898   }
00899   
00900   int ip,ir,it;
00901   double temp;
00902   
00903   TH2D *h2;
00904   TH1D *h1;
00905   
00906   h2 = (TH2D*)FD_TrueVsRecoVsPID[qNuMuToNuMu]->Project3D("yx");
00907   FDMC[Background::kNuMuCC] = (TH2D*)h2->Clone("FDMC_NuMuCC");
00908   FNRatio[Background::kNuMuCC] = (TH2D*)h2->Clone("FNRatio_NuMuCC");
00909   
00910   h2 = (TH2D*)FD_TrueVsRecoVsPID[qBNueToNuMu]->Project3D("yx");
00911   FDMC[Background::kNuMuCC]->Add(h2);
00912   FNRatio[Background::kNuMuCC]->Add(h2);
00913   
00914   h2 = (TH2D*)FD_TrueVsRecoVsPID[qNC]->Project3D("yx");
00915   FDMC[Background::kNC] = (TH2D*)h2->Clone("FDMC_NC");
00916   FNRatio[Background::kNC] = (TH2D*)h2->Clone("FNRatio_NC");
00917   
00918   h2 = (TH2D*)FD_TrueVsRecoVsPID[qBNueToBNue]->Project3D("yx");
00919   FDMC[Background::kBNueCC] = (TH2D*)h2->Clone("FDMC_BNueCC");
00920   FNRatio[Background::kBNueCC] = (TH2D*)h2->Clone("FNRatio_BNueCC");
00921   
00922   h2 = (TH2D*)ND_TrueVsRecoVsPID[qNuMuToNuMu]->Project3D("yx");
00923   NDMC[Background::kNuMuCC] = (TH2D*)h2->Clone("NDMC_NuMuCC");
00924   FNRatio[Background::kNuMuCC]->Divide(h2);
00925   ND_DataOverMC_RecoVsPID[Background::kNuMuCC] = new TH2D("ND_DataOverMC_RecoVsPID_NuMuCC","",nPID,p,nReco,r);
00926   for(ip=0;ip<nPID;ip++)
00927   {
00928     for(ir=0;ir<nReco;ir++)
00929     {
00930       temp=0;
00931       if(h2->GetBinContent(ip+1,ir+1)>0)
00932       {
00933         temp = NDData[Background::kNuMuCC]->GetBinContent(ip+1,ir+1)/h2->GetBinContent(ip+1,ir+1);
00934       }
00935       ND_DataOverMC_RecoVsPID[Background::kNuMuCC]->SetBinContent(ip+1,ir+1,temp);
00936     }
00937   }
00938   
00939   h2 = (TH2D*)ND_TrueVsRecoVsPID[qNC]->Project3D("yx");
00940   NDMC[Background::kNC] = (TH2D*)h2->Clone("NDMC_NC");
00941   FNRatio[Background::kNC]->Divide(h2);
00942   ND_DataOverMC_RecoVsPID[Background::kNC] = new TH2D("ND_DataOverMC_RecoVsPID_NC","",nPID,p,nReco,r);
00943   for(ip=0;ip<nPID;ip++)
00944   {
00945     for(ir=0;ir<nReco;ir++)
00946     {
00947       temp=0;
00948       if(h2->GetBinContent(ip+1,ir+1)>0)
00949       {
00950         temp = NDData[Background::kNC]->GetBinContent(ip+1,ir+1)/h2->GetBinContent(ip+1,ir+1);
00951       }
00952       ND_DataOverMC_RecoVsPID[Background::kNC]->SetBinContent(ip+1,ir+1,temp);
00953     }
00954   }
00955   
00956   h2 = (TH2D*)ND_TrueVsRecoVsPID[qBNueToBNue]->Project3D("yx");
00957   NDMC[Background::kBNueCC] = (TH2D*)h2->Clone("NDMC_BNueCC");
00958   FNRatio[Background::kBNueCC]->Divide(h2);
00959   ND_DataOverMC_RecoVsPID[Background::kBNueCC] = new TH2D("ND_DataOverMC_RecoVsPID_BNueCC","",nPID,p,nReco,r);
00960   for(ip=0;ip<nPID;ip++)
00961   {
00962     for(ir=0;ir<nReco;ir++)
00963     {
00964       temp=0;
00965       if(h2->GetBinContent(ip+1,ir+1)>0)
00966       {
00967         temp = NDData[Background::kBNueCC]->GetBinContent(ip+1,ir+1)/h2->GetBinContent(ip+1,ir+1);
00968       }
00969       ND_DataOverMC_RecoVsPID[Background::kBNueCC]->SetBinContent(ip+1,ir+1,temp);
00970     }
00971   }
00972   
00973   ND_Reco_CClike = ND_TrueVsReco_CClike->ProjectionX("ND_Reco_CClike");
00974   if(UseSeparateNuNuBar)
00975   {
00976     ND_Reco_CClike_Pos = ND_TrueVsReco_CClike_Pos->ProjectionX("ND_Reco_CClike_Pos");
00977     ND_Reco_CClike_Neg = ND_TrueVsReco_CClike_Neg->ProjectionX("ND_Reco_CClike_Neg");
00978   }
00979   
00980   FD_Reco_CClike = FD_TrueVsReco_CClike->ProjectionX("FD_Reco_CClike");
00981   if(UseSeparateNuNuBar)
00982   {
00983     FD_Reco_CClike_Pos = FD_TrueVsReco_CClike_Pos->ProjectionX("FD_Reco_CClike_Pos");
00984     FD_Reco_CClike_Neg = FD_TrueVsReco_CClike_Neg->ProjectionX("FD_Reco_CClike_Neg");
00985   }
00986   
00987   FD_Reco2True_CClike = new TH2D("FD_Reco2True_CClike","",nRecoCC,rcc,nTrue,t);
00988   if(UseSeparateNuNuBar)
00989   {
00990     FD_Reco2True_CClike_Pos = new TH2D("FD_Reco2True_CClike_Pos","",nRecoCC,rcc,nTrue,t);
00991     FD_Reco2True_CClike_Neg = new TH2D("FD_Reco2True_CClike_Neg","",nRecoCC,rcc,nTrue,t);
00992   }
00993   for(ir=0;ir<nRecoCC;ir++)
00994   {
00995     for(it=0;it<nTrue;it++)
00996     {
00997       temp=0;
00998       if(FD_Reco_CClike->GetBinContent(ir+1)>0)
00999       {
01000         temp = FD_TrueVsReco_CClike->GetBinContent(ir+1,it+1)/FD_Reco_CClike->GetBinContent(ir+1);
01001       }
01002       FD_Reco2True_CClike->SetBinContent(ir+1,it+1,temp);
01003       
01004       if(UseSeparateNuNuBar)
01005       {
01006         temp=0;
01007         if(FD_Reco_CClike_Pos->GetBinContent(ir+1)>0)
01008         {
01009           temp = FD_TrueVsReco_CClike_Pos->GetBinContent(ir+1,it+1)/FD_Reco_CClike_Pos->GetBinContent(ir+1);
01010         }
01011         FD_Reco2True_CClike_Pos->SetBinContent(ir+1,it+1,temp);
01012         
01013         temp=0;
01014         if(FD_Reco_CClike_Neg->GetBinContent(ir+1)>0)
01015         {
01016           temp = FD_TrueVsReco_CClike_Neg->GetBinContent(ir+1,it+1)/FD_Reco_CClike_Neg->GetBinContent(ir+1);
01017         }
01018         FD_Reco2True_CClike_Neg->SetBinContent(ir+1,it+1,temp);
01019       }
01020     }
01021   }
01022   
01023   FD_Purity_CC = new TH1D("FD_Purity_CC","",nTrue,t);
01024   if(UseSeparateNuNuBar)
01025   {
01026     FD_Purity_NuMuCC_Neg = new TH1D("FD_Purity_NuMuCC_Neg","",nTrue,t);
01027     FD_Purity_NuMuBarCC_Pos = new TH1D("FD_Purity_NuMuBarCC_Pos","",nTrue,t);
01028   }
01029   
01030   FD_Eff_CC = new TH1D("FD_Eff_CC","",nTrue,t);
01031   if(UseSeparateNuNuBar)
01032   {
01033     FD_Eff_NuMuCC_Neg = new TH1D("FD_Eff_NuMuCC_Neg","",nTrue,t);
01034     FD_Eff_NuMuBarCC_Pos = new TH1D("FD_Eff_NuMuBarCC_Pos","",nTrue,t);
01035   }
01036   
01037   if(UseSeparateNuNuBar)
01038   {
01039     TH1D *FD_True_CClike_Neg = FD_TrueVsReco_CClike_Neg->ProjectionY("FD_True_CClike_Neg");
01040     TH1D *FD_True_CClike_Neg_NuMuCC = FD_TrueVsReco_CClike_Neg_NuMuCC->ProjectionY("FD_True_CClike_Neg_NuMuCC");
01041     TH1D *FD_True_Fid_NuMuCC = FD_TrueVsReco_Fid_NuMuCC->ProjectionY("FD_True_Fid_NuMuCC");
01042     FD_Purity_NuMuCC_Neg->Divide(FD_True_CClike_Neg_NuMuCC,FD_True_CClike_Neg,1,1);
01043     FD_Eff_NuMuCC_Neg->Divide(FD_True_CClike_Neg_NuMuCC,FD_True_Fid_NuMuCC,1,1);
01044     
01045     TH1D *FD_True_CClike_Pos = FD_TrueVsReco_CClike_Pos->ProjectionY("FD_True_CClike_Pos");
01046     TH1D *FD_True_CClike_Pos_NuMuBarCC = FD_TrueVsReco_CClike_Pos_NuMuBarCC->ProjectionY("FD_True_CClike_Pos_NuMuBarCC");
01047     TH1D *FD_True_Fid_NuMuBarCC = FD_TrueVsReco_Fid_NuMuBarCC->ProjectionY("FD_True_Fid_NuMuBarCC");
01048     FD_Purity_NuMuBarCC_Pos->Divide(FD_True_CClike_Pos_NuMuBarCC,FD_True_CClike_Pos,1,1);
01049     FD_Eff_NuMuBarCC_Pos->Divide(FD_True_CClike_Pos_NuMuBarCC,FD_True_Fid_NuMuBarCC,1,1);
01050   }
01051   else
01052   {
01053     TH1D *FD_True_CClike = FD_TrueVsReco_CClike->ProjectionY("FD_True_CClike");
01054     TH1D *FD_True_CClike_NuMuCC = FD_TrueVsReco_CClike_NuMuCC->ProjectionY("FD_True_CClike_NuMuCC");
01055     TH1D *FD_True_Fid_NuMuCC = FD_TrueVsReco_Fid_NuMuCC->ProjectionY("FD_True_Fid_NuMuCC");
01056     FD_Purity_CC->Divide(FD_True_CClike_NuMuCC,FD_True_CClike,1,1);
01057     FD_Eff_CC->Divide(FD_True_CClike_NuMuCC,FD_True_Fid_NuMuCC,1,1);
01058   }
01059   
01060   FD_True2Reco_Fid[Background::kNueCC] = new TH2D("FD_True2Reco_Fid_NueCC","",nReco,r,nTrue,t);
01061   for(it=0;it<nTrue;it++)
01062   {
01063     for(ir=0;ir<nReco;ir++)
01064     {
01065       temp=0;
01066       if(FD_True_Fid_NueCC->GetBinContent(it+1)>0)
01067       {
01068         temp = FD_TrueVsReco_Fid_NueCC->GetBinContent(ir+1,it+1)/FD_True_Fid_NueCC->GetBinContent(it+1);
01069       }
01070       FD_True2Reco_Fid[Background::kNueCC]->SetBinContent(ir+1,it+1,temp);
01071     }
01072   }
01073   
01074   FD_True2Reco_Fid[Background::kNuTauCC] = new TH2D("FD_True2Reco_Fid_NuTauCC","",nReco,r,nTrue,t);
01075   for(it=0;it<nTrue;it++)
01076   {
01077     for(ir=0;ir<nReco;ir++)
01078     {
01079       temp=0;
01080       if(FD_True_Fid_NuTauCC->GetBinContent(it+1)>0)
01081       {
01082         temp = FD_TrueVsReco_Fid_NuTauCC->GetBinContent(ir+1,it+1)/FD_True_Fid_NuTauCC->GetBinContent(it+1);
01083       }
01084       FD_True2Reco_Fid[Background::kNuTauCC]->SetBinContent(ir+1,it+1,temp);
01085     }
01086   }
01087   
01088   if(UseSeparateNuNuBar)
01089   {
01090     FD_True2Reco_NuBar_Fid[Background::kNueCC] = new TH2D("FD_True2Reco_Fid_NueBarCC","",nReco,r,nTrue,t);
01091     for(it=0;it<nTrue;it++)
01092     {
01093       for(ir=0;ir<nReco;ir++)
01094       {
01095         temp=0;
01096         if(FD_True_Fid_NueBarCC->GetBinContent(it+1)>0)
01097         {
01098           temp = FD_TrueVsReco_Fid_NueBarCC->GetBinContent(ir+1,it+1)/FD_True_Fid_NueBarCC->GetBinContent(it+1);
01099         }
01100         FD_True2Reco_NuBar_Fid[Background::kNueCC]->SetBinContent(ir+1,it+1,temp);
01101       }
01102     }
01103       
01104     FD_True2Reco_NuBar_Fid[Background::kNuTauCC] = new TH2D("FD_True2Reco_Fid_NuTauBarCC","",nReco,r,nTrue,t);
01105     for(it=0;it<nTrue;it++)
01106     {
01107       for(ir=0;ir<nReco;ir++)
01108       {
01109         temp=0;
01110         if(FD_True_Fid_NuTauBarCC->GetBinContent(it+1)>0)
01111         {
01112           temp = FD_TrueVsReco_Fid_NuTauBarCC->GetBinContent(ir+1,it+1)/FD_True_Fid_NuTauBarCC->GetBinContent(it+1);
01113         }
01114        FD_True2Reco_NuBar_Fid[Background::kNuTauCC]->SetBinContent(ir+1,it+1,temp);
01115       }
01116     }
01117   }
01118   
01119   if(UseSeparateNuNuBar)
01120   {
01121     FD_Eff[Background::kNueCC] = new TH2D("FD_Eff_NueCC","",nPID,p,nReco,r);
01122     h2 = (TH2D*)FD_Nu_TrueVsRecoVsPID[qNuMuToNue]->Project3D("yx");
01123     h1 = FD_TrueVsReco_Fid_NueCC->ProjectionX();
01124     for(ip=0;ip<nPID;ip++)
01125     {
01126       for(ir=0;ir<nReco;ir++)
01127       {
01128         temp=0;
01129         if(h1->GetBinContent(ir+1)>0)
01130         {
01131           temp = h2->GetBinContent(ip+1,ir+1)/h1->GetBinContent(ir+1);
01132         }
01133         FD_Eff[Background::kNueCC]->SetBinContent(ip+1,ir+1,temp);
01134       }
01135     }
01136     if(ReadMREFromFile) FD_Eff[Background::kNueCC]->Multiply(MREEffRatio);
01137     
01138     FD_Eff_NuBar[Background::kNueCC] = new TH2D("FD_Eff_NueBarCC","",nPID,p,nReco,r);
01139     h2 = (TH2D*)FD_NuBar_TrueVsRecoVsPID[qNuMuToNue]->Project3D("yx");
01140     h1 = FD_TrueVsReco_Fid_NueBarCC->ProjectionX();
01141     for(ip=0;ip<nPID;ip++)
01142     {
01143       for(ir=0;ir<nReco;ir++)
01144       {
01145         temp=0;
01146         if(h1->GetBinContent(ir+1)>0)
01147         {
01148           temp = h2->GetBinContent(ip+1,ir+1)/h1->GetBinContent(ir+1);
01149         }
01150         FD_Eff_NuBar[Background::kNueCC]->SetBinContent(ip+1,ir+1,temp);
01151       }
01152     }
01153     if(ReadMREFromFile) FD_Eff_NuBar[Background::kNueCC]->Multiply(MREEffRatio);
01154   }
01155   else
01156   {
01157     FD_Eff[Background::kNueCC] = new TH2D("FD_Eff_NueCC","",nPID,p,nReco,r);
01158     h2 = (TH2D*)FD_TrueVsRecoVsPID[qNuMuToNue]->Project3D("yx");
01159     h1 = FD_TrueVsReco_Fid_NueCC->ProjectionX();
01160     for(ip=0;ip<nPID;ip++)
01161     {
01162       for(ir=0;ir<nReco;ir++)
01163       {
01164         temp=0;
01165         if(h1->GetBinContent(ir+1)>0)
01166         {
01167           temp = h2->GetBinContent(ip+1,ir+1)/h1->GetBinContent(ir+1);
01168         }
01169         FD_Eff[Background::kNueCC]->SetBinContent(ip+1,ir+1,temp);
01170       }
01171     }
01172     if(ReadMREFromFile) FD_Eff[Background::kNueCC]->Multiply(MREEffRatio);
01173   }
01174   
01175   if(UseSeparateNuNuBar)
01176   {
01177     FD_Eff[Background::kNuTauCC] = new TH2D("FD_Eff_NuTauCC","",nPID,p,nReco,r);
01178     h2 = (TH2D*)FD_Nu_TrueVsRecoVsPID[qNuMuToNuTau]->Project3D("yx");
01179     h2->Add((TH2D*)FD_Nu_TrueVsRecoVsPID[qBNueToNuTau]->Project3D("yx"));
01180     h1 = FD_TrueVsReco_Fid_NuTauCC->ProjectionX();
01181     for(ip=0;ip<nPID;ip++)
01182     {
01183       for(ir=0;ir<nReco;ir++)
01184       {
01185         temp=0;
01186         if(h1->GetBinContent(ir+1)>0)
01187         {
01188           temp = h2->GetBinContent(ip+1,ir+1)/h1->GetBinContent(ir+1);
01189         }
01190         FD_Eff[Background::kNuTauCC]->SetBinContent(ip+1,ir+1,temp);
01191       }
01192     }
01193     
01194     FD_Eff_NuBar[Background::kNuTauCC] = new TH2D("FD_Eff_NuTauBarCC","",nPID,p,nReco,r);
01195     h2 = (TH2D*)FD_NuBar_TrueVsRecoVsPID[qNuMuToNuTau]->Project3D("yx");
01196     h2->Add((TH2D*)FD_NuBar_TrueVsRecoVsPID[qBNueToNuTau]->Project3D("yx"));
01197     h1 = FD_TrueVsReco_Fid_NuTauBarCC->ProjectionX();
01198     for(ip=0;ip<nPID;ip++)
01199     {
01200       for(ir=0;ir<nReco;ir++)
01201       {
01202         temp=0;
01203         if(h1->GetBinContent(ir+1)>0)
01204         {
01205           temp = h2->GetBinContent(ip+1,ir+1)/h1->GetBinContent(ir+1);
01206         }
01207         FD_Eff_NuBar[Background::kNuTauCC]->SetBinContent(ip+1,ir+1,temp);
01208       }
01209     }
01210   }
01211   else
01212   {
01213     FD_Eff[Background::kNuTauCC] = new TH2D("FD_Eff_NuTauCC","",nPID,p,nReco,r);
01214     h2 = (TH2D*)FD_TrueVsRecoVsPID[qNuMuToNuTau]->Project3D("yx");
01215     h2->Add((TH2D*)FD_TrueVsRecoVsPID[qBNueToNuTau]->Project3D("yx"));
01216     h1 = FD_TrueVsReco_Fid_NuTauCC->ProjectionX();
01217     for(ip=0;ip<nPID;ip++)
01218     {
01219       for(ir=0;ir<nReco;ir++)
01220       {
01221         temp=0;
01222         if(h1->GetBinContent(ir+1)>0)
01223         {
01224           temp = h2->GetBinContent(ip+1,ir+1)/h1->GetBinContent(ir+1);
01225         }
01226         FD_Eff[Background::kNuTauCC]->SetBinContent(ip+1,ir+1,temp);
01227       }
01228     }
01229   }
01230   
01231   delete [] r;
01232   delete [] p;
01233   delete [] t;
01234   
01235   return;
01236 }

void Extrapolate2D::ReadMREFile (  )  [protected]

Definition at line 1237 of file Extrapolate2D.cxx.

References Form(), gSystem(), MRE_infile, MREEffRatio, nPID, nReco, PID, ReadError, and ReadMREFromFile.

Referenced by ReadFiles().

01238 {
01239   if(!ReadMREFromFile)
01240   {
01241     MREEffRatio = 0;
01242     return;
01243   }
01244   
01245   if(gSystem->AccessPathName(gSystem->ExpandPathName(MRE_infile.c_str())))
01246   {
01247     cout<<"Failure to read MRE file."<<endl;
01248     ReadError = true;
01249     return;
01250   }
01251   
01252   TFile *f = new TFile(gSystem->ExpandPathName(MRE_infile.c_str()),"READ");
01253   MREEffRatio = (TH2D*)f->Get(Form("%s/eff_ratio",PID.c_str()));
01254   
01255   if(MREEffRatio->GetNbinsX()!=nPID || MREEffRatio->GetNbinsY()!=nReco)
01256   {
01257     cout<<"Warning: MRE correction histogram doesn't have the correct binning."<<endl;
01258   }
01259   
01260   return;
01261 }

void Extrapolate2D::ReadNDDataFile (  )  [protected, virtual]

Reimplemented in Extrapolate2D_Simple.

Definition at line 483 of file Extrapolate2D.cxx.

References Form(), gSystem(), Background::kBNueCC, Background::kNC, Background::kNuMuCC, NDData, NDData_infile, nPID, nPOTNear, nReco, PID_NDData, ReadError, and RunPeriod.

Referenced by ReadFiles().

00484 {
00485   //read in ND decomposition results
00486   
00487   if(RunPeriod<0 || RunPeriod>3)
00488   {
00489     cout<<"Failure to read NDData file: choose run period 0 (all runs), 1, 2, or 3"<<endl;
00490     ReadError = true;
00491     return;
00492   }
00493   
00494   if(gSystem->AccessPathName(gSystem->ExpandPathName(NDData_infile.c_str())))
00495   {
00496     cout<<"Failure to read ND data file."<<endl;
00497     ReadError = true;
00498     return;
00499   }
00500   
00501   TFile *f = new TFile(gSystem->ExpandPathName(NDData_infile.c_str()),"READ");
00502   
00503   TH2D *h;
00504   
00505   h = (TH2D*)f->Get(Form("NDData_NuMuCC_%s_Run%i",PID_NDData.c_str(),RunPeriod));
00506   h->Scale(nPOTNear/1e19);//assumes NDData files have been normalized to 1e19
00507   NDData[Background::kNuMuCC] = h;
00508   
00509   h = (TH2D*)f->Get(Form("NDData_NC_%s_Run%i",PID_NDData.c_str(),RunPeriod));
00510   h->Scale(nPOTNear/1e19);//assumes NDData files have been normalized to 1e19
00511   NDData[Background::kNC] = h;
00512   
00513   h = (TH2D*)f->Get(Form("NDData_BNueCC_%s_Run%i",PID_NDData.c_str(),RunPeriod));
00514   h->Scale(nPOTNear/1e19);//assumes NDData files have been normalized to 1e19
00515   NDData[Background::kBNueCC] = h;
00516   
00517   if(NDData[Background::kNC]->GetNbinsX()!=nPID || NDData[Background::kNC]->GetNbinsY()!=nReco)
00518   {
00519     cout<<"Warning: ND Data input histograms don't have the correct binning."<<endl;
00520   }
00521   
00522   return;
00523 }

void Extrapolate2D::ReadXSecFile (  )  [protected]

Definition at line 1262 of file Extrapolate2D.cxx.

References MuELoss::e, fNueBarCCXSec, fNueCCXSec, fNuMuBarCCXSec, fNuMuCCXSec, fNuTauBarCCXSec, fNuTauCCXSec, gSystem(), Background::kNueCC, Background::kNuTauCC, n, nTrue, ReadError, TrueEdges, XSec_infile, XSecWeight, and XSecWeight_NuBar.

Referenced by ReadFiles(), and Extrapolate2D_Simple::ReadFiles().

01263 {
01264   //read in tau/nue cross section file
01265   
01266   if(gSystem->AccessPathName(gSystem->ExpandPathName(XSec_infile.c_str())))
01267   {
01268     cout<<"Failure to read cross section file."<<endl;
01269     ReadError = true;
01270     return;
01271   }
01272   
01273   TFile *fxsec = new TFile(gSystem->ExpandPathName(XSec_infile.c_str()),"READ");
01274   string names[5] = {"tot", "qe", "res", "dis", "coh"};
01275   
01276   for(int i = 0; i < 5; i++)
01277   {
01278     string id = "h_numu_cc_" + names[i];
01279     fxsec->GetObject(id.c_str(), fNuMuCCXSec[i]);
01280     id = "h_nutau_cc_" + names[i];
01281     fxsec->GetObject(id.c_str(), fNuTauCCXSec[i]);
01282     id = "h_nue_cc_" + names[i];
01283     fxsec->GetObject(id.c_str(),fNueCCXSec[i]);
01284     
01285     id = "h_numubar_cc_" + names[i];
01286     fxsec->GetObject(id.c_str(), fNuMuBarCCXSec[i]);
01287     id = "h_nutaubar_cc_" + names[i];
01288     fxsec->GetObject(id.c_str(), fNuTauBarCCXSec[i]);
01289     id = "h_nuebar_cc_" + names[i];
01290     fxsec->GetObject(id.c_str(),fNueBarCCXSec[i]);
01291   }
01292   
01293   XSecWeight.clear();
01294   XSecWeight_NuBar.clear();
01295   
01296   TH1D *hnue,*hnutau;
01297   hnue = (TH1D*)fNueCCXSec[0]->Clone("hnue");
01298   hnue->Divide(fNuMuCCXSec[0]);
01299   hnutau = (TH1D*)fNuTauCCXSec[0]->Clone("hnutau");
01300   hnutau->Divide(fNuMuCCXSec[0]);
01301   
01302   TH1D *hnuebar,*hnutaubar;
01303   hnuebar = (TH1D*)fNueBarCCXSec[0]->Clone("hnue");
01304   hnuebar->Divide(fNuMuBarCCXSec[0]);
01305   hnutaubar = (TH1D*)fNuTauBarCCXSec[0]->Clone("hnutau");
01306   hnutaubar->Divide(fNuMuBarCCXSec[0]);
01307   
01308   //just in case binning of xsec hists is not the same as the true binning in this class:
01309   //this works as if the range is different, as long as the bin width is the same
01310   
01311   int n = hnue->GetNbinsX();
01312   int i,k;
01313   double E;
01314   double *t = new double[nTrue+1];
01315   for(i=0;i<nTrue+1;i++)
01316   {
01317     t[i] = TrueEdges.at(i);
01318   }
01319   
01320   TH1D *XSecWeight_NueCC = new TH1D("XSecWeight_NueCC","",nTrue,t);
01321   TH1D *XSecWeight_NuTauCC = new TH1D("XSecWeight_NuTauCC","",nTrue,t);
01322   TH1D *XSecWeight_NueBarCC = new TH1D("XSecWeight_NueBarCC","",nTrue,t);
01323   TH1D *XSecWeight_NuTauBarCC = new TH1D("XSecWeight_NuTauBarCC","",nTrue,t);
01324   
01325   if((XSecWeight_NueCC->GetXaxis()->GetBinWidth(1)-hnue->GetXaxis()->GetBinWidth(1))>1e-5)
01326   {
01327     cout<<"Warning: the set true energy bin width is not the same as that in the input cross section file"<<endl;
01328   }
01329   
01330   for(i=0;i<nTrue;i++)
01331   {
01332     E = XSecWeight_NueCC->GetBinCenter(i+1);
01333     for(k=0;k<n;k++)
01334     {
01335       if(E>=hnue->GetXaxis()->GetBinLowEdge(k+1) && E<hnue->GetXaxis()->GetBinUpEdge(k+1))
01336       {
01337         XSecWeight_NueCC->SetBinContent(i+1,hnue->GetBinContent(k+1));
01338         XSecWeight_NuTauCC->SetBinContent(i+1,hnutau->GetBinContent(k+1));
01339         break;
01340       }
01341     }
01342   }
01343   
01344   XSecWeight[Background::kNueCC] = XSecWeight_NueCC;
01345   XSecWeight[Background::kNuTauCC] = XSecWeight_NuTauCC;
01346   
01347   for(i=0;i<nTrue;i++)
01348   {
01349     E = XSecWeight_NueBarCC->GetBinCenter(i+1);
01350     for(k=0;k<n;k++)
01351     {
01352       if(E>=hnuebar->GetXaxis()->GetBinLowEdge(k+1) && E<hnuebar->GetXaxis()->GetBinUpEdge(k+1))
01353       {
01354         XSecWeight_NueBarCC->SetBinContent(i+1,hnuebar->GetBinContent(k+1));
01355         XSecWeight_NuTauBarCC->SetBinContent(i+1,hnutaubar->GetBinContent(k+1));
01356         break;
01357       }
01358     }
01359   }
01360   
01361   XSecWeight_NuBar[Background::kNueCC] = XSecWeight_NueBarCC;
01362   XSecWeight_NuBar[Background::kNuTauCC] = XSecWeight_NuTauBarCC;
01363   
01364   return;
01365 }

void Extrapolate2D::RebinInputHists (  )  [protected, virtual]

Reimplemented in Extrapolate2D_Simple.

Definition at line 2559 of file Extrapolate2D.cxx.

References FD_Nu_TrueVsRecoVsPID, FD_NuBar_TrueVsRecoVsPID, FD_TrueVsReco_Fid_NueBarCC, FD_TrueVsReco_Fid_NueCC, FD_TrueVsReco_Fid_NuTauBarCC, FD_TrueVsReco_Fid_NuTauCC, FD_TrueVsRecoVsPID, FD_TrueVsRecoVsPID_NC_NueBarFrac, FD_TrueVsRecoVsPID_NC_NueFrac, FD_TrueVsRecoVsPID_NC_NuMuBarFrac, FD_TrueVsRecoVsPID_NC_NuMuFrac, MBH, ND_TrueVsRecoVsPID, nPID, nReco, OscMethod, PIDEdges, qBNueToBNue, qBNueToNuMu, qBNueToNuTau, qNC, qNuMuToNue, qNuMuToNuMu, qNuMuToNuTau, MultiBinAnaHelper::Rebin2DHist(), MultiBinAnaHelper::Rebin3DHist(), RecoEdges, and UseSeparateNuNuBar.

Referenced by ReadFNFile().

02560 {
02561   int nr = nReco;
02562   int np = nPID;
02563   double *r = new double[nReco+1];
02564   double *p = new double[nPID+1];
02565   int i;
02566   for(i=0;i<nReco+1;i++)
02567   {
02568     r[i] = RecoEdges.at(i);
02569   }
02570   for(i=0;i<nPID+1;i++)
02571   {
02572     p[i] = PIDEdges.at(i);
02573   }
02574   
02575   MBH.Rebin2DHist(FD_TrueVsReco_Fid_NueCC,nr,r,0,0);
02576   MBH.Rebin2DHist(FD_TrueVsReco_Fid_NuTauCC,nr,r,0,0);
02577   if(UseSeparateNuNuBar)
02578   {
02579     MBH.Rebin2DHist(FD_TrueVsReco_Fid_NueBarCC,nr,r,0,0);
02580     MBH.Rebin2DHist(FD_TrueVsReco_Fid_NuTauBarCC,nr,r,0,0);
02581   }
02582 
02583   MBH.Rebin3DHist(ND_TrueVsRecoVsPID[qNC],np,p,nr,r,0,0);
02584   MBH.Rebin3DHist(ND_TrueVsRecoVsPID[qNuMuToNuMu],np,p,nr,r,0,0);
02585   MBH.Rebin3DHist(ND_TrueVsRecoVsPID[qBNueToBNue],np,p,nr,r,0,0);
02586   
02587   MBH.Rebin3DHist(FD_TrueVsRecoVsPID[qNC],np,p,nr,r,0,0);
02588   MBH.Rebin3DHist(FD_TrueVsRecoVsPID[qNuMuToNuMu],np,p,nr,r,0,0);
02589   MBH.Rebin3DHist(FD_TrueVsRecoVsPID[qBNueToNuMu],np,p,nr,r,0,0);
02590   MBH.Rebin3DHist(FD_TrueVsRecoVsPID[qBNueToBNue],np,p,nr,r,0,0);
02591   MBH.Rebin3DHist(FD_TrueVsRecoVsPID[qNuMuToNue],np,p,nr,r,0,0);
02592   MBH.Rebin3DHist(FD_TrueVsRecoVsPID[qNuMuToNuTau],np,p,nr,r,0,0);
02593   MBH.Rebin3DHist(FD_TrueVsRecoVsPID[qBNueToNuTau],np,p,nr,r,0,0);
02594   
02595   if( OscMethod == 3){
02596   MBH.Rebin3DHist(FD_TrueVsRecoVsPID_NC_NueFrac,np,p,nr,r,0,0);
02597   MBH.Rebin3DHist(FD_TrueVsRecoVsPID_NC_NueBarFrac,np,p,nr,r,0,0);
02598   MBH.Rebin3DHist(FD_TrueVsRecoVsPID_NC_NuMuFrac,np,p,nr,r,0,0);
02599   MBH.Rebin3DHist(FD_TrueVsRecoVsPID_NC_NuMuBarFrac,np,p,nr,r,0,0);
02600   }
02601   if(UseSeparateNuNuBar)
02602   {
02603     MBH.Rebin3DHist(FD_Nu_TrueVsRecoVsPID[qNC],np,p,nr,r,0,0);
02604     MBH.Rebin3DHist(FD_Nu_TrueVsRecoVsPID[qNuMuToNuMu],np,p,nr,r,0,0);
02605     MBH.Rebin3DHist(FD_Nu_TrueVsRecoVsPID[qBNueToNuMu],np,p,nr,r,0,0);
02606     MBH.Rebin3DHist(FD_Nu_TrueVsRecoVsPID[qBNueToBNue],np,p,nr,r,0,0);
02607     MBH.Rebin3DHist(FD_Nu_TrueVsRecoVsPID[qNuMuToNue],np,p,nr,r,0,0);
02608     MBH.Rebin3DHist(FD_Nu_TrueVsRecoVsPID[qNuMuToNuTau],np,p,nr,r,0,0);
02609     MBH.Rebin3DHist(FD_Nu_TrueVsRecoVsPID[qBNueToNuTau],np,p,nr,r,0,0);
02610     
02611     MBH.Rebin3DHist(FD_NuBar_TrueVsRecoVsPID[qNC],np,p,nr,r,0,0);
02612     MBH.Rebin3DHist(FD_NuBar_TrueVsRecoVsPID[qNuMuToNuMu],np,p,nr,r,0,0);
02613     MBH.Rebin3DHist(FD_NuBar_TrueVsRecoVsPID[qBNueToNuMu],np,p,nr,r,0,0);
02614     MBH.Rebin3DHist(FD_NuBar_TrueVsRecoVsPID[qBNueToBNue],np,p,nr,r,0,0);
02615     MBH.Rebin3DHist(FD_NuBar_TrueVsRecoVsPID[qNuMuToNue],np,p,nr,r,0,0);
02616     MBH.Rebin3DHist(FD_NuBar_TrueVsRecoVsPID[qNuMuToNuTau],np,p,nr,r,0,0);
02617     MBH.Rebin3DHist(FD_NuBar_TrueVsRecoVsPID[qBNueToNuTau],np,p,nr,r,0,0);
02618   }
02619   
02620   delete [] r;
02621   delete [] p;
02622   
02623   return;
02624 }

void Extrapolate2D::Set1DPredHists (  )  [protected]

Definition at line 2542 of file Extrapolate2D.cxx.

References Background::kNueCC, nPID, nReco, Pred, Pred_Signal_VsBinNumber, Pred_TotalBkgd, and Pred_TotalBkgd_VsBinNumber.

Referenced by GetPrediction(), Extrapolate2D_Simple::OscillatePrediction_NoSep(), OscillatePrediction_NoSep(), OscillatePrediction_SepNuNuBar(), Extrapolate2D_Simple::OscillatePrediction_SepNuNuBar(), and ReadExtrap().

02543 {
02544   int ip,ir,i;
02545   
02546   i=0;
02547   for(ir=0;ir<nReco;ir++)
02548   {
02549     for(ip=0;ip<nPID;ip++)
02550     {
02551       Pred_TotalBkgd_VsBinNumber->SetBinContent(i+1,Pred_TotalBkgd->GetBinContent(ip+1,ir+1));
02552       Pred_Signal_VsBinNumber->SetBinContent(i+1,Pred[Background::kNueCC]->GetBinContent(ip+1,ir+1));
02553       i++;
02554     }
02555   }
02556   
02557   return;
02558 }

void Extrapolate2D::SetDelta14 ( double  val  ) 
void Extrapolate2D::SetDelta24 ( double  val  ) 
void Extrapolate2D::SetDelta_emu ( double  val  ) 
void Extrapolate2D::SetDelta_etau ( double  val  ) 

Definition at line 263 of file Extrapolate2D.cxx.

References OscPar::kDelta_etau, osc, and OscCalc::SetOscParam().

00264 {
00265   osc.SetOscParam(OscPar::kDelta_etau,val);
00266   
00267   return;
00268 
00269 }

void Extrapolate2D::SetDelta_mutau ( double  val  ) 
void Extrapolate2D::SetDeltaCP ( double  val  ) 

Definition at line 243 of file Extrapolate2D.cxx.

References OscPar::kDelta, osc, and OscCalc::SetOscParam().

00244 {
00245   osc.SetOscParam(OscPar::kDelta,val);
00246   
00247   return;
00248 }

void Extrapolate2D::SetDm41 ( double  val  ) 

Definition at line 256 of file Extrapolate2D.cxx.

References OscPar::kDm41, osc, and OscCalc::SetOscParam().

00257 {
00258   osc.SetOscParam(OscPar::kDm41,val);
00259   
00260   return;
00261 
00262 }

void Extrapolate2D::SetEps_ee ( double  val  ) 
void Extrapolate2D::SetEps_emu ( double  val  ) 
void Extrapolate2D::SetEps_etau ( double  val  ) 

Definition at line 249 of file Extrapolate2D.cxx.

References OscPar::kEps_etau, osc, and OscCalc::SetOscParam().

00250 {
00251   osc.SetOscParam(OscPar::kEps_etau,val);
00252   
00253   return;
00254 
00255 }

void Extrapolate2D::SetEps_mumu ( double  val  ) 
void Extrapolate2D::SetEps_mutau ( double  val  ) 
void Extrapolate2D::SetEps_tautau ( double  val  ) 
void Extrapolate2D::SetFarPOT ( double  pot = 7e20  )  [inline]

Definition at line 46 of file Extrapolate2D.h.

References nPOTFar.

Referenced by Extrapolate2D(), Extrapolate2D_Simple::Extrapolate2D_Simple(), and ReadExtrap().

00046 { nPOTFar = pot;};

void Extrapolate2D::SetFNFile ( string  s  ) 

Definition at line 151 of file Extrapolate2D.cxx.

References FN_infile.

00152 {
00153   FN_infile = s;
00154   return;
00155 }

void Extrapolate2D::SetFNforBeamNue (  )  [inline]

Definition at line 50 of file Extrapolate2D.h.

References FNforBeamNue.

00050 { FNforBeamNue = true; };

void Extrapolate2D::SetMREFile ( string  s  ) 

Definition at line 156 of file Extrapolate2D.cxx.

References MRE_infile, and ReadMREFromFile.

00157 {
00158   MRE_infile = s;
00159   ReadMREFromFile = true;
00160   return;
00161 }

void Extrapolate2D::SetNDDataFile ( string  s  ) 

Definition at line 146 of file Extrapolate2D.cxx.

References NDData_infile.

00147 {
00148   NDData_infile = s;
00149   return;
00150 }

void Extrapolate2D::SetNDDataPID ( string  pid = "ANN11"  ) 

Definition at line 141 of file Extrapolate2D.cxx.

References PID_NDData.

00142 {
00143   PID_NDData = pid;
00144   return;
00145 }

void Extrapolate2D::SetNearPOT ( double  pot = 1e19  )  [inline]

Definition at line 45 of file Extrapolate2D.h.

References nPOTNear.

Referenced by Extrapolate2D(), Extrapolate2D_Simple::Extrapolate2D_Simple(), and ReadExtrap().

00045 { nPOTNear = pot;};

void Extrapolate2D::SetNominalOscProb (  )  [protected]

Definition at line 276 of file Extrapolate2D.cxx.

References OscCalc::ElecToElec(), OscCalc::ElecToMu(), OscCalc::ElecToTau(), Form(), it, OscPar::kNuAntiNu, OscCalc::MuToElec(), OscCalc::MuToMu(), OscCalc::MuToTau(), NominalOscProb, NominalOscProb_NuBar, nTrue, osc, OscCalc::Oscillate(), OscCalc::OscillateLSND(), OscCalc::OscillateNSI(), OscMethod, qBNueToBNue, qBNueToNuMu, qBNueToNuTau, qNC, qNuMuToNue, qNuMuToNuMu, qNuMuToNuTau, RunPeriod, OscCalc::SetOscParam(), and TrueEdges.

Referenced by ReadExtrap(), ReadFNFile(), Extrapolate2D_Simple::ReadFNFile(), and Extrapolate2D_Simple::ReadFNFileNo3D().

00277 {
00278   NominalOscProb.clear();
00279   
00280   int it;
00281   double *t = new double[nTrue+1];
00282   for(it=0;it<nTrue+1;it++)
00283   {
00284     t[it] = TrueEdges.at(it);
00285   }
00286   
00287   TH1D *h;
00288   double E;
00289   
00290   //osc prob doesn't depend on run of course, but giving a unique name avoids a memory leak warning
00291   
00292   //for neutrinos
00293   osc.SetOscParam(OscPar::kNuAntiNu,1);
00294   h = new TH1D(Form("NominalOscProb_NC_%i",RunPeriod),"",nTrue,t);
00295   for(it=0;it<nTrue;it++)
00296   {
00297     h->SetBinContent(it+1,1);
00298   }
00299   NominalOscProb[qNC]=h;
00300   /*  
00301   h = new TH1D(Form("NominalOscProb_NuMuNC_%i",RunPeriod),"",nTrue,t);
00302    for(it=0;it<nTrue;it++)
00303   {
00304     E = h->GetBinCenter(it+1);
00305     if(OscMethod == 3){h->SetBinContent(it+1,(1-osc.OscillateLSND(18,14,E)));}
00306     else{h->SetBinContent(it+1,0);}
00307   }
00308   NominalOscProb[qNuMuNC]=h; 
00309  
00310   h = new TH1D(Form("NominalOscProb_BNueNC_%i",RunPeriod),"",nTrue,t);
00311    for(it=0;it<nTrue;it++)
00312   {
00313     E = h->GetBinCenter(it+1);
00314     if(OscMethod == 3){h->SetBinContent(it+1,(1-osc.OscillateLSND(18,12,E)));}
00315     else{h->SetBinContent(it+1,0);}
00316   }
00317   NominalOscProb[qBNueNC]=h; 
00318   */
00319   h = new TH1D(Form("NominalOscProb_NuMuToNuMu_%i",RunPeriod),"",nTrue,t);
00320   for(it=0;it<nTrue;it++)
00321   {
00322     E = h->GetBinCenter(it+1);
00323     if(OscMethod == 3){h->SetBinContent(it+1,osc.OscillateLSND(14,14,E));}
00324     else if(OscMethod == 2){h->SetBinContent(it+1,osc.OscillateNSI(14,14,E));}
00325     else if(OscMethod == 1){h->SetBinContent(it+1,osc.Oscillate(14,14,E));}
00326     else{h->SetBinContent(it+1,osc.MuToMu(E));}
00327   }
00328   NominalOscProb[qNuMuToNuMu]=h;
00329   
00330   h = new TH1D(Form("NominalOscProb_BNueToNuMu_%i",RunPeriod),"",nTrue,t);
00331   for(it=0;it<nTrue;it++)
00332   {
00333     E = h->GetBinCenter(it+1);
00334     if(OscMethod == 3){h->SetBinContent(it+1,osc.OscillateLSND(14,12,E));}
00335     else if(OscMethod == 2){h->SetBinContent(it+1,osc.OscillateNSI(14,12,E));}
00336     else if(OscMethod == 1){h->SetBinContent(it+1,osc.Oscillate(14,12,E));}
00337     else{h->SetBinContent(it+1,osc.ElecToMu(E));}
00338   }
00339   NominalOscProb[qBNueToNuMu]=h;
00340   
00341   h = new TH1D(Form("NominalOscProb_BNueToBNue_%i",RunPeriod),"",nTrue,t);
00342   for(it=0;it<nTrue;it++)
00343   {
00344     E = h->GetBinCenter(it+1);
00345     if(OscMethod == 3){h->SetBinContent(it+1,osc.OscillateLSND(12,12,E));}
00346     else if(OscMethod == 2){h->SetBinContent(it+1,osc.OscillateNSI(12,12,E));}
00347     else if(OscMethod == 1){h->SetBinContent(it+1,osc.Oscillate(12,12,E));}
00348     else{h->SetBinContent(it+1,osc.ElecToElec(E));}
00349   }
00350   NominalOscProb[qBNueToBNue]=h;
00351   
00352   h = new TH1D(Form("NominalOscProb_NuMuToNue_%i",RunPeriod),"",nTrue,t);
00353   for(it=0;it<nTrue;it++)
00354   {
00355     E = h->GetBinCenter(it+1);
00356     if(OscMethod == 3){h->SetBinContent(it+1,osc.OscillateLSND(12,14,E));}
00357     else if(OscMethod == 2){h->SetBinContent(it+1,osc.OscillateNSI(12,14,E));}
00358     else if(OscMethod == 1){h->SetBinContent(it+1,osc.Oscillate(12,14,E));}    
00359     else{h->SetBinContent(it+1,osc.MuToElec(E));}
00360   }
00361   NominalOscProb[qNuMuToNue]=h;
00362   
00363   h = new TH1D(Form("NominalOscProb_NuMuToNuTau_%i",RunPeriod),"",nTrue,t);
00364   for(it=0;it<nTrue;it++)
00365   {
00366     E = h->GetBinCenter(it+1);
00367     if(OscMethod == 3){h->SetBinContent(it+1,osc.OscillateLSND(16,14,E));}
00368     else if(OscMethod == 2){h->SetBinContent(it+1,osc.OscillateNSI(16,14,E));}
00369     else if(OscMethod == 1){h->SetBinContent(it+1,osc.Oscillate(16,14,E));}
00370     else{h->SetBinContent(it+1,osc.MuToTau(E));}
00371   }
00372   NominalOscProb[qNuMuToNuTau]=h;
00373   
00374   h = new TH1D(Form("NominalOscProb_BNueToNuTau_%i",RunPeriod),"",nTrue,t);
00375   for(it=0;it<nTrue;it++)
00376   {
00377     E = h->GetBinCenter(it+1);
00378     if(OscMethod == 3){h->SetBinContent(it+1,osc.OscillateLSND(16,12,E));}
00379     else if(OscMethod == 2){h->SetBinContent(it+1,osc.OscillateNSI(16,12,E));}
00380     else if(OscMethod == 1){h->SetBinContent(it+1,osc.Oscillate(16,12,E));}
00381     else{h->SetBinContent(it+1,osc.ElecToTau(E));}
00382   }
00383   NominalOscProb[qBNueToNuTau]=h;
00384   
00385   //for antineutrinos
00386   osc.SetOscParam(OscPar::kNuAntiNu,-1);
00387   h = new TH1D(Form("NominalOscProb_NuBar_NC_%i",RunPeriod),"",nTrue,t);
00388   for(it=0;it<nTrue;it++)
00389   {
00390     h->SetBinContent(it+1,1);
00391   }
00392   NominalOscProb_NuBar[qNC]=h;
00393   /*
00394   h = new TH1D(Form("NominalOscProb_NuBar_NuMuNC_%i",RunPeriod),"",nTrue,t);
00395   for(it=0;it<nTrue;it++)
00396   {
00397     E = h->GetBinCenter(it+1);
00398     if(OscMethod == 3){h->SetBinContent(it+1,(1-osc.OscillateLSND(-18,-14,E)));}
00399     else{h->SetBinContent(it+1,0);}
00400   }
00401   NominalOscProb_NuBar[qNuMuNC]=h;
00402 
00403   h = new TH1D(Form("NominalOscProb_NuBar_BNueNC_%i",RunPeriod),"",nTrue,t);
00404   for(it=0;it<nTrue;it++)
00405   {
00406     E = h->GetBinCenter(it+1);
00407     if(OscMethod == 3){h->SetBinContent(it+1,(1-osc.OscillateLSND(-18,-12,E)));}
00408     else{h->SetBinContent(it+1,0);}
00409   }
00410   NominalOscProb_NuBar[qBNueNC]=h;
00411   */
00412   h = new TH1D(Form("NominalOscProb_NuBar_NuMuToNuMu_%i",RunPeriod),"",nTrue,t);
00413   for(it=0;it<nTrue;it++)
00414   {
00415     E = h->GetBinCenter(it+1);
00416     if(OscMethod == 3){h->SetBinContent(it+1,osc.OscillateLSND(-14,-14,E));}
00417     else if(OscMethod == 2){h->SetBinContent(it+1,osc.OscillateNSI(-14,-14,E));}
00418     else if(OscMethod == 1){h->SetBinContent(it+1,osc.Oscillate(-14,-14,E));}
00419     else{h->SetBinContent(it+1,osc.MuToMu(E));}
00420   }
00421   NominalOscProb_NuBar[qNuMuToNuMu]=h;
00422   
00423   h = new TH1D(Form("NominalOscProb_NuBar_BNueToNuMu_%i",RunPeriod),"",nTrue,t);
00424   for(it=0;it<nTrue;it++)
00425   {
00426     E = h->GetBinCenter(it+1);
00427     if(OscMethod == 3){h->SetBinContent(it+1,osc.OscillateLSND(-14,-12,E));}
00428     else if(OscMethod == 2){h->SetBinContent(it+1,osc.OscillateNSI(-14,-12,E));}
00429     else if(OscMethod == 1){h->SetBinContent(it+1,osc.Oscillate(-14,-12,E));}
00430     else{h->SetBinContent(it+1,osc.ElecToMu(E));}
00431   }
00432   NominalOscProb_NuBar[qBNueToNuMu]=h;
00433   
00434   h = new TH1D(Form("NominalOscProb_NuBar_BNueToBNue_%i",RunPeriod),"",nTrue,t);
00435   for(it=0;it<nTrue;it++)
00436   {
00437     E = h->GetBinCenter(it+1);
00438     if(OscMethod == 3){h->SetBinContent(it+1,osc.OscillateLSND(-12,-12,E));}
00439     else if(OscMethod == 2){h->SetBinContent(it+1,osc.OscillateNSI(-12,-12,E));}
00440     else if(OscMethod == 1){h->SetBinContent(it+1,osc.Oscillate(-12,-12,E));}
00441     else{h->SetBinContent(it+1,osc.ElecToElec(E));}
00442   }
00443   NominalOscProb_NuBar[qBNueToBNue]=h;
00444   
00445   h = new TH1D(Form("NominalOscProb_NuBar_NuMuToNue_%i",RunPeriod),"",nTrue,t);
00446   for(it=0;it<nTrue;it++)
00447   {
00448     E = h->GetBinCenter(it+1);
00449     if(OscMethod == 3){h->SetBinContent(it+1,osc.OscillateLSND(-12,-14,E));}
00450     else if(OscMethod == 2){h->SetBinContent(it+1,osc.OscillateNSI(-12,-14,E));}
00451     else if(OscMethod == 1){h->SetBinContent(it+1,osc.Oscillate(-12,-14,E));} 
00452     else{h->SetBinContent(it+1,osc.MuToElec(E));}
00453   }
00454   NominalOscProb_NuBar[qNuMuToNue]=h;
00455   
00456   h = new TH1D(Form("NominalOscProb_NuBar_NuMuToNuTau_%i",RunPeriod),"",nTrue,t);
00457   for(it=0;it<nTrue;it++)
00458   {
00459     E = h->GetBinCenter(it+1);
00460     if(OscMethod == 3){h->SetBinContent(it+1,osc.OscillateLSND(-16,-14,E));}
00461     else if(OscMethod == 2){h->SetBinContent(it+1,osc.OscillateNSI(-16,-14,E));}
00462     else if(OscMethod == 1){h->SetBinContent(it+1,osc.Oscillate(-16,-14,E));}
00463     else{h->SetBinContent(it+1,osc.MuToTau(E));}
00464   }
00465   NominalOscProb_NuBar[qNuMuToNuTau]=h;
00466   
00467   h = new TH1D(Form("NominalOscProb_NuBar_BNueToNuTau_%i",RunPeriod),"",nTrue,t);
00468   for(it=0;it<nTrue;it++)
00469   {
00470     E = h->GetBinCenter(it+1);
00471     if(OscMethod == 3){h->SetBinContent(it+1,osc.OscillateLSND(-16,-12,E));}
00472     else if(OscMethod == 2){h->SetBinContent(it+1,osc.OscillateNSI(-16,-12,E));}
00473     else if(OscMethod == 1){h->SetBinContent(it+1,osc.Oscillate(-16,-12,E));}
00474     else{h->SetBinContent(it+1,osc.ElecToTau(E));}
00475   }
00476   NominalOscProb_NuBar[qBNueToNuTau]=h;
00477   
00478 //   cout<<osc.MuToElec(2.0)<<endl;
00479   osc.SetOscParam(OscPar::kNuAntiNu,1);
00480 //   cout<<osc.MuToElec(2.0)<<endl;
00481   return;
00482 }

void Extrapolate2D::SetOscMethod ( int  m = 0  )  [inline]

Definition at line 124 of file Extrapolate2D.h.

References Munits::m, and OscMethod.

00124 { OscMethod = m; }; // 0 = StdNueOscCalc, 1 = osc.Oscillate, 2 = osc.OscillateNSI, 3 = osc.OscillateLSND

void Extrapolate2D::SetOscPar ( OscPar::OscPar_t  par,
double  val 
)

Definition at line 209 of file Extrapolate2D.cxx.

References osc, and OscCalc::SetOscParam().

00210 {
00211   osc.SetOscParam(par,val);
00212   
00213   return;
00214 }

void Extrapolate2D::SetOutputFile ( string  filename  ) 

Definition at line 128 of file Extrapolate2D.cxx.

References ExtrapFile, gSystem(), outFileName, and WriteOutput.

00129 {
00130   outFileName = filename;
00131   WriteOutput = true;
00132   ExtrapFile = new TFile(gSystem->ExpandPathName(outFileName.c_str()),"RECREATE");
00133   return;
00134 }

void Extrapolate2D::SetPID ( string  pid = "ANN11"  ) 

Definition at line 135 of file Extrapolate2D.cxx.

References PID, and PID_NDData.

00136 {
00137   PID = pid;
00138   PID_NDData = pid;
00139   return;
00140 }

void Extrapolate2D::SetPIDBins ( Int_t  n,
Double_t *  e 
)

Definition at line 104 of file Extrapolate2D.cxx.

References nPID, and PIDEdges.

Referenced by ReadExtrap().

00105 {
00106   int i;
00107   nPID = n;
00108   PIDEdges.clear();
00109   for(i=0;i<nPID+1;i++)
00110   {
00111     PIDEdges.push_back(e[i]);
00112   }
00113   
00114   return;
00115 }

void Extrapolate2D::SetPrintResult (  )  [inline]

Definition at line 53 of file Extrapolate2D.h.

References PrintResult.

00053 { PrintResult = true; };

void Extrapolate2D::SetReadExtrapFromFile ( string  s  ) 

Definition at line 167 of file Extrapolate2D.cxx.

References inFileName, and ReadExtrapFromFile.

00168 {
00169   inFileName = s;
00170   ReadExtrapFromFile = true;
00171   return;
00172 }

void Extrapolate2D::SetRecoBins ( Int_t  n,
Double_t *  e 
)

Definition at line 92 of file Extrapolate2D.cxx.

References nReco, and RecoEdges.

Referenced by ReadExtrap().

00093 {
00094   int i;
00095   nReco = n;
00096   RecoEdges.clear();
00097   for(i=0;i<nReco+1;i++)
00098   {
00099     RecoEdges.push_back(e[i]);
00100   }
00101   
00102   return;
00103 }

void Extrapolate2D::SetRunPeriod ( int  run = 1  )  [inline]

Definition at line 51 of file Extrapolate2D.h.

References run(), and RunPeriod.

Referenced by Extrapolate2D(), and Extrapolate2D_Simple::Extrapolate2D_Simple().

00051 { RunPeriod = run; };

void Extrapolate2D::SetSinSq2Th13 ( double  val  ) 

Definition at line 215 of file Extrapolate2D.cxx.

References OscPar::kTh13, osc, and OscCalc::SetOscParam().

00216 {
00217   Double_t th13 = TMath::ASin(TMath::Sqrt(val))/2;
00218   osc.SetOscParam(OscPar::kTh13,th13);
00219   
00220   return;
00221 }

void Extrapolate2D::SetSinSq2Th14 ( double  val  ) 

Definition at line 222 of file Extrapolate2D.cxx.

References OscPar::kTh14, osc, and OscCalc::SetOscParam().

00223 {
00224   Double_t th14 = TMath::ASin(TMath::Sqrt(val))/2;
00225   osc.SetOscParam(OscPar::kTh14,th14);
00226   
00227   return;
00228 }

void Extrapolate2D::SetSinSqTh14 ( double  val  ) 

Definition at line 229 of file Extrapolate2D.cxx.

References OscPar::kTh14, osc, and OscCalc::SetOscParam().

00230 {
00231   Double_t th14 = TMath::ASin(TMath::Sqrt(val));
00232   osc.SetOscParam(OscPar::kTh14,th14);
00233   
00234   return;
00235 }

void Extrapolate2D::SetSinSqTh24 ( double  val  ) 

Definition at line 236 of file Extrapolate2D.cxx.

References OscPar::kTh24, osc, and OscCalc::SetOscParam().

00237 {
00238   Double_t th24 = TMath::ASin(TMath::Sqrt(val));
00239   osc.SetOscParam(OscPar::kTh24,th24);
00240   
00241   return;
00242 }

void Extrapolate2D::SetTheta14 ( double  val  ) 
void Extrapolate2D::SetTheta24 ( double  val  ) 
void Extrapolate2D::SetTheta34 ( double  val  ) 
void Extrapolate2D::SetTrueBins ( Int_t  n,
Double_t *  e 
)

Definition at line 116 of file Extrapolate2D.cxx.

References nTrue, and TrueEdges.

Referenced by ReadExtrap().

00117 {
00118   int i;
00119   nTrue = n;
00120   TrueEdges.clear();
00121   for(i=0;i<nTrue+1;i++)
00122   {
00123     TrueEdges.push_back(e[i]);
00124   }
00125   
00126   return;
00127 }

void Extrapolate2D::SetupPredHists (  )  [protected, virtual]

Reimplemented in Extrapolate2D_Simple.

Definition at line 2359 of file Extrapolate2D.cxx.

References Background::AsString(), FDComponents, nPID, nReco, nTrue, PIDEdges, Pred, Pred_3D, Pred_CC_Fid, Pred_Nu_3D, Pred_NuBar_3D, Pred_NueBarCCSignal, Pred_NueCCSignal, Pred_NuMuBarCC_Fid, Pred_NuMuCC_Fid, Pred_Signal_VsBinNumber, Pred_TotalBkgd, Pred_TotalBkgd_VsBinNumber, qBNueToBNue, qBNueToNuMu, qBNueToNuTau, qNC, qNuMuToNue, qNuMuToNuMu, qNuMuToNuTau, RecoEdges, and TrueEdges.

Referenced by GetPrediction().

02360 {
02361   Pred_3D.clear();
02362   Pred_Nu_3D.clear();
02363   Pred_NuBar_3D.clear();
02364   Pred.clear();
02365   Pred_TotalBkgd = NULL;
02366   Pred_NueCCSignal = NULL;
02367   Pred_NueBarCCSignal = NULL;
02368   Pred_CC_Fid = NULL;
02369   Pred_NuMuCC_Fid = NULL;
02370   Pred_NuMuBarCC_Fid = NULL;
02371   Pred_TotalBkgd_VsBinNumber = NULL;
02372   Pred_Signal_VsBinNumber = NULL;
02373   
02374   double *r = new double[nReco+1];
02375   double *p = new double[nPID+1];
02376   double *t = new double[nTrue+1];
02377   int i;
02378   for(i=0;i<nReco+1;i++)
02379   {
02380     r[i] = RecoEdges.at(i);
02381   }
02382   for(i=0;i<nPID+1;i++)
02383   {
02384     p[i] = PIDEdges.at(i);
02385   }
02386   for(i=0;i<nTrue+1;i++)
02387   {
02388     t[i] = TrueEdges.at(i);
02389   }
02390   
02391   TH3D *h3;
02392   string name;
02393   
02394   h3 = new TH3D("Pred_3D_NC","",nPID,p,nReco,r,nTrue,t);
02395   Pred_3D[qNC] = h3;
02396   h3 = new TH3D("Pred_3D_NuMuToNuMu","",nPID,p,nReco,r,nTrue,t);
02397   Pred_3D[qNuMuToNuMu] = h3;
02398   h3 = new TH3D("Pred_3D_BNueToNuMu","",nPID,p,nReco,r,nTrue,t);
02399   Pred_3D[qBNueToNuMu] = h3;
02400   h3 = new TH3D("Pred_3D_BNueToBNue","",nPID,p,nReco,r,nTrue,t);
02401   Pred_3D[qBNueToBNue] = h3;
02402   h3 = new TH3D("Pred_3D_NuMuToNue","",nPID,p,nReco,r,nTrue,t);
02403   Pred_3D[qNuMuToNue] = h3;
02404   h3 = new TH3D("Pred_3D_NuMuToNuTau","",nPID,p,nReco,r,nTrue,t);
02405   Pred_3D[qNuMuToNuTau] = h3;
02406   h3 = new TH3D("Pred_3D_BNueToNuTau","",nPID,p,nReco,r,nTrue,t);
02407   Pred_3D[qBNueToNuTau] = h3;
02408   
02409   //nu only
02410   h3 = new TH3D("Pred_Nu_3D_NC","",nPID,p,nReco,r,nTrue,t);
02411   Pred_Nu_3D[qNC] = h3;
02412   h3 = new TH3D("Pred_Nu_3D_NuMuToNuMu","",nPID,p,nReco,r,nTrue,t);
02413   Pred_Nu_3D[qNuMuToNuMu] = h3;
02414   h3 = new TH3D("Pred_Nu_3D_BNueToNuMu","",nPID,p,nReco,r,nTrue,t);
02415   Pred_Nu_3D[qBNueToNuMu] = h3;
02416   h3 = new TH3D("Pred_Nu_3D_BNueToBNue","",nPID,p,nReco,r,nTrue,t);
02417   Pred_Nu_3D[qBNueToBNue] = h3;
02418   h3 = new TH3D("Pred_Nu_3D_NuMuToNue","",nPID,p,nReco,r,nTrue,t);
02419   Pred_Nu_3D[qNuMuToNue] = h3;
02420   h3 = new TH3D("Pred_Nu_3D_NuMuToNuTau","",nPID,p,nReco,r,nTrue,t);
02421   Pred_Nu_3D[qNuMuToNuTau] = h3;
02422   h3 = new TH3D("Pred_Nu_3D_BNueToNuTau","",nPID,p,nReco,r,nTrue,t);
02423   Pred_Nu_3D[qBNueToNuTau] = h3;
02424   
02425   //nubar only
02426   h3 = new TH3D("Pred_NuBar_3D_NC","",nPID,p,nReco,r,nTrue,t);
02427   Pred_NuBar_3D[qNC] = h3;
02428   h3 = new TH3D("Pred_NuBar_3D_NuMuToNuMu","",nPID,p,nReco,r,nTrue,t);
02429   Pred_NuBar_3D[qNuMuToNuMu] = h3;
02430   h3 = new TH3D("Pred_NuBar_3D_BNueToNuMu","",nPID,p,nReco,r,nTrue,t);
02431   Pred_NuBar_3D[qBNueToNuMu] = h3;
02432   h3 = new TH3D("Pred_NuBar_3D_BNueToBNue","",nPID,p,nReco,r,nTrue,t);
02433   Pred_NuBar_3D[qBNueToBNue] = h3;
02434   h3 = new TH3D("Pred_NuBar_3D_NuMuToNue","",nPID,p,nReco,r,nTrue,t);
02435   Pred_NuBar_3D[qNuMuToNue] = h3;
02436   h3 = new TH3D("Pred_NuBar_3D_NuMuToNuTau","",nPID,p,nReco,r,nTrue,t);
02437   Pred_NuBar_3D[qNuMuToNuTau] = h3;
02438   h3 = new TH3D("Pred_NuBar_3D_BNueToNuTau","",nPID,p,nReco,r,nTrue,t);
02439   Pred_NuBar_3D[qBNueToNuTau] = h3;
02440   
02441   TH2D *h2;
02442   for(unsigned int j=0;j<FDComponents.size();j++)
02443   {
02444     name = "Pred_" + string(Background::AsString(FDComponents[j]));
02445     h2 = new TH2D(name.c_str(),"",nPID,p,nReco,r);
02446     Pred[FDComponents[j]] = h2;
02447   }
02448   
02449   Pred_TotalBkgd = new TH2D("Pred_TotalBkgd","",nPID,p,nReco,r);
02450   Pred_NueCCSignal = new TH2D("Pred_NueCCSignal","",nPID,p,nReco,r);
02451   Pred_NueBarCCSignal = new TH2D("Pred_NueBarCCSignal","",nPID,p,nReco,r);
02452   
02453   Pred_CC_Fid = new TH1D("Pred_CC_Fid","",nTrue,t);
02454   Pred_NuMuCC_Fid = new TH1D("Pred_NuMuCC_Fid","",nTrue,t);
02455   Pred_NuMuBarCC_Fid = new TH1D("Pred_NuMuBarCC_Fid","",nTrue,t);
02456   
02457   int totbin = nReco*nPID;
02458   Pred_TotalBkgd_VsBinNumber = new TH1D("Pred_TotalBkgd_VsBinNumber","",totbin,-0.5,totbin-0.5);
02459   Pred_Signal_VsBinNumber = new TH1D("Pred_Signal_VsBinNumber","",totbin,-0.5,totbin-0.5);
02460   
02461   delete [] r;
02462   delete [] p;
02463   delete [] t;
02464   
02465   return;
02466 }

void Extrapolate2D::SetXSecFile ( string  s  ) 

Definition at line 162 of file Extrapolate2D.cxx.

References XSec_infile.

00163 {
00164   XSec_infile = s;
00165   return;
00166 }

void Extrapolate2D::WriteToFile (  )  [protected]

Definition at line 1911 of file Extrapolate2D.cxx.

References Delta14, Delta24, Delta_emu, Delta_etau, Delta_mutau, DeltaCP, DeltaMSq12, DeltaMSq23, Dm41, Eps_ee, Eps_emu, Eps_etau, Eps_mumu, Eps_mutau, Eps_tautau, ExtrapFile, FD_TrueVsRecoVsPID_NC_NueBarFrac, FD_TrueVsRecoVsPID_NC_NueFrac, FD_TrueVsRecoVsPID_NC_NuMuBarFrac, FD_TrueVsRecoVsPID_NC_NuMuFrac, FDComponents, FNRatio, Form(), Background::kBNueCC, Background::kNC, Background::kNuMuCC, NDData, NDData_Reco_CClike, NDData_Reco_CClike_Neg, NDData_Reco_CClike_Pos, nPOTFar, nPOTNear, OscMethod, PID_NDData, Pred, Pred_3D, Pred_CC_Fid, Pred_Nu_3D, Pred_NuBar_3D, Pred_NueBarCCSignal, Pred_NueCCSignal, Pred_NuMuBarCC_Fid, Pred_NuMuCC_Fid, Pred_TotalBkgd, qBNueToBNue, qBNueToNuMu, qBNueToNuTau, qNC, qNuMuToNue, qNuMuToNuMu, qNuMuToNuTau, RunPeriod, Theta12, Theta13, Theta14, Theta23, Theta24, Theta34, and UseSeparateNuNuBar.

Referenced by GetPrediction().

01912 {
01913   ExtrapFile->cd();
01914   
01915   TTree *paramtree = new TTree("paramtree","paramtree");
01916   paramtree->Branch("nearPOT",&nPOTNear,"nearPOT/D");
01917   paramtree->Branch("farPOT",&nPOTFar,"farPOT/D");
01918   paramtree->Branch("Theta12",&Theta12,"Theta12/D");
01919   paramtree->Branch("Theta13",&Theta13,"Theta13/D");
01920   paramtree->Branch("Theta23",&Theta23,"Theta23/D");
01921   paramtree->Branch("DeltaMSq23",&DeltaMSq23,"DeltaMSq23/D");
01922   paramtree->Branch("DeltaMSq12",&DeltaMSq12,"DeltaMSq12/D");
01923   paramtree->Branch("DeltaCP",&DeltaCP,"DeltaCP/D");
01924   paramtree->Branch("Eps_ee",&Eps_ee);
01925   paramtree->Branch("Eps_emu",&Eps_emu);
01926   paramtree->Branch("Eps_etau",&Eps_etau);
01927   paramtree->Branch("Eps_mumu",&Eps_mumu);
01928   paramtree->Branch("Eps_mutau",&Eps_mutau);
01929   paramtree->Branch("Eps_tautau",&Eps_tautau);
01930   paramtree->Branch("Delta_emu",&Delta_emu);
01931   paramtree->Branch("Delta_etau",&Delta_etau);
01932   paramtree->Branch("Delta_mutau",&Delta_mutau);
01933   paramtree->Branch("Theta14",&Theta14,"Theta14/D");
01934   paramtree->Branch("Theta24",&Theta24,"Theta24/D");
01935   paramtree->Branch("Theta34",&Theta34,"Theta34/D");
01936   paramtree->Branch("Dm41",&Dm41,"Dm41/D");
01937   paramtree->Branch("Delta14",&Delta14);
01938   paramtree->Branch("Delta24",&Delta24);
01939 
01940 
01941   paramtree->Fill();
01942   
01943   for(unsigned int i=0;i<FDComponents.size();i++)
01944   {
01945     Pred[FDComponents[i]]->Write();
01946   }
01947   
01948   Pred_3D[qNC]->Write();
01949   Pred_3D[qNuMuToNuMu]->Write();
01950   Pred_3D[qBNueToNuMu]->Write();
01951   Pred_3D[qBNueToBNue]->Write();
01952   Pred_3D[qNuMuToNue]->Write();
01953   Pred_3D[qNuMuToNuTau]->Write();
01954   Pred_3D[qBNueToNuTau]->Write();
01955   
01956   if(UseSeparateNuNuBar)
01957   {
01958     Pred_Nu_3D[qNC]->Write();
01959     Pred_Nu_3D[qNuMuToNuMu]->Write();
01960     Pred_Nu_3D[qBNueToNuMu]->Write();
01961     Pred_Nu_3D[qBNueToBNue]->Write();
01962     Pred_Nu_3D[qNuMuToNue]->Write();
01963     Pred_Nu_3D[qNuMuToNuTau]->Write();
01964     Pred_Nu_3D[qBNueToNuTau]->Write();
01965     
01966     Pred_NuBar_3D[qNC]->Write();
01967     Pred_NuBar_3D[qNuMuToNuMu]->Write();
01968     Pred_NuBar_3D[qBNueToNuMu]->Write();
01969     Pred_NuBar_3D[qBNueToBNue]->Write();
01970     Pred_NuBar_3D[qNuMuToNue]->Write();
01971     Pred_NuBar_3D[qNuMuToNuTau]->Write();
01972     Pred_NuBar_3D[qBNueToNuTau]->Write();
01973   }
01974   
01975   Pred_TotalBkgd->Write();
01976   if(UseSeparateNuNuBar)
01977   {
01978     Pred_NueCCSignal->Write();
01979     Pred_NueBarCCSignal->Write();
01980   }
01981   
01982   Pred_CC_Fid->Write();
01983   if(UseSeparateNuNuBar)
01984   {
01985     Pred_NuMuCC_Fid->Write();
01986     Pred_NuMuBarCC_Fid->Write();
01987   }
01988   FNRatio[Background::kNC]->Write();
01989   FNRatio[Background::kNuMuCC]->Write();
01990   FNRatio[Background::kBNueCC]->Write();
01991   
01992   NDData[Background::kNC]->Write(Form("NDData_NC_%s_Run%i",PID_NDData.c_str(),RunPeriod));
01993   NDData[Background::kNuMuCC]->Write(Form("NDData_NuMuCC_%s_Run%i",PID_NDData.c_str(),RunPeriod));
01994   NDData[Background::kBNueCC]->Write(Form("NDData_BNueCC_%s_Run%i",PID_NDData.c_str(),RunPeriod));
01995   NDData_Reco_CClike->Write();
01996   if(UseSeparateNuNuBar)
01997   {
01998     NDData_Reco_CClike_Neg->Write();
01999     NDData_Reco_CClike_Pos->Write();
02000   }
02001   
02002   if( OscMethod == 3){
02003   FD_TrueVsRecoVsPID_NC_NueFrac->Write();
02004   FD_TrueVsRecoVsPID_NC_NueBarFrac->Write();
02005   FD_TrueVsRecoVsPID_NC_NuMuFrac->Write();
02006   FD_TrueVsRecoVsPID_NC_NuMuBarFrac->Write();
02007   }
02008   paramtree->Write();
02009   
02010   //ExtrapFile->Close();
02011   
02012   return;
02013 }


Member Data Documentation

Double_t Extrapolate2D::Delta14 [protected]

Definition at line 298 of file Extrapolate2D.h.

Referenced by Extrapolate2D(), ReadExtrap(), ReadFNFile(), and WriteToFile().

Double_t Extrapolate2D::Delta24 [protected]

Definition at line 299 of file Extrapolate2D.h.

Referenced by Extrapolate2D(), ReadExtrap(), ReadFNFile(), and WriteToFile().

Double_t Extrapolate2D::Delta_emu [protected]

Definition at line 290 of file Extrapolate2D.h.

Referenced by Extrapolate2D(), ReadExtrap(), ReadFNFile(), and WriteToFile().

Double_t Extrapolate2D::Delta_etau [protected]

Definition at line 291 of file Extrapolate2D.h.

Referenced by Extrapolate2D(), ReadExtrap(), ReadFNFile(), and WriteToFile().

Double_t Extrapolate2D::Delta_mutau [protected]

Definition at line 292 of file Extrapolate2D.h.

Referenced by Extrapolate2D(), ReadExtrap(), ReadFNFile(), and WriteToFile().

Double_t Extrapolate2D::DeltaCP [protected]
Double_t Extrapolate2D::DeltaMSq12 [protected]
Double_t Extrapolate2D::DeltaMSq23 [protected]
Double_t Extrapolate2D::Dm41 [protected]

Definition at line 297 of file Extrapolate2D.h.

Referenced by Extrapolate2D(), ReadExtrap(), ReadFNFile(), and WriteToFile().

Double_t Extrapolate2D::Eps_ee [protected]

Definition at line 284 of file Extrapolate2D.h.

Referenced by Extrapolate2D(), ReadExtrap(), ReadFNFile(), and WriteToFile().

Double_t Extrapolate2D::Eps_emu [protected]

Definition at line 285 of file Extrapolate2D.h.

Referenced by Extrapolate2D(), ReadExtrap(), ReadFNFile(), and WriteToFile().

Double_t Extrapolate2D::Eps_etau [protected]

Definition at line 286 of file Extrapolate2D.h.

Referenced by Extrapolate2D(), ReadExtrap(), ReadFNFile(), and WriteToFile().

Double_t Extrapolate2D::Eps_mumu [protected]

Definition at line 287 of file Extrapolate2D.h.

Referenced by Extrapolate2D(), ReadExtrap(), ReadFNFile(), and WriteToFile().

Double_t Extrapolate2D::Eps_mutau [protected]

Definition at line 288 of file Extrapolate2D.h.

Referenced by Extrapolate2D(), ReadExtrap(), ReadFNFile(), and WriteToFile().

Double_t Extrapolate2D::Eps_tautau [protected]

Definition at line 289 of file Extrapolate2D.h.

Referenced by Extrapolate2D(), ReadExtrap(), ReadFNFile(), and WriteToFile().

TFile* Extrapolate2D::ExtrapFile [protected]

Definition at line 317 of file Extrapolate2D.h.

Referenced by SetOutputFile(), WriteToFile(), and ~Extrapolate2D().

std::map<Background::Background_t,TH2D*> Extrapolate2D::FD_Eff [protected]
TH1D* Extrapolate2D::FD_Eff_CC [protected]

Definition at line 258 of file Extrapolate2D.h.

Referenced by AppearancePred(), and ReadFNFile().

Definition at line 253 of file Extrapolate2D.h.

Referenced by GetNoOscCCPrediction(), and ReadFNFile().

Definition at line 251 of file Extrapolate2D.h.

Referenced by GetNoOscCCPrediction(), and ReadFNFile().

TH1D* Extrapolate2D::FD_Purity_CC [protected]

Definition at line 252 of file Extrapolate2D.h.

Referenced by GetNoOscCCPrediction(), and ReadFNFile().

Definition at line 250 of file Extrapolate2D.h.

Referenced by GetNoOscCCPrediction(), and ReadFNFile().

Definition at line 246 of file Extrapolate2D.h.

Referenced by GetNoOscCCPrediction(), and ReadFNFile().

Definition at line 245 of file Extrapolate2D.h.

Referenced by GetNoOscCCPrediction(), and ReadFNFile().

TH1D* Extrapolate2D::FD_Reco_CClike [protected]

Definition at line 242 of file Extrapolate2D.h.

Referenced by GetNoOscCCPrediction(), and ReadFNFile().

Definition at line 241 of file Extrapolate2D.h.

Referenced by GetNoOscCCPrediction(), and ReadFNFile().

Definition at line 257 of file Extrapolate2D.h.

Referenced by AppearancePred(), and ReadFNFile().

Definition at line 215 of file Extrapolate2D.h.

Referenced by ReadFNFile().

Definition at line 216 of file Extrapolate2D.h.

Referenced by ReadFNFile().

Definition at line 202 of file Extrapolate2D.h.

Referenced by ReadFNFile().

Definition at line 206 of file Extrapolate2D.h.

Referenced by ReadFNFile().

Definition at line 201 of file Extrapolate2D.h.

Referenced by ReadFNFile().

Definition at line 205 of file Extrapolate2D.h.

Referenced by ReadFNFile().

Definition at line 213 of file Extrapolate2D.h.

Referenced by ReadFNFile(), and RebinInputHists().

Definition at line 198 of file Extrapolate2D.h.

Referenced by ReadFNFile().

Definition at line 214 of file Extrapolate2D.h.

Referenced by ReadFNFile(), and RebinInputHists().

Definition at line 104 of file Extrapolate2D.h.

Referenced by ReadFNFile().

string Extrapolate2D::FN_infile [protected]
Bool_t Extrapolate2D::FNforBeamNue [protected]
TH1F* Extrapolate2D::fNueBarCCXSec[5] [protected]

Definition at line 270 of file Extrapolate2D.h.

Referenced by ReadXSecFile().

TH1F* Extrapolate2D::fNueCCXSec[5] [protected]

Definition at line 267 of file Extrapolate2D.h.

Referenced by ReadXSecFile().

TH1F* Extrapolate2D::fNuMuBarCCXSec[5] [protected]

Definition at line 268 of file Extrapolate2D.h.

Referenced by ReadXSecFile().

TH1F* Extrapolate2D::fNuMuCCXSec[5] [protected]

Definition at line 265 of file Extrapolate2D.h.

Referenced by ReadXSecFile().

TH1F* Extrapolate2D::fNuTauBarCCXSec[5] [protected]

Definition at line 269 of file Extrapolate2D.h.

Referenced by ReadXSecFile().

TH1F* Extrapolate2D::fNuTauCCXSec[5] [protected]

Definition at line 266 of file Extrapolate2D.h.

Referenced by ReadXSecFile().

string Extrapolate2D::inFileName [protected]

Definition at line 307 of file Extrapolate2D.h.

Referenced by ReadExtrap(), and SetReadExtrapFromFile().

bool Extrapolate2D::Init [protected]
string Extrapolate2D::MRE_infile [protected]
TH2D* Extrapolate2D::MREEffRatio [protected]

Definition at line 262 of file Extrapolate2D.h.

Referenced by ReadFNFile(), and ReadMREFile().

Definition at line 234 of file Extrapolate2D.h.

Referenced by FarNearPred(), and ReadFNFile().

TH1D* Extrapolate2D::ND_Reco_CClike [protected]

Definition at line 238 of file Extrapolate2D.h.

Referenced by GetNoOscCCPrediction(), and ReadFNFile().

Definition at line 237 of file Extrapolate2D.h.

Referenced by GetNoOscCCPrediction(), and ReadFNFile().

Definition at line 227 of file Extrapolate2D.h.

Referenced by ReadFNFile().

Definition at line 231 of file Extrapolate2D.h.

Referenced by ReadFNFile().

Definition at line 226 of file Extrapolate2D.h.

Referenced by ReadFNFile().

Definition at line 230 of file Extrapolate2D.h.

Referenced by ReadFNFile().

Definition at line 223 of file Extrapolate2D.h.

Referenced by ReadFNFile().

Definition at line 219 of file Extrapolate2D.h.

Referenced by ReadFNFile(), and RebinInputHists().

string Extrapolate2D::NDData_infile [protected]

Definition at line 101 of file Extrapolate2D.h.

Referenced by GetNoOscCCPrediction(), ReadExtrap(), ReadFNFile(), and WriteToFile().

Definition at line 100 of file Extrapolate2D.h.

Referenced by GetNoOscCCPrediction(), ReadExtrap(), ReadFNFile(), and WriteToFile().

Definition at line 98 of file Extrapolate2D.h.

Referenced by Extrapolate2D_Simple::ReadNDDataFile().

Definition at line 103 of file Extrapolate2D.h.

Referenced by ReadFNFile().

std::map<OscType_t,TH1D*> Extrapolate2D::NominalOscProb [protected]
std::map<OscType_t,TH1D*> Extrapolate2D::NominalOscProb_NuBar [protected]
int Extrapolate2D::nPID [protected]
Double_t Extrapolate2D::nPOTFar [protected]
Double_t Extrapolate2D::nPOTNear [protected]
int Extrapolate2D::nReco [protected]
int Extrapolate2D::nRecoCC [protected]
int Extrapolate2D::nTrue [protected]
bool Extrapolate2D::Oscillated [protected]
int Extrapolate2D::OscMethod [protected]
string Extrapolate2D::outFileName [protected]

Definition at line 156 of file Extrapolate2D.h.

Referenced by SetOutputFile().

string Extrapolate2D::PID [protected]
string Extrapolate2D::PID_NDData [protected]
vector<double> Extrapolate2D::PIDEdges [protected]
bool Extrapolate2D::PrintResult [protected]
bool Extrapolate2D::ReadError [protected]
Bool_t Extrapolate2D::RebinE [protected]
Bool_t Extrapolate2D::RebinP [protected]
vector<double> Extrapolate2D::RecoCCEdges [protected]
vector<double> Extrapolate2D::RecoEdges [protected]
Int_t Extrapolate2D::RunPeriod [protected]
Double_t Extrapolate2D::Theta12 [protected]
Double_t Extrapolate2D::Theta13 [protected]
Double_t Extrapolate2D::Theta14 [protected]

Definition at line 294 of file Extrapolate2D.h.

Referenced by Extrapolate2D(), ReadExtrap(), ReadFNFile(), and WriteToFile().

Double_t Extrapolate2D::Theta23 [protected]
Double_t Extrapolate2D::Theta24 [protected]

Definition at line 295 of file Extrapolate2D.h.

Referenced by Extrapolate2D(), ReadExtrap(), ReadFNFile(), and WriteToFile().

Double_t Extrapolate2D::Theta34 [protected]

Definition at line 296 of file Extrapolate2D.h.

Referenced by Extrapolate2D(), ReadExtrap(), ReadFNFile(), and WriteToFile().

vector<double> Extrapolate2D::TrueEdges [protected]
bool Extrapolate2D::WriteOutput [protected]
string Extrapolate2D::XSec_infile [protected]

Definition at line 187 of file Extrapolate2D.h.

Referenced by ReadXSecFile(), and SetXSecFile().

Definition at line 272 of file Extrapolate2D.h.

Referenced by AppearancePred(), and ReadXSecFile().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1