27 const Var kSliceMeanTime =
SIMPLEVAR(hdr.subevtmeantime);
31 const HistAxis kNue2017EnergyAxis(
"Nue Energy Estimator (GeV)",
36 "prod_sumrestricteddecaf_R17-03-01-prod3reco.k_fd_numi_fhc_full_v1_goodruns_nue2017";
47 Spectrum spec_cvn_nueE_core_outtime(loadercos, kNue2017EnergyAxis,
51 Spectrum spec_cvn_nueE_peripheral_outtime(loadercos, kNue2017EnergyAxis,
55 Spectrum spec_cvn_time_outtime(loadercos, kTimeAxis,
59 Spectrum spec_cvn_slctime_outtime(loadercos, kSliceTimeAxis,
68 Spectrum spec_cvn_nueE_core_intime(loadercos, kNue2017EnergyAxis,
72 Spectrum spec_cvn_nueE_peripheral_intime(loadercos, kNue2017EnergyAxis,
76 Spectrum spec_cvn_time_intime(loadercos, kTimeAxis,
80 Spectrum spec_cvn_slctime_intime(loadercos, kSliceTimeAxis,
88 TFile
fout(
"Ana2017_numi_data.root",
"RECREATE");
91 spec_cvn_intime.
SaveTo(&fout,
"spec_cvn_cvn2d_numi");
92 spec_cvn_outtime.
SaveTo(&fout,
"spec_cvn_cvn2d_cosmic");
94 spec_cvn_nueE_core_intime.
SaveTo(&fout,
"spec_cvn_nueE_core_numi");
95 spec_cvn_nueE_core_outtime.
SaveTo(&fout,
"spec_cvn_nueE_core_cosmic");
97 spec_cvn_nueE_peripheral_intime.
SaveTo(&fout,
"spec_cvn_nueE_peripheral_numi");
98 spec_cvn_nueE_peripheral_outtime.
SaveTo(&fout,
"spec_cvn_nueE_peripheral_cosmic");
100 spec_cvn_time_intime.
SaveTo(&fout,
"spec_cvn_time_numi");
101 spec_cvn_time_outtime.
SaveTo(&fout,
"spec_cvn_time_cosmic");
103 spec_cvn_slctime_intime.
SaveTo(&fout,
"spec_cvn_slctime_numi");
104 spec_cvn_slctime_outtime.
SaveTo(&fout,
"spec_cvn_slctime_cosmic");
121 {
"nue2017_selected_numi.txt",
122 "nue2017_selected_cosmic.txt"},
Cuts and Vars for the 2020 FD DiF Study.
const Var kSliceTime([](const caf::SRProxy *sr){return sr->slc.meantime/1000;})
void SetSpillCut(const SpillCut &cut)
const Cut kNue2017FD
Full FD nue selection for 2017 analysis.
#define SIMPLEVAR(CAFNAME)
For Vars where literally all you need is a single CAF variable.
Representation of a spectrum in any variable, with associated POT.
const Cut kInTimingSideband([](const caf::SRProxy *sr){if(sr->spill.run > util::kLastBadTimingRun) return(kInTimingSideband_before(sr)|| kInTimingSideband_after(sr));else return(kInTimingSideband_before(sr)|| kInTimingSideband_afterA(sr)|| kInTimingSideband_afterB(sr));}, [](const caf::SRSpillProxy *spill){if(spill->run > util::kLastBadTimingRun) return(kInTimingSideband_before.Livetime(spill)+ kInTimingSideband_after.Livetime(spill));else return(kInTimingSideband_before.Livetime(spill)+ kInTimingSideband_afterA.Livetime(spill)+ kInTimingSideband_afterB.Livetime(spill));}, [](const caf::SRSpillProxy *spill){return 0;})
void MakeTextListFile(const std::string &wildcard, const std::vector< Cut > &cut, const std::vector< std::string > &output, const std::vector< const Var * > &floatVars, const std::vector< const Var * > &intVars, const SpillCut *spillCut)
Make a file listing all the events passing the specified cut.
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));})
const Cut kNue2017FDPeripheral
Definition of the FD peripheral sample around our core selected events.
virtual void Go() override
Load all the registered spectra.
void SaveTo(TDirectory *dir, const std::string &name) const
const HistAxis kNue2017Axis("NuE Energy / Analysis Bin", kNue2017Binning, kNue2017AnaBin)
const SystShifts kNoShift
const Var kNue2017AnaBin([](const caf::SRProxy *sr){int selBin=kNue2017SelectionBin(sr);float nuE=kNueEnergy2017(sr);int nuEBin=nuE/0.5;assert(nuEBin<=8 &&"An event with nuE > 4.5 should never happen");int anaBin=9 *selBin+nuEBin;return anaBin;})
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
const Cut kInBeamSpill([](const caf::SRProxy *sr){if(sr->spill.run > util::kLastBadTimingRun) return kInBeamSpill_main(sr);else return kInBeamSpill_main(sr)||kInBeamSpill_shifted(sr);}, [](const caf::SRSpillProxy *spill){if(spill->run > util::kLastBadTimingRun) return kInBeamSpill_main.Livetime(spill);else return kInBeamSpill_main.Livetime(spill)+kInBeamSpill_shifted.Livetime(spill);}, [](const caf::SRSpillProxy *spill) -> double{return spill->spillpot;})
Does the event fall inside the window we call the beam spill?
const SpillCut kStandardSpillCuts
Apply this unless you're doing something special.
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})
void Ana2017_box_opening_macro()
const Cut kNue2017FDAllSamples
Our FD selection including all samples, for making predictions, etc.