EventList.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Rtypes.h"
4 #include "TAttMarker.h"
5 
6 #include "CAFAna/Core/Cut.h"
7 #include "CAFAna/Core/Var.h"
8 #include "CAFAna/Core/MultiVar.h"
9 
10 #include <string>
11 
12 namespace ana
13 {
14  /// \brief Make a file listing all the events passing the specified cut
15  ///
16  /// \param wildcard Filename or wildcard to use for input
17  /// \param cut The cut events must pass
18  /// \param output The filename for the output.
19  /// \param floatVars Vector with the vars to be included in
20  /// the output
21  /// \param intVars Vars whose output should be formatted with as integers
22  /// \param spillCut Optional requirement on SRSpill
24  const std::vector<Cut>& cut,
25  const std::vector<std::string>& output,
26  const std::vector<const Var*>& floatVars,
27  const std::vector<const Var*>& intVars,
28  const SpillCut* spillCut = 0);
29 
31  const std::vector<Cut>& cut,
32  const std::vector<std::string>& output,
33  const std::vector<const Var*>& floatVars,
34  const SpillCut* spillCut = 0)
35  {
36  MakeTextListFile(wildcard, cut, output, floatVars, {}, spillCut);
37  }
38 
39  /// \brief Make a file listing all the events passing the specified cut
40  ///
41  /// \param fnames Vector of filenames to use for input
42  /// \param cut The cut events must pass
43  /// \param output The filename for the output.
44  /// \param floatVars Vector with the vars to be included in
45  /// the output
46  /// \param intVars Vars whose output should be formatted as integers
47  /// \param spillCut Optional requirement on SRSpill
48  void MakeTextListFile(const std::vector<std::string>& fnames,
49  const std::vector<Cut>& cut,
50  const std::vector<std::string>& output,
51  const std::vector<const Var*>& floatVars,
52  const std::vector<const Var*>& intVars,
53  const SpillCut* spillCut = 0);
54 
55  void MakeTextListFile(const std::vector<std::string>& fnames,
56  const std::vector<Cut>& cut,
57  const std::vector<std::string>& output,
58  const std::vector<const Var*>& floatVars,
59  const SpillCut* spillCut = 0)
60  {
61  MakeTextListFile(fnames, cut, output, floatVars, {}, spillCut);
62  }
63 
64  /// \brief Make a file listing multi-var values
66  const std::vector<Cut>& cut,
67  const std::vector<std::string>& output,
68  const std::vector<const MultiVar*>& multivars = {},
69  const SpillCut* spillCut = 0);
70 
71  /// \brief Make a file listing all the events passing the specified cut
72  ///
73  /// \param wildcard Filename or wildcard to use for input
74  /// \param cut The cut events must pass
75  /// \param output The filename for the output.
76  /// Format is space-seperated run, subrun, event.
77  /// \param includeSliceIndex Add a column for the slice index
78  /// \param includeSliceTime Add a column for the slice mean time (ns)
79  /// \param includeCycleNumber Add a column for the cycle number.
80  /// Cycle number differentiates multiple
81  /// instances of a given run/subrun combination
82  /// during file production.
83  /// \param spillCut Optional requirement on SRSpil
84  /// \param includeBatchNumber Add a column for the batch number.
85  /// Differentiates different batches that end
86  /// up with the same run/subrun/cycle combo.
87  void MakeEventListFile(const std::string& wildcard,
88  const Cut& cut,
89  const std::string& output,
90  bool includeSliceIndex = false,
91  bool includeSliceTime = false,
92  bool includeCycleNumber = false,
93  const SpillCut* spillCut = 0,
94  bool includeBatchNumber = false);
95 
96  /// \brief Make a set of files listing all the events passing cuts
97  /// One output file is created for each cut in the cuts vector
98  /// \param wildcard Filename or wildcard to use for input
99  /// \param cuts A vector of cuts events must pass
100  /// \param outputs The filenames for the output.
101  /// Format is space-seperated run, subrun, event.
102  /// \param includeSliceIndex Add a column for the slice index
103  /// \param includeSliceTime Add a column for the slice mean time (ns)
104  /// \param includeCycleNumber Add a column for the cycle number.
105  /// Cycle number differentiates multiple
106  /// instances of a given run/subrun combination
107  /// during file production.
108  /// \param spillCut Optional requirement on SRSpill
109  /// \param includeBatchNumber Add a column for the batch number.
110  /// Differentiates different batches that end
111  /// up with the same run/subrun/cycle combo.
112  void MakeEventListFile(const std::string& wildcard,
113  const std::vector<Cut>& cuts,
114  const std::vector<std::string>& outputs,
115  bool includeSliceIndex = false,
116  bool includeSliceTime = false,
117  bool includeCycleNumber = false,
118  const SpillCut* spillCut = 0,
119  bool includeBatchNumber = false);
120 
121  /// \brief Make a set of files listing all the events passing cuts
122  /// One output file is created for each cut in the cuts vector
123  /// \param wildcard Vector of filenames or wildcards to use for input
124  /// \param cuts The cut events must pass
125  /// \param outputs The filename for the output.
126  /// Format is space-seperated run, subrun, event.
127  /// \param includeSliceIndex Add a column for the slice index
128  /// \param includeSliceTime Add a column for the slice mean time (ns)
129  /// \param includeCycleNumber Add a column for the cycle number.
130  /// Cycle number differentiates multiple
131  /// instances of a given run/subrun combination
132  /// during file production.
133  /// \param spillCut Optional requirement on SRSpill
134  /// \param includeBatchNumber Add a column for the batch number.
135  /// Differentiates different batches that end
136  /// up with the same run/subrun/cycle combo.
137  void MakeEventListFile(const std::vector<std::string>& fnames,
138  const Cut& cut,
139  const std::string& output,
140  bool includeSliceIndex = false,
141  bool includeSliceTime = false,
142  bool includeCycleNumber = false,
143  const SpillCut* spillCut = 0,
144  bool includeBatchNumber = false);
145 
146  /// \brief Make a set of files listing all the events passing cuts
147  /// One output file is created for each cut in the cuts vector
148  /// \param fnames Vector of filenames or wildcards to use for input
149  /// \param cuts A vector of cuts events must pass
150  /// \param outputs The filenames for the output.
151  /// Format is space-seperated run, subrun, event.
152  /// \param includeSliceIndex Add a column for the slice index
153  /// \param includeSliceTime Add a column for the slice mean time (ns)
154  /// \param includeCycleNumber Add a column for the cycle number.
155  /// Cycle number differentiates multiple
156  /// instances of a given run/subrun combination
157  /// during file production.
158  /// \param spillCut Optional requirement on SRSpill
159  /// \param includeBatchNumber Add a column for the batch number.
160  /// Differentiates different batches that end
161  /// up with the same run/subrun/cycle combo.
162  void MakeEventListFile(const std::vector<std::string>& fnames,
163  const std::vector<Cut>& cuts,
164  const std::vector<std::string>& outputs,
165  bool includeSliceIndex = false,
166  bool includeSliceTime = false,
167  bool includeCycleNumber = false,
168  const SpillCut* spillCut = 0,
169  bool includeBatchNumber = false);
170 
171  /// \brief Make a ROOT file listing all the events passing the specified cut
172  ///
173  /// \param wildcard Filename or wildcard to use for input
174  /// \param cuts Cuts events must pass, with tree name
175  /// \param vars Vector with the vars to be included in
176  /// the output, with branch name
177  /// \param output The filename for the output.
178  /// \param spillCut Optional requirement on SRSpill
179  void MakeEventTTreeFile(const std::string& wildcard,
180  const std::string& output,
181  const std::vector<std::pair<std::string, Cut>>& cuts,
182  const std::vector<std::pair<std::string, Var>>& floatVars,
183  const std::vector<std::pair<std::string, Var>>& intVars = {},
184  const SpillCut* spillCut = 0);
185 }
ofstream output
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
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
_Cut< caf::SRSpillProxy > SpillCut
Definition: Cut.h:10
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.
Definition: EventList.cxx:193
std::vector< std::string > wildcard(const std::string &wildcardString)
Definition: convert.C:9
const Cut cut
Definition: exporter_fd.C:30
void MakeEventTTreeFile(const std::string &wildcard, const std::string &output, const std::vector< std::pair< std::string, Cut >> &cuts, const std::vector< std::pair< std::string, Var >> &floatVars, const std::vector< std::pair< std::string, Var >> &intVars, const SpillCut *spillCut)
Make a ROOT file listing all the events passing the specified cut.
Definition: EventList.cxx:324
Template for Cuts applied to any type of object.
Definition: Cut.h:15
enum BeamMode string