Functions | Variables
make_nueFDprediction_kinematics.C File Reference
#include "CAFAna/Analysis/Exposures.h"
#include "CAFAna/Analysis/Plots.h"
#include "CAFAna/Analysis/SALoaders.h"
#include "CAFAna/Analysis/Style.h"
#include "CAFAna/Core/Binning.h"
#include "CAFAna/Core/Cut.h"
#include "CAFAna/Core/HistAxis.h"
#include "CAFAna/Core/LoadFromFile.h"
#include "CAFAna/Core/Spectrum.h"
#include "CAFAna/Core/SpectrumLoader.h"
#include "CAFAna/Core/SpectrumLoaderBase.h"
#include "CAFAna/Cuts/Cuts.h"
#include "CAFAna/Cuts/NumuCuts.h"
#include "CAFAna/Cuts/NueCutsSecondAna.h"
#include "CAFAna/Cuts/SpillCuts.h"
#include "CAFAna/Cuts/NueCuts2017.h"
#include "CAFAna/Decomp/ProportionalDecomp.h"
#include "CAFAna/Decomp/BENDecomp.h"
#include "CAFAna/Decomp/MichelDecomp.h"
#include "CAFAna/Decomp/NumuDecomp.h"
#include "CAFAna/Extrap/ModularExtrap.h"
#include "CAFAna/Prediction/PredictionExtrap.h"
#include "CAFAna/Prediction/PredictionNoExtrap.h"
#include "CAFAna/Systs/Systs.h"
#include "CAFAna/Vars/GenieWeights.h"
#include "CAFAna/Vars/HistAxes.h"
#include "CAFAna/Vars/NueVars.h"
#include "CAFAna/Vars/Vars.h"
#include "CAFAna/Vars/NueVarsExtra.h"
#include "CAFAna/Vars/PPFXWeights.h"
#include "OscLib/func/OscCalculatorDumb.h"
#include "StandardRecord/Proxy/SRProxy.h"
#include <iostream>
#include <iomanip>

Go to the source code of this file.

Functions

void CheckFileOverwrite (TString)
 
void make_nueFDprediction_kinematics (const std::string &outfilename="FDprediction_kinematics.root", const bool hastau=false)
 

Variables

osc::OscCalculatorDumb calc
 

Function Documentation

void CheckFileOverwrite ( TString  outfilename)

Definition at line 184 of file make_nueFDprediction_kinematics.C.

References om::cout.

Referenced by make_nueFDprediction_kinematics().

184  {
185  if(!gSystem->AccessPathName(outfilename.Data())){
186  std::cout << "\n\nThis will overwrite " << outfilename
187  << "\n\nAre you sure you want to continue? y/n ";
188  string input = ""; getline(cin,input);
189  if (input!="y") abort();
190  }
191 }
string outfilename
knobs that need extra care
OStream cout
Definition: OStream.cxx:6
void make_nueFDprediction_kinematics ( const std::string &  outfilename = "FDprediction_kinematics.root",
const bool  hastau = false 
)

Definition at line 72 of file make_nueFDprediction_kinematics.C.

References ana::HistDef::axis, axisNue, axisNumu, CheckFileOverwrite(), ana::defs, file, ana::kBeam, ana::kCosTheta, fnex::kData, caf::kFARDET, kMC, caf::kNEARDET, ana::kNoShift, ana::kNue2017FDAllSamples, ana::kNue2017NDPresel, ana::kNueEnergy2017, ana::kNueSecondAnaCVNeSsb, ana::kNumSels, ana::kNumuNDCvn, ana::kNumuNonQEAxisFirstAna(), ana::kNumVars, ana::kPPFXFluxCVWgt, ana::kPtP, ana::kStandardSpillCuts, fnex::kTauSwap, ana::kTrueQ2, ana::kTrueW, ana::kWOscDumb, ana::kXSecCVWgt2017, loaders, caf::SRProxy::mc, ana::HistDef::name, caf::SRTruthBranchProxy::nu, ana::ModularExtrap::Nue(), make_template_knob_config::outfilename, ana::PredictionExtrap::SaveTo(), ana::PredictionNoExtrap::SaveTo(), ana::selNames, ana::Binning::Simple(), and Munits::sr.

76 {
77  // ND loaders
78  std::string loaderNDData = "prod_decaf_R17-03-01-prod3reco.d_nd_numi_fhc_full_nue_or_numu_or_nus_contain_v1_goodruns";
79  std::string loaderNDMC = "prod_decaf_R17-03-01-prod3reco.d_nd_genie_nonswap_fhc_nova_v08_full_nue_or_numu_or_nus_contain_v1";
80 
81  // FD loaders
82  std::string loaderFDnonswapMC = "prod_decaf_R17-03-01-prod3reco.l_fd_genie_nonswap_fhc_nova_v08_full_nue_or_numu_or_nus_contain_v1";
83  std::string loaderFDfluxswapMC = "prod_decaf_R17-03-01-prod3reco.l_fd_genie_fluxswap_fhc_nova_v08_full_nue_or_numu_or_nus_contain_v1";
84  std::string loaderFDtauswapMC = "prod_decaf_R17-03-01-prod3reco.l_fd_genie_tau_fhc_nova_v08_full_nue_or_numu_or_nus_contain_v1";
85 
86  //******* 1. Set up selection and variables ********
87  //Only needed here. Keep updated!
89 
90  const Var kWOscDumb([](const caf::SRProxy* sr){return sr->mc.nu[0].woscdumb;});
91 
92  const int kNumSels = 1;
93  const int kNumVars = 5;
94 
95  const HistDef defs[kNumVars] = {
96  {"recoE", {"E_{reco} (GeV)", Binning::Simple(10, 0, 5), kNueEnergy2017}},
97  {"trueQ2", {"true Q^{2} (GeV^{2})", Binning::Simple(500, 0, 5), kTrueQ2}},
98  {"trueW2", {"true W^{2} (GeV^{2})", Binning::Simple(100, 0, 2), kTrueW}},
99  {"PtP", {"p_{t}/p", Binning::Simple(500,0,1), kPtP}},
100  {"CosTheta", {"CosTheta", Binning::Simple(500,0,1), kCosTheta}}
101  };
102 
103  const Cut selFD[kNumSels] = {
105  };
106  const Cut selND[kNumSels] = {
108  };
109  const std::string selNames[kNumSels] = {
110  "AllSamples"
111  };
112  const Cut cutNDNumu = {
113  kNumuNDCvn
114  };
115 
117 
118  //********** 2. Set up loaders *********************
120 
121  loaders.SetLoaderPath(loaderNDData, caf::kNEARDET, ana::Loaders::DataMC::kData);
122  loaders.SetLoaderPath(loaderNDMC, caf::kNEARDET, ana::Loaders::DataMC::kMC);
123 
124  loaders.SetLoaderPath(loaderFDnonswapMC, caf::kFARDET, ana::Loaders::DataMC::kMC, DataSource::kBeam, ana::Loaders::SwappingConfig::kNonSwap);
125  loaders.SetLoaderPath(loaderFDfluxswapMC, caf::kFARDET, ana::Loaders::DataMC::kMC, DataSource::kBeam,ana::Loaders::SwappingConfig::kFluxSwap);
126  if(hastau)
128  else
130 
131  loaders.SetSpillCut(kStandardSpillCuts);
132 
133  //******* 3. Set up the extrapolations and go *******
134  SystShifts thisShift = kNoShift;
135 
136  NumuDecomp * numuDecomp;
137  ProportionalDecomp * propDecomp[kNumSels][kNumVars];
138  ModularExtrap extrapProp[kNumSels][kNumVars];
139  PredictionExtrap * predicProp[kNumSels][kNumVars];
140  PredictionNoExtrap * predicNoXP[kNumSels][kNumVars];
141 
142  numuDecomp = new NumuDecomp (loaders, axisNumu, cutNDNumu, thisShift, kNoShift, kXSecCVWgt2017*kPPFXFluxCVWgt);
143 
144  for(unsigned int selIdx = 0; selIdx < kNumSels; ++selIdx){
145  for(unsigned int varIdx = 0; varIdx < kNumVars; ++varIdx){
146 
147  const HistAxis& axisNue = defs[varIdx].axis;
148 
149  propDecomp[selIdx][varIdx] = new ProportionalDecomp (loaders,
150  axisNue, selND[selIdx],
151  thisShift, kNoShift, kXSecCVWgt2017*kPPFXFluxCVWgt );
152 
153  extrapProp[selIdx][varIdx] = ModularExtrap::Nue (loaders,
154  *propDecomp[selIdx][varIdx], *numuDecomp,
155  axisNue, axisNumu,
156  selFD[selIdx], selND[selIdx], cutNDNumu,
157  thisShift, kXSecCVWgt2017*kPPFXFluxCVWgt);
158 
159  predicProp[selIdx][varIdx] = new PredictionExtrap (&extrapProp[selIdx][varIdx]);
160 
161  predicNoXP[selIdx][varIdx] = new PredictionNoExtrap (loaders,
162  axisNue,
163  selFD[selIdx], thisShift, kXSecCVWgt2017*kPPFXFluxCVWgt);
164 
165  }//vars
166  }//sels
167  loaders.Go();
168 
169  //********** 4. Save everything ********************
170  TFile * file = new TFile(outfilename.c_str(),"RECREATE");
171  TDirectory * dFDshi = file->mkdir("prediction");
172  for(unsigned int selIdx = 0; selIdx < kNumSels; ++selIdx){
173  for(unsigned int varIdx = 0; varIdx < kNumVars; ++varIdx){
174  TString varName = defs[varIdx].name.c_str();
175  predicProp[selIdx][varIdx]->SaveTo(dFDshi->mkdir("nue_pred_"+selNames[selIdx]+"_"+varName) );
176  predicNoXP[selIdx][varIdx]->SaveTo(dFDshi->mkdir("nue_pred_noextrap_"+selNames[selIdx]+"_"+varName) );
177  }
178  }
179  file->Close();
180 
181 } // end
Near Detector underground.
Definition: SREnums.h:10
const int kNumVars
Definition: vars.h:14
Far Detector at Ash River.
Definition: SREnums.h:11
const Var kPPFXFluxCVWgt
Definition: PPFXWeights.h:16
VectorProxy< SRNeutrinoProxy > nu
Definition: SRProxy.h:1890
nue decafs in FD, nue_or_numu in ND
Definition: SALoaders.h:36
Simple record of shifts applied to systematic parameters.
Definition: SystShifts.h:20
const Var kCosTheta
HistAxis axis
Definition: NuePlotLists.h:13
Proxy for StandardRecord.
Definition: SRProxy.h:2237
const Color_t kMC
const Var kTrueQ2
Definition: TruthVars.h:27
string outfilename
knobs that need extra care
const Var kPtP
Transverse momentum fraction in slice.
Definition: NueVars.cxx:90
Uses MC for NC and CC components, assigns remainder of data to CC.
Definition: NumuDecomp.h:10
const Var kNueEnergy2017([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-1.0;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1.0;return NueRecoE_2017FDFit(kCVNemE(sr), kCVNhadE(sr));})
Definition: NueEnergy2017.h:11
const Cut kNueSecondAnaCVNeSsb([](const caf::SRProxy *sr){return(sr->sel.cvn.nueid > 0.75);})
const Cut kNumuNDCvn
Definition: NumuCuts.h:61
const Var kWOscDumb([](const caf::SRProxy *sr){return sr->mc.nu[0].woscdumb;})
void CheckFileOverwrite(TString)
virtual void SaveTo(TDirectory *dir) const override
const HistAxis kNumuNonQEAxisFirstAna("Reconstructed Neutrino Energy (GeV)", kNumuEnergyBinningFirstAna, kCCE)
const int kNumSels
Definition: vars.h:43
virtual void SaveTo(TDirectory *dir) const override
std::string name
Definition: NuePlotLists.h:12
const SystShifts kNoShift
Definition: SystShifts.h:112
const HistAxis axisNue
Definition: syst_header.h:377
const Cut kNue2017NDPresel
Definition: NueCuts2017.h:289
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
Splits Data proportionally according to MC.
std::vector< Loaders * > loaders
Definition: syst_header.h:385
SRTruthBranchProxy mc
Definition: SRProxy.h:2253
TFile * file
Definition: cellShifts.C:17
const HistAxis axisNumu
const SpillCut kStandardSpillCuts
Apply this unless you&#39;re doing something special.
Definition: SpillCuts.h:28
Prediction that just uses FD MC, with no extrapolation.
Take the output of an extrapolation and oscillate it as required.
TString selNames[kNumSels]
const Var kXSecCVWgt2017
Definition: XsecTunes.h:40
Extrapolate each component using a separate ModularExtrapComponent.
Definition: ModularExtrap.h:21
const HistDef defs[kNumVars]
const Var kTrueW
Definition: TruthVars.h:22
static constexpr Double_t sr
Definition: Munits.h:164
const Cut kNue2017FDAllSamples
Our FD selection including all samples, for making predictions, etc.
Definition: NueCuts2017.h:159

Variable Documentation

Definition at line 70 of file make_nueFDprediction_kinematics.C.

Referenced by ana::MultiExperiment::Add(), ana::AddErrorInQuadrature(), FDPredictionHandler::AddSystematics(), NDPredictionHandler::AddSystematics(), AnalyzeNus18Pred(), BackPredict(), Beam(), bicount_2018(), bin_composition_pie_chart(), ana::CovarianceMatrix::BuildFullCovMx(), CAF_makeCAFSensitivities_for_FNEX(), caf_numu_sensitivity(), caf_numu_sensitivity_no_tau(), CalcRWithSysts(), CalcRWithSystsNus17(), calculateComponentsNumu(), calculateWrongSignNue(), calculateWrongSignNumuQ1(), calculateWrongSignNumuQ2(), calculateWrongSignNumuQ3(), calculateWrongSignNumuQ4(), cc(), check_predinterp(), check_predinterp_numu(), compare_pid_cut_sens(), ComparisonPlots_MC(), cont(), cont23(), contours(), ana::CovMxManager::CovMxManager(), CutFlow_MC(), CutTableAna(), CVNCuts(), default_calc(), demo3(), demo4(), demo5(), demo_nueNumuSysts(), demo_numuOnly(), demoBarChart(), demoFitContours(), demoFitSlices(), demoPlotSystBands(), demoStarPlots(), ana::SolarConstraints::Derivative(), ana::T2KToyExperiment::Derivative(), osc::DowncastToNSI(), osc::DowncastToSterile(), osc::DowncastToSterileBeam(), Draw2DSurface(), draw_decomp_plots(), DrawCovMx(), drawPlot(), DrawSurface(), ana::CovMxSurface::DrawSurfacePoint(), drawSystsShiftingNDdata(), drawSystsShiftingNDdata_updatedAna(), efficiency(), efficiencySA(), extrap_syst_fa(), fa_fd_data_mc_systs(), fa_numuContours(), fake_future_data(), fd_plot(), fd_plot_bless(), FD_plots(), FDDataMC(), FDDataMCSystBandAna(), FDDataMCSystBandLoad(), fiducial_accounting(), fill_col(), ana::FrequentistSurface::FillSurfacePoint(), first_ana_proj(), FitSystEffectsLoad(), futureSig_reach_singlePOTcombo_syst(), generate_fake_data(), genie_contours(), get_sa_syst_mags(), get_sa_systs_mags_v2(), GetBestTh23vsDeltaPDG(), ana::GetBG(), GetBkgd(), getContProf(), getContProf_Sensitivity(), GetGraphs(), getHists_FNEX(), GetHistVectors(), GetMinchiFixTh23(), GetMinchiPDG(), ana::GetMinchiTh23Fixed(), ana::MinuitFitter::GetMINUITPrecision(), ana::GetNC(), test::GetNumuPrediction(), GetNumuPredictions2017(), GetNumuPredictions2018(), GetNumuPredictions2019(), getPredictions(), getPredictions_updatedAna(), GetSig(), ana::GetSpectrum(), GetSpectToHist(), goodness_of_fit(), SystEntry::hDm(), SystEntry::hDmDcp(), SystEntry::hSin(), SystEntry::hSinDcp(), joint_fit_2017_contours(), joint_fit_2017_make_fc_slice(), joint_fit_2017_make_fc_surf(), joint_fit_2017_slices(), joint_fit_2018_contours(), joint_fit_2018_slices(), joint_fit_2019_bestfit(), joint_fit_2019_contours(), joint_fit_2019_slices(), joint_fit_make_fc_slice(), joint_fit_make_fc_surf(), joint_fit_make_sa_pred_numu(), jointsensitivity(), LOverEPlot(), make_expt_profile(), make_extrap_figure(), make_extrap_figure_hists(), make_fa_pred(), make_fc_mass_and_oct_nersc_2018(), make_fc_mass_and_oct_nersc_2019(), make_fc_mh_nersc_2018(), make_fc_mh_nersc_2019(), make_fc_nus_surfs_nersc_2019(), make_fc_oct_nersc_2018(), make_fc_oct_nersc_2019(), make_fc_points(), make_fc_slice(), make_fc_slices_nersc_2018(), make_fc_slices_nersc_2018_stats(), make_fc_slices_nersc_2019(), make_fc_surf(), make_fc_surfaces_nersc_2018(), make_fc_surfaces_nersc_2018_stats(), make_fc_surfaces_nersc_2019(), make_mass_and_oct_fc_input_2019(), make_mockdata_syst_contours(), make_nom_expt(), make_nue_fd_datamc(), make_prediction(), make_prediction_extrap(), make_prediction_noextrap(), make_prediction_rhc(), make_prediction_tables(), make_qstop(), make_sa_pred(), make_starplots(), make_surfprof(), make_surfprof_sensitivity(), make_theorist_text_file(), MakeCAFSensitivities_for_FNEX(), MakeCovarSim(), MakeCovMx(), MakeExtrapSurface(), MakeFakeData(), MakeFileSystMatrix(), MakeGENIEMatrix(), MakeLegend(), MakeNus18CovarSim(), MakeNus18ExtrapPred(), MakePeriCutPlot(), makePredTables(), MakeSurface(), makeSystTable(), makeSystTable_reduced(), MakeTable(), MatrixValidation(), mec_tuning(), mec_tuning_fitter_2020(), MichelDecompTest(), modularextrap_demo_nue(), modularextrap_demo_numu(), monoprob(), monoprob_plot(), nhits(), nhits2D(), nue_ana_basic(), nue_bg_stat_err_calc(), nue_fd_mc_validation(), nue_pid_effs(), nue_pid_effs_miniprod(), nue_pid_effs_paper_numu_neweff(), numu_cut_flow(), numu_demo_split_plot(), numu_sig_nonmax(), nus17_fiducial_accounting(), osc::OscCalculatorCPT::OscCalculatorCPT(), ana::OscCovMxExperiment::OscCovMxExperiment(), ana::OscillatableSpectrum::Oscillated(), oscprob_cartoon(), osc::_OscCalculatorPMNSOpt< T >::P(), PeripheralCuts(), plot_datapredictions(), plot_extrap_syst_fa(), plot_fa_results(), plot_fd_datamc(), plot_nominal_spectra(), plot_nuCrystalBall(), plot_nue_xsec_pred(), plot_oscprob(), plot_prediction_systs(), plot_predictions(), plot_rationoosc(), plot_sa_results(), plot_sa_results_nodata(), plot_shifts(), PlotComp(), plotDataPred(), plotDataPred_SplitCanvas(), PlotNus18Sideband(), plots(), plots_interactionMode(), ana::PlotSpectra(), Plotting_DataAndPrediction(), ana::FDPredictionSterile::Predict(), ana::PredictionXSecTuning::Predict(), ana::NDPredictionSterile::Predict(), ana::PredictionNoOsc::Predict(), ana::FDPredictionSterile::PredictComponent(), ana::PredictionExtrap::PredictComponent(), ana::NDPredictionSterile::PredictComponent(), ana::PredictionInterp::PredictComponentSyst(), ana::PredictionTemplateShift::PredictionTemplateShift(), ana::PrintOscilationParameters(), prob_biprob_pedagogical(), ratio(), ratio2D(), reach_2018_dCPfractions(), ana::RefineSeeds(), rhc_sensitivity(), saTestContours(), saveContours_addExpt(), saveContours_complete(), saveContours_oscpar(), saveContours_simple(), saveContours_systs(), saveFDMCHists(), savePrediction_addExpt(), savePrediction_complete(), savePrediction_extrap(), savePrediction_simple(), savePrediction_systs(), selection_story_plots(), sensitivity(), sensitivity2018(), sensitivity_slices(), ana::Seed::Set(), ana::PredictionInterp::ShiftedComponent(), caf::CAFMaker::SimpleOscProb(), ana::SingleSampleExperiment::SingleSampleExperiment(), slice(), slices(), slices_paper(), ana::SolarConstraintsNu::SolarConstraintsNu(), ana::SolarConstraintsNubar::SolarConstraintsNubar(), starPlot(), sterile_demo(), ana::MinuitFitter::SupportsDerivatives(), syst_plot_test(), syst_table_fit(), syst_test(), systematics_table(), template_basic(), template_GENIE_systs(), template_nonGENIE_systs(), test_ana(), test_external_constraints(), test_genie_systs(), test_mockdata(), test_nue2017Prediction(), test_nue2018_fitter(), test_nue2018_surface(), test_nueextrapsyst(), test_numu_summed_genie_systs(), test_numupred2017(), test_prediction_interp(), test_saloaders(), test_stanfit_statsonly(), test_stanfit_systpulls(), test_stanfit_withsysts(), TestPred(), Toy_analyses(), jw::TrivialPrediction::TrivialPrediction(), ana::TrivialPrediction::TrivialPrediction(), ana::OscillatableSpectrum::TrueEnergy(), Tutorial2019Fit(), Tutorial2019FitContours(), Tutorial2019FitSlices(), ana::CovarianceMatrix::~CovarianceMatrix(), ana::IPrediction::~IPrediction(), osc::OscCalculatorSterileTrivial::~OscCalculatorSterileTrivial(), and SystEntry::~SystEntry().