GridGen Class Reference

#include <GridGen.h>

Inheritance diagram for GridGen:
GridGen_Joint

List of all members.

Public Member Functions

 GridGen ()
virtual ~GridGen ()
void SetOutputFile (string s="GridOut.root")
void AddExtrap (Extrapolate2D *E)
void SetNDeltaSteps (int n=20)
void SetNSinSq2Th13Steps (int n=3000)
void SetDeltaRange (double l=0, double h=2)
void SetSinSq2Th13Range (double l=0.05, double h=0.35)
void SetNormalHierarchy (Bool_t normal=true)
void SetTheta12 (double val=0.59365, double errup=0.041, double errdn=0.041)
void SetTheta23 (double val=0.78540, double errup=0.122, double errdn=0.122)
void SetAbsValDeltaMSq23 (double val=2.32e-3, double errup=0.11e-3, double errdn=0.11e-3)
void SetDeltaMSq12 (double val=8.0e-5, double errup=0.6e-5, double errdn=0.6e-5)
void SetTheta13 (double val=0.1594, double errup=0.0110, double errdn=0.0110)
void FreezeTheta23 (Bool_t flag)
void SetNExperiments (int n=2000)
void Run ()
void RunWithOscParErrs (string s="OscParErrDistributions.root")
virtual void RunMultiBinOscParErrs (string s="OscParErrDistributions.root")
virtual void RunMultiBin_VaryTheta13 (string s="OscParErrDistributions.root")

Protected Member Functions

double AsymGaus (Double_t sm, Double_t sp)
double DrawTheta23 (double dtheta)

Protected Attributes

vector< Extrapolate2D * > Extrap
Int_t nDeltaSteps
Int_t nSinSq2Th13Steps
Double_t DeltaLow
Double_t DeltaHigh
Double_t SinSq2Th13Low
Double_t SinSq2Th13High
Bool_t FrozenTheta23
Bool_t NormalHier
string outFileName
Double_t Theta12
Double_t Theta23
Double_t DeltaMSq23
Double_t DeltaMSq12
Double_t dTheta12_up
Double_t dTheta12_dn
Double_t dTheta23_up
Double_t dTheta23_dn
Double_t dDeltaMSq23_up
Double_t dDeltaMSq23_dn
Double_t dDeltaMSq12_up
Double_t dDeltaMSq12_dn
Double_t Theta13
Double_t dTheta13_up
Double_t dTheta13_dn
Int_t NumExpts

Detailed Description

Definition at line 15 of file GridGen.h.


Constructor & Destructor Documentation

GridGen::GridGen (  ) 

Definition at line 5 of file GridGen.cxx.

References FreezeTheta23(), SetAbsValDeltaMSq23(), SetDeltaMSq12(), SetDeltaRange(), SetNDeltaSteps(), SetNExperiments(), SetNormalHierarchy(), SetNSinSq2Th13Steps(), SetOutputFile(), SetSinSq2Th13Range(), SetTheta12(), SetTheta13(), and SetTheta23().

00006 {
00007   SetOutputFile();
00008   
00009   SetNDeltaSteps();
00010   SetNSinSq2Th13Steps();
00011   SetDeltaRange();
00012   SetSinSq2Th13Range();
00013   SetNormalHierarchy();
00014   
00015   SetTheta12();
00016   SetTheta23();
00017   SetAbsValDeltaMSq23();
00018   SetDeltaMSq12();
00019   
00020   SetTheta13();
00021   
00022   SetNExperiments();
00023   
00024   FreezeTheta23(false);
00025   
00026   return;
00027 }

GridGen::~GridGen (  )  [virtual]

Definition at line 28 of file GridGen.cxx.

00029 {
00030 }


Member Function Documentation

void GridGen::AddExtrap ( Extrapolate2D E  ) 

Definition at line 91 of file GridGen.cxx.

References Extrap.

00092 {
00093   Extrap.push_back(E);
00094   return;
00095 }

Double_t GridGen::AsymGaus ( Double_t  sm,
Double_t  sp 
) [protected]

Definition at line 96 of file GridGen.cxx.

References Munits::g.

Referenced by GridGen_Joint::RunMultiBin_VaryTheta13(), RunMultiBin_VaryTheta13(), GridGen_Joint::RunMultiBinOscParErrs(), RunMultiBinOscParErrs(), and RunWithOscParErrs().

00097 {
00098   // sm = sigma-minus
00099   // sp = sigma-plus
00100   Double_t u = gRandom->Uniform();
00101   Double_t g = gRandom->Gaus(0,1);
00102   if (u>sp/(sp+sm)) {
00103     return -TMath::Abs(g*sm);
00104   }
00105   else {
00106     return TMath::Abs(g*sp);
00107   }
00108 }

double GridGen::DrawTheta23 ( double  dtheta  )  [protected]

Definition at line 109 of file GridGen.cxx.

References FrozenTheta23, and Theta23.

00110 {
00111   if (FrozenTheta23) {
00112     return Theta23; 
00113   }
00114   else {
00115     Double_t sstt = 1-TMath::Abs(gRandom->Gaus(0,dtheta));
00116     Double_t stt;
00117     Double_t tt;
00118     if (gRandom->Uniform()>0.5) {
00119       stt  = TMath::Sqrt(sstt);
00120       tt   = TMath::Pi()/2+(gRandom->Uniform()>0.5?-1:1)*(TMath::Pi()/2-TMath::ASin(stt));
00121     }
00122     else {
00123       stt  = -TMath::Sqrt(sstt);
00124       tt   = -TMath::Pi()/2+(gRandom->Uniform()>0.5?-1:1)*(-TMath::Pi()/2-TMath::ASin(stt));
00125     }
00126     double theta23new = tt/2;
00127     
00128     return theta23new;
00129   }
00130 }

void GridGen::FreezeTheta23 ( Bool_t  flag  )  [inline]

Definition at line 36 of file GridGen.h.

References FrozenTheta23.

Referenced by GridGen(), and GridGen_Joint::GridGen_Joint().

00036 { FrozenTheta23 = flag;}

void GridGen::Run (  ) 

Definition at line 131 of file GridGen.cxx.

References NueConvention::bnue, DeltaHigh, DeltaLow, DeltaMSq12, DeltaMSq23, Extrap, Form(), gSystem(), id, Background::kBNueCC, OscPar::kDeltaM12, OscPar::kDeltaM23, Background::kNC, Background::kNueCC, Background::kNuMuCC, Background::kNuTauCC, OscPar::kTh12, OscPar::kTh23, nDeltaSteps, NormalHier, nSinSq2Th13Steps, NueConvention::nue, outFileName, SinSq2Th13High, SinSq2Th13Low, Theta12, and Theta23.

00132 {
00133   if(Extrap.size()==0)
00134   {
00135     cout<<"No Extrapolate2D input.  Quitting..."<<endl;
00136     return;
00137   }
00138   
00139   unsigned int ie;
00140   for(ie=0;ie<Extrap.size();ie++)
00141   {
00142     Extrap[ie]->GetPrediction();//this initializes everything (note: if creating Extrapolate2D object from a file, the number of bins, etc. doesn't get set until GetPrediction() is called)
00143   }
00144   
00145   for(ie=0;ie<Extrap.size();ie++)
00146   {
00147     Extrap[ie]->SetOscPar(OscPar::kTh12,Theta12);
00148     Extrap[ie]->SetOscPar(OscPar::kTh23,Theta23);
00149     Extrap[ie]->SetOscPar(OscPar::kDeltaM12,DeltaMSq12);
00150     Extrap[ie]->SetOscPar(OscPar::kDeltaM23,DeltaMSq23);
00151     if(!NormalHier) Extrap[ie]->InvertMassHierarchy();
00152     Extrap[ie]->OscillatePrediction();
00153   }
00154   
00155   int i;
00156   unsigned int j;
00157   int nbins=Extrap[0]->Pred_TotalBkgd_VsBinNumber->GetNbinsX();
00158   double delta,ssq2th13;
00159   double sig, bkgd;
00160   double nc,numucc,bnue,tau,nue;
00161   
00162   vector<TTree*> ftree;
00163   vector< vector<TTree*> > ftree2;
00164   TTree *ttmp;
00165   for(i=0;i<nbins;i++)
00166   {
00167     ttmp = new TTree(Form("Bin_%i",i),Form("Bin_%i",i));
00168     ttmp->Branch("Delta",&delta,"Delta/D");
00169     ttmp->Branch("Th13Axis",&ssq2th13,"Th13Axis/D");
00170     ttmp->Branch("Signal",&sig,"Signal/D");
00171     ttmp->Branch("Background",&bkgd,"Background/D");
00172     
00173     ftree.push_back(ttmp);
00174     
00175     ttmp->Reset();
00176     
00177     ftree2.push_back( vector<TTree*>() );
00178     
00179     for(j=0;j<Extrap.size();j++)
00180     {
00181       ttmp = new TTree(Form("Bin_%i_Run_%i",i,j),Form("Bin_%i_Run_%i",i,j));
00182       ttmp->Branch("Delta",&delta,"Delta/D");
00183       ttmp->Branch("Th13Axis",&ssq2th13,"Th13Axis/D");
00184       ttmp->Branch("Signal",&nue,"Signal/D");
00185       ttmp->Branch("NC",&nc,"NC/D");
00186       ttmp->Branch("NuMuCC",&numucc,"NuMuCC/D");
00187       ttmp->Branch("BNueCC",&bnue,"BNueCC/D");
00188       ttmp->Branch("NuTauCC",&tau,"NuTauCC/D");
00189       
00190       ftree2[i].push_back(ttmp);
00191       
00192       ttmp->Reset();
00193     }
00194   }
00195   
00196   double delta_increment = 0;
00197   if(nDeltaSteps>0) delta_increment = (DeltaHigh - DeltaLow)/(nDeltaSteps);
00198   double ssq2th13_increment = 0;
00199   if(nSinSq2Th13Steps>0) ssq2th13_increment = (SinSq2Th13High - SinSq2Th13Low)/(nSinSq2Th13Steps);
00200   
00201   int id,is,l;
00202   int ir,ip;
00203   int nPID = Extrap[0]->GetNPID();
00204   
00205   l=0;
00206   for(id=0;id<nDeltaSteps+1;id++)
00207   {
00208     delta = (id*delta_increment + DeltaLow)*TMath::Pi();
00209     
00210     for(is=0;is<nSinSq2Th13Steps+1;is++)
00211     {
00212       ssq2th13 = (is*ssq2th13_increment + SinSq2Th13Low);
00213       for(ie=0;ie<Extrap.size();ie++)
00214       {
00215         Extrap[ie]->SetDeltaCP(delta);
00216         Extrap[ie]->SetSinSq2Th13(ssq2th13);
00217         Extrap[ie]->OscillatePrediction();
00218       }
00219       
00220       for(i=0;i<nbins;i++)
00221       {
00222         sig=0;
00223         bkgd=0;
00224         ir = int(i/nPID);
00225         ip = i%nPID;
00226         for(ie=0;ie<Extrap.size();ie++)
00227         {
00228           sig += Extrap[ie]->Pred_Signal_VsBinNumber->GetBinContent(i+1);
00229           bkgd += Extrap[ie]->Pred_TotalBkgd_VsBinNumber->GetBinContent(i+1);
00230           
00231           nc = Extrap[ie]->Pred[Background::kNC]->GetBinContent(ip+1,ir+1);
00232           numucc = Extrap[ie]->Pred[Background::kNuMuCC]->GetBinContent(ip+1,ir+1);
00233           bnue = Extrap[ie]->Pred[Background::kBNueCC]->GetBinContent(ip+1,ir+1);
00234           tau = Extrap[ie]->Pred[Background::kNuTauCC]->GetBinContent(ip+1,ir+1);
00235           nue = Extrap[ie]->Pred[Background::kNueCC]->GetBinContent(ip+1,ir+1);
00236           
00237           ftree2[i][ie]->Fill();
00238         }
00239         ftree[i]->Fill();
00240       }
00241       
00242       if(l%100==0) cout<<100.*l/((nDeltaSteps+1)*(nSinSq2Th13Steps+1))<<"% complete"<<endl;
00243       l++;
00244     }
00245   }
00246   
00247   double nPOTNear,nPOTFar;
00248   double dm23;
00249   
00250   TTree *paramtree = new TTree("paramtree","paramtree");
00251   paramtree->Branch("nearPOT",&nPOTNear,"nearPOT/D");
00252   paramtree->Branch("farPOT",&nPOTFar,"farPOT/D");
00253   paramtree->Branch("Theta12",&Theta12,"Theta12/D");
00254   paramtree->Branch("Theta23",&Theta23,"Theta23/D");
00255   paramtree->Branch("DeltaMSq23",&dm23,"DeltaMSq23/D");
00256   paramtree->Branch("DeltaMSq12",&DeltaMSq12,"DeltaMSq12/D");
00257   
00258   dm23 = DeltaMSq23;
00259   if(!NormalHier) dm23 = -1.*DeltaMSq23;
00260   
00261   for(ie=0;ie<Extrap.size();ie++)
00262   {
00263     nPOTNear = Extrap[ie]->GetNearPOT();
00264     nPOTFar = Extrap[ie]->GetFarPOT();
00265     paramtree->Fill();
00266   }
00267   
00268   TFile *fout = new TFile(gSystem->ExpandPathName(outFileName.c_str()),"RECREATE");
00269   for(i=0;i<nbins;i++)
00270   {
00271     ftree[i]->Write();
00272     for(j=0;j<Extrap.size();j++)
00273     {
00274       ftree2[i][j]->Write();
00275     }
00276   }
00277   paramtree->Write();
00278   fout->Close();
00279   
00280   return;
00281 }

void GridGen::RunMultiBin_VaryTheta13 ( string  s = "OscParErrDistributions.root"  )  [virtual]

Reimplemented in GridGen_Joint.

Definition at line 753 of file GridGen.cxx.

References AsymGaus(), NueConvention::bnue, dDeltaMSq12_dn, dDeltaMSq12_up, dDeltaMSq23_dn, dDeltaMSq23_up, DeltaHigh, DeltaLow, DeltaMSq12, DeltaMSq23, dTheta12_dn, dTheta12_up, dTheta13_dn, dTheta13_up, dTheta23_dn, dTheta23_up, Extrap, Form(), gSystem(), id, Background::kBNueCC, OscPar::kDeltaM12, OscPar::kDeltaM23, Background::kNC, Background::kNueCC, Background::kNuMuCC, Background::kNuTauCC, OscPar::kTh12, OscPar::kTh13, OscPar::kTh23, nDeltaSteps, NormalHier, NueConvention::nue, NumExpts, outFileName, Theta12, Theta13, and Theta23.

00754 {
00755   if(Extrap.size()==0)
00756   {
00757     cout<<"No Extrapolate2D input.  Quitting..."<<endl;
00758     return;
00759   }
00760   
00761   unsigned int ie;
00762   for(ie=0;ie<Extrap.size();ie++)
00763   {
00764     Extrap[ie]->GetPrediction();
00765   }
00766   
00767   for(ie=0;ie<Extrap.size();ie++)
00768   {
00769     Extrap[ie]->SetOscPar(OscPar::kTh13,Theta13);
00770     Extrap[ie]->SetOscPar(OscPar::kTh12,Theta12);
00771     Extrap[ie]->SetOscPar(OscPar::kTh23,Theta23);
00772     Extrap[ie]->SetOscPar(OscPar::kDeltaM12,DeltaMSq12);
00773     Extrap[ie]->SetOscPar(OscPar::kDeltaM23,DeltaMSq23);
00774     if(!NormalHier) Extrap[ie]->InvertMassHierarchy();
00775     Extrap[ie]->OscillatePrediction();
00776   }
00777   
00778   int i,k;
00779   unsigned int j;
00780   int nbins=Extrap[0]->Pred_TotalBkgd_VsBinNumber->GetNbinsX();
00781   int nPID = Extrap[0]->GetNPID();
00782   double delta,t13axis;
00783   vector<double> sig, bkgd;
00784   vector< vector<double> > nc,numucc,bnue,tau,nue;
00785   vector<double> oscparerr;
00786   vector<double> oscparerr_offdiag;
00787   int noff;
00788   
00789   t13axis = TMath::Sin(2*Theta13)*TMath::Sin(2*Theta13);
00790   
00791   for(i=0;i<nbins;i++)
00792   {
00793     sig.push_back(0);
00794     bkgd.push_back(0);
00795     oscparerr.push_back(0);
00796     nc.push_back( vector<double>() );
00797     numucc.push_back( vector<double>() );
00798     bnue.push_back( vector<double>() );
00799     tau.push_back( vector<double>() );
00800     nue.push_back( vector<double>() );
00801     for(k=0;k<nbins;k++)
00802     {
00803       if(k>i)
00804       {
00805         oscparerr_offdiag.push_back(0);
00806       }
00807     }
00808     for(j=0;j<Extrap.size();j++)
00809     {
00810       nc[i].push_back(0);
00811       numucc[i].push_back(0);
00812       bnue[i].push_back(0);
00813       tau[i].push_back(0);
00814       nue[i].push_back(0);
00815     }
00816   }
00817   
00818   vector<TTree*> ftree;
00819   vector< vector<TTree*> > ftree2;
00820   TTree *ttmp;
00821   noff=0;
00822   for(i=0;i<nbins;i++)
00823   {
00824     ttmp = new TTree(Form("Bin_%i",i),Form("Bin_%i",i));
00825     ttmp->Branch("Delta",&delta,"Delta/D");
00826     ttmp->Branch("Th13Axis",&t13axis,"Th13Axis/D");
00827     ttmp->Branch("Signal",&sig[i],"Signal/D");
00828     ttmp->Branch("Background",&bkgd[i],"Background/D");
00829     ttmp->Branch("DNExp_DOscPars",&oscparerr[i],"DNExp_DOscPars/D");
00830     for(k=0;k<nbins;k++)
00831     {
00832       if(k>i)
00833       {
00834         ttmp->Branch(Form("Bin_%i_Bin_%i",i,k),&oscparerr_offdiag[noff],Form("Bin_%i_Bin_%i/D",i,k));
00835         noff++;
00836       }
00837     }
00838     ftree.push_back(ttmp);
00839     
00840     ttmp->Reset();
00841     
00842     ftree2.push_back( vector<TTree*>() );
00843     
00844     for(j=0;j<Extrap.size();j++)
00845     {
00846       ttmp = new TTree(Form("Bin_%i_Run_%i",i,j),Form("Bin_%i_Run_%i",i,j));
00847       ttmp->Branch("Delta",&delta,"Delta/D");
00848       ttmp->Branch("Th13Axis",&t13axis,"Th13Axis/D");
00849       ttmp->Branch("Signal",&nue[i][j],"Signal/D");
00850       ttmp->Branch("NC",&nc[i][j],"NC/D");
00851       ttmp->Branch("NuMuCC",&numucc[i][j],"NuMuCC/D");
00852       ttmp->Branch("BNueCC",&bnue[i][j],"BNueCC/D");
00853       ttmp->Branch("NuTauCC",&tau[i][j],"NuTauCC/D");
00854       
00855       ftree2[i].push_back(ttmp);
00856       
00857       ttmp->Reset();
00858     }
00859   }
00860   
00861   double delta_increment = 0;
00862   if(nDeltaSteps>0) delta_increment = (DeltaHigh - DeltaLow)/(nDeltaSteps);
00863   
00864   int id,l,u;
00865   int ip,ir;
00866   double theta23,theta12,dm21,dm32,theta13;
00867   vector<double> nexp,nobs;
00868   vector<TH1D*> delnexphist;
00869   vector<TH1D*> delnexphist_offdiag;
00870   for(i=0;i<nbins;i++)
00871   {
00872     delnexphist.push_back(new TH1D(Form("delnexphist_%i",i),"",400,-1,1));
00873     nexp.push_back(0);
00874     nobs.push_back(0);
00875     for(k=0;k<nbins;k++)
00876     {
00877       if(k>i)
00878       {
00879         delnexphist_offdiag.push_back(new TH1D(Form("delnexphist_%i_%i",i,k),"",400,-1,1));
00880       }
00881     }
00882   }
00883   
00884   gRandom->SetSeed(0);
00885   
00886   TFile *f = new TFile(gSystem->ExpandPathName(s.c_str()),"RECREATE");//save the osc par err distributions to this file
00887   
00888   l=0;
00889   for(id=0;id<nDeltaSteps+1;id++)
00890   {
00891     delta = (id*delta_increment + DeltaLow)*TMath::Pi();
00892     
00893     //get nominal prediction
00894     for(ie=0;ie<Extrap.size();ie++)
00895     {
00896       Extrap[ie]->SetOscPar(OscPar::kTh13,Theta13);
00897       Extrap[ie]->SetOscPar(OscPar::kTh12,Theta12);
00898       Extrap[ie]->SetOscPar(OscPar::kTh23,Theta23);
00899       Extrap[ie]->SetOscPar(OscPar::kDeltaM12,DeltaMSq12);
00900       Extrap[ie]->SetOscPar(OscPar::kDeltaM23,DeltaMSq23);//note that DeltaMSq23 is always positive
00901       if(!NormalHier) Extrap[ie]->InvertMassHierarchy();
00902       Extrap[ie]->SetDeltaCP(delta);
00903       Extrap[ie]->OscillatePrediction();
00904     }
00905     
00906     for(i=0;i<nbins;i++)
00907     {
00908       sig[i]=0;
00909       bkgd[i]=0;
00910       ir = int(i/nPID);
00911       ip = i%nPID;
00912       for(ie=0;ie<Extrap.size();ie++)
00913       {
00914         bkgd[i] += (Extrap[ie]->Pred_TotalBkgd_VsBinNumber->GetBinContent(i+1));
00915         sig[i] += (Extrap[ie]->Pred_Signal_VsBinNumber->GetBinContent(i+1));
00916         
00917         nc[i][ie] = Extrap[ie]->Pred[Background::kNC]->GetBinContent(ip+1,ir+1);
00918         numucc[i][ie] = Extrap[ie]->Pred[Background::kNuMuCC]->GetBinContent(ip+1,ir+1);
00919         bnue[i][ie] = Extrap[ie]->Pred[Background::kBNueCC]->GetBinContent(ip+1,ir+1);
00920         tau[i][ie] = Extrap[ie]->Pred[Background::kNuTauCC]->GetBinContent(ip+1,ir+1);
00921         nue[i][ie] = Extrap[ie]->Pred[Background::kNueCC]->GetBinContent(ip+1,ir+1);
00922       }
00923       nexp[i] = sig[i]+bkgd[i];
00924     }
00925     
00926     //do pseudo experiments
00927     noff=0;
00928     for(i=0;i<nbins;i++)
00929     {
00930       delnexphist[i]->Reset();
00931       delnexphist[i]->SetName(Form("DeltaNexp_%i_Diag_%i",id,i));
00932       for(k=0;k<nbins;k++)
00933       {
00934         if(k>i)
00935         {
00936           delnexphist_offdiag[noff]->Reset();
00937           delnexphist_offdiag[noff]->SetName(Form("DeltaNexp_%i_OffDiag_%i_%i",id,i,k));
00938           noff++;
00939         }
00940       }
00941     }
00942     for(u=0;u<NumExpts;u++)
00943     {
00944       theta13 = Theta13 + AsymGaus(dTheta13_dn,dTheta13_up);
00945       theta12 = Theta12 + AsymGaus(dTheta12_dn,dTheta12_up);
00946       dm21 = DeltaMSq12 + AsymGaus(dDeltaMSq12_dn,dDeltaMSq12_up);
00947       dm32 = DeltaMSq23 + AsymGaus(dDeltaMSq23_dn,dDeltaMSq23_up);
00948       theta23 = Theta23 + AsymGaus(dTheta23_dn,dTheta23_up);
00949       
00950       for(ie=0;ie<Extrap.size();ie++)
00951       {
00952         Extrap[ie]->SetOscPar(OscPar::kTh13,theta13);
00953         Extrap[ie]->SetOscPar(OscPar::kTh12,theta12);
00954         Extrap[ie]->SetOscPar(OscPar::kDeltaM12,dm21);
00955         Extrap[ie]->SetOscPar(OscPar::kDeltaM23,dm32);
00956         if(!NormalHier) Extrap[ie]->InvertMassHierarchy();
00957         Extrap[ie]->SetOscPar(OscPar::kTh23,theta23);
00958         Extrap[ie]->OscillatePrediction();
00959       }
00960       
00961       noff=0;
00962       for(i=0;i<nbins;i++)
00963       {
00964         nobs[i]=0;
00965         for(ie=0;ie<Extrap.size();ie++)
00966         {
00967           nobs[i] += (Extrap[ie]->Pred_TotalBkgd_VsBinNumber->GetBinContent(i+1));
00968           nobs[i] += (Extrap[ie]->Pred_Signal_VsBinNumber->GetBinContent(i+1));
00969         }
00970         delnexphist[i]->Fill((nobs[i]-nexp[i])/(nexp[i]));
00971       }
00972       for(i=0;i<nbins;i++)
00973       {
00974         for(k=0;k<nbins;k++)
00975         {
00976           if(k>i)
00977           {
00978             delnexphist_offdiag[noff]->Fill((nobs[i]-nexp[i])*(nobs[k]-nexp[k])/(nexp[i]*nexp[k]));
00979             noff++;
00980           }
00981         }
00982       }
00983     }
00984     
00985     noff=0;
00986     for(i=0;i<nbins;i++)
00987     {
00988       oscparerr[i] = delnexphist[i]->GetRMS();
00989       delnexphist[i]->Write();
00990       for(k=0;k<nbins;k++)
00991       {
00992         if(k>i)
00993         {
00994           oscparerr_offdiag[noff] = delnexphist_offdiag[noff]->GetRMS();
00995           if(delnexphist_offdiag[noff]->GetMean()<0) oscparerr_offdiag[noff] = -1.*oscparerr_offdiag[noff];
00996           delnexphist_offdiag[noff]->Write();
00997           noff++;
00998         }
00999       }
01000     }
01001     f->Close();
01002     
01003     gROOT->cd("/");
01004     
01005     for(i=0;i<nbins;i++)
01006     {
01007       for(ie=0;ie<Extrap.size();ie++)
01008       {
01009         ftree2[i][ie]->Fill();
01010       }
01011       ftree[i]->Fill();
01012     }
01013     
01014     f = new TFile(gSystem->ExpandPathName(s.c_str()),"UPDATE");
01015     
01016     if(l%100==0) cout<<100.*l/(nDeltaSteps+1)<<"% complete"<<endl;
01017     l++;
01018   }
01019   
01020   f->Close();
01021   
01022   double nPOTNear,nPOTFar;
01023   
01024   TTree *paramtree = new TTree("paramtree","paramtree");
01025   paramtree->Branch("nearPOT",&nPOTNear,"nearPOT/D");
01026   paramtree->Branch("farPOT",&nPOTFar,"farPOT/D");
01027   paramtree->Branch("Theta13",&Theta13,"Theta13/D");
01028   paramtree->Branch("Theta12",&Theta12,"Theta12/D");
01029   paramtree->Branch("Theta23",&Theta23,"Theta23/D");
01030   paramtree->Branch("DeltaMSq23",&dm32,"DeltaMSq23/D");
01031   paramtree->Branch("DeltaMSq12",&DeltaMSq12,"DeltaMSq12/D");
01032   
01033   dm32 = DeltaMSq23;
01034   if(!NormalHier) dm32 = -1.*DeltaMSq23;
01035   
01036   for(ie=0;ie<Extrap.size();ie++)
01037   {
01038     nPOTNear = Extrap[ie]->GetNearPOT();
01039     nPOTFar = Extrap[ie]->GetFarPOT();
01040     paramtree->Fill();
01041   }
01042   
01043   TFile *fout = new TFile(gSystem->ExpandPathName(outFileName.c_str()),"RECREATE");
01044   for(i=0;i<nbins;i++)
01045   {
01046     ftree[i]->Write();
01047     for(ie=0;ie<Extrap.size();ie++)
01048     {
01049       ftree2[i][ie]->Write();
01050     }
01051   }
01052   paramtree->Write();
01053   fout->Close();
01054   
01055   return;
01056 }

void GridGen::RunMultiBinOscParErrs ( string  s = "OscParErrDistributions.root"  )  [virtual]

Reimplemented in GridGen_Joint.

Definition at line 443 of file GridGen.cxx.

References AsymGaus(), NueConvention::bnue, dDeltaMSq12_dn, dDeltaMSq12_up, dDeltaMSq23_dn, dDeltaMSq23_up, DeltaHigh, DeltaLow, DeltaMSq12, DeltaMSq23, dTheta12_dn, dTheta12_up, dTheta23_dn, dTheta23_up, Extrap, Form(), gSystem(), id, Background::kBNueCC, OscPar::kDeltaM12, OscPar::kDeltaM23, Background::kNC, Background::kNueCC, Background::kNuMuCC, Background::kNuTauCC, OscPar::kTh12, OscPar::kTh23, nDeltaSteps, NormalHier, nSinSq2Th13Steps, NueConvention::nue, NumExpts, outFileName, SinSq2Th13High, SinSq2Th13Low, Theta12, and Theta23.

00444 {
00445   if(Extrap.size()==0)
00446   {
00447     cout<<"No Extrapolate2D input.  Quitting..."<<endl;
00448     return;
00449   }
00450   
00451   unsigned int ie;
00452   for(ie=0;ie<Extrap.size();ie++)
00453   {
00454     Extrap[ie]->GetPrediction();
00455   }
00456   
00457   for(ie=0;ie<Extrap.size();ie++)
00458   {
00459     Extrap[ie]->SetOscPar(OscPar::kTh12,Theta12);
00460     Extrap[ie]->SetOscPar(OscPar::kTh23,Theta23);
00461     Extrap[ie]->SetOscPar(OscPar::kDeltaM12,DeltaMSq12);
00462     Extrap[ie]->SetOscPar(OscPar::kDeltaM23,DeltaMSq23);
00463     if(!NormalHier) Extrap[ie]->InvertMassHierarchy();
00464     Extrap[ie]->OscillatePrediction();
00465   }
00466   
00467   int i,k;
00468   unsigned int j;
00469   int nbins=Extrap[0]->Pred_TotalBkgd_VsBinNumber->GetNbinsX();
00470   int nPID = Extrap[0]->GetNPID();
00471   double delta,t13axis;
00472   vector<double> sig, bkgd;
00473   vector< vector<double> > nc,numucc,bnue,tau,nue;
00474   vector<double> oscparerr;
00475   vector<double> oscparerr_offdiag;
00476   int noff;
00477   
00478   for(i=0;i<nbins;i++)
00479   {
00480     sig.push_back(0);
00481     bkgd.push_back(0);
00482     oscparerr.push_back(0);
00483     nc.push_back( vector<double>() );
00484     numucc.push_back( vector<double>() );
00485     bnue.push_back( vector<double>() );
00486     tau.push_back( vector<double>() );
00487     nue.push_back( vector<double>() );
00488     for(k=0;k<nbins;k++)
00489     {
00490       if(k>i)
00491       {
00492         oscparerr_offdiag.push_back(0);
00493       }
00494     }
00495     for(j=0;j<Extrap.size();j++)
00496     {
00497       nc[i].push_back(0);
00498       numucc[i].push_back(0);
00499       bnue[i].push_back(0);
00500       tau[i].push_back(0);
00501       nue[i].push_back(0);
00502     }
00503   }
00504   
00505   vector<TTree*> ftree;
00506   vector< vector<TTree*> > ftree2;
00507   TTree *ttmp;
00508   noff=0;
00509   for(i=0;i<nbins;i++)
00510   {
00511     ttmp = new TTree(Form("Bin_%i",i),Form("Bin_%i",i));
00512     ttmp->Branch("Delta",&delta,"Delta/D");
00513     ttmp->Branch("Th13Axis",&t13axis,"Th13Axis/D");
00514     ttmp->Branch("Signal",&sig[i],"Signal/D");
00515     ttmp->Branch("Background",&bkgd[i],"Background/D");
00516     ttmp->Branch("DNExp_DOscPars",&oscparerr[i],"DNExp_DOscPars/D");
00517     for(k=0;k<nbins;k++)
00518     {
00519       if(k>i)
00520       {
00521         ttmp->Branch(Form("Bin_%i_Bin_%i",i,k),&oscparerr_offdiag[noff],Form("Bin_%i_Bin_%i/D",i,k));
00522         noff++;
00523       }
00524     }
00525     ftree.push_back(ttmp);
00526     
00527     ttmp->Reset();
00528     
00529     ftree2.push_back( vector<TTree*>() );
00530     
00531     for(j=0;j<Extrap.size();j++)
00532     {
00533       ttmp = new TTree(Form("Bin_%i_Run_%i",i,j),Form("Bin_%i_Run_%i",i,j));
00534       ttmp->Branch("Delta",&delta,"Delta/D");
00535       ttmp->Branch("Th13Axis",&t13axis,"Th13Axis/D");
00536       ttmp->Branch("Signal",&nue[i][j],"Signal/D");
00537       ttmp->Branch("NC",&nc[i][j],"NC/D");
00538       ttmp->Branch("NuMuCC",&numucc[i][j],"NuMuCC/D");
00539       ttmp->Branch("BNueCC",&bnue[i][j],"BNueCC/D");
00540       ttmp->Branch("NuTauCC",&tau[i][j],"NuTauCC/D");
00541       
00542       ftree2[i].push_back(ttmp);
00543       
00544       ttmp->Reset();
00545     }
00546   }
00547   
00548   double delta_increment = 0;
00549   if(nDeltaSteps>0) delta_increment = (DeltaHigh - DeltaLow)/(nDeltaSteps);
00550   double ssq2th13_increment = 0;
00551   if(nSinSq2Th13Steps>0) ssq2th13_increment = (SinSq2Th13High - SinSq2Th13Low)/(nSinSq2Th13Steps);
00552   
00553   int id,is,l,u;
00554   int ip,ir;
00555   double theta23,theta12,dm21,dm32,ssq2th13;
00556   vector<double> nexp,nobs;
00557   vector<TH1D*> delnexphist;
00558   vector<TH1D*> delnexphist_offdiag;
00559   for(i=0;i<nbins;i++)
00560   {
00561     delnexphist.push_back(new TH1D(Form("delnexphist_%i",i),"",400,-1,1));
00562     nexp.push_back(0);
00563     nobs.push_back(0);
00564     for(k=0;k<nbins;k++)
00565     {
00566       if(k>i)
00567       {
00568         delnexphist_offdiag.push_back(new TH1D(Form("delnexphist_%i_%i",i,k),"",400,-1,1));
00569       }
00570     }
00571   }
00572   
00573   gRandom->SetSeed(0);
00574   
00575   TFile *f = new TFile(gSystem->ExpandPathName(s.c_str()),"RECREATE");//save the osc par err distributions to this file
00576   
00577   l=0;
00578   for(id=0;id<nDeltaSteps+1;id++)
00579   {
00580     delta = (id*delta_increment + DeltaLow)*TMath::Pi();
00581     
00582     for(is=0;is<nSinSq2Th13Steps+1;is++)
00583     {
00584       t13axis = (is*ssq2th13_increment + SinSq2Th13Low);
00585       ssq2th13 = t13axis/(2.*TMath::Sin(Theta23)*TMath::Sin(Theta23));
00586       
00587       //get nominal prediction
00588       for(ie=0;ie<Extrap.size();ie++)
00589       {
00590         Extrap[ie]->SetOscPar(OscPar::kTh12,Theta12);
00591         Extrap[ie]->SetOscPar(OscPar::kTh23,Theta23);
00592         Extrap[ie]->SetOscPar(OscPar::kDeltaM12,DeltaMSq12);
00593         Extrap[ie]->SetOscPar(OscPar::kDeltaM23,DeltaMSq23);//note that DeltaMSq23 is always positive
00594         if(!NormalHier) Extrap[ie]->InvertMassHierarchy();
00595         Extrap[ie]->SetDeltaCP(delta);
00596         Extrap[ie]->SetSinSq2Th13(ssq2th13);
00597         Extrap[ie]->OscillatePrediction();
00598       }
00599       
00600       for(i=0;i<nbins;i++)
00601       {
00602         sig[i]=0;
00603         bkgd[i]=0;
00604         ir = int(i/nPID);
00605         ip = i%nPID;
00606         for(ie=0;ie<Extrap.size();ie++)
00607         {
00608           bkgd[i] += (Extrap[ie]->Pred_TotalBkgd_VsBinNumber->GetBinContent(i+1));
00609           sig[i] += (Extrap[ie]->Pred_Signal_VsBinNumber->GetBinContent(i+1));
00610           
00611           nc[i][ie] = Extrap[ie]->Pred[Background::kNC]->GetBinContent(ip+1,ir+1);
00612           numucc[i][ie] = Extrap[ie]->Pred[Background::kNuMuCC]->GetBinContent(ip+1,ir+1);
00613           bnue[i][ie] = Extrap[ie]->Pred[Background::kBNueCC]->GetBinContent(ip+1,ir+1);
00614           tau[i][ie] = Extrap[ie]->Pred[Background::kNuTauCC]->GetBinContent(ip+1,ir+1);
00615           nue[i][ie] = Extrap[ie]->Pred[Background::kNueCC]->GetBinContent(ip+1,ir+1);
00616         }
00617         nexp[i] = sig[i]+bkgd[i];
00618       }
00619       
00620       //do pseudo experiments
00621       noff=0;
00622       for(i=0;i<nbins;i++)
00623       {
00624         delnexphist[i]->Reset();
00625         delnexphist[i]->SetName(Form("DeltaNexp_%i_%i_Diag_%i",id,is,i));
00626         for(k=0;k<nbins;k++)
00627         {
00628           if(k>i)
00629           {
00630             delnexphist_offdiag[noff]->Reset();
00631             delnexphist_offdiag[noff]->SetName(Form("DeltaNexp_%i_%i_OffDiag_%i_%i",id,is,i,k));
00632             noff++;
00633           }
00634         }
00635       }
00636       for(u=0;u<NumExpts;u++)
00637       {
00638         theta12 = Theta12 + AsymGaus(dTheta12_dn,dTheta12_up);
00639         dm21 = DeltaMSq12 + AsymGaus(dDeltaMSq12_dn,dDeltaMSq12_up);
00640         dm32 = DeltaMSq23 + AsymGaus(dDeltaMSq23_dn,dDeltaMSq23_up);
00641         //theta23 = DrawTheta23(dTheta23_up);
00642         theta23 = Theta23 + AsymGaus(dTheta23_dn,dTheta23_up);
00643         
00644         ssq2th13 = t13axis/(2.*TMath::Sin(theta23)*TMath::Sin(theta23));
00645 
00646         for(ie=0;ie<Extrap.size();ie++)
00647         {
00648           Extrap[ie]->SetOscPar(OscPar::kTh12,theta12);
00649           Extrap[ie]->SetOscPar(OscPar::kDeltaM12,dm21);
00650           Extrap[ie]->SetOscPar(OscPar::kDeltaM23,dm32);
00651           if(!NormalHier) Extrap[ie]->InvertMassHierarchy();
00652           Extrap[ie]->SetOscPar(OscPar::kTh23,theta23);
00653           Extrap[ie]->SetSinSq2Th13(ssq2th13);
00654           Extrap[ie]->OscillatePrediction();
00655         }
00656         
00657         noff=0;
00658         for(i=0;i<nbins;i++)
00659         {
00660           nobs[i]=0;
00661           for(ie=0;ie<Extrap.size();ie++)
00662           {
00663             nobs[i] += (Extrap[ie]->Pred_TotalBkgd_VsBinNumber->GetBinContent(i+1));
00664             nobs[i] += (Extrap[ie]->Pred_Signal_VsBinNumber->GetBinContent(i+1));
00665           }
00666           delnexphist[i]->Fill((nobs[i]-nexp[i])/(nexp[i]));
00667         }
00668         for(i=0;i<nbins;i++)
00669         {
00670           for(k=0;k<nbins;k++)
00671           {
00672             if(k>i)
00673             {
00674               delnexphist_offdiag[noff]->Fill((nobs[i]-nexp[i])*(nobs[k]-nexp[k])/(nexp[i]*nexp[k]));
00675               noff++;
00676             }
00677           }
00678         }
00679       }
00680       
00681       noff=0;
00682       for(i=0;i<nbins;i++)
00683       {
00684         oscparerr[i] = delnexphist[i]->GetRMS();
00685         delnexphist[i]->Write();
00686         for(k=0;k<nbins;k++)
00687         {
00688           if(k>i)
00689           {
00690             oscparerr_offdiag[noff] = delnexphist_offdiag[noff]->GetRMS();
00691             if(delnexphist_offdiag[noff]->GetMean()<0) oscparerr_offdiag[noff] = -1.*oscparerr_offdiag[noff];
00692             delnexphist_offdiag[noff]->Write();
00693             noff++;
00694           }
00695         }
00696       }
00697       f->Close();
00698       
00699       gROOT->cd("/");
00700       
00701       for(i=0;i<nbins;i++)
00702       {
00703         for(ie=0;ie<Extrap.size();ie++)
00704         {
00705           ftree2[i][ie]->Fill();
00706         }
00707         ftree[i]->Fill();
00708       }
00709       
00710       f = new TFile(gSystem->ExpandPathName(s.c_str()),"UPDATE");
00711       
00712       if(l%100==0) cout<<100.*l/((nDeltaSteps+1)*(nSinSq2Th13Steps+1))<<"% complete"<<endl;
00713       l++;
00714     }
00715   }
00716   
00717   f->Close();
00718   
00719   double nPOTNear,nPOTFar;
00720   
00721   TTree *paramtree = new TTree("paramtree","paramtree");
00722   paramtree->Branch("nearPOT",&nPOTNear,"nearPOT/D");
00723   paramtree->Branch("farPOT",&nPOTFar,"farPOT/D");
00724   paramtree->Branch("Theta12",&Theta12,"Theta12/D");
00725   paramtree->Branch("Theta23",&Theta23,"Theta23/D");
00726   paramtree->Branch("DeltaMSq23",&dm32,"DeltaMSq23/D");
00727   paramtree->Branch("DeltaMSq12",&DeltaMSq12,"DeltaMSq12/D");
00728   
00729   dm32 = DeltaMSq23;
00730   if(!NormalHier) dm32 = -1.*DeltaMSq23;
00731   
00732   for(ie=0;ie<Extrap.size();ie++)
00733   {
00734     nPOTNear = Extrap[ie]->GetNearPOT();
00735     nPOTFar = Extrap[ie]->GetFarPOT();
00736     paramtree->Fill();
00737   }
00738   
00739   TFile *fout = new TFile(gSystem->ExpandPathName(outFileName.c_str()),"RECREATE");
00740   for(i=0;i<nbins;i++)
00741   {
00742     ftree[i]->Write();
00743     for(ie=0;ie<Extrap.size();ie++)
00744     {
00745       ftree2[i][ie]->Write();
00746     }
00747   }
00748   paramtree->Write();
00749   fout->Close();
00750   
00751   return;
00752 }

void GridGen::RunWithOscParErrs ( string  s = "OscParErrDistributions.root"  ) 

Definition at line 282 of file GridGen.cxx.

References AsymGaus(), dDeltaMSq12_dn, dDeltaMSq12_up, dDeltaMSq23_dn, dDeltaMSq23_up, DeltaHigh, DeltaLow, DeltaMSq12, DeltaMSq23, dTheta12_dn, dTheta12_up, dTheta23_dn, dTheta23_up, Extrap, Form(), gSystem(), id, OscPar::kDeltaM12, OscPar::kDeltaM23, OscPar::kTh12, OscPar::kTh23, nDeltaSteps, NormalHier, nSinSq2Th13Steps, NumExpts, outFileName, SinSq2Th13High, SinSq2Th13Low, Theta12, and Theta23.

00283 {
00284   if(Extrap.size()==0)
00285   {
00286     cout<<"No Extrapolate2D input.  Quitting..."<<endl;
00287     return;
00288   }
00289   
00290   unsigned int ie;
00291   for(ie=0;ie<Extrap.size();ie++)
00292   {
00293 //     Extrap[ie]->SetPrintResult();
00294     Extrap[ie]->GetPrediction();
00295   }
00296   
00297   if(Extrap[0]->Pred_TotalBkgd_VsBinNumber->GetNbinsX()!=1)
00298   {
00299     cout<<"RunWithOscParErrs() only works for 1 bin right now.  Quitting..."<<endl;
00300     return;
00301   }
00302   
00303   for(ie=0;ie<Extrap.size();ie++)
00304   {
00305     Extrap[ie]->SetOscPar(OscPar::kTh12,Theta12);
00306     Extrap[ie]->SetOscPar(OscPar::kTh23,Theta23);
00307     Extrap[ie]->SetOscPar(OscPar::kDeltaM12,DeltaMSq12);
00308     Extrap[ie]->SetOscPar(OscPar::kDeltaM23,DeltaMSq23);
00309     if(!NormalHier) Extrap[ie]->InvertMassHierarchy();
00310     Extrap[ie]->OscillatePrediction();
00311   }
00312   
00313   double delta,t13axis;
00314   double sig, bkgd;
00315   double oscparerr;
00316   
00317   TTree *ftree = new TTree("Bin_0","Bin_0");
00318   ftree->Branch("Delta",&delta,"Delta/D");
00319   ftree->Branch("Th13Axis",&t13axis,"Th13Axis/D");
00320   ftree->Branch("Signal",&sig,"Signal/D");
00321   ftree->Branch("Background",&bkgd,"Background/D");
00322   ftree->Branch("DNExp_DOscPars",&oscparerr,"DNExp_DOscPars/D");
00323   
00324   double delta_increment = 0;
00325   if(nDeltaSteps>0) delta_increment = (DeltaHigh - DeltaLow)/(nDeltaSteps);
00326   double ssq2th13_increment = 0;
00327   if(nSinSq2Th13Steps>0) ssq2th13_increment = (SinSq2Th13High - SinSq2Th13Low)/(nSinSq2Th13Steps);
00328   
00329   int id,is,l,u;
00330   double theta23,theta12,dm21,dm32,ssq2th13;
00331   double nexp,nobs;
00332   double delnexp;
00333   TH1D *delnexphist = new TH1D("delnexphist","",400,-1,1);
00334   
00335   gRandom->SetSeed(0);
00336   
00337   TFile *f = new TFile(gSystem->ExpandPathName(s.c_str()),"RECREATE");//save the osc par err distributions to this file
00338   
00339   l=0;
00340   for(id=0;id<nDeltaSteps+1;id++)
00341   {
00342     delta = (id*delta_increment + DeltaLow)*TMath::Pi();
00343     
00344     for(is=0;is<nSinSq2Th13Steps+1;is++)
00345     {
00346       t13axis = (is*ssq2th13_increment + SinSq2Th13Low);
00347       ssq2th13 = t13axis/(2.*TMath::Sin(Theta23)*TMath::Sin(Theta23));
00348       
00349       //get nominal prediction
00350       sig=0;
00351       bkgd=0;
00352       for(ie=0;ie<Extrap.size();ie++)
00353       {
00354         Extrap[ie]->SetOscPar(OscPar::kTh12,Theta12);
00355         Extrap[ie]->SetOscPar(OscPar::kTh23,Theta23);
00356         Extrap[ie]->SetOscPar(OscPar::kDeltaM12,DeltaMSq12);
00357         Extrap[ie]->SetOscPar(OscPar::kDeltaM23,DeltaMSq23);//note that DeltaMSq23 is always positive
00358         if(!NormalHier) Extrap[ie]->InvertMassHierarchy();
00359         Extrap[ie]->SetDeltaCP(delta);
00360         Extrap[ie]->SetSinSq2Th13(ssq2th13);
00361         Extrap[ie]->OscillatePrediction();
00362         bkgd += (Extrap[ie]->Pred_TotalBkgd_VsBinNumber->GetBinContent(1));
00363         sig += (Extrap[ie]->Pred_Signal_VsBinNumber->GetBinContent(1));
00364       }
00365       nexp = sig+bkgd;
00366       
00367       //do pseudo experiments
00368       delnexphist->Reset();
00369       delnexphist->SetName(Form("DeltaNexp_%i_%i",id,is));
00370       for(u=0;u<NumExpts;u++)
00371       {
00372 //         theta12 = gRandom->Gaus(Theta12,dTheta12);
00373 //         dm21 = gRandom->Gaus(DeltaMSq12,dDeltaMSq12);
00374 //         dm32 = gRandom->Gaus(DeltaMSq23,dDeltaMSq23);
00375 //         theta23 = gRandom->Gaus(Theta23,dTheta23);
00376         theta12 = Theta12 + AsymGaus(dTheta12_dn,dTheta12_up);
00377         dm21 = DeltaMSq12 + AsymGaus(dDeltaMSq12_dn,dDeltaMSq12_up);
00378         dm32 = DeltaMSq23 + AsymGaus(dDeltaMSq23_dn,dDeltaMSq23_up);
00379         //theta23 = DrawTheta23(dTheta23_up);
00380         theta23 = Theta23 + AsymGaus(dTheta23_dn,dTheta23_up);
00381         
00382         ssq2th13 = t13axis/(2.*TMath::Sin(theta23)*TMath::Sin(theta23));
00383         
00384         nobs=0;
00385         for(ie=0;ie<Extrap.size();ie++)
00386         {
00387           Extrap[ie]->SetOscPar(OscPar::kTh12,theta12);
00388           Extrap[ie]->SetOscPar(OscPar::kDeltaM12,dm21);
00389           Extrap[ie]->SetOscPar(OscPar::kDeltaM23,dm32);
00390           if(!NormalHier) Extrap[ie]->InvertMassHierarchy();
00391           Extrap[ie]->SetOscPar(OscPar::kTh23,theta23);
00392           Extrap[ie]->SetSinSq2Th13(ssq2th13);
00393           Extrap[ie]->OscillatePrediction();
00394           nobs += (Extrap[ie]->Pred_TotalBkgd_VsBinNumber->GetBinContent(1));
00395           nobs += (Extrap[ie]->Pred_Signal_VsBinNumber->GetBinContent(1));
00396         }
00397         delnexp = (nobs-nexp)/nexp;
00398         delnexphist->Fill(delnexp);
00399       }
00400       oscparerr = delnexphist->GetRMS();
00401       delnexphist->Write();
00402       f->Close();
00403       
00404       gROOT->cd("/");
00405       ftree->Fill();
00406       
00407       f = new TFile(gSystem->ExpandPathName(s.c_str()),"UPDATE");
00408       
00409       if(l%100==0) cout<<100.*l/((nDeltaSteps+1)*(nSinSq2Th13Steps+1))<<"% complete"<<endl;
00410       l++;
00411     }
00412   }
00413   
00414   f->Close();
00415   
00416   double nPOTNear,nPOTFar;
00417   
00418   TTree *paramtree = new TTree("paramtree","paramtree");
00419   paramtree->Branch("nearPOT",&nPOTNear,"nearPOT/D");
00420   paramtree->Branch("farPOT",&nPOTFar,"farPOT/D");
00421   paramtree->Branch("Theta12",&Theta12,"Theta12/D");
00422   paramtree->Branch("Theta23",&Theta23,"Theta23/D");
00423   paramtree->Branch("DeltaMSq23",&dm32,"DeltaMSq23/D");
00424   paramtree->Branch("DeltaMSq12",&DeltaMSq12,"DeltaMSq12/D");
00425   
00426   dm32 = DeltaMSq23;
00427   if(!NormalHier) dm32 = -1.*DeltaMSq23;
00428   
00429   for(ie=0;ie<Extrap.size();ie++)
00430   {
00431     nPOTNear = Extrap[ie]->GetNearPOT();
00432     nPOTFar = Extrap[ie]->GetFarPOT();
00433     paramtree->Fill();
00434   }
00435   
00436   TFile *fout = new TFile(gSystem->ExpandPathName(outFileName.c_str()),"RECREATE");
00437   ftree->Write();
00438   paramtree->Write();
00439   fout->Close();
00440   
00441   return;
00442 }

void GridGen::SetAbsValDeltaMSq23 ( double  val = 2.32e-3,
double  errup = 0.11e-3,
double  errdn = 0.11e-3 
)

Definition at line 70 of file GridGen.cxx.

References dDeltaMSq23_dn, dDeltaMSq23_up, and DeltaMSq23.

Referenced by GridGen(), and GridGen_Joint::GridGen_Joint().

00071 {
00072   DeltaMSq23 = TMath::Abs(val);
00073   dDeltaMSq23_up = errup;
00074   dDeltaMSq23_dn = errdn;
00075   return;
00076 }

void GridGen::SetDeltaMSq12 ( double  val = 8.0e-5,
double  errup = 0.6e-5,
double  errdn = 0.6e-5 
)

Definition at line 77 of file GridGen.cxx.

References dDeltaMSq12_dn, dDeltaMSq12_up, and DeltaMSq12.

Referenced by GridGen(), and GridGen_Joint::GridGen_Joint().

00078 {
00079   DeltaMSq12 = val;
00080   dDeltaMSq12_up = errup;
00081   dDeltaMSq12_dn = errdn;
00082   return;
00083 }

void GridGen::SetDeltaRange ( double  l = 0,
double  h = 2 
)

Definition at line 31 of file GridGen.cxx.

References DeltaHigh, and DeltaLow.

Referenced by GridGen(), and GridGen_Joint::GridGen_Joint().

00032 {
00033   DeltaLow = l;
00034   DeltaHigh = h;
00035   
00036   return;
00037 }

void GridGen::SetNDeltaSteps ( int  n = 20  )  [inline]

Definition at line 23 of file GridGen.h.

References n, and nDeltaSteps.

Referenced by GridGen(), and GridGen_Joint::GridGen_Joint().

00023 { nDeltaSteps = n; };

void GridGen::SetNExperiments ( int  n = 2000  )  [inline]

Definition at line 38 of file GridGen.h.

References n, and NumExpts.

Referenced by GridGen(), and GridGen_Joint::GridGen_Joint().

00038 { NumExpts = n; };

void GridGen::SetNormalHierarchy ( Bool_t  normal = true  )  [inline]

Definition at line 27 of file GridGen.h.

References NormalHier.

Referenced by GridGen(), and GridGen_Joint::GridGen_Joint().

00027 { NormalHier = normal; };

void GridGen::SetNSinSq2Th13Steps ( int  n = 3000  )  [inline]

Definition at line 24 of file GridGen.h.

References n, and nSinSq2Th13Steps.

Referenced by GridGen(), and GridGen_Joint::GridGen_Joint().

00024 { nSinSq2Th13Steps = n; };

void GridGen::SetOutputFile ( string  s = "GridOut.root"  )  [inline]

Definition at line 20 of file GridGen.h.

References outFileName.

Referenced by GridGen(), and GridGen_Joint::GridGen_Joint().

00020 { outFileName = s; };

void GridGen::SetSinSq2Th13Range ( double  l = 0.05,
double  h = 0.35 
)

Definition at line 38 of file GridGen.cxx.

References SinSq2Th13High, and SinSq2Th13Low.

Referenced by GridGen(), and GridGen_Joint::GridGen_Joint().

00039 {
00040   if(l<0 || l>1)
00041   {
00042     cout<<"Unphysical value of SinSq2Th13.  Setting low value to 0."<<endl;
00043     l=0;
00044   }
00045   if(h<0 || h>1)
00046   {
00047     cout<<"Unphysical value of SinSq2Th13.  Setting high value to 1."<<endl;
00048     h=1;
00049   }
00050   
00051   SinSq2Th13Low = l;
00052   SinSq2Th13High = h;
00053   
00054   return;
00055 }

void GridGen::SetTheta12 ( double  val = 0.59365,
double  errup = 0.041,
double  errdn = 0.041 
)

Definition at line 56 of file GridGen.cxx.

References dTheta12_dn, dTheta12_up, and Theta12.

Referenced by GridGen(), and GridGen_Joint::GridGen_Joint().

00057 {
00058   Theta12 = val;
00059   dTheta12_up = errup;
00060   dTheta12_dn = errdn;
00061   return;
00062 }

void GridGen::SetTheta13 ( double  val = 0.1594,
double  errup = 0.0110,
double  errdn = 0.0110 
)

Definition at line 84 of file GridGen.cxx.

References dTheta13_dn, dTheta13_up, and Theta13.

Referenced by GridGen().

00085 {
00086   Theta13 = val;
00087   dTheta13_up = errup;
00088   dTheta13_dn = errdn;
00089   return;
00090 }

void GridGen::SetTheta23 ( double  val = 0.78540,
double  errup = 0.122,
double  errdn = 0.122 
)

Definition at line 63 of file GridGen.cxx.

References dTheta23_dn, dTheta23_up, and Theta23.

Referenced by GridGen(), and GridGen_Joint::GridGen_Joint().

00064 {
00065   Theta23 = val;
00066   dTheta23_up = errup;
00067   dTheta23_dn = errdn;
00068   return;
00069 }


Member Data Documentation

Double_t GridGen::dDeltaMSq12_dn [protected]
Double_t GridGen::dDeltaMSq12_up [protected]
Double_t GridGen::dDeltaMSq23_dn [protected]
Double_t GridGen::dDeltaMSq23_up [protected]
Double_t GridGen::DeltaHigh [protected]
Double_t GridGen::DeltaLow [protected]
Double_t GridGen::DeltaMSq12 [protected]
Double_t GridGen::DeltaMSq23 [protected]
Double_t GridGen::dTheta12_dn [protected]
Double_t GridGen::dTheta12_up [protected]
Double_t GridGen::dTheta13_dn [protected]
Double_t GridGen::dTheta13_up [protected]
Double_t GridGen::dTheta23_dn [protected]
Double_t GridGen::dTheta23_up [protected]
Bool_t GridGen::FrozenTheta23 [protected]

Definition at line 60 of file GridGen.h.

Referenced by DrawTheta23(), and FreezeTheta23().

Int_t GridGen::nDeltaSteps [protected]
Bool_t GridGen::NormalHier [protected]
Int_t GridGen::nSinSq2Th13Steps [protected]
Int_t GridGen::NumExpts [protected]
string GridGen::outFileName [protected]
Double_t GridGen::SinSq2Th13High [protected]
Double_t GridGen::SinSq2Th13Low [protected]
Double_t GridGen::Theta12 [protected]
Double_t GridGen::Theta13 [protected]
Double_t GridGen::Theta23 [protected]

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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1