313 {
314
317
318 const char* xAODFileName = "";
319 std::string customInputFolder = "";
320 std::string customFileName = "";
321 const char* nrOfEntries = "";
322 std::string trigger = "";
325 for (
int i = 1;
i <
argc - 1;
i++) {
326 std::string
arg = std::string(argv[i]);
327 if (arg == "-x") {
328 xAODFileName =
argv[
i + 1];
329 }
330 else if (arg == "-d")
331 customInputFolder =
argv[
i + 1];
332 else if (arg == "-f")
333 customFileName =
argv[
i + 1];
334 else if (arg == "-e")
335 nrOfEntries =
argv[
i + 1];
336 else if (arg == "-t")
337 trigger =
argv[
i + 1];
338 else if (arg == "-y")
340 else if (arg == "-p")
342 }
343
345 if (xAODFileName[0] == '\0') {
348 }
349 if (trigger == "") {
352 }
354 Error(
APP_NAME,
" Usage: %s -x [xAOD file name] -y [year] -p [period] -t [trigger] -d [custom input folder] -f [custom file name] -e [number of events to process]",
APP_NAME);
355 return 1;
356 }
357
359
361 std::unique_ptr<TFile>
ifile(TFile::Open(xAODFileName,
"READ"));
364 return 1;
365 }
366
369 Info(
APP_NAME,
"Number of events in the file: %i",
static_cast<int>(
event.getEntries()));
370
371
372 int nrOfEntriesToRunOver = 1000;
373 if (!std::string(nrOfEntries).
empty()) {
374 int e = atoll(nrOfEntries);
375 if (e < nrOfEntriesToRunOver) {
376 nrOfEntriesToRunOver =
e;
377 }
378 }
379
380
382 sfChecker.initialiseTools(customFileName, customInputFolder, year, period);
383 for(Long64_t entry = 0;
entry < nrOfEntriesToRunOver;
entry++) {
384
385 event.getEntry(entry);
386 sfChecker.processEvent(event, year, period);
387
388 }
389
390 Info(
APP_NAME,
"%i events successfully processed, %i warnings, %i errors detected.", nrOfEntriesToRunOver, sfChecker.m_warningsCount, sfChecker.m_errorsCount);
391 return 0;
392}
#define RETURN_CHECK(CONTEXT, EXP)
Helper macro for checking return codes in a compact form in the code.
static const Attributes_t empty
static void enableFailure() noexcept
Tool for accessing xAOD files outside of Athena.
@ kClassAccess
Access auxiliary data using the aux containers.
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Error
The different types of error that can be flagged in the L1TopoRDO.
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.