317 {
318
321
322 const char* xAODFileName = "";
323 std::string customInputFolder = "";
324 std::string customFileName = "";
325 const char* nrOfEntries = "";
326 std::string trigger = "";
329 for (
int i = 1;
i <
argc - 1;
i++) {
330 std::string
arg = std::string(argv[i]);
331 if (arg == "-x") {
332 xAODFileName =
argv[
i + 1];
333 }
334 else if (arg == "-d")
335 customInputFolder =
argv[
i + 1];
336 else if (arg == "-f")
337 customFileName =
argv[
i + 1];
338 else if (arg == "-e")
339 nrOfEntries =
argv[
i + 1];
340 else if (arg == "-t")
341 trigger =
argv[
i + 1];
342 else if (arg == "-y")
344 else if (arg == "-p")
346 }
347
349 if (xAODFileName[0] == '\0') {
352 }
353 if (trigger == "") {
356 }
358 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);
359 return 1;
360 }
361
363
365 std::unique_ptr<TFile>
ifile(TFile::Open(xAODFileName,
"READ"));
368 return 1;
369 }
370
373 Info(
APP_NAME,
"Number of events in the file: %i",
static_cast<int>(
event.getEntries()));
374
375
376 int nrOfEntriesToRunOver = 1000;
377 if (!std::string(nrOfEntries).
empty()) {
378 int e = atoll(nrOfEntries);
379 if (e < nrOfEntriesToRunOver) {
380 nrOfEntriesToRunOver =
e;
381 }
382 }
383
384
386 sfChecker.initialiseTools(customFileName, customInputFolder, year, period);
387 for(Long64_t entry = 0;
entry < nrOfEntriesToRunOver;
entry++) {
388
389 event.getEntry(entry);
390 sfChecker.processEvent(event, year, period);
391
392 }
393
394 Info(
APP_NAME,
"%i events successfully processed, %i warnings, %i errors detected.", nrOfEntriesToRunOver, sfChecker.m_warningsCount, sfChecker.m_errorsCount);
395 return 0;
396}
#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.