Functions | Variables
saveFDMCHists.C File Reference
#include "includes.h"
#include "numu_tools.h"
#include "3FlavorAna/Plotting/NuePlotStyle.h"

Go to the source code of this file.

Functions

void HornSettings (int quantile, double &pot, double &livetime, Sign::Sign_t &wrongs, double &maxy)
 
void saveFDMCHists (std::string anaName="fhc", bool withExtrap=true)
 

Variables

const double pot_fhc = kAna2018FHCPOT
 
const double pot_rhc = kAna2018RHCPOT
 
const double livetime_fhc = kAna2018FHCLivetime
 
const double livetime_rhc = kAna2018RHCLivetime
 
double pot = 0
 
double pot_one = pot_rhc
 
double pot_two = pot_fhc
 
double livetime = 0
 
double livetime_one = livetime_rhc
 
double livetime_two = livetime_fhc
 
double maxy = 0
 
double maxy_one = 1.999
 
double maxy_two = 3.999
 
Sign::Sign_t wrongs = Sign::kNu
 
Sign::Sign_t ws_one = Sign::kNu
 
Sign::Sign_t ws_two = Sign::kAntiNu
 
std::string extrapName = "extrap"
 
std::string horn_one = "rhc"
 
std::string horn_two = "fhc"
 
std::string period_one = "full"
 
std::string period_two = "full"
 
bool twobeams = true
 
int totquant = 8
 
bool DianaIsLazy = true
 
bool errorBand = true
 
Color_t color_band = kViolet-9
 
Color_t color_pred = kViolet+1
 
Color_t color_ws = kBlue-7
 
Color_t color_nc = kBlue-7
 
Color_t color_data = kBlack
 
Color_t color_cos = kGreen+1
 
Color_t color_bkg = kGray+1
 
Style_t line_ws = kSolid
 
Style_t line_nc = kSolid
 
Style_t line_data = kSolid
 
Style_t line_pred = kSolid
 
Style_t line_cos = kSolid
 
Style_t line_bkg = kSolid
 
Style_t marker_ws = kFullCircle
 
Style_t marker_nc = kFullSquare
 
Style_t marker_data = kFullCircle
 
Style_t marker_pred = kFullCircle
 
Style_t marker_cos = kFullTriangleUp
 
Style_t marker_bkg = kFullCircle
 

Function Documentation

void HornSettings ( int  quantile,
double &  pot,
double &  livetime,
Sign::Sign_t wrongs,
double &  maxy 
)

Definition at line 69 of file saveFDMCHists.C.

References livetime_one, livetime_two, maxy_one, maxy_two, pot_one, pot_two, ws_one, and ws_two.

69  {
70  if(quantile<4){
71  pot = pot_one;
73  wrongs = ws_one;
74  maxy = maxy_one;
75  }
76  else{
77  pot = pot_two;
79  wrongs = ws_two;
80  maxy = maxy_two;
81  }
82 
83 }// end HornSettings
double maxy_one
Definition: saveFDMCHists.C:25
double pot_two
Definition: saveFDMCHists.C:20
double pot
Definition: saveFDMCHists.C:18
double maxy
Definition: saveFDMCHists.C:24
double pot_one
Definition: saveFDMCHists.C:19
double livetime_two
Definition: saveFDMCHists.C:23
Sign::Sign_t ws_one
Definition: saveFDMCHists.C:28
Sign::Sign_t ws_two
Definition: saveFDMCHists.C:29
unsigned int quantile(std::vector< std::vector< double >> v, float E, float hadEfrac)
Definition: Toy_analyses.C:480
double livetime
Definition: saveFDMCHists.C:21
double livetime_one
Definition: saveFDMCHists.C:22
Sign::Sign_t wrongs
Definition: saveFDMCHists.C:27
double maxy_two
Definition: saveFDMCHists.C:26
void saveFDMCHists ( std::string  anaName = "fhc",
bool  withExtrap = true 
)

Definition at line 87 of file saveFDMCHists.C.

References std::asin(), calc, Close(), om::cout, ana::DefaultOscCalc(), allTimeWatchdog::endl, plotROC::fileName, makeBrightnessMap::fOut, horn_one, ana::Flavors::kAll, ana::Flavors::kAllNuE, ana::Flavors::kAllNuMu, ana::Flavors::kAllNuTau, ana::Sign::kAntiNu, ana::Sign::kBoth, ana::Current::kCC, ana::Current::kNC, ana::Sign::kNu, ana::Flavors::kNuEToNuE, ana::Flavors::kNuEToNuMu, ana::Flavors::kNuEToNuTau, ana::kNuMu, ana::kNumuNoExtrap, ana::Flavors::kNuMuToNuE, ana::Flavors::kNuMuToNuMu, ana::Flavors::kNuMuToNuTau, livetime_fhc, livetime_one, maxy_one, period_one, pot_fhc, pot_one, preliminary, ana::Spectrum::SaveTo(), osc::_IOscCalcAdjustable< T >::SetDmsq32(), osc::_IOscCalcAdjustable< T >::SetTh23(), std::sqrt(), totquant, twobeams, and ws_one.

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
double maxy_one
Definition: saveFDMCHists.C:25
fileName
Definition: plotROC.py:78
Antineutrinos-only.
Definition: IPrediction.h:50
(&#39; appearance&#39;)
Definition: IPrediction.h:18
int totquant
Definition: saveFDMCHists.C:40
(&#39;beam &#39;)
Definition: IPrediction.h:15
T sqrt(T number)
Definition: d0nt_math.hpp:156
const double livetime_fhc
Definition: saveFDMCHists.C:12
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
Charged-current interactions.
Definition: IPrediction.h:39
Sign::Sign_t ws_one
Definition: saveFDMCHists.C:28
Int_t preliminary
Definition: SimpleIterate.C:63
void SaveTo(TDirectory *dir, const std::string &name) const
Definition: Spectrum.cxx:517
c1 Close()
Neutrinos-only.
Definition: IPrediction.h:49
OStream cout
Definition: OStream.cxx:6
(&#39; survival&#39;)
Definition: IPrediction.h:19
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
const double pot_fhc
Definition: saveFDMCHists.C:10
double livetime_one
Definition: saveFDMCHists.C:22
virtual void SetTh23(const T &th23)=0
All neutrinos, any flavor.
Definition: IPrediction.h:26
(&#39; appearance&#39;)
Definition: IPrediction.h:16
std::string period_one
Definition: saveFDMCHists.C:35
std::string horn_one
Definition: saveFDMCHists.C:33
T asin(T number)
Definition: d0nt_math.hpp:60

Variable Documentation

Color_t color_band = kViolet-9

Definition at line 46 of file saveFDMCHists.C.

Referenced by demoPlotSystBands(), and plot_datapredictions().

Color_t color_bkg = kGray+1

Definition at line 52 of file saveFDMCHists.C.

Referenced by plot_datapredictions(), and plot_rationoosc().

Color_t color_cos = kGreen+1

Definition at line 51 of file saveFDMCHists.C.

Referenced by plot_datapredictions(), and plot_rationoosc().

Color_t color_data = kBlack

Definition at line 50 of file saveFDMCHists.C.

Referenced by plot_datapredictions(), and plot_rationoosc().

Color_t color_nc = kBlue-7

Definition at line 49 of file saveFDMCHists.C.

Referenced by plot_datapredictions(), and plot_rationoosc().

Color_t color_pred = kViolet+1

Definition at line 47 of file saveFDMCHists.C.

Referenced by plot_datapredictions(), and plot_rationoosc().

Color_t color_ws = kBlue-7

Definition at line 48 of file saveFDMCHists.C.

Referenced by plot_datapredictions(), and plot_rationoosc().

bool DianaIsLazy = true

Definition at line 41 of file saveFDMCHists.C.

bool errorBand = true

Definition at line 42 of file saveFDMCHists.C.

std::string extrapName = "extrap"

Definition at line 32 of file saveFDMCHists.C.

std::string horn_one = "rhc"
std::string horn_two = "fhc"
Style_t line_bkg = kSolid

Definition at line 58 of file saveFDMCHists.C.

Referenced by plot_datapredictions(), and plot_rationoosc().

Style_t line_cos = kSolid

Definition at line 57 of file saveFDMCHists.C.

Referenced by plot_datapredictions(), and plot_rationoosc().

Style_t line_data = kSolid

Definition at line 55 of file saveFDMCHists.C.

Referenced by mre_blessed(), plot_datapredictions(), and plot_rationoosc().

Style_t line_nc = kSolid

Definition at line 54 of file saveFDMCHists.C.

Referenced by plot_datapredictions(), and plot_rationoosc().

Style_t line_pred = kSolid

Definition at line 56 of file saveFDMCHists.C.

Referenced by plot_datapredictions(), and plot_rationoosc().

Style_t line_ws = kSolid

Definition at line 53 of file saveFDMCHists.C.

Referenced by plot_datapredictions(), and plot_rationoosc().

double livetime = 0

Definition at line 21 of file saveFDMCHists.C.

Referenced by AnalyzeNus18Pred(), AnaPlotMaker(), caf::Proxy< caf::SRSpill >::CheckEquals(), compare_cos_numi(), demoBarChart(), demoPlotSystBands(), demoStarPlots(), DrawSurface(), fnex::EventListMaker::endSubRun(), energyResolution(), estimate_cosmics(), estimate_cosmics_triggeronly(), ana::Spectrum::FakeData(), febrates(), get_cosmic_sample(), getContProf(), getContProf_Sensitivity(), GetFakeData(), ana::Multiverse::GetNSigmaShift(), GetNueCosmics2018(), GetNueCosmics2019(), ana::GetNueCosmics2020(), GetNueData2018(), GetNueData2019(), ana::GetNueData2020(), ana::GetNumuCosmics2020(), GetNumuData2019(), ana::GetNumuData2020(), ana::Multiverse::GetNUniverses(), ana::ExposureSource::HandleSpill(), joint_fit_2017_make_fc_slice(), joint_fit_2017_make_fc_surf(), ana::LikelihoodCovMxExperiment::LikelihoodCovMxExperiment(), make_dst_cosrejbdttrain(), make_fc_nus_surfs_nersc_2018(), make_fc_surfaces_2020(), make_fc_surfaces_2020_validation(), make_starplots(), make_surfprof(), MakeExtrapSurface(), MakeNus17CosBkgd(), MakeNus18CosBkgd(), makePredTables(), MakeSurface(), mrbrem_get_reweighted_spectra(), mrbrem_plots(), OnMonPlotMaker(), caf::Proxy< caf::SRSpill >::operator=(), plot_datapredictions(), plot_rationoosc(), plot_shifts(), plot_spectra_2dplots(), plotDataPred(), plotDataPred_SplitCanvas(), ana::PlotSpectra(), Plotting_DataAndPrediction(), pred_err(), PrintNus18CosBkgd(), ana::PredictionExtendToPeripheral::ReduceHelper(), run_joint_fit_2020_bestfit(), run_joint_fit_2020_contours(), run_joint_fit_2020_slices(), sensitivity2018(), sensitivity2020(), systematics_summary_from_pred_interp(), ana::Multiverse::ToSpectrum(), ana::Spectrum::ToTH1(), and ana::Multiverse::Transform().

const double livetime_fhc = kAna2018FHCLivetime
double livetime_one = livetime_rhc
const double livetime_rhc = kAna2018RHCLivetime

Definition at line 13 of file saveFDMCHists.C.

double livetime_two = livetime_fhc
Style_t marker_bkg = kFullCircle

Definition at line 64 of file saveFDMCHists.C.

Referenced by plot_datapredictions(), and plot_rationoosc().

Style_t marker_cos = kFullTriangleUp

Definition at line 63 of file saveFDMCHists.C.

Referenced by plot_datapredictions(), and plot_rationoosc().

Style_t marker_data = kFullCircle

Definition at line 61 of file saveFDMCHists.C.

Referenced by plot_datapredictions(), and plot_rationoosc().

Style_t marker_nc = kFullSquare

Definition at line 60 of file saveFDMCHists.C.

Referenced by plot_datapredictions(), and plot_rationoosc().

Style_t marker_pred = kFullCircle

Definition at line 62 of file saveFDMCHists.C.

Referenced by plot_datapredictions(), and plot_rationoosc().

Style_t marker_ws = kFullCircle

Definition at line 59 of file saveFDMCHists.C.

Referenced by plot_datapredictions(), and plot_rationoosc().

double maxy = 0

Definition at line 24 of file saveFDMCHists.C.

double maxy_one = 1.999

Definition at line 25 of file saveFDMCHists.C.

Referenced by HornSettings(), and saveFDMCHists().

double maxy_two = 3.999

Definition at line 26 of file saveFDMCHists.C.

Referenced by HornSettings().

std::string period_one = "full"
std::string period_two = "full"

Definition at line 36 of file saveFDMCHists.C.

Referenced by make_surfprof().

double pot = 0

Definition at line 18 of file saveFDMCHists.C.

const double pot_fhc = kAna2018FHCPOT
double pot_one = pot_rhc
const double pot_rhc = kAna2018RHCPOT

Definition at line 11 of file saveFDMCHists.C.

double pot_two = pot_fhc
int totquant = 8
bool twobeams = true
Sign::Sign_t wrongs = Sign::kNu
Sign::Sign_t ws_one = Sign::kNu

Definition at line 28 of file saveFDMCHists.C.

Referenced by HornSettings(), plot_datapredictions(), plot_rationoosc(), and saveFDMCHists().

Sign::Sign_t ws_two = Sign::kAntiNu

Definition at line 29 of file saveFDMCHists.C.

Referenced by HornSettings().