121{
124
130
131 try {
132
133 JParser<> zap(
"Example program to select events from DST files.");
134
138 "<run> <frame index> <trigger counter>"\
139 " (one header line)") = "";
142
144 }
145 catch(const exception &error) {
147 }
148
150
151 inputFile = getFilenames(inputFile);
152
154
156
158
160
161 for (JTag tag; in >> tag; ) {
162 selection.insert(tag);
163 }
164
165 in.close();
166 }
167
169
170 if (out ==
NULL || ! out->IsOpen()) {
172 }
173
176
178
179 TFile* in = TFile::Open(file_name->c_str(),
"EXISTS");
180
181 if (in !=
NULL && in->IsOpen()) {
182
184
186
187 TKey* p =
dynamic_cast<TKey*
>(in->GetListOfKeys()->Before(key));
188
189 if (p ==
NULL ||
strcmp(
key->GetName(), p->GetName()) != 0) {
190
191 TTree* t1 =
dynamic_cast<TTree*
>(
key->ReadObj());
192
194
196
198
199 if (
strcmp((*i)->GetName(), t1->GetName()) == 0) {
200
201 q = *i;
202
203 break;
204 }
205 }
206
208 input.push_back(q = new TChain(t1->GetName()));
209 }
210
211 q->Add(file_name->c_str());
212 }
213 }
214 }
215 }
216 }
217
218
219
221
223
225
227
228 break;
229 }
230 }
231
234 }
235
237
240
241
242
244 if (
tm->GetEntries() == (*i)->GetEntries())
245 ++i;
246 else
247 i = input.erase(i);
248 }
249
250 out->cd();
251
253 output.push_back((*i)->GetTree()->CloneTree(0));
254 }
255
257
259
261
263
264 DEBUG(
"tag " << tag <<
' ' << (selection.empty() || selection.count(tag)) <<
endl);
265
266 if (selection.empty() || selection.count(tag)) {
267
268 for (size_t m = 0; m != input.size(); ++m) {
269 input [m]->GetEntry(i);
270 output[m]->Fill();
271 }
272 }
273 }
275
276 out->Write();
277 out->Close();
278}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Template definition of a multi-dimensional oscillation probability interpolation table.
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
static const char *const TTREE_OFFLINE_EVENT
ROOT TTree name.
static const char *const TBRANCH_OFFLINE_EVENT
ROOT TBranch name.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
int frame_index
from the raw data
int run_id
DAQ run identifier.
ULong64_t trigger_counter
trigger counter
Auxiliary class for defining the range of iterations of objects.