reduce_bendecomp2017.C
Go to the documentation of this file.
3 #include "CAFAna/Cuts/Cuts.h"
7 #include "CAFAna/Cuts/NueCutsSecondAna.h"
9 
10 using namespace ana;
11 
12 Cut DetectorSwitcher(const Cut& ndCut, const Cut& fdCut)
13 {
14  return Cut([&ndCut, &fdCut](const caf::SRProxy* sr)
15  {
16  if(sr->hdr.det == caf::kFARDET)
17  return fdCut(sr);
18  else
19  return ndCut(sr);
20  });
21 }
22 
24 {
25  FileReducer reduce(fname, outname);
26  reduce.SetMetadata("nova.decaf_skim", "nue2017_numu_uncontained");
27 
29 
30  const Cut fdCut = kNueFD2017DecafCut;
31 
32  const Cut eitherCut = DetectorSwitcher(ndCut, fdCut);
33 
34  reduce.AddEventCut(eitherCut);
35 
36  reduce.AddReductionStep(BENDecomp::ReduceForBEN2017Decaf);
38 
39  reduce.Go();
40 
41 
42 }
Far Detector at Ash River.
Definition: SREnums.h:11
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
void AddSpillReductionStep(const std::function< SpillReductionFunc > &f)
Run the specified reduction function over each spill.
Definition: FileReducer.h:90
caf::Proxy< caf::SRHeader > hdr
Definition: SRProxy.h:2137
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2126
void SetMetadata(const std::string &key, const std::string &val)
Cause the output file to be systematically shifted.
Definition: FileReducer.h:102
void reduce_bendecomp2017(std::string fname, std::string outname)
void AddReductionStep(const std::function< ReductionFunc > &f)
Run the specified reduction function over each event.
Definition: FileReducer.h:85
Cut DetectorSwitcher(const Cut &ndCut, const Cut &fdCut)
void AddEventCut(const Cut &cut)
Only copy records to the output file if they pass this cut.
_Cut< caf::SRProxy > Cut
Representation of a cut (selection) to be applied to a caf::StandardRecord object.
Definition: Cut.h:96
caf::StandardRecord * sr
virtual void Go() override
Load all the registered spectra.
Create smaller CAFs.
Definition: FileReducer.h:56
const Cut kNumuUncontainNDDecafCut
Definition: BeamNueCuts.h:23
void CleanSpillQualityInfo(caf::SRSpill *spill, const caf::SRSpillProxy *spillProxy)
const Cut kNueFD2017DecafCut
Definition: NueCuts2017.h:157
const Cut kNueND2017DecafCut
Definition: NueCuts2017.h:280
const Cut kNumuContainNDDecafCut
Definition: BeamNueCuts.h:22
caf::Proxy< caf::Det_t > det
Definition: SRProxy.h:232
enum BeamMode string