ExtrapFileGen Class Reference

#include <ExtrapFileGen.h>

List of all members.

Public Member Functions

 ExtrapFileGen ()
virtual ~ExtrapFileGen ()
void SetOutputFile (string name="DefaultOut.root")
void SetNearPOT (double pot=1e19)
void SetFarPOT (double pot=7e20)
void AddPID (string pidname)
void SetFileLists (string nddata="NULL", string ndmc="NULL", string fdmcbeam="NULL", string fdmcnue="NULL", string fdmctau="NULL")
void Run ()
void SetFakeData ()

Private Member Functions

void Initialize ()
void InitializeHistograms ()
void WriteToFile ()

Private Attributes

ExtrapHists2DExHists_NDMC
ExtrapHists2DExHists_NDData
ExtrapHists2DExHists_FDMC
ExtrapHists2DExHists_Nu_FDMC
ExtrapHists2DExHists_NuBar_FDMC
string outFileName
string FileList_NDData
string FileList_NDMC
string FileList_FDMC_Beam
string FileList_FDMC_Nue
string FileList_FDMC_Tau
double fNearPOT
double fFarPOT
vector< std::string > PIDlist
TFile * fout
TTree * paramtree
double Theta12
double Theta13
double Theta23
double DeltaMSq23
double DeltaMSq12
double DeltaCP
int nReco
int nTrue
int nPID
vector< double > RecoEdges
vector< double > PIDEdges
vector< double > TrueEdges
bool fakedata

Detailed Description

Definition at line 23 of file ExtrapFileGen.h.


Constructor & Destructor Documentation

ExtrapFileGen::ExtrapFileGen (  ) 

Definition at line 3 of file ExtrapFileGen.cxx.

References Initialize().

00004 {
00005   Initialize();
00006   return;
00007 }

virtual ExtrapFileGen::~ExtrapFileGen (  )  [inline, virtual]

Definition at line 27 of file ExtrapFileGen.h.

00027 {};


Member Function Documentation

void ExtrapFileGen::AddPID ( string  pidname  ) 

Definition at line 26 of file ExtrapFileGen.cxx.

References PIDlist.

00027 {
00028   PIDlist.push_back(pidname);
00029   return;
00030 }

void ExtrapFileGen::Initialize (  )  [private]

Definition at line 8 of file ExtrapFileGen.cxx.

References fakedata, fout, nPID, nReco, nTrue, paramtree, SetFarPOT(), SetFileLists(), SetNearPOT(), and SetOutputFile().

Referenced by ExtrapFileGen().

00009 {
00010   SetOutputFile();
00011   SetNearPOT();
00012   SetFarPOT();
00013   SetFileLists();
00014   
00015   fout = 0;
00016   paramtree = 0;
00017   
00018   nReco = 0;
00019   nPID = 0;
00020   nTrue = 0;
00021   
00022   fakedata=false;
00023   
00024   return;
00025 }

void ExtrapFileGen::InitializeHistograms (  )  [private]

Definition at line 125 of file ExtrapFileGen.cxx.

References ExtrapHists2D::AddPID(), ExHists_FDMC, ExHists_NDData, ExHists_NDMC, ExHists_Nu_FDMC, ExHists_NuBar_FDMC, ExtrapHists2D::fDirectory, ExtrapHists2D::InitializeHists(), nPID, nReco, nTrue, PIDEdges, PIDlist, RecoEdges, ExtrapHists2D::SetPIDBins(), ExtrapHists2D::SetRecoBins(), ExtrapHists2D::SetTrueBins(), and TrueEdges.

Referenced by Run().

00126 {
00127   double *r = new double[nReco+1];
00128   double *p = new double[nPID+1];
00129   double *t = new double[nTrue+1];
00130   int i;
00131   for(i=0;i<nReco+1;i++)
00132   {
00133     r[i] = RecoEdges.at(i);
00134   }
00135   for(i=0;i<nPID+1;i++)
00136   {
00137     p[i] = PIDEdges.at(i);
00138   }
00139   for(i=0;i<nTrue+1;i++)
00140   {
00141     t[i] = TrueEdges.at(i);
00142   }
00143   
00144   gDirectory->cd("/");
00145   unsigned int np = PIDlist.size();
00146   unsigned int j;
00147   
00148   ExHists_NDMC = new ExtrapHists2D("ExtrapHists_NDMC");
00149   ExHists_NDMC->fDirectory->cd();
00150   for(j=0;j<np;j++)
00151   {
00152     ExHists_NDMC->AddPID(PIDlist[j]);
00153   }
00154   ExHists_NDMC->SetPIDBins(nPID,p);
00155   ExHists_NDMC->SetRecoBins(nReco,r);
00156   ExHists_NDMC->SetTrueBins(nTrue,t);
00157   ExHists_NDMC->InitializeHists();
00158   
00159   ExHists_FDMC = new ExtrapHists2D("ExtrapHists_FDMC");
00160   ExHists_FDMC->fDirectory->cd();
00161   for(j=0;j<np;j++)
00162   {
00163     ExHists_FDMC->AddPID(PIDlist[j]);
00164   }
00165   ExHists_FDMC->SetPIDBins(nPID,p);
00166   ExHists_FDMC->SetRecoBins(nReco,r);
00167   ExHists_FDMC->SetTrueBins(nTrue,t);
00168   ExHists_FDMC->InitializeHists();
00169   
00170   ExHists_Nu_FDMC = new ExtrapHists2D("ExtrapHists_Nu_FDMC");
00171   ExHists_Nu_FDMC->fDirectory->cd();
00172   for(j=0;j<np;j++)
00173   {
00174     ExHists_Nu_FDMC->AddPID(PIDlist[j]);
00175   }
00176   ExHists_Nu_FDMC->SetPIDBins(nPID,p);
00177   ExHists_Nu_FDMC->SetRecoBins(nReco,r);
00178   ExHists_Nu_FDMC->SetTrueBins(nTrue,t);
00179   ExHists_Nu_FDMC->InitializeHists();
00180   
00181   ExHists_NuBar_FDMC = new ExtrapHists2D("ExtrapHists_NuBar_FDMC");
00182   ExHists_NuBar_FDMC->fDirectory->cd();
00183   for(j=0;j<np;j++)
00184   {
00185     ExHists_NuBar_FDMC->AddPID(PIDlist[j]);
00186   }
00187   ExHists_NuBar_FDMC->SetPIDBins(nPID,p);
00188   ExHists_NuBar_FDMC->SetRecoBins(nReco,r);
00189   ExHists_NuBar_FDMC->SetTrueBins(nTrue,t);
00190   ExHists_NuBar_FDMC->InitializeHists();
00191   
00192   ExHists_NDData = new ExtrapHists2D("ExtrapHist_NDData");
00193   ExHists_NDData->fDirectory->cd();
00194   ExHists_NDData->SetPIDBins(nPID,p);
00195   ExHists_NDData->SetRecoBins(nReco,r);
00196   ExHists_NDData->SetTrueBins(nTrue,t);
00197   ExHists_NDData->InitializeHists();
00198   
00199   return;
00200 }

void ExtrapFileGen::Run (  ) 

Definition at line 201 of file ExtrapFileGen.cxx.

References DeltaCP, DeltaMSq12, DeltaMSq23, ExHists_FDMC, ExHists_NDData, ExHists_NDMC, ExHists_Nu_FDMC, ExHists_NuBar_FDMC, fakedata, fFarPOT, FileList_FDMC_Beam, FileList_FDMC_Nue, FileList_FDMC_Tau, FileList_NDData, FileList_NDMC, fNearPOT, Form(), gSystem(), InitializeHistograms(), n, nPID, nReco, nTrue, PIDEdges, PIDlist, ExtrapHists2D::Reco_CClike, ExtrapHists2D::Reco_CClike_Neg, ExtrapHists2D::Reco_CClike_Pos, RecoEdges, Theta12, Theta13, Theta23, ExtrapHists2D::True_Fid_NueBarCC, ExtrapHists2D::True_Fid_NueCC, ExtrapHists2D::True_Fid_NuTauBarCC, ExtrapHists2D::True_Fid_NuTauCC, TrueEdges, ExtrapHists2D::TrueVsReco_CClike, ExtrapHists2D::TrueVsReco_CClike_Neg, ExtrapHists2D::TrueVsReco_CClike_Neg_NuMuCC, ExtrapHists2D::TrueVsReco_CClike_NuMuCC, ExtrapHists2D::TrueVsReco_CClike_Pos, ExtrapHists2D::TrueVsReco_CClike_Pos_NuMuBarCC, ExtrapHists2D::TrueVsReco_Fid, ExtrapHists2D::TrueVsReco_Fid_NueBarCC, ExtrapHists2D::TrueVsReco_Fid_NueCC, ExtrapHists2D::TrueVsReco_Fid_NuMuBarCC, ExtrapHists2D::TrueVsReco_Fid_NuMuCC, ExtrapHists2D::TrueVsReco_Fid_NuTauBarCC, ExtrapHists2D::TrueVsReco_Fid_NuTauCC, ExtrapHists2D::TrueVsRecoVsPID_BNueToBNue, ExtrapHists2D::TrueVsRecoVsPID_BNueToNuMu, ExtrapHists2D::TrueVsRecoVsPID_BNueToNuTau, ExtrapHists2D::TrueVsRecoVsPID_NC, ExtrapHists2D::TrueVsRecoVsPID_NC_NoOscNue, ExtrapHists2D::TrueVsRecoVsPID_NC_NoOscNueBar, ExtrapHists2D::TrueVsRecoVsPID_NC_NoOscNuMu, ExtrapHists2D::TrueVsRecoVsPID_NC_NoOscNuMuBar, ExtrapHists2D::TrueVsRecoVsPID_NuMuToNue, ExtrapHists2D::TrueVsRecoVsPID_NuMuToNuMu, ExtrapHists2D::TrueVsRecoVsPID_NuMuToNuTau, and WriteToFile().

00202 {
00203   //first read in one file to get the bin edges
00204   ifstream flist;
00205   string line;
00206   flist.open(gSystem->ExpandPathName(FileList_NDMC.c_str()));
00207   getline(flist,line);
00208   TH3D *h3;
00209   int i;
00210   if(!line.empty())
00211   {
00212     if(gSystem->AccessPathName(gSystem->ExpandPathName(line.c_str())))
00213       {
00214         cout<<line<<" doesn't exist.  Quitting..."<<endl;
00215         return;
00216       }
00217       TFile f(line.c_str(),"READ");
00218       if(f.Read("NDMC")==0)
00219       {
00220         cout<<"NDMC directory doesn't exist in "<<line<<".  Quitting..."<<endl;
00221         return;
00222       }
00223       h3 = (TH3D*)f.Get(Form("NDMC/TrueVsRecoVs%s_NC",PIDlist[0].c_str()));
00224       nPID = h3->GetNbinsX();
00225       nReco = h3->GetNbinsY();
00226       nTrue = h3->GetNbinsZ();
00227       for(i=0;i<nPID+1;i++)
00228       {
00229         PIDEdges.push_back(h3->GetXaxis()->GetBinLowEdge(i+1));
00230       }
00231       for(i=0;i<nReco+1;i++)
00232       {
00233         RecoEdges.push_back(h3->GetYaxis()->GetBinLowEdge(i+1));
00234       }
00235       for(i=0;i<nTrue+1;i++)
00236       {
00237         TrueEdges.push_back(h3->GetZaxis()->GetBinLowEdge(i+1));
00238       }
00239   }
00240   
00241   InitializeHistograms();
00242   
00243   unsigned int np = PIDlist.size();
00244   unsigned int j;
00245   int n=0;
00246   
00247   gROOT->cd("/");
00248   TTree *paramtree_;
00249   double del,dm2_23,dm2_12,t12,t13,t23,npot;
00250   
00251   if(!fakedata)//if using real ND data
00252   {
00253   cout<<"NDData:"<<endl;
00254   double tot_ndata=0;
00255   ifstream filelist;
00256   filelist.open(gSystem->ExpandPathName(FileList_NDData.c_str()));
00257   if(!filelist.good())
00258   {
00259     cout<<"Problem reading "<<FileList_NDData<<". Quitting..."<<endl;
00260     return;
00261   }
00262   n=0;
00263   while(!filelist.eof())
00264   {
00265     cout<<n<<endl;
00266     getline(filelist,line);
00267     if(!line.empty())
00268     {
00269       if(gSystem->AccessPathName(gSystem->ExpandPathName(line.c_str())))
00270       {
00271         cout<<line<<" doesn't exist.  Skipping..."<<endl;
00272         continue;
00273       }
00274       TFile f(line.c_str(),"READ");
00275       if(f.Read("NDData")==0 || f.Read("paramtree")==0)
00276       {
00277         cout<<"NDData directory or paramtree doesn't exist.  Skipping..."<<endl;
00278         continue;
00279       }
00280       
00281       ExHists_NDData->Reco_CClike->Add((TH1D*)f.Get("NDData/Reco_CClike"));
00282       ExHists_NDData->Reco_CClike_Pos->Add((TH1D*)f.Get("NDData/Reco_CClike_Pos"));
00283       ExHists_NDData->Reco_CClike_Neg->Add((TH1D*)f.Get("NDData/Reco_CClike_Neg"));
00284       
00285       paramtree_ = (TTree*)f.Get("paramtree");
00286       paramtree_->SetBranchAddress("POT",&npot);
00287       paramtree_->GetEntry(0);
00288       tot_ndata+=npot;
00289     }
00290     n++;
00291   }
00292   filelist.close();
00293   
00294   ExHists_NDData->Reco_CClike->Scale(fNearPOT/tot_ndata);
00295   ExHists_NDData->Reco_CClike_Pos->Scale(fNearPOT/tot_ndata);
00296   ExHists_NDData->Reco_CClike_Neg->Scale(fNearPOT/tot_ndata);
00297   }
00298   
00299   cout<<"NDMC:"<<endl;
00300   double tot_nmc=0;
00301   ifstream filelist2;
00302   filelist2.open(gSystem->ExpandPathName(FileList_NDMC.c_str()));
00303   if(!filelist2.good())
00304   {
00305     cout<<"Problem reading "<<FileList_NDMC<<". Quitting..."<<endl;
00306     return;
00307   }
00308   n=0;
00309   while(!filelist2.eof())
00310   {
00311     cout<<n<<endl;
00312     getline(filelist2,line);
00313     if(!line.empty())
00314     {
00315       if(gSystem->AccessPathName(gSystem->ExpandPathName(line.c_str())))
00316       {
00317         cout<<line<<" doesn't exist.  Skipping..."<<endl;
00318         continue;
00319       }
00320       TFile f(line.c_str(),"READ");
00321       if(f.Read("NDMC")==0 || f.Read("paramtree")==0)
00322       {
00323         cout<<"NDMC directory or paramtree doesn't exist.  Skipping..."<<endl;
00324         continue;
00325       }
00326       
00327       ExHists_NDMC->TrueVsReco_Fid->Add((TH2D*)f.Get("NDMC/TrueVsReco_Fid"));
00328       ExHists_NDMC->TrueVsReco_Fid_NuMuCC->Add((TH2D*)f.Get("NDMC/TrueVsReco_Fid_NuMuCC"));
00329       ExHists_NDMC->TrueVsReco_Fid_NuMuBarCC->Add((TH2D*)f.Get("NDMC/TrueVsReco_Fid_NuMuBarCC"));
00330       ExHists_NDMC->TrueVsReco_CClike->Add((TH2D*)f.Get("NDMC/TrueVsReco_CClike"));
00331       ExHists_NDMC->TrueVsReco_CClike_Pos->Add((TH2D*)f.Get("NDMC/TrueVsReco_CClike_Pos"));
00332       ExHists_NDMC->TrueVsReco_CClike_Neg->Add((TH2D*)f.Get("NDMC/TrueVsReco_CClike_Neg"));
00333       ExHists_NDMC->TrueVsReco_CClike_NuMuCC->Add((TH2D*)f.Get("NDMC/TrueVsReco_CClike_NuMuCC"));
00334       ExHists_NDMC->TrueVsReco_CClike_Pos_NuMuBarCC->Add((TH2D*)f.Get("NDMC/TrueVsReco_CClike_Pos_NuMuBarCC"));
00335       ExHists_NDMC->TrueVsReco_CClike_Neg_NuMuCC->Add((TH2D*)f.Get("NDMC/TrueVsReco_CClike_Neg_NuMuCC"));
00336       
00337       for(j=0;j<np;j++)
00338       {
00339         ExHists_NDMC->TrueVsRecoVsPID_NC[PIDlist[j]]->Add((TH3D*)f.Get(Form("NDMC/TrueVsRecoVs%s_NC",PIDlist[j].c_str())));
00340         ExHists_NDMC->TrueVsRecoVsPID_NuMuToNuMu[PIDlist[j]]->Add((TH3D*)f.Get(Form("NDMC/TrueVsRecoVs%s_NuMuToNuMu",PIDlist[j].c_str())));
00341         ExHists_NDMC->TrueVsRecoVsPID_BNueToBNue[PIDlist[j]]->Add((TH3D*)f.Get(Form("NDMC/TrueVsRecoVs%s_BNueToBNue",PIDlist[j].c_str())));
00342       }
00343       
00344       paramtree_ = (TTree*)f.Get("paramtree");
00345       paramtree_->SetBranchAddress("POT",&npot);
00346       paramtree_->GetEntry(0);
00347       tot_nmc+=npot;
00348     }
00349     n++;
00350   }
00351   filelist2.close();
00352   
00353   ExHists_NDMC->TrueVsReco_Fid->Scale(fNearPOT/tot_nmc);
00354   ExHists_NDMC->TrueVsReco_Fid_NuMuCC->Scale(fNearPOT/tot_nmc);
00355   ExHists_NDMC->TrueVsReco_Fid_NuMuBarCC->Scale(fNearPOT/tot_nmc);
00356   ExHists_NDMC->TrueVsReco_CClike->Scale(fNearPOT/tot_nmc);
00357   ExHists_NDMC->TrueVsReco_CClike_Pos->Scale(fNearPOT/tot_nmc);
00358   ExHists_NDMC->TrueVsReco_CClike_Neg->Scale(fNearPOT/tot_nmc);
00359   ExHists_NDMC->TrueVsReco_CClike_NuMuCC->Scale(fNearPOT/tot_nmc);
00360   ExHists_NDMC->TrueVsReco_CClike_Pos_NuMuBarCC->Scale(fNearPOT/tot_nmc);
00361   ExHists_NDMC->TrueVsReco_CClike_Neg_NuMuCC->Scale(fNearPOT/tot_nmc);
00362   
00363   for(j=0;j<np;j++)
00364   {
00365     ExHists_NDMC->TrueVsRecoVsPID_NC[PIDlist[j]]->Scale(fNearPOT/tot_nmc);
00366     ExHists_NDMC->TrueVsRecoVsPID_NuMuToNuMu[PIDlist[j]]->Scale(fNearPOT/tot_nmc);
00367     ExHists_NDMC->TrueVsRecoVsPID_BNueToBNue[PIDlist[j]]->Scale(fNearPOT/tot_nmc);
00368   }
00369   
00370   if(fakedata)
00371   {
00372     ExHists_NDData->Reco_CClike->Add(ExHists_NDMC->TrueVsReco_CClike->ProjectionX());
00373     ExHists_NDData->Reco_CClike_Pos->Add(ExHists_NDMC->TrueVsReco_CClike_Pos->ProjectionX());
00374     ExHists_NDData->Reco_CClike_Neg->Add(ExHists_NDMC->TrueVsReco_CClike_Neg->ProjectionX());
00375   }
00376   
00377   gROOT->cd("/");
00378   vector<TH3D*> TrueVsRecoVsPID_NC_Beam;
00379   vector<TH3D*> TrueVsRecoVsPID_NC_Nue;
00380   vector<TH3D*> TrueVsRecoVsPID_NC_Tau;
00381   for(j=0;j<np;j++)
00382   {
00383     TrueVsRecoVsPID_NC_Beam.push_back((TH3D*)ExHists_NDMC->TrueVsRecoVsPID_NC[PIDlist[j]]->Clone(Form("NC_Beam_%s",PIDlist[j].c_str())));
00384     TrueVsRecoVsPID_NC_Nue.push_back((TH3D*)ExHists_NDMC->TrueVsRecoVsPID_NC[PIDlist[j]]->Clone(Form("NC_Nue_%s",PIDlist[j].c_str())));
00385     TrueVsRecoVsPID_NC_Tau.push_back((TH3D*)ExHists_NDMC->TrueVsRecoVsPID_NC[PIDlist[j]]->Clone(Form("NC_Tau_%s",PIDlist[j].c_str())));
00386     
00387     TrueVsRecoVsPID_NC_Beam[j]->Reset();
00388     TrueVsRecoVsPID_NC_Nue[j]->Reset();
00389     TrueVsRecoVsPID_NC_Tau[j]->Reset();
00390   }
00391   vector<TH3D*> TrueVsRecoVsPID_Nu_NC_Beam;
00392   vector<TH3D*> TrueVsRecoVsPID_Nu_NC_Nue;
00393   vector<TH3D*> TrueVsRecoVsPID_Nu_NC_Tau;
00394   for(j=0;j<np;j++)
00395   {
00396     TrueVsRecoVsPID_Nu_NC_Beam.push_back((TH3D*)ExHists_NDMC->TrueVsRecoVsPID_NC[PIDlist[j]]->Clone(Form("Nu_NC_Beam_%s",PIDlist[j].c_str())));
00397     TrueVsRecoVsPID_Nu_NC_Nue.push_back((TH3D*)ExHists_NDMC->TrueVsRecoVsPID_NC[PIDlist[j]]->Clone(Form("Nu_NC_Nue_%s",PIDlist[j].c_str())));
00398     TrueVsRecoVsPID_Nu_NC_Tau.push_back((TH3D*)ExHists_NDMC->TrueVsRecoVsPID_NC[PIDlist[j]]->Clone(Form("Nu_NC_Tau_%s",PIDlist[j].c_str())));
00399     
00400     TrueVsRecoVsPID_Nu_NC_Beam[j]->Reset();
00401     TrueVsRecoVsPID_Nu_NC_Nue[j]->Reset();
00402     TrueVsRecoVsPID_Nu_NC_Tau[j]->Reset();
00403   }
00404   vector<TH3D*> TrueVsRecoVsPID_NuBar_NC_Beam;
00405   vector<TH3D*> TrueVsRecoVsPID_NuBar_NC_Nue;
00406   vector<TH3D*> TrueVsRecoVsPID_NuBar_NC_Tau;
00407   for(j=0;j<np;j++)
00408   {
00409     TrueVsRecoVsPID_NuBar_NC_Beam.push_back((TH3D*)ExHists_NDMC->TrueVsRecoVsPID_NC[PIDlist[j]]->Clone(Form("NuBar_NC_Beam_%s",PIDlist[j].c_str())));
00410     TrueVsRecoVsPID_NuBar_NC_Nue.push_back((TH3D*)ExHists_NDMC->TrueVsRecoVsPID_NC[PIDlist[j]]->Clone(Form("NuBar_NC_Nue_%s",PIDlist[j].c_str())));
00411     TrueVsRecoVsPID_NuBar_NC_Tau.push_back((TH3D*)ExHists_NDMC->TrueVsRecoVsPID_NC[PIDlist[j]]->Clone(Form("NuBar_NC_Tau_%s",PIDlist[j].c_str())));
00412     
00413     TrueVsRecoVsPID_NuBar_NC_Beam[j]->Reset();
00414     TrueVsRecoVsPID_NuBar_NC_Nue[j]->Reset();
00415     TrueVsRecoVsPID_NuBar_NC_Tau[j]->Reset();
00416   }
00417   
00418   cout<<"FDMC (Beam):"<<endl;
00419   double tot_fbmc=0;
00420   ifstream filelist3;
00421   filelist3.open(gSystem->ExpandPathName(FileList_FDMC_Beam.c_str()));
00422   if(!filelist3.good())
00423   {
00424     cout<<"Problem reading "<<FileList_FDMC_Beam<<". Quitting..."<<endl;
00425     return;
00426   }
00427   n=0;
00428   while(!filelist3.eof())
00429   {
00430     cout<<n<<endl;
00431     getline(filelist3,line);
00432     if(!line.empty())
00433     {
00434       if(gSystem->AccessPathName(gSystem->ExpandPathName(line.c_str())))
00435       {
00436         cout<<line<<" doesn't exist.  Skipping..."<<endl;
00437         continue;
00438       }
00439       TFile f(line.c_str(),"READ");
00440       if(f.Read("FDMC_Beam")==0 || f.Read("paramtree")==0)
00441       {
00442         cout<<"FDMC_Beam directory or paramtree doesn't exist.  Skipping..."<<endl;
00443         continue;
00444       }
00445       
00446       ExHists_FDMC->TrueVsReco_Fid->Add((TH2D*)f.Get("FDMC_Beam/TrueVsReco_Fid"));
00447       ExHists_FDMC->TrueVsReco_Fid_NuMuCC->Add((TH2D*)f.Get("FDMC_Beam/TrueVsReco_Fid_NuMuCC"));
00448       ExHists_FDMC->TrueVsReco_Fid_NuMuBarCC->Add((TH2D*)f.Get("FDMC_Beam/TrueVsReco_Fid_NuMuBarCC"));
00449       ExHists_FDMC->TrueVsReco_CClike->Add((TH2D*)f.Get("FDMC_Beam/TrueVsReco_CClike"));
00450       ExHists_FDMC->TrueVsReco_CClike_Pos->Add((TH2D*)f.Get("FDMC_Beam/TrueVsReco_CClike_Pos"));
00451       ExHists_FDMC->TrueVsReco_CClike_Neg->Add((TH2D*)f.Get("FDMC_Beam/TrueVsReco_CClike_Neg"));
00452       ExHists_FDMC->TrueVsReco_CClike_NuMuCC->Add((TH2D*)f.Get("FDMC_Beam/TrueVsReco_CClike_NuMuCC"));
00453       ExHists_FDMC->TrueVsReco_CClike_Pos_NuMuBarCC->Add((TH2D*)f.Get("FDMC_Beam/TrueVsReco_CClike_Pos_NuMuBarCC"));
00454       ExHists_FDMC->TrueVsReco_CClike_Neg_NuMuCC->Add((TH2D*)f.Get("FDMC_Beam/TrueVsReco_CClike_Neg_NuMuCC"));
00455       
00456       for(j=0;j<np;j++)
00457       {
00458         TrueVsRecoVsPID_NC_Beam[j]->Add((TH3D*)f.Get(Form("FDMC_Beam/TrueVsRecoVs%s_NC",PIDlist[j].c_str())));
00459         ExHists_FDMC->TrueVsRecoVsPID_NuMuToNuMu[PIDlist[j]]->Add((TH3D*)f.Get(Form("FDMC_Beam/TrueVsRecoVs%s_NuMuToNuMu",PIDlist[j].c_str())));
00460         ExHists_FDMC->TrueVsRecoVsPID_BNueToBNue[PIDlist[j]]->Add((TH3D*)f.Get(Form("FDMC_Beam/TrueVsRecoVs%s_BNueToBNue",PIDlist[j].c_str())));
00461         
00462         ExHists_FDMC->TrueVsRecoVsPID_NC_NoOscNue[PIDlist[j]]->Add((TH3D*)f.Get(Form("FDMC_Beam/TrueVsRecoVs%s_NC_NoOscNue",PIDlist[j].c_str())));
00463         ExHists_FDMC->TrueVsRecoVsPID_NC_NoOscNueBar[PIDlist[j]]->Add((TH3D*)f.Get(Form("FDMC_Beam/TrueVsRecoVs%s_NC_NoOscNueBar",PIDlist[j].c_str())));
00464         ExHists_FDMC->TrueVsRecoVsPID_NC_NoOscNuMu[PIDlist[j]]->Add((TH3D*)f.Get(Form("FDMC_Beam/TrueVsRecoVs%s_NC_NoOscNuMu",PIDlist[j].c_str())));
00465         ExHists_FDMC->TrueVsRecoVsPID_NC_NoOscNuMuBar[PIDlist[j]]->Add((TH3D*)f.Get(Form("FDMC_Beam/TrueVsRecoVs%s_NC_NoOscNuMuBar",PIDlist[j].c_str())));
00466       }
00467       
00468       paramtree_ = (TTree*)f.Get("paramtree");
00469       paramtree_->SetBranchAddress("POT",&npot);
00470       if(n==0)
00471       {
00472         paramtree_->SetBranchAddress("DeltaCP",&del);
00473         paramtree_->SetBranchAddress("DeltaMSq12",&dm2_12);
00474         paramtree_->SetBranchAddress("DeltaMSq23",&dm2_23);
00475         paramtree_->SetBranchAddress("Theta12",&t12);
00476         paramtree_->SetBranchAddress("Theta23",&t23);
00477         paramtree_->SetBranchAddress("Theta13",&t13);
00478       }
00479       paramtree_->GetEntry(0);
00480       tot_fbmc+=npot;
00481     }
00482     n++;
00483   }
00484   filelist3.close();
00485   
00486   cout<<"FDMC Nu (Beam):"<<endl;
00487   filelist3.clear();
00488   filelist3.open(gSystem->ExpandPathName(FileList_FDMC_Beam.c_str()));
00489   n=0;
00490   while(!filelist3.eof())
00491   {
00492     cout<<n<<endl;
00493     getline(filelist3,line);
00494     if(!line.empty())
00495     {
00496       if(gSystem->AccessPathName(gSystem->ExpandPathName(line.c_str())))
00497       {
00498         cout<<line<<" doesn't exist.  Skipping..."<<endl;
00499         continue;
00500       }
00501       TFile f(line.c_str(),"READ");
00502       if(f.Read("FDMC_Beam_Nu")==0 || f.Read("paramtree")==0)
00503       {
00504         cout<<"FDMC_Beam_Nu directory or paramtree doesn't exist.  Skipping..."<<endl;
00505         continue;
00506       }
00507       
00508       for(j=0;j<np;j++)
00509       {
00510         TrueVsRecoVsPID_Nu_NC_Beam[j]->Add((TH3D*)f.Get(Form("FDMC_Beam_Nu/TrueVsRecoVs%s_NC",PIDlist[j].c_str())));
00511         ExHists_Nu_FDMC->TrueVsRecoVsPID_NuMuToNuMu[PIDlist[j]]->Add((TH3D*)f.Get(Form("FDMC_Beam_Nu/TrueVsRecoVs%s_NuMuToNuMu",PIDlist[j].c_str())));
00512         ExHists_Nu_FDMC->TrueVsRecoVsPID_BNueToBNue[PIDlist[j]]->Add((TH3D*)f.Get(Form("FDMC_Beam_Nu/TrueVsRecoVs%s_BNueToBNue",PIDlist[j].c_str())));
00513       }
00514     }
00515     n++;
00516   }
00517   filelist3.close();
00518   
00519   cout<<"FDMC NuBar (Beam):"<<endl;
00520   filelist3.clear();
00521   filelist3.open(gSystem->ExpandPathName(FileList_FDMC_Beam.c_str()));
00522   n=0;
00523   while(!filelist3.eof())
00524   {
00525     cout<<n<<endl;
00526     getline(filelist3,line);
00527     if(!line.empty())
00528     {
00529       if(gSystem->AccessPathName(gSystem->ExpandPathName(line.c_str())))
00530       {
00531         cout<<line<<" doesn't exist.  Skipping..."<<endl;
00532         continue;
00533       }
00534       TFile f(line.c_str(),"READ");
00535       if(f.Read("FDMC_Beam_NuBar")==0 || f.Read("paramtree")==0)
00536       {
00537         cout<<"FDMC_Beam_NuBar directory or paramtree doesn't exist.  Skipping..."<<endl;
00538         continue;
00539       }
00540       
00541       for(j=0;j<np;j++)
00542       {
00543         TrueVsRecoVsPID_NuBar_NC_Beam[j]->Add((TH3D*)f.Get(Form("FDMC_Beam_NuBar/TrueVsRecoVs%s_NC",PIDlist[j].c_str())));
00544         ExHists_NuBar_FDMC->TrueVsRecoVsPID_NuMuToNuMu[PIDlist[j]]->Add((TH3D*)f.Get(Form("FDMC_Beam_NuBar/TrueVsRecoVs%s_NuMuToNuMu",PIDlist[j].c_str())));
00545         ExHists_NuBar_FDMC->TrueVsRecoVsPID_BNueToBNue[PIDlist[j]]->Add((TH3D*)f.Get(Form("FDMC_Beam_NuBar/TrueVsRecoVs%s_BNueToBNue",PIDlist[j].c_str())));
00546       }
00547     }
00548     n++;
00549   }
00550   filelist3.close();
00551   
00552   ExHists_FDMC->TrueVsReco_Fid->Scale(fFarPOT/tot_fbmc);
00553   ExHists_FDMC->TrueVsReco_Fid_NuMuCC->Scale(fFarPOT/tot_fbmc);
00554   ExHists_FDMC->TrueVsReco_Fid_NuMuBarCC->Scale(fFarPOT/tot_fbmc);
00555   ExHists_FDMC->TrueVsReco_CClike->Scale(fFarPOT/tot_fbmc);
00556   ExHists_FDMC->TrueVsReco_CClike_Pos->Scale(fFarPOT/tot_fbmc);
00557   ExHists_FDMC->TrueVsReco_CClike_Neg->Scale(fFarPOT/tot_fbmc);
00558   ExHists_FDMC->TrueVsReco_CClike_NuMuCC->Scale(fFarPOT/tot_fbmc);
00559   ExHists_FDMC->TrueVsReco_CClike_Pos_NuMuBarCC->Scale(fFarPOT/tot_fbmc);
00560   ExHists_FDMC->TrueVsReco_CClike_Neg_NuMuCC->Scale(fFarPOT/tot_fbmc);
00561   for(j=0;j<np;j++)
00562   {
00563     TrueVsRecoVsPID_NC_Beam[j]->Scale(fFarPOT/tot_fbmc);
00564     ExHists_FDMC->TrueVsRecoVsPID_NuMuToNuMu[PIDlist[j]]->Scale(fFarPOT/tot_fbmc);
00565     ExHists_FDMC->TrueVsRecoVsPID_BNueToBNue[PIDlist[j]]->Scale(fFarPOT/tot_fbmc);
00566     
00567     ExHists_FDMC->TrueVsRecoVsPID_NC_NoOscNue[PIDlist[j]]->Scale(fFarPOT/tot_fbmc);
00568     ExHists_FDMC->TrueVsRecoVsPID_NC_NoOscNueBar[PIDlist[j]]->Scale(fFarPOT/tot_fbmc);
00569     ExHists_FDMC->TrueVsRecoVsPID_NC_NoOscNuMu[PIDlist[j]]->Scale(fFarPOT/tot_fbmc);
00570     ExHists_FDMC->TrueVsRecoVsPID_NC_NoOscNuMuBar[PIDlist[j]]->Scale(fFarPOT/tot_fbmc);
00571     
00572     TrueVsRecoVsPID_Nu_NC_Beam[j]->Scale(fFarPOT/tot_fbmc);
00573     ExHists_Nu_FDMC->TrueVsRecoVsPID_NuMuToNuMu[PIDlist[j]]->Scale(fFarPOT/tot_fbmc);
00574     ExHists_Nu_FDMC->TrueVsRecoVsPID_BNueToBNue[PIDlist[j]]->Scale(fFarPOT/tot_fbmc);
00575     
00576     TrueVsRecoVsPID_NuBar_NC_Beam[j]->Scale(fFarPOT/tot_fbmc);
00577     ExHists_NuBar_FDMC->TrueVsRecoVsPID_NuMuToNuMu[PIDlist[j]]->Scale(fFarPOT/tot_fbmc);
00578     ExHists_NuBar_FDMC->TrueVsRecoVsPID_BNueToBNue[PIDlist[j]]->Scale(fFarPOT/tot_fbmc);
00579   }
00580   
00581   cout<<"FDMC (Nue):"<<endl;
00582   double tot_fnmc=0;
00583   ifstream filelist4;
00584   filelist4.open(gSystem->ExpandPathName(FileList_FDMC_Nue.c_str()));
00585   if(!filelist4.good())
00586   {
00587     cout<<"Problem reading "<<FileList_FDMC_Nue<<". Quitting..."<<endl;
00588     return;
00589   }
00590   n=0;
00591   while(!filelist4.eof())
00592   {
00593     cout<<n<<endl;
00594     getline(filelist4,line);
00595     if(!line.empty())
00596     {
00597       if(gSystem->AccessPathName(gSystem->ExpandPathName(line.c_str())))
00598       {
00599         cout<<line<<" doesn't exist.  Skipping..."<<endl;
00600         continue;
00601       }
00602       TFile f(line.c_str(),"READ");
00603       if(f.Read("FDMC_Nue")==0 || f.Read("paramtree")==0)
00604       {
00605         cout<<"FDMC_Nue directory or paramtree doesn't exist.  Skipping..."<<endl;
00606         continue;
00607       }
00608       
00609       ExHists_FDMC->TrueVsReco_Fid_NueCC->Add((TH2D*)f.Get("FDMC_Nue/TrueVsReco_Fid_NueCC"));
00610       ExHists_FDMC->True_Fid_NueCC->Add((TH1D*)f.Get("FDMC_Nue/True_Fid_NueCC"));
00611       ExHists_FDMC->TrueVsReco_Fid_NueBarCC->Add((TH2D*)f.Get("FDMC_Nue/TrueVsReco_Fid_NueBarCC"));
00612       ExHists_FDMC->True_Fid_NueBarCC->Add((TH1D*)f.Get("FDMC_Nue/True_Fid_NueBarCC"));
00613       
00614       for(j=0;j<np;j++)
00615       {
00616         TrueVsRecoVsPID_NC_Nue[j]->Add((TH3D*)f.Get(Form("FDMC_Nue/TrueVsRecoVs%s_NC",PIDlist[j].c_str())));
00617         ExHists_FDMC->TrueVsRecoVsPID_NuMuToNue[PIDlist[j]]->Add((TH3D*)f.Get(Form("FDMC_Nue/TrueVsRecoVs%s_NuMuToNue",PIDlist[j].c_str())));
00618         ExHists_FDMC->TrueVsRecoVsPID_BNueToNuMu[PIDlist[j]]->Add((TH3D*)f.Get(Form("FDMC_Nue/TrueVsRecoVs%s_BNueToNuMu",PIDlist[j].c_str())));
00619       }
00620       
00621       paramtree_ = (TTree*)f.Get("paramtree");
00622       paramtree_->SetBranchAddress("POT",&npot);
00623       paramtree_->GetEntry(0);
00624       tot_fnmc+=npot;
00625     }
00626     n++;
00627   }
00628   filelist4.close();
00629   
00630   cout<<"FDMC Nu (Nue):"<<endl;
00631   filelist4.clear();
00632   filelist4.open(gSystem->ExpandPathName(FileList_FDMC_Nue.c_str()));
00633   n=0;
00634   while(!filelist4.eof())
00635   {
00636     cout<<n<<endl;
00637     getline(filelist4,line);
00638     if(!line.empty())
00639     {
00640       if(gSystem->AccessPathName(gSystem->ExpandPathName(line.c_str())))
00641       {
00642         cout<<line<<" doesn't exist.  Skipping..."<<endl;
00643         continue;
00644       }
00645       TFile f(line.c_str(),"READ");
00646       if(f.Read("FDMC_Nue_Nu")==0 || f.Read("paramtree")==0)
00647       {
00648         cout<<"FDMC_Nue_Nu directory or paramtree doesn't exist.  Skipping..."<<endl;
00649         continue;
00650       }
00651       
00652       for(j=0;j<np;j++)
00653       {
00654         TrueVsRecoVsPID_Nu_NC_Nue[j]->Add((TH3D*)f.Get(Form("FDMC_Nue_Nu/TrueVsRecoVs%s_NC",PIDlist[j].c_str())));
00655         ExHists_Nu_FDMC->TrueVsRecoVsPID_NuMuToNue[PIDlist[j]]->Add((TH3D*)f.Get(Form("FDMC_Nue_Nu/TrueVsRecoVs%s_NuMuToNue",PIDlist[j].c_str())));
00656         ExHists_Nu_FDMC->TrueVsRecoVsPID_BNueToNuMu[PIDlist[j]]->Add((TH3D*)f.Get(Form("FDMC_Nue_Nu/TrueVsRecoVs%s_BNueToNuMu",PIDlist[j].c_str())));
00657       }
00658     }
00659     n++;
00660   }
00661   filelist4.close();
00662   
00663   cout<<"FDMC NuBar (Nue):"<<endl;
00664   filelist4.clear();
00665   filelist4.open(gSystem->ExpandPathName(FileList_FDMC_Nue.c_str()));
00666   n=0;
00667   while(!filelist4.eof())
00668   {
00669     cout<<n<<endl;
00670     getline(filelist4,line);
00671     if(!line.empty())
00672     {
00673       if(gSystem->AccessPathName(gSystem->ExpandPathName(line.c_str())))
00674       {
00675         cout<<line<<" doesn't exist.  Skipping..."<<endl;
00676         continue;
00677       }
00678       TFile f(line.c_str(),"READ");
00679       if(f.Read("FDMC_Nue_NuBar")==0 || f.Read("paramtree")==0)
00680       {
00681         cout<<"FDMC_Nue_NuBar directory or paramtree doesn't exist.  Skipping..."<<endl;
00682         continue;
00683       }
00684       
00685       for(j=0;j<np;j++)
00686       {
00687         TrueVsRecoVsPID_NuBar_NC_Nue[j]->Add((TH3D*)f.Get(Form("FDMC_Nue_NuBar/TrueVsRecoVs%s_NC",PIDlist[j].c_str())));
00688         ExHists_NuBar_FDMC->TrueVsRecoVsPID_NuMuToNue[PIDlist[j]]->Add((TH3D*)f.Get(Form("FDMC_Nue_NuBar/TrueVsRecoVs%s_NuMuToNue",PIDlist[j].c_str())));
00689         ExHists_NuBar_FDMC->TrueVsRecoVsPID_BNueToNuMu[PIDlist[j]]->Add((TH3D*)f.Get(Form("FDMC_Nue_NuBar/TrueVsRecoVs%s_BNueToNuMu",PIDlist[j].c_str())));
00690       }
00691     }
00692     n++;
00693   }
00694   filelist4.close();
00695   
00696   ExHists_FDMC->TrueVsReco_Fid_NueCC->Scale(fFarPOT/tot_fnmc);
00697   ExHists_FDMC->True_Fid_NueCC->Scale(fFarPOT/tot_fnmc);
00698   ExHists_FDMC->TrueVsReco_Fid_NueBarCC->Scale(fFarPOT/tot_fnmc);
00699   ExHists_FDMC->True_Fid_NueBarCC->Scale(fFarPOT/tot_fnmc);
00700   for(j=0;j<np;j++)
00701   {
00702     TrueVsRecoVsPID_NC_Nue[j]->Scale(fFarPOT/tot_fnmc);
00703     ExHists_FDMC->TrueVsRecoVsPID_NuMuToNue[PIDlist[j]]->Scale(fFarPOT/tot_fnmc);
00704     ExHists_FDMC->TrueVsRecoVsPID_BNueToNuMu[PIDlist[j]]->Scale(fFarPOT/tot_fnmc);
00705     
00706     TrueVsRecoVsPID_Nu_NC_Nue[j]->Scale(fFarPOT/tot_fnmc);
00707     ExHists_Nu_FDMC->TrueVsRecoVsPID_NuMuToNue[PIDlist[j]]->Scale(fFarPOT/tot_fnmc);
00708     ExHists_Nu_FDMC->TrueVsRecoVsPID_BNueToNuMu[PIDlist[j]]->Scale(fFarPOT/tot_fnmc);
00709     
00710     TrueVsRecoVsPID_NuBar_NC_Nue[j]->Scale(fFarPOT/tot_fnmc);
00711     ExHists_NuBar_FDMC->TrueVsRecoVsPID_NuMuToNue[PIDlist[j]]->Scale(fFarPOT/tot_fnmc);
00712     ExHists_NuBar_FDMC->TrueVsRecoVsPID_BNueToNuMu[PIDlist[j]]->Scale(fFarPOT/tot_fnmc);
00713   }
00714   
00715   cout<<"FDMC (Tau):"<<endl;
00716   double tot_ftmc=0;
00717   ifstream filelist5;
00718   filelist5.open(gSystem->ExpandPathName(FileList_FDMC_Tau.c_str()));
00719   if(!filelist5.good())
00720   {
00721     cout<<"Problem reading "<<FileList_FDMC_Tau<<". Quitting..."<<endl;
00722     return;
00723   }
00724   n=0;
00725   while(!filelist5.eof())
00726   {
00727     cout<<n<<endl;
00728     getline(filelist5,line);
00729     if(!line.empty())
00730     {
00731       if(gSystem->AccessPathName(gSystem->ExpandPathName(line.c_str())))
00732       {
00733         cout<<line<<" doesn't exist.  Skipping..."<<endl;
00734         continue;
00735       }
00736       TFile f(line.c_str(),"READ");
00737       if(f.Read("FDMC_Tau")==0 || f.Read("paramtree")==0)
00738       {
00739         cout<<"FDMC_Tau directory or paramtree doesn't exist.  Skipping..."<<endl;
00740         continue;
00741       }
00742       
00743       ExHists_FDMC->TrueVsReco_Fid_NuTauCC->Add((TH2D*)f.Get("FDMC_Tau/TrueVsReco_Fid_NuTauCC"));
00744       ExHists_FDMC->True_Fid_NuTauCC->Add((TH1D*)f.Get("FDMC_Tau/True_Fid_NuTauCC"));
00745       ExHists_FDMC->TrueVsReco_Fid_NuTauBarCC->Add((TH2D*)f.Get("FDMC_Tau/TrueVsReco_Fid_NuTauBarCC"));
00746       ExHists_FDMC->True_Fid_NuTauBarCC->Add((TH1D*)f.Get("FDMC_Tau/True_Fid_NuTauBarCC"));
00747       
00748       for(j=0;j<np;j++)
00749       {
00750         TrueVsRecoVsPID_NC_Tau[j]->Add((TH3D*)f.Get(Form("FDMC_Tau/TrueVsRecoVs%s_NC",PIDlist[j].c_str())));
00751         ExHists_FDMC->TrueVsRecoVsPID_NuMuToNuTau[PIDlist[j]]->Add((TH3D*)f.Get(Form("FDMC_Tau/TrueVsRecoVs%s_NuMuToNuTau",PIDlist[j].c_str())));
00752         ExHists_FDMC->TrueVsRecoVsPID_BNueToNuTau[PIDlist[j]]->Add((TH3D*)f.Get(Form("FDMC_Tau/TrueVsRecoVs%s_BNueToNuTau",PIDlist[j].c_str())));
00753       }
00754       
00755       paramtree_ = (TTree*)f.Get("paramtree");
00756       paramtree_->SetBranchAddress("POT",&npot);
00757       paramtree_->GetEntry(0);
00758       tot_ftmc+=npot;
00759     }
00760     n++;
00761   }
00762   filelist5.close();
00763   
00764   cout<<"FDMC Nu (Tau):"<<endl;
00765   filelist5.clear();
00766   filelist5.open(gSystem->ExpandPathName(FileList_FDMC_Tau.c_str()));
00767   n=0;
00768   while(!filelist5.eof())
00769   {
00770     cout<<n<<endl;
00771     getline(filelist5,line);
00772     if(!line.empty())
00773     {
00774       if(gSystem->AccessPathName(gSystem->ExpandPathName(line.c_str())))
00775       {
00776         cout<<line<<" doesn't exist.  Skipping..."<<endl;
00777         continue;
00778       }
00779       TFile f(line.c_str(),"READ");
00780       if(f.Read("FDMC_Tau_Nu")==0 || f.Read("paramtree")==0)
00781       {
00782         cout<<"FDMC_Tau_Nu directory or paramtree doesn't exist.  Skipping..."<<endl;
00783         continue;
00784       }
00785       
00786       for(j=0;j<np;j++)
00787       {
00788         TrueVsRecoVsPID_Nu_NC_Tau[j]->Add((TH3D*)f.Get(Form("FDMC_Tau_Nu/TrueVsRecoVs%s_NC",PIDlist[j].c_str())));
00789         ExHists_Nu_FDMC->TrueVsRecoVsPID_NuMuToNuTau[PIDlist[j]]->Add((TH3D*)f.Get(Form("FDMC_Tau_Nu/TrueVsRecoVs%s_NuMuToNuTau",PIDlist[j].c_str())));
00790         ExHists_Nu_FDMC->TrueVsRecoVsPID_BNueToNuTau[PIDlist[j]]->Add((TH3D*)f.Get(Form("FDMC_Tau_Nu/TrueVsRecoVs%s_BNueToNuTau",PIDlist[j].c_str())));
00791       }
00792     }
00793     n++;
00794   }
00795   filelist5.close();
00796   
00797   cout<<"FDMC NuBar (Tau):"<<endl;
00798   filelist5.clear();
00799   filelist5.open(gSystem->ExpandPathName(FileList_FDMC_Tau.c_str()));
00800   n=0;
00801   while(!filelist5.eof())
00802   {
00803     cout<<n<<endl;
00804     getline(filelist5,line);
00805     if(!line.empty())
00806     {
00807       if(gSystem->AccessPathName(gSystem->ExpandPathName(line.c_str())))
00808       {
00809         cout<<line<<" doesn't exist.  Skipping..."<<endl;
00810         continue;
00811       }
00812       TFile f(line.c_str(),"READ");
00813       if(f.Read("FDMC_Tau_NuBar")==0 || f.Read("paramtree")==0)
00814       {
00815         cout<<"FDMC_Tau_NuBar directory or paramtree doesn't exist.  Skipping..."<<endl;
00816         continue;
00817       }
00818       
00819       for(j=0;j<np;j++)
00820       {
00821         TrueVsRecoVsPID_NuBar_NC_Tau[j]->Add((TH3D*)f.Get(Form("FDMC_Tau_NuBar/TrueVsRecoVs%s_NC",PIDlist[j].c_str())));
00822         ExHists_NuBar_FDMC->TrueVsRecoVsPID_NuMuToNuTau[PIDlist[j]]->Add((TH3D*)f.Get(Form("FDMC_Tau_NuBar/TrueVsRecoVs%s_NuMuToNuTau",PIDlist[j].c_str())));
00823         ExHists_NuBar_FDMC->TrueVsRecoVsPID_BNueToNuTau[PIDlist[j]]->Add((TH3D*)f.Get(Form("FDMC_Tau_NuBar/TrueVsRecoVs%s_BNueToNuTau",PIDlist[j].c_str())));
00824       }
00825     }
00826     n++;
00827   }
00828   filelist5.close();
00829   
00830   ExHists_FDMC->TrueVsReco_Fid_NuTauCC->Scale(fFarPOT/tot_ftmc);
00831   ExHists_FDMC->True_Fid_NuTauCC->Scale(fFarPOT/tot_ftmc);
00832   ExHists_FDMC->TrueVsReco_Fid_NuTauBarCC->Scale(fFarPOT/tot_ftmc);
00833   ExHists_FDMC->True_Fid_NuTauBarCC->Scale(fFarPOT/tot_ftmc);
00834   for(j=0;j<np;j++)
00835   {
00836     TrueVsRecoVsPID_NC_Tau[j]->Scale(fFarPOT/tot_ftmc);
00837     ExHists_FDMC->TrueVsRecoVsPID_NuMuToNuTau[PIDlist[j]]->Scale(fFarPOT/tot_ftmc);
00838     ExHists_FDMC->TrueVsRecoVsPID_BNueToNuTau[PIDlist[j]]->Scale(fFarPOT/tot_ftmc);
00839     
00840     TrueVsRecoVsPID_Nu_NC_Tau[j]->Scale(fFarPOT/tot_ftmc);
00841     ExHists_Nu_FDMC->TrueVsRecoVsPID_NuMuToNuTau[PIDlist[j]]->Scale(fFarPOT/tot_ftmc);
00842     ExHists_Nu_FDMC->TrueVsRecoVsPID_BNueToNuTau[PIDlist[j]]->Scale(fFarPOT/tot_ftmc);
00843     
00844     TrueVsRecoVsPID_NuBar_NC_Tau[j]->Scale(fFarPOT/tot_ftmc);
00845     ExHists_NuBar_FDMC->TrueVsRecoVsPID_NuMuToNuTau[PIDlist[j]]->Scale(fFarPOT/tot_ftmc);
00846     ExHists_NuBar_FDMC->TrueVsRecoVsPID_BNueToNuTau[PIDlist[j]]->Scale(fFarPOT/tot_ftmc);
00847   }
00848   
00849   for(j=0;j<np;j++)
00850   {
00851     ExHists_FDMC->TrueVsRecoVsPID_NC[PIDlist[j]]->Add(TrueVsRecoVsPID_NC_Beam[j]);
00852     ExHists_FDMC->TrueVsRecoVsPID_NC[PIDlist[j]]->Add(TrueVsRecoVsPID_NC_Nue[j]);
00853     ExHists_FDMC->TrueVsRecoVsPID_NC[PIDlist[j]]->Add(TrueVsRecoVsPID_NC_Tau[j]);
00854     
00855     ExHists_Nu_FDMC->TrueVsRecoVsPID_NC[PIDlist[j]]->Add(TrueVsRecoVsPID_Nu_NC_Beam[j]);
00856     ExHists_Nu_FDMC->TrueVsRecoVsPID_NC[PIDlist[j]]->Add(TrueVsRecoVsPID_Nu_NC_Nue[j]);
00857     ExHists_Nu_FDMC->TrueVsRecoVsPID_NC[PIDlist[j]]->Add(TrueVsRecoVsPID_Nu_NC_Tau[j]);
00858     
00859     ExHists_NuBar_FDMC->TrueVsRecoVsPID_NC[PIDlist[j]]->Add(TrueVsRecoVsPID_NuBar_NC_Beam[j]);
00860     ExHists_NuBar_FDMC->TrueVsRecoVsPID_NC[PIDlist[j]]->Add(TrueVsRecoVsPID_NuBar_NC_Nue[j]);
00861     ExHists_NuBar_FDMC->TrueVsRecoVsPID_NC[PIDlist[j]]->Add(TrueVsRecoVsPID_NuBar_NC_Tau[j]);
00862   }
00863   
00864   DeltaCP = del;
00865   DeltaMSq12 = dm2_12;
00866   DeltaMSq23 = dm2_23;
00867   Theta12 = t12;
00868   Theta13 = t13;
00869   Theta23 = t23;
00870   
00871   WriteToFile();
00872   
00873   return;
00874 }

void ExtrapFileGen::SetFakeData (  )  [inline]

Definition at line 35 of file ExtrapFileGen.h.

References fakedata.

00035 {fakedata=true;};//use MC instead of data for ND CC-like selection

void ExtrapFileGen::SetFarPOT ( double  pot = 7e20  )  [inline]

Definition at line 31 of file ExtrapFileGen.h.

References fFarPOT.

Referenced by Initialize().

00031 { fFarPOT = pot;};

void ExtrapFileGen::SetFileLists ( string  nddata = "NULL",
string  ndmc = "NULL",
string  fdmcbeam = "NULL",
string  fdmcnue = "NULL",
string  fdmctau = "NULL" 
)

Definition at line 31 of file ExtrapFileGen.cxx.

References FileList_FDMC_Beam, FileList_FDMC_Nue, FileList_FDMC_Tau, FileList_NDData, and FileList_NDMC.

Referenced by Initialize().

00032 {
00033   FileList_NDData = nddata;
00034   FileList_NDMC = ndmc;
00035   FileList_FDMC_Beam = fdmcbeam;
00036   FileList_FDMC_Nue = fdmcnue;
00037   FileList_FDMC_Tau = fdmctau;
00038   return;
00039 }

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

Definition at line 30 of file ExtrapFileGen.h.

References fNearPOT.

Referenced by Initialize().

00030 { fNearPOT = pot;};

void ExtrapFileGen::SetOutputFile ( string  name = "DefaultOut.root"  ) 

Referenced by Initialize().

void ExtrapFileGen::WriteToFile (  )  [private]

Definition at line 46 of file ExtrapFileGen.cxx.

References DeltaCP, DeltaMSq12, DeltaMSq23, ExHists_FDMC, ExHists_NDData, ExHists_NDMC, ExHists_Nu_FDMC, ExHists_NuBar_FDMC, ExtrapHists2D::fDirectory, fFarPOT, fNearPOT, fout, gSystem(), outFileName, paramtree, Theta12, Theta13, and Theta23.

Referenced by Run().

00047 {
00048 //   double par[100]={0};
00049 //   NueStandard::GetOscParam(par);
00050 //   Theta12 = par[OscPar::kTh12];
00051 //   Theta13 = par[OscPar::kTh13];
00052 //   Theta23 = par[OscPar::kTh23];
00053 //   DeltaMSq23 = par[OscPar::kDeltaM23];
00054 //   DeltaMSq12 = par[OscPar::kDeltaM12];
00055 //   DeltaCP = par[OscPar::kDelta];
00056   
00057   fout = new TFile(gSystem->ExpandPathName(outFileName.c_str()),"RECREATE");
00058   paramtree = new TTree("paramtree","paramtree");
00059   paramtree->Branch("nearPOT",&fNearPOT,"nearPOT/D");
00060   paramtree->Branch("farPOT",&fFarPOT,"farPOT/D");
00061   paramtree->Branch("Theta12",&Theta12,"Theta12/D");
00062   paramtree->Branch("Theta13",&Theta13,"Theta13/D");
00063   paramtree->Branch("Theta23",&Theta23,"Theta23/D");
00064   paramtree->Branch("DeltaMSq23",&DeltaMSq23,"DeltaMSq23/D");
00065   paramtree->Branch("DeltaMSq12",&DeltaMSq12,"DeltaMSq12/D");
00066   paramtree->Branch("DeltaCP",&DeltaCP,"DeltaCP/D");
00067   paramtree->Fill();
00068   
00069   fout->cd();
00070   TDirectory *ndmcdir = fout->mkdir("NDMC");
00071   ndmcdir->cd();
00072   TList *list = ExHists_NDMC->fDirectory->GetList();
00073   TIter iter(list->MakeIterator());
00074   TObject *ob = 0;
00075   while((ob = iter())) 
00076   {
00077     ob->Write();
00078   }
00079   
00080   fout->cd();
00081   TDirectory *nddatadir = fout->mkdir("NDData");
00082   nddatadir->cd();
00083   list = ExHists_NDData->fDirectory->GetList();
00084   iter = list->MakeIterator();
00085   while((ob = iter())) 
00086   {
00087     ob->Write();
00088   }
00089   
00090   fout->cd();
00091   TDirectory *fdmcdir = fout->mkdir("FDMC");
00092   fdmcdir->cd();
00093   list = ExHists_FDMC->fDirectory->GetList();
00094   iter = list->MakeIterator();
00095   while((ob = iter())) 
00096   {
00097     ob->Write();
00098   }
00099   
00100   fout->cd();
00101   TDirectory *fdmcdirnu = fout->mkdir("FDMC_Nu");
00102   fdmcdirnu->cd();
00103   list = ExHists_Nu_FDMC->fDirectory->GetList();
00104   iter = list->MakeIterator();
00105   while((ob = iter())) 
00106   {
00107     ob->Write();
00108   }
00109   
00110   fout->cd();
00111   TDirectory *fdmcdirnubar = fout->mkdir("FDMC_NuBar");
00112   fdmcdirnubar->cd();
00113   list = ExHists_NuBar_FDMC->fDirectory->GetList();
00114   iter = list->MakeIterator();
00115   while((ob = iter())) 
00116   {
00117     ob->Write();
00118   }
00119   
00120   fout->cd();
00121   paramtree->Write();
00122   fout->Close();
00123 }


Member Data Documentation

double ExtrapFileGen::DeltaCP [private]

Definition at line 68 of file ExtrapFileGen.h.

Referenced by Run(), and WriteToFile().

double ExtrapFileGen::DeltaMSq12 [private]

Definition at line 67 of file ExtrapFileGen.h.

Referenced by Run(), and WriteToFile().

double ExtrapFileGen::DeltaMSq23 [private]

Definition at line 66 of file ExtrapFileGen.h.

Referenced by Run(), and WriteToFile().

Definition at line 44 of file ExtrapFileGen.h.

Referenced by InitializeHistograms(), Run(), and WriteToFile().

Definition at line 43 of file ExtrapFileGen.h.

Referenced by InitializeHistograms(), Run(), and WriteToFile().

Definition at line 42 of file ExtrapFileGen.h.

Referenced by InitializeHistograms(), Run(), and WriteToFile().

Definition at line 45 of file ExtrapFileGen.h.

Referenced by InitializeHistograms(), Run(), and WriteToFile().

Definition at line 46 of file ExtrapFileGen.h.

Referenced by InitializeHistograms(), Run(), and WriteToFile().

bool ExtrapFileGen::fakedata [private]

Definition at line 78 of file ExtrapFileGen.h.

Referenced by Initialize(), Run(), and SetFakeData().

double ExtrapFileGen::fFarPOT [private]

Definition at line 56 of file ExtrapFileGen.h.

Referenced by Run(), SetFarPOT(), and WriteToFile().

Definition at line 51 of file ExtrapFileGen.h.

Referenced by Run(), and SetFileLists().

Definition at line 52 of file ExtrapFileGen.h.

Referenced by Run(), and SetFileLists().

Definition at line 53 of file ExtrapFileGen.h.

Referenced by Run(), and SetFileLists().

Definition at line 49 of file ExtrapFileGen.h.

Referenced by Run(), and SetFileLists().

string ExtrapFileGen::FileList_NDMC [private]

Definition at line 50 of file ExtrapFileGen.h.

Referenced by Run(), and SetFileLists().

double ExtrapFileGen::fNearPOT [private]

Definition at line 55 of file ExtrapFileGen.h.

Referenced by Run(), SetNearPOT(), and WriteToFile().

TFile* ExtrapFileGen::fout [private]

Definition at line 60 of file ExtrapFileGen.h.

Referenced by Initialize(), and WriteToFile().

int ExtrapFileGen::nPID [private]

Definition at line 72 of file ExtrapFileGen.h.

Referenced by Initialize(), InitializeHistograms(), and Run().

int ExtrapFileGen::nReco [private]

Definition at line 70 of file ExtrapFileGen.h.

Referenced by Initialize(), InitializeHistograms(), and Run().

int ExtrapFileGen::nTrue [private]

Definition at line 71 of file ExtrapFileGen.h.

Referenced by Initialize(), InitializeHistograms(), and Run().

string ExtrapFileGen::outFileName [private]

Definition at line 48 of file ExtrapFileGen.h.

Referenced by WriteToFile().

TTree* ExtrapFileGen::paramtree [private]

Definition at line 61 of file ExtrapFileGen.h.

Referenced by Initialize(), and WriteToFile().

vector<double> ExtrapFileGen::PIDEdges [private]

Definition at line 75 of file ExtrapFileGen.h.

Referenced by InitializeHistograms(), and Run().

vector<std::string> ExtrapFileGen::PIDlist [private]

Definition at line 58 of file ExtrapFileGen.h.

Referenced by AddPID(), InitializeHistograms(), and Run().

vector<double> ExtrapFileGen::RecoEdges [private]

Definition at line 74 of file ExtrapFileGen.h.

Referenced by InitializeHistograms(), and Run().

double ExtrapFileGen::Theta12 [private]

Definition at line 63 of file ExtrapFileGen.h.

Referenced by Run(), and WriteToFile().

double ExtrapFileGen::Theta13 [private]

Definition at line 64 of file ExtrapFileGen.h.

Referenced by Run(), and WriteToFile().

double ExtrapFileGen::Theta23 [private]

Definition at line 65 of file ExtrapFileGen.h.

Referenced by Run(), and WriteToFile().

vector<double> ExtrapFileGen::TrueEdges [private]

Definition at line 76 of file ExtrapFileGen.h.

Referenced by InitializeHistograms(), and Run().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1