Functions
savePrediction_addExpt.C File Reference
#include "../WorkshopIncludes.h"

Go to the source code of this file.

Functions

void savePrediction_addExpt ()
 

Function Documentation

void savePrediction_addExpt ( )

Definition at line 9 of file savePrediction_addExpt.C.

References allInOneTrainingPlots::axis, calc, om::cout, e, allTimeWatchdog::endl, MakeMiniprodValidationCuts::f, ana::Loaders::Go(), ana::kBeam, ana::kCCE, cmf::kData, caf::kFARDET, kMC, caf::kNEARDET, ana::kNoShift, ana::kNumuContainFD, ana::kNumuCosmicRej, ana::kNumuEnergyBinning, ana::kNumuQuality, ana::kStandardSpillCuts, cmf::kTauSwap, ana::kTuftsWeightCC, loaders, caf::SRRemid::pid, caf::SRIDBranch::remid, ana::ResetOscCalcToDefault(), ana::PredictionNoExtrap::SaveTo(), caf::StandardRecord::sel, ana::Loaders::SetLoaderPath(), ana::Loaders::SetSpillCut(), std::sqrt(), sr, and string.

10 {
11  std::cout << "Drawing plots..." << std::endl;
12 
13  // Production Concats
14  std::string directoryD = "/pnfs/nova/persistent/production/concat/R16-03-03-prod2reco.d/";
15  std::string directoryF = "/pnfs/nova/persistent/production/concat/R16-03-03-prod2reco.f/";
16  // Data
17  std::string nd_data = directoryD+"prod_decaf_R16-03-03-prod2reco.d_nd_numi_fhc_full_numu_contain_v1_goodruns_prod2-snapshot.root";
18 
19  // Baseline MC
20  // Only one of the files. In true life, use all MC!
21  std::string nd_nonswap_few = directoryD+"prod_decaf_R16-03-03-prod2reco.d_nd_genie_nonswap_genierw_fhc_nova_v08_epoch1-3c_numu_contain_v1_prod2-snapshot/*_1_of_16.root";
22  // Epoch 3b only for FD to run quickly. In practice, use a PredictionCombinePeriods
23  std::string fd_nonswap_3b = directoryF+"/epoch3b/prod_decaf_R16-03-03-prod2reco.f_fd_genie_nonswap_fhc_nova_v08_epoch3b_numu_contain_v1_prod2-snapshot.root";
24  std::string fd_fluxswap_3b = directoryF+"/epoch3b/prod_decaf_R16-03-03-prod2reco.f_fd_genie_fluxswap_fhc_nova_v08_epoch3b_numu_contain_v1_prod2-snapshot.root";
25  std::string fd_tau_3b = directoryF+"/epoch3b/prod_decaf_R16-03-03-prod2reco.f_fd_genie_tau_fhc_nova_v08_epoch3b_numu_contain_v1_prod2-snapshot.root";
26 
28  loaders.SetLoaderPath( nd_data, caf::kNEARDET, Loaders::kData, ana::kBeam, Loaders::kNonSwap );
29  loaders.SetLoaderPath( nd_nonswap_few, caf::kNEARDET, Loaders::kMC, ana::kBeam, Loaders::kNonSwap );
30  loaders.SetLoaderPath( fd_nonswap_3b, caf::kFARDET, Loaders::kMC, ana::kBeam, Loaders::kNonSwap );
31  loaders.SetLoaderPath( fd_fluxswap_3b, caf::kFARDET, Loaders::kMC, ana::kBeam, Loaders::kFluxSwap);
33 
35 
36  osc::OscCalculatorPMNSOpt calc;
37  ana::ResetOscCalcToDefault(&calc); // This seeds to default (in particular max-mixing)
38 
39  calc.SetTh23(TMath::ASin(sqrt(0.403))); // Second analysis best fit
40  calc.SetDmsq32(2.67e-3); // Same
41 
42  TFile* f = new TFile("../Predictions/Prediction_epoch3b_addExpt_kCCE.root","RECREATE"); // different name
43 
44  const Cut kUglyRemID(
45  {"sel.remid.pid"},
46  [](const caf::StandardRecord* sr)
47  { return (sr->sel.remid.pid > 0.25 && sr->sel.remid.pid < 0.75 );
48  }
49  );
50 
51  const Cut kBadRemID(
52  {"sel.remid.pid"},
53  [](const caf::StandardRecord* sr)
54  { return (sr->sel.remid.pid >= 0.75 && sr->sel.remid.pid < 1.0 );
55  }
56  );
57 
58  const Cut kGoodRemID(
59  {"sel.remid.pid"},
60  [](const caf::StandardRecord* sr)
61  { return (sr->sel.remid.pid == 1.0 );
62  }
63  );
64 
65  const Cut kUglyFD = kNumuQuality && kNumuContainFD && kUglyRemID && kNumuCosmicRej;
66  const Cut kBadFD = kNumuQuality && kNumuContainFD && kBadRemID && kNumuCosmicRej;
67  const Cut kGoodFD = kNumuQuality && kNumuContainFD && kGoodRemID && kNumuCosmicRej;
68 
69  HistAxis axis( ";Reconstructed neutrino energy (GeV);Events / (0.25 GeV)", kNumuEnergyBinning, kCCE );
70 
71  PredictionNoExtrap* prediction_ugly = new PredictionNoExtrap(loaders, axis, kUglyFD, kNoShift, kTuftsWeightCC);
72  PredictionNoExtrap* prediction_bad = new PredictionNoExtrap(loaders, axis, kBadFD, kNoShift, kTuftsWeightCC);
73  PredictionNoExtrap* prediction_good = new PredictionNoExtrap(loaders, axis, kGoodFD, kNoShift, kTuftsWeightCC);
74 
75  // GO!
76  loaders.Go();
77 
78  prediction_ugly->SaveTo(f->mkdir( "pred_ugly" ));
79  prediction_bad->SaveTo(f->mkdir( "pred_bad" ));
80  prediction_good->SaveTo(f->mkdir( "pred_good" ));
81 
82  f->Close();
83 
84  std::cout << "Predictions saved!" << std::endl;
85 
86 } // End of function
Near Detector underground.
Definition: SREnums.h:10
Far Detector at Ash River.
Definition: SREnums.h:11
void ResetOscCalcToDefault(osc::IOscCalcAdjustable *calc)
Reset calculator to default assumptions for all parameters.
Definition: Calcs.cxx:23
Collection of SpectrumLoaders for many configurations.
Definition: Loaders.h:23
T sqrt(T number)
Definition: d0nt_math.hpp:156
const Color_t kMC
const Cut kNumuCosmicRej([](const caf::SRProxy *sr){return(sr->sel.cosrej.anglekal > 0.5 && sr->sel.cosrej.numucontpid2019 > 0.535 && sr->slc.nhit< 400);})
Definition: NumuCuts.h:32
const Cut kNumuContainFD([](const caf::SRProxy *sr){ std::pair< int, int > planes=calcFirstLastLivePlane(sr->slc.firstplane, std::bitset< 14 >(sr->hdr.dibmask));int planestofront=sr->slc.firstplane-planes.first;int planestoback=planes.second-sr->slc.lastplane;return( sr->slc.ncellsfromedge > 1 &&planestofront > 1 &&planestoback > 1 &&sr->sel.contain.kalfwdcell > 10 &&sr->sel.contain.kalbakcell > 10 &&sr->sel.contain.cosfwdcell > 0 &&sr->sel.contain.cosbakcell > 0);})
Definition: NumuCuts.h:20
osc::OscCalcDumb calc
void Go()
Call Go() on all the loaders.
Definition: Loaders.cxx:162
void SetSpillCut(const SpillCut &cut)
Definition: Loaders.cxx:121
float pid
PID value output by kNN.
Definition: SRRemid.h:25
const Binning kNumuEnergyBinning
Definition: Binnings.cxx:13
SRRemid remid
Output from RecoMuonID (ReMId) package.
Definition: SRIDBranch.h:39
const Var kCCE
Definition: NumuVars.h:21
caf::StandardRecord * sr
virtual void SaveTo(TDirectory *dir, const std::string &name) const override
const SystShifts kNoShift
Definition: SystShifts.cxx:22
OStream cout
Definition: OStream.cxx:6
The StandardRecord is the primary top-level object in the Common Analysis File trees.
const Var kTuftsWeightCC
Definition: XsecTunes.h:30
std::vector< Loaders * > loaders
Definition: syst_header.h:386
SRIDBranch sel
Selector (PID) branch.
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 Cut kNumuQuality
Definition: NumuCuts.h:18
Float_t e
Definition: plot.C:35
void SetLoaderPath(const std::string &path, caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap)
Configure loader via wildcard path.
Definition: Loaders.cxx:25
enum BeamMode string