make_nus_ana01_event_list.C
Go to the documentation of this file.
2 #include "CAFAna/Core/Loaders.h"
3 #include "CAFAna/Cuts/Cuts.h"
4 #include "NuXAna/Cuts/NusCuts.h"
5 #include "CAFAna/Core/Spectrum.h"
10 #include "CAFAna/Vars/Vars.h"
11 
13 
14 using namespace ana;
15 
16 std::vector<std::string> MakeUnblindList();
17 
18 #include "TFile.h"
19 #include "TH1D.h"
20 
22 {
23  const std::vector<std::string> fnameunblind(MakeUnblindList());
24 
25 
26  const Var kRun = SIMPLEVAR(hdr.run);
27  const Var kSubrun = SIMPLEVAR(hdr.subrun);
28  const Var kEvt = SIMPLEVAR(hdr.evt);
29  const Var kSlice = SIMPLEVAR(hdr.subevt);
30  const Var kSliceMeanTime = SIMPLEVAR(hdr.subevtmeantime);
31 
32  std::vector<const Var*> vars = {&kRun, &kSubrun, &kEvt, &kSlice,
33  &kSliceMeanTime};
34 
35  MakeEventListFile(fnameunblind,
37  {"nus_ana01_event_list.txt"},
38  true,
39  true,
40  false,
42 }
43 
44 std::vector<std::string> MakeUnblindList()
45 {
46  std::vector<std::string> fname1 = Wildcard(
47  diskdirFD + "by_period/prod_restricteddecaf_S16-05-20_fd_numi_fhc_period1_nus_contain_v1_goodruns_prod2-snapshot/"
48  + "prod_restricteddecaf_S16-05-20_fd_numi_fhc_period1_nus_contain_v1_goodruns_prod2-snapshot*.root"
49  );
50  std::vector<std::string> fname2 = Wildcard(
51  diskdirFD + "by_period/prod_restricteddecaf_S16-05-20_fd_numi_fhc_period2_nus_contain_v1_goodruns_prod2-snapshot/"
52  + "prod_restricteddecaf_S16-05-20_fd_numi_fhc_period2_nus_contain_v1_goodruns_prod2-snapshot*.root"
53  );
54  std::vector<std::string> fname3b = Wildcard(
55  diskdirFD + "by_period/prod_restricteddecaf_S16-05-20_fd_numi_fhc_epoch3*_nus_contain_v1_goodruns_prod2-snapshot.root"
56  );
57  std::vector<std::string> fname3c = Wildcard(
58  diskdirFD + "by_period/prod_restricteddecaf_S16-05-20_fd_numi_fhc_epoch3c_nus_contain_v1_goodruns_prod2-snapshot/"
59  + "prod_restricteddecaf_S16-05-20_fd_numi_fhc_epoch3c_nus_contain_v1_goodruns_prod2-snapshot*.root"
60  );
61  std::vector<std::string> fname3d = Wildcard(
62  diskdirFD + "by_period/prod_restricteddecaf_S16-05-20_fd_numi_fhc_epoch3d_nus_contain_v1_goodruns_prod2-snapshot/"
63  + "prod_restricteddecaf_S16-05-20_fd_numi_fhc_epoch3d_nus_contain_v1_goodruns_prod2-snapshot*.root"
64  );
65  std::vector<std::string> ret;
66  for(const auto& file : fname1) { ret.push_back(file); }
67  for(const auto& file : fname2) { ret.push_back(file); }
68  for(const auto& file : fname3b) { ret.push_back(file); }
69  for(const auto& file : fname3c) { ret.push_back(file); }
70  for(const auto& file : fname3d) { ret.push_back(file); }
71  return ret;
72 }
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
void make_nus_ana01_event_list()
std::vector< std::string > MakeUnblindList()
Definition: Ana01Data.h:7
const Cut kNusFD
Definition: NusCuts.h:46
void MakeEventListFile(const std::string &wildcard, const std::vector< Cut > &cuts, const std::vector< std::string > &outputs, bool includeSliceIndex, bool includeSliceTime, bool includeCycleNumber, const SpillCut *spillCut, bool includeBatchNumber)
Make a set of files listing all the events passing cuts One output file is created for each cut in th...
Definition: EventList.cxx:255
#define SIMPLEVAR(CAFNAME)
Definition: Var.h:11
const Var kSubrun
Definition: Vars.cxx:21
std::vector< std::string > Wildcard(const std::string &wildcardString)
Find files matching a UNIX glob, plus expand environment variables.
Definition: UtilsExt.cxx:268
const Var kEvt
Definition: Vars.cxx:23
const std::string diskdirFD
const std::map< std::pair< std::string, std::string >, Variable > vars
TFile * file
Definition: cellShifts.C:17
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?
Definition: TimingCuts.h:8
const Var kSlice
const SpillCut kStandardSpillCuts
Apply this unless you&#39;re doing something special.
Definition: SpillCuts.h:49
const Var kRun
Definition: Vars.cxx:20