PeriodCuts.cxx
Go to the documentation of this file.
2 
4 
6 
7 #include <iostream>
8 
9 namespace ana
10 {
12  {
13  if(hdr.det == caf::kNEARDET){
14  return PeriodFromRunND(hdr.run);
15  }
16  else if(hdr.det == caf::kFARDET){
17  return PeriodFromRunFD(hdr.run);
18  }
19  else{
20  std::cout << "PeriodFromHeader(): Unknown detector "
21  << hdr.det << ". Abort" << std::endl;
22  abort();
23  }
24  }
25 
26  const Cut kPeriod1([](const caf::SRProxy* sr) {
27  return PeriodFromHeader(sr->hdr) == 1;
28  });
29 
30  const Cut kPeriod2([](const caf::SRProxy* sr) {
31  return PeriodFromHeader(sr->hdr) == 2;
32  });
33 
34  const Cut kPeriod3([](const caf::SRProxy* sr) {
35  return PeriodFromHeader(sr->hdr) == 3;
36  });
37 
38  const Cut kPeriod4([](const caf::SRProxy* sr) {
39  return PeriodFromHeader(sr->hdr) == 4;
40  });
41 
42  const Cut kPeriod5([](const caf::SRProxy* sr) {
43  return PeriodFromHeader(sr->hdr) == 5;
44  });
45 
46  const Cut kPeriod6([](const caf::SRProxy* sr) {
47  return PeriodFromHeader(sr->hdr) == 6;
48  });
49 
50  const Cut kPeriod7([](const caf::SRProxy* sr) {
51  return PeriodFromHeader(sr->hdr) == 7;
52  });
53 
54  const Cut kPeriod8([](const caf::SRProxy* sr) {
55  return PeriodFromHeader(sr->hdr) == 8;
56  });
57 
58  const Cut kPeriod9([](const caf::SRProxy* sr) {
59  return PeriodFromHeader(sr->hdr) == 9;
60  });
61 
62 
63 
64 
66  {
67  if(truth->det == caf::kNEARDET){
68  return PeriodFromRunND(truth->run);
69  }
70  else if(truth->det == caf::kFARDET){
71  return PeriodFromRunFD(truth->run);
72  }
73  else{
74  std::cout << "PeriodFromNeutrinor(): Unknown detector "
75  << truth->det << ". Abort" << std::endl;
76  abort();
77  }
78  }
79 
80  const NuTruthCut kPeriod1_NT([](const caf::SRNeutrinoProxy* truth) {
81  return PeriodFromNeutrino(truth) == 1;
82  });
83 
84  const NuTruthCut kPeriod2_NT([](const caf::SRNeutrinoProxy* truth) {
85  return PeriodFromNeutrino(truth) == 2;
86  });
87 
88  const NuTruthCut kPeriod3_NT([](const caf::SRNeutrinoProxy* truth) {
89  return PeriodFromNeutrino(truth) == 3;
90  });
91 
92  const NuTruthCut kPeriod4_NT([](const caf::SRNeutrinoProxy* truth) {
93  return PeriodFromNeutrino(truth) == 4;
94  });
95 
96  const NuTruthCut kPeriod5_NT([](const caf::SRNeutrinoProxy* truth) {
97  return PeriodFromNeutrino(truth) == 5;
98  });
99 
100  const NuTruthCut kPeriod6_NT([](const caf::SRNeutrinoProxy* truth) {
101  return PeriodFromNeutrino(truth) == 6;
102  });
103 
104  const NuTruthCut kPeriod7_NT([](const caf::SRNeutrinoProxy* truth) {
105  return PeriodFromNeutrino(truth) == 7;
106  });
107 
108  const NuTruthCut kPeriod8_NT([](const caf::SRNeutrinoProxy* truth) {
109  return PeriodFromNeutrino(truth) == 8;
110  });
111 
112  const NuTruthCut kPeriod9_NT([](const caf::SRNeutrinoProxy* truth) {
113  return PeriodFromNeutrino(truth) == 9;
114  });
115 
116 
117 
118 
119 
120 
121 }
const Cut kPeriod2([](const caf::SRProxy *sr){return PeriodFromHeader(sr->hdr)==2;})
Definition: PeriodCuts.h:8
Near Detector underground.
Definition: SREnums.h:10
const Cut kPeriod1([](const caf::SRProxy *sr){return PeriodFromHeader(sr->hdr)==1;})
Definition: PeriodCuts.h:7
const NuTruthCut kPeriod7_NT([](const caf::SRNeutrinoProxy *truth){return PeriodFromNeutrino(truth)==7;})
Definition: PeriodCuts.h:28
const Cut kPeriod4([](const caf::SRProxy *sr){return PeriodFromHeader(sr->hdr)==4;})
Definition: PeriodCuts.h:10
const NuTruthCut kPeriod4_NT([](const caf::SRNeutrinoProxy *truth){return PeriodFromNeutrino(truth)==4;})
Definition: PeriodCuts.h:25
Far Detector at Ash River.
Definition: SREnums.h:11
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Cut kPeriod5([](const caf::SRProxy *sr){return PeriodFromHeader(sr->hdr)==5;})
Definition: PeriodCuts.h:11
const NuTruthCut kPeriod5_NT([](const caf::SRNeutrinoProxy *truth){return PeriodFromNeutrino(truth)==5;})
Definition: PeriodCuts.h:26
Proxy for caf::SRNeutrino.
Definition: SRProxy.h:510
caf::Proxy< caf::Det_t > det
Definition: SRProxy.h:525
caf::Proxy< caf::SRHeader > hdr
Definition: SRProxy.h:2137
const NuTruthCut kPeriod9_NT([](const caf::SRNeutrinoProxy *truth){return PeriodFromNeutrino(truth)==9;})
Definition: PeriodCuts.h:30
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2126
const Cut kPeriod9([](const caf::SRProxy *sr){return PeriodFromHeader(sr->hdr)==9;})
Definition: PeriodCuts.h:15
const Cut kPeriod8([](const caf::SRProxy *sr){return PeriodFromHeader(sr->hdr)==8;})
Definition: PeriodCuts.h:14
caf::Proxy< unsigned int > run
Definition: SRProxy.h:248
unsigned int PeriodFromRunFD(int run)
: Helper function to compute the period given a run number for the FD.
Definition: RunPeriods.cxx:15
const NuTruthCut kPeriod6_NT([](const caf::SRNeutrinoProxy *truth){return PeriodFromNeutrino(truth)==6;})
Definition: PeriodCuts.h:27
int PeriodFromHeader(const caf::SRHeaderProxy &hdr)
Definition: PeriodCuts.cxx:11
caf::StandardRecord * sr
const Cut kPeriod3([](const caf::SRProxy *sr){return PeriodFromHeader(sr->hdr)==3;})
Definition: PeriodCuts.h:9
OStream cout
Definition: OStream.cxx:6
const Cut kPeriod7([](const caf::SRProxy *sr){return PeriodFromHeader(sr->hdr)==7;})
Definition: PeriodCuts.h:13
const NuTruthCut kPeriod1_NT([](const caf::SRNeutrinoProxy *truth){return PeriodFromNeutrino(truth)==1;})
Definition: PeriodCuts.h:22
const NuTruthCut kPeriod8_NT([](const caf::SRNeutrinoProxy *truth){return PeriodFromNeutrino(truth)==8;})
Definition: PeriodCuts.h:29
const NuTruthCut kPeriod3_NT([](const caf::SRNeutrinoProxy *truth){return PeriodFromNeutrino(truth)==3;})
Definition: PeriodCuts.h:24
caf::Proxy< unsigned int > run
Definition: SRProxy.h:559
int PeriodFromNeutrino(const caf::SRNeutrinoProxy *truth)
Definition: PeriodCuts.cxx:65
const NuTruthCut kPeriod2_NT([](const caf::SRNeutrinoProxy *truth){return PeriodFromNeutrino(truth)==2;})
Definition: PeriodCuts.h:23
Proxy for caf::SRHeader.
Definition: SRProxy.h:218
unsigned int PeriodFromRunND(int run)
: Helper function to compute the period given a run number for the ND.
Definition: RunPeriods.cxx:34
caf::Proxy< caf::Det_t > det
Definition: SRProxy.h:232
const Cut kPeriod6([](const caf::SRProxy *sr){return PeriodFromHeader(sr->hdr)==6;})
Definition: PeriodCuts.h:12