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 "3FlavorAna/Cuts/NumuCuts.h"
#include "CAFAna/Cuts/NueCutsSecondAna.h"
#include "CAFAna/Cuts/SpillCuts.h"
#include "3FlavorAna/Cuts/NueCuts2017.h"
#include "CAFAna/Decomp/ProportionalDecomp.h"
#include "3FlavorAna/Decomp/BENDecomp.h"
#include "3FlavorAna/Decomp/MichelDecomp.h"
#include "3FlavorAna/Decomp/NumuDecomp.h"
#include "3FlavorAna/Extrap/NueExtrap.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 "3FlavorAna/Vars/NueVars.h"
#include "CAFAna/Vars/Vars.h"
#include "3FlavorAna/Vars/NueVarsExtra.h"
#include "CAFAna/Vars/PPFXWeights.h"
#include "OscLib/OscCalcDumb.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::OscCalcDumb 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, cmf::kData, caf::kFARDET, kMC, caf::kNEARDET, ana::kNoShift, ana::kNue2017FDAllSamples, ana::kNue2017NDPresel, ana::kNueEnergy2017, ana::kNumSels, ana::kNumuNDCvn, ana::kNumVars, ana::kPPFXFluxCVWgt, ana::kPtP, ana::kStandardSpillCuts, cmf::kTauSwap, ana::kTrueQ2, ana::kTrueW, ana::kWOscDumb, ana::kXSecCVWgt2017, loaders, caf::Proxy< caf::StandardRecord >::mc, ana::HistDef::name, caf::Proxy< caf::SRTruthBranch >::nu, NueExtrap(), make_template_knob_config::outfilename, ana::PredictionExtrap::SaveTo(), ana::PredictionNoExtrap::SaveTo(), ana::selNames, ana::Binning::Simple(), and 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!
88  const HistAxis axisNumu = kNumuNonQEAxisFirstAna;
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] = {
107  kNue2017NDPresel && kNueSecondAnaCVNeSsb
108  };
109  const std::string selNames[kNumSels] = {
110  "AllSamples"
111  };
112  const Cut cutNDNumu = {
113  kNumuNDCvn
114  };
115 
117 
118  //********** 2. Set up loaders *********************
119  SANueExtrapLoaders 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] = new NueExtrap (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, "nue_pred_"+selNames[selIdx]+"_"+varName) ;
176  predicNoXP[selIdx][varIdx]->SaveTo(dFDshi, "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
Simple record of shifts applied to systematic parameters.
Definition: SystShifts.h:20
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2108
caf::Proxy< std::vector< caf::SRNeutrino > > nu
Definition: SRProxy.h:597
const Color_t kMC
std::string name
Definition: NuePlotLists.h:12
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 kNumuNDCvn
Definition: NumuCuts.h:62
const Var kCosTheta
void CheckFileOverwrite(TString)
caf::StandardRecord * sr
const HistDef defs[kNumVars]
Definition: vars.h:15
const int kNumSels
Definition: vars.h:43
virtual void SaveTo(TDirectory *dir, const std::string &name) const override
HistAxis axis
Definition: NuePlotLists.h:13
const SystShifts kNoShift
Definition: SystShifts.cxx:21
const HistAxis axisNue
Definition: syst_header.h:378
const Cut kNue2017NDPresel
Definition: NueCuts2017.h:285
caf::Proxy< caf::SRTruthBranch > mc
Definition: SRProxy.h:2120
const Var kWOscDumb([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return 0.f;return float(sr->mc.nu[0].woscdumb);})
Definition: TruthVars.h:10
void NueExtrap(string beam="fhc", string cvntype="oldpresel")
Definition: NueExtrap.C:28
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
virtual void SaveTo(TDirectory *dir, const std::string &name) const override
Splits Data proportionally according to MC.
std::vector< Loaders * > loaders
Definition: syst_header.h:386
TFile * file
Definition: cellShifts.C:17
const SpillCut kStandardSpillCuts
Apply this unless you&#39;re doing something special.
Definition: SpillCuts.h:49
Prediction that just uses FD MC, with no extrapolation.
const HistAxis axisNumu
Take the output of an extrapolation and oscillate it as required.
const std::string selNames[kNumSels]
Definition: vars.h:46
const Var kXSecCVWgt2017
Definition: XsecTunes.h:37
Extrapolate each component using a separate ModularExtrapComponent.
Definition: ModularExtrap.h:23
const Var kTrueW
Definition: TruthVars.h:22
const Cut kNue2017FDAllSamples
Our FD selection including all samples, for making predictions, etc.
Definition: NueCuts2017.h:155

Variable Documentation

Definition at line 70 of file make_nueFDprediction_kinematics.C.

Referenced by ana::PredictionExtrapSum::_PredictComponent(), ana::PredictionExtendToPeripheral::_PredictComponent(), ana::PredictionAddRock::_PredictComponentSyst(), ana::AddErrorInQuadrature(), ana::MCMCSamples::AddSample(), ana::CovMxManager::AddSystematic(), FDPredictionHandler::AddSystematics(), PredictionHandler::AddSystematics(), NDPredictionHandler::AddSystematics(), AnalyzeNus18Pred(), BackPredict(), Beam(), BestFit(), bicount(), bicount_2018(), bin_composition_pie_chart(), ana::covmx::CovarianceMatrix::BuildFullCovMx(), CAF_makeCAFSensitivities_for_FNEX(), caf_numu_sensitivity(), caf_numu_sensitivity_no_tau(), cafe_FD_predictions(), CalcRWithSysts(), CalcRWithSystsNus17(), calculateComponentsNumu(), calculateWrongSignNue(), calculateWrongSignNumuQ1(), calculateWrongSignNumuQ2(), calculateWrongSignNumuQ3(), calculateWrongSignNumuQ4(), cc(), check_predinterp(), check_predinterp_numu(), CompareBinningSchemes(), CompareMissingLeptons(), ana::CompareNDDataMCFromVector(), ana::CompareOneShiftPred(), ana::CompareTwoShiftPred(), ComparisonPlots_MC(), ana::ComparisonTableNbins(), CutFlow_MC(), CutTableAna(), CVNCuts(), DecorrelateFD(), default_calc(), demo3(), demo4(), demo5(), demo_nueNumuSysts(), demo_numuOnly(), demoBarChart(), demoFitContours(), demoFitSlices(), demoPlotSystBands(), demoStarPlots(), osc::DowncastToNSI(), osc::DowncastToSterile(), osc::DowncastToSterileBeam(), Draw2DSurface(), draw_decomp_plots(), DrawBackgrounds(), DrawBins(), DrawCCOscillations(), DrawCovMx(), drawPlot(), DrawPulls(), DrawSensitivityDip(), DrawSurface(), ana::CovMxSurface::DrawSurfacePoint(), DrawSystShifts(), drawSystsShiftingNDdata(), drawSystsShiftingNDdata_updatedAna(), efficiency(), efficiencySA(), mcmc::ExptPtrs(), fake_future_data(), FCTutorial2020(), FD_Data_PosComp(), fd_plot(), FD_plots(), FDDataMC(), FDDataMCSystBandAna(), FDDataMCSystBandLoad(), fiducial_accounting(), fill_col(), ana::FrequentistSurface::FillSurfacePoint(), fit_3flavor_withsysts(), ana::StanFitter::FitHelperSeeded(), FitSystEffectsLoad(), futureSig_reach_singlePOTcombo_syst(), generate_fake_data(), genie_contours(), genie_preds_make(), ana::GetBG(), GetBkgd(), GetCalculator(), getContProf(), getContProf_Sensitivity(), ana::GetFDMCComponents(), GetHist(), getHists_FNEX(), GetHistVectors(), ana::MinuitFitter::GetMINUITPrecision(), ana::GetNC(), ana::GetNDComponents(), ana::GetNDCompsFromDecomp(), ana::GetNDDecompsFromDecomp(), test::GetNumuPrediction(), GetNumuPredictions2017(), GetNumuPredictions2018(), GetNumuPredictions2019(), ana::GetNumuPredictions2020(), GetNumuPredictionsFuture(), getPredictions(), getPredictions_updatedAna(), GetSig(), 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_future_bestfit_univ(), joint_fit_future_contour_univ(), jointsensitivity(), LoadFakeDataFromPred(), LOverEPlot(), make_expt_profile(), make_extrap_figure(), make_extrap_figure_hists(), 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_slices_nersc_2018(), make_fc_slices_nersc_2018_stats(), make_fc_slices_nersc_2019(), make_fc_surfaces_2020(), make_fc_surfaces_2020_validation(), 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_prediction(), make_prediction_extrap(), make_prediction_noextrap(), make_prediction_rhc(), make_prediction_tables(), make_qstop(), make_starplots(), make_surfprof(), make_surfprof_sensitivity(), MakeCAFSensitivities_for_FNEX(), MakeCovarSim(), MakeCovMx(), MakeExtrapSurface(), MakeFakeData(), MakeFileSystMatrix(), MakeGENIEMatrix(), MakeISysts(), MakeLegend(), MakeNumuCovMx(), MakeNus18CovarSim(), MakeNus18ExtrapPred(), MakePeriCutPlot(), MakePlots(), MakePrediction(), MakePredictionNoOsc_FHC_FD(), MakePredictionNoOsc_FHC_ND(), MakePredictionNoOsc_RHC_FD(), MakePredictionNoOsc_RHC_ND(), makePredTables(), MakeSurface(), MakeSurfaceBinningStudy(), MakeSurfaceJoint(), MakeSurfaceLLTest(), MakeSurfaceNoNDOsc(), MakeSystsPDF(), makeSystTable(), makeSystTable_reduced(), MakeTable(), MatrixDeterminant(), MatrixValidation(), mec_tuning(), mec_tuning_fitter_2020(), MichelDecompTest(), modularextrap_demo_nue(), modularextrap_demo_numu(), monoprob(), nue_fd_mc_validation(), nue_pid_effs(), nue_pid_effs_miniprod(), nue_pid_effs_paper_numu_neweff(), NuMu2020_TrimCAFs(), numu_cut_flow(), numu_sig_nonmax(), nus17_fiducial_accounting(), osc::OscCalcCPT::OscCalcCPT(), ana::OscCovMxExperiment::OscCovMxExperiment(), osc::_OscCalcPMNSOpt< T >::P(), PeripheralCuts(), plot_3flavor_withsysts(), plot_DataMCComp_numu(), plot_datapredictions(), plot_joint_fit_2020_contours(), plot_nominal_spectra(), plot_nuCrystalBall(), plot_nue_xsec_pred(), plot_oscprob(), plot_prediction_systs(), plot_predictions(), plot_rationoosc(), plot_recoE_numu(), plot_shifts(), plot_spectra_2dplots(), PlotComp(), plotDataPred(), plotDataPred_SplitCanvas(), PlotInfo::PlotInfo(), PlotNus18Sideband(), plots(), ana::PlotSpectra(), Plotting_DataAndPrediction(), ana::SingleSampleExperiment::PredHistIncCosmics(), ana::FDPredictionSterile::Predict(), ana::PredictionXSecTuning::Predict(), ana::NDPredictionSterile::Predict(), ana::PredictionNoOsc::Predict(), ana::FDPredictionSterile::PredictComponent(), ana::NDPredictionSterile::PredictComponent(), ana::PrintOscilationParameters(), prob_biprob_pedagogical(), reach_2018_dCPfractions(), ana::RefineSeeds(), run_joint_fit_2020_bestfit(), run_joint_fit_2020_contours(), run_joint_fit_2020_slices(), saveContours_addExpt(), saveContours_complete(), saveContours_oscpar(), saveContours_simple(), saveContours_systs(), saveFDMCHists(), savePrediction_addExpt(), savePrediction_complete(), savePrediction_extrap(), savePrediction_simple(), savePrediction_systs(), ScaleCovarianceMatrix(), selection_story_plots(), sensitivity2018(), sensitivity2020(), ana::Seed::Set(), ana::T2KToyExperiment::SetPOTAnti(), ana::PredictionInterp::ShiftedComponent(), caf::CAFMaker::SimpleOscProb(), ana::SingleSampleExperiment::SingleSampleExperiment(), starPlot(), sterile_demo(), SterileOscillator(), syst_plot_test(), syst_table_fit(), syst_table_fit_new(), syst_test(), template_basic(), template_GENIE_systs(), template_nonGENIE_systs(), test_ana(), test_genie_systs(), 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(), TestCovMxNew(), TestPred(), ThrowFakeData(), Toy_analyses(), jw::TrivialPrediction::TrivialPrediction(), ana::TrivialPrediction::TrivialPrediction(), ana::OscillatableSpectrum::TrueEnergy(), Tutorial2019Fit(), Tutorial2019FitContours(), Tutorial2019FitSlices(), ana::NDOscillatableSpectrum::Uninitialized(), ValidatePredictions(), ana::covmx::CovarianceMatrix::~CovarianceMatrix(), ana::IPrediction::~IPrediction(), osc::OscCalcSterileTrivial::~OscCalcSterileTrivial(), and SystEntry::~SystEntry().