saveFDMCHists.C
Go to the documentation of this file.
1 #pragma once
2 
3 #include "includes.h"
4 #include "numu_tools.h"
6 
7 using namespace ana;
8 
9 
10 const double pot_fhc = kAna2018FHCPOT;
11 const double pot_rhc = kAna2018RHCPOT;
14 
15 
16 // default for rhc+fhc
17 // horn 1 is rhc, horn 2 is fhc
18 double pot = 0;
19 double pot_one = pot_rhc;
20 double pot_two = pot_fhc;
21 double livetime = 0;
24 double maxy = 0;
25 double maxy_one = 1.999;
26 double maxy_two = 3.999;
30 
31 
37 
38 
39 bool twobeams = true;
40 int totquant = 8;
41 bool DianaIsLazy = true;
42 bool errorBand = true;
43 
44 //
45 //kViolet-9, kTeal-5, kBlue-7, kGray+1
46 Color_t color_band = kViolet-9;
47 Color_t color_pred = kViolet+1;
48 Color_t color_ws = kBlue-7;
49 Color_t color_nc = kBlue-7;
50 Color_t color_data = kBlack;
51 Color_t color_cos = kGreen+1;
52 Color_t color_bkg = kGray+1;
53 Style_t line_ws = kSolid;
54 Style_t line_nc = kSolid;
55 Style_t line_data = kSolid;
56 Style_t line_pred = kSolid;
57 Style_t line_cos = kSolid;
58 Style_t line_bkg = kSolid;
59 Style_t marker_ws = kFullCircle;
60 Style_t marker_nc = kFullSquare;
61 Style_t marker_data = kFullCircle;
62 Style_t marker_pred = kFullCircle;
63 Style_t marker_cos = kFullTriangleUp;
64 Style_t marker_bkg = kFullCircle;
65 
66 
67 
68 
69 void HornSettings(int quantile, double &pot, double &livetime, Sign::Sign_t &wrongs, double &maxy){
70  if(quantile<4){
71  pot = pot_one;
72  livetime = livetime_one;
73  wrongs = ws_one;
74  maxy = maxy_one;
75  }
76  else{
77  pot = pot_two;
78  livetime = livetime_two;
79  wrongs = ws_two;
80  maxy = maxy_two;
81  }
82 
83 }// end HornSettings
84 
85 
86 
87 void saveFDMCHists(std::string anaName = "fhc",
88  bool withExtrap =true)
89 {
90 
91  bool preliminary = false;
92 
93  if(anaName=="rhc"){
94  totquant = 4;
95  twobeams = false;
96  }
97  // if fhc, change settings so the first 4 quantiles are fhc instead of rhc
98  // dont do anything if rhc as the first 4 quantiles are rhc already
99  if(anaName=="fhc"){
100  horn_one = "fhc";
101  period_one = "full";
102  pot_one = pot_fhc;
105  maxy_one = 3.999;
106  twobeams = false;
107  totquant = 4;
108  }
109 
110  // calculator
112  calc->SetTh23(asin(sqrt(0.558)));
113  calc->SetDmsq32(0.00244);
114 
115  //inputs
116  std::string dpred_name = "/nova/ana/nu_mu_ana/Ana2018/Predictions/";
117 
118  std::cout << "\nloading predictions" << std::endl;
119  const std::string dpred_name_fhc= dpred_name+"pred_numuconcat_fhc__numu2018.root";
120  const std::string dpred_name_rhc= dpred_name+"pred_numuconcat_rhc__numu2018.root";
121  std::string dpred_name_one = dpred_name_rhc;
122  if(anaName=="fhc") dpred_name_one = dpred_name_fhc;
123 
124  std::vector<PredictionInterp*> predictions;
125  ENumu2018ExtrapType extrap = kNuMu;
126  ENumu2018ExtrapType noextrap = kNumuNoExtrap;
127  for(int quant = 1; quant < totquant+1; quant++){
128  if(withExtrap) predictions.push_back(new PredictionSystNumu2018(extrap, calc, quant, {}, dpred_name_one));
129  if(!withExtrap) predictions.push_back(new PredictionSystNumu2018(noextrap, calc, quant, {}, dpred_name_one));
130  }
131 
132 
133  std::map< TString, Flavors::Flavors_t > mapFlavor;
134  mapFlavor["All"] = Flavors::kAll;
135  mapFlavor["AllNuMu"] = Flavors::kAllNuMu;
136  mapFlavor["AllNuE"] = Flavors::kAllNuE;
137  mapFlavor["AllNuTau"] = Flavors::kAllNuTau;
138  mapFlavor["NuEToNuE"] = Flavors::kNuEToNuE;
139  mapFlavor["NuEToNuMu"] = Flavors::kNuEToNuMu;
140  mapFlavor["NuEToNuTau"] = Flavors::kNuEToNuTau;
141  mapFlavor["NuMuToNuE"] = Flavors::kNuMuToNuE;
142  mapFlavor["NuMuToNuMu"] = Flavors::kNuMuToNuMu;
143  mapFlavor["NuMuToNuTau"] = Flavors::kNuMuToNuTau;
144 
145  std::map< TString, Sign::Sign_t > mapSign;
146  mapSign["Both"] = Sign::kBoth;
147  mapSign["Nu"] = Sign::kNu;
148  mapSign["AntiNu"] = Sign::kAntiNu;
149 
150 
151  TString fileName = "FDMCHist";
152  if(withExtrap) fileName += "_extrap_";
153  if(!withExtrap) fileName += "_noExtrap_";
154  fileName += anaName;
155  TFile *fOut = new TFile(fileName + ".root","RECREATE");
156 
157  for(int quant = 0; quant < totquant; quant++){
158  Spectrum hTot = predictions[quant] -> Predict(calc);
159  Spectrum hNC = predictions[quant] -> PredictComponent(calc, Flavors::kAll, Current::kNC, Sign::kBoth);
160  hTot.SaveTo(fOut, Form("Q%d_tot",quant+1));
161  hNC.SaveTo(fOut, Form("Q%d_NC",quant+1));
162  for(auto const& thisSign : mapSign){
163  for(auto const& thisFlav : mapFlavor){
164  Spectrum hComp = predictions[quant] -> PredictComponent(calc, thisFlav.second, Current::kCC, thisSign.second);
165  hComp.SaveTo(fOut, Form("Q%d_",quant+1) + thisSign.first + "_" + thisFlav.first);
166  }
167  }
168  }
169 
170  fOut -> Close();
171  delete fOut;
172 
173 
174 } // End of function
175 
double maxy_one
Definition: saveFDMCHists.C:25
void HornSettings(int quantile, double &pot, double &livetime, Sign::Sign_t &wrongs, double &maxy)
Definition: saveFDMCHists.C:69
Style_t marker_cos
Definition: saveFDMCHists.C:63
fileName
Definition: plotROC.py:78
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
Antineutrinos-only.
Definition: IPrediction.h:50
(&#39; appearance&#39;)
Definition: IPrediction.h:18
double pot_two
Definition: saveFDMCHists.C:20
double pot
Definition: saveFDMCHists.C:18
int totquant
Definition: saveFDMCHists.C:40
(&#39;beam &#39;)
Definition: IPrediction.h:15
bool errorBand
Definition: saveFDMCHists.C:42
T sqrt(T number)
Definition: d0nt_math.hpp:156
Color_t color_pred
Definition: saveFDMCHists.C:47
Style_t marker_data
Definition: saveFDMCHists.C:61
const double livetime_fhc
Definition: saveFDMCHists.C:12
Style_t line_bkg
Definition: saveFDMCHists.C:58
double maxy
Definition: saveFDMCHists.C:24
Style_t line_data
Definition: saveFDMCHists.C:55
Color_t color_data
Definition: saveFDMCHists.C:50
osc::OscCalcDumb calc
osc::IOscCalcAdjustable * DefaultOscCalc()
Create a new calculator with default assumptions for all parameters.
Definition: Calcs.cxx:49
double pot_one
Definition: saveFDMCHists.C:19
virtual void SetDmsq32(const T &dmsq32)=0
bool twobeams
Definition: saveFDMCHists.C:39
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:40
Style_t line_pred
Definition: saveFDMCHists.C:56
const double kAna2018RHCPOT
Definition: Exposures.h:208
Style_t line_cos
Definition: saveFDMCHists.C:57
double livetime_two
Definition: saveFDMCHists.C:23
Charged-current interactions.
Definition: IPrediction.h:39
Color_t color_ws
Definition: saveFDMCHists.C:48
const double livetime_rhc
Definition: saveFDMCHists.C:13
std::string extrapName
Definition: saveFDMCHists.C:32
Sign::Sign_t ws_one
Definition: saveFDMCHists.C:28
const double pot_rhc
Definition: saveFDMCHists.C:11
Int_t preliminary
Definition: SimpleIterate.C:63
void SaveTo(TDirectory *dir, const std::string &name) const
Definition: Spectrum.cxx:506
void saveFDMCHists(std::string anaName="fhc", bool withExtrap=true)
Definition: saveFDMCHists.C:87
Color_t color_nc
Definition: saveFDMCHists.C:49
c1 Close()
Sign::Sign_t ws_two
Definition: saveFDMCHists.C:29
Style_t marker_pred
Definition: saveFDMCHists.C:62
unsigned int quantile(std::vector< std::vector< double >> v, float E, float hadEfrac)
Definition: Toy_analyses.C:480
Neutrinos-only.
Definition: IPrediction.h:49
OStream cout
Definition: OStream.cxx:6
(&#39; survival&#39;)
Definition: IPrediction.h:19
const double pot_fhc
Definition: saveFDMCHists.C:10
double livetime
Definition: saveFDMCHists.C:21
double livetime_one
Definition: saveFDMCHists.C:22
Sign::Sign_t wrongs
Definition: saveFDMCHists.C:27
enum BeamMode kViolet
virtual void SetTh23(const T &th23)=0
Color_t color_cos
Definition: saveFDMCHists.C:51
Neutral-current interactions.
Definition: IPrediction.h:40
Style_t marker_bkg
Definition: saveFDMCHists.C:64
double maxy_two
Definition: saveFDMCHists.C:26
Both neutrinos and antineutrinos.
Definition: IPrediction.h:52
Style_t line_nc
Definition: saveFDMCHists.C:54
const double kAna2018FHCPOT
Definition: Exposures.h:207
Style_t marker_ws
Definition: saveFDMCHists.C:59
std::string period_two
Definition: saveFDMCHists.C:36
All neutrinos, any flavor.
Definition: IPrediction.h:26
(&#39; appearance&#39;)
Definition: IPrediction.h:16
enum BeamMode kGreen
enum BeamMode kBlue
std::string period_one
Definition: saveFDMCHists.C:35
Style_t marker_nc
Definition: saveFDMCHists.C:60
bool DianaIsLazy
Definition: saveFDMCHists.C:41
std::string horn_one
Definition: saveFDMCHists.C:33
Color_t color_band
Definition: saveFDMCHists.C:46
Style_t line_ws
Definition: saveFDMCHists.C:53
const double kAna2018FHCLivetime
Definition: Exposures.h:213
Color_t color_bkg
Definition: saveFDMCHists.C:52
std::string horn_two
Definition: saveFDMCHists.C:34
const double kAna2018RHCLivetime
Definition: Exposures.h:214
T asin(T number)
Definition: d0nt_math.hpp:60
enum BeamMode string