make_extrap_figure_hists.C
Go to the documentation of this file.
1 // This is the macro to make the inputs for make_extrap_figure.C
2 //
3 // It sets up the very simplest numu extrapolation and dumps the debug
4 // histograms.
5 
6 #include "CAFAna/Core/Loaders.h"
7 #include "CAFAna/Core/OscCurve.h"
14 #include "CAFAna/Analysis/Calcs.h"
15 
16 using namespace ana;
17 
18 #include "OscLib/IOscCalc.h"
19 
20 #include "TFile.h"
21 
22 #include <iostream>
23 
24 const double pot = 9e20;
25 
26 void make_extrap_figure_hists(string ana = "nue")
27 {
28  bool IsNue = (ana == "nue")? true: false;
30  if(IsNue)
31  fname = "/nova/ana/nu_e_ana/Ana2018/Predictions/provisional_singles/NueProd4SystematicsOnRealNDData_2018-05-03/pred_allxp_Nue2018Axis_full_FHCAllSyst_nueconcat_realNDData_2018-05-11.root";
32  else
33  {
34  auto cvmfs_dir = std::getenv("NUMUDATA_DIR");
35  if (!cvmfs_dir)
36  {
37  std::cerr << "Couldn't find UPS dir for numu prediction!" << std::endl;
38  return;
39  }
40  fname = std::string(cvmfs_dir) + "ana2018/Predictions/pred_numuconcat_fhc__numu2018.root";
41  }
42 
43  TFile* file = new TFile(fname.c_str(), "read");
44 
45  ModularExtrap* extrap;
46  if(IsNue)
47  extrap = LoadFrom<ModularExtrap>(file, "pred_xp_combo_RelativeCalib/plusTwo/nue_pred_Nue2018Axis/extrap/").release();
48  else
49  extrap = LoadFrom<ModularExtrap>(file, "pred_xp_numu_RelativeCalib/plusTwo/numu_pred_NumuEnergy/extrap").release();
50 
51  TFile* fout = new TFile((TString)"extrap_hists_"+ana+".root", "RECREATE");
52 std::cout<<"start saving plots"<<std::endl;
53 
54  if(IsNue) extrap->SavePlotsNue(fout, pot);
55  else extrap->SavePlotsNumu(fout, pot);
56 
58  calc->SetdCP(0.186 *(TMath::Pi()));
59  calc->SetTh23( asin(sqrt(0.586)));
60  calc->SetDmsq32( 2.502e-3);
61  if(IsNue){
62  OscCurve curve(calc, 14,12);
63  curve.ToTH1()->Write("osc");
64  }
65  else{
66  OscCurve curve(calc, 14,14);
67  curve.ToTH1()->Write("osc");
68  }
69  file->Close();
70 }
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
T sqrt(T number)
Definition: d0nt_math.hpp:156
OStream cerr
Definition: OStream.cxx:7
osc::OscCalcDumb calc
osc::IOscCalcAdjustable * DefaultOscCalc()
Create a new calculator with default assumptions for all parameters.
Definition: Calcs.cxx:49
virtual void SetDmsq32(const T &dmsq32)=0
std::string getenv(std::string const &name)
TH1D * ToTH1(bool title=false) const
Definition: OscCurve.cxx:59
OStream cout
Definition: OStream.cxx:6
Transition probability for any one channel as a function of energy.
Definition: OscCurve.h:11
virtual void SetTh23(const T &th23)=0
TFile * file
Definition: cellShifts.C:17
void make_extrap_figure_hists(string ana="nue")
Float_t e
Definition: plot.C:35
Extrapolate each component using a separate ModularExtrapComponent.
Definition: ModularExtrap.h:23
virtual void SetdCP(const T &dCP)=0
T asin(T number)
Definition: d0nt_math.hpp:60
const double pot
enum BeamMode string