ATLAS Offline Software
xAODRNChecker.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // System include(s):
6 #include <cstring>
7 #include <memory>
8 
9 // ROOT include(s):
10 // #include <TFile.h>
11 #include "../Root/ROOTTypes.h"
12 #include <TError.h>
13 
16 
17 // Local include(s):
18 #include "xAODRootAccess/Init.h"
19 #include "xAODRootAccess/REvent.h"
22 
23 int main ATLAS_NOT_THREAD_SAFE ( int argc, char* argv[] ) {
24 
25  ANA_CHECK_SET_TYPE (int);
26  using namespace asg::msgUserCode;
27 
28  // The application's name:
29  const char* APP_NAME = argv[ 0 ];
30 
31  // Check that the application will be able to run:
32  if( ( argc == 1 ) ||
33  ( ( argc == 2 ) && ( ::strcmp( argv[ 1 ], "-h" ) == 0 ) ) ) {
34  ::Info( APP_NAME, "Usage: %s <xAOD file1> [xAOD file2] ...", APP_NAME );
35  return 0;
36  }
37 
38  // Initialise the application's environment:
39  ANA_CHECK( xAOD::Init() );
40 
41  // The object used in the checks:
43  checker.setStopOnError( kFALSE ); // Don't stop on errors, print them all
44 
45  // Loop over the files:
46  for( int i = 1; i < argc; ++i ) {
47 
48  // The file name:
49  const char* fname = argv[ i ];
50 
51  // // Open the file:
52  ::Info( APP_NAME, "Opening file: %s", fname );
53 
54  // Later on the code should find all the top level event trees in the
55  // input file. But for now let's just assume that only "CollectionTree" is
56  // in the file.
57 
58  // Set up reading from the file:
61 
62  // Run the sanity checks:
63  ANA_CHECK( checker.check( event ) );
64  }
65 
66  // Return gracefully:
67  return 0;
68 }
xAOD::Experimental::REvent
Tool for accessing xAOD files outside of Athena, version RNTuple.
Definition: REvent.h:105
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
ATLAS_NOT_THREAD_SAFE
int main ATLAS_NOT_THREAD_SAFE(int argc, char *argv[])
Definition: xAODRNChecker.cxx:23
ReturnCheck.h
main
int main(int, char **)
Main class for all the CppUnit test classes
Definition: CppUnit_SGtestdriver.cxx:141
REvent.h
POOL::TEvent::readFrom
StatusCode readFrom(TFile *file)
Definition: PhysicsAnalysis/POOLRootAccess/src/TEvent.cxx:133
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
lumiFormat.i
int i
Definition: lumiFormat.py:85
LArCellNtuple.argv
argv
Definition: LArCellNtuple.py:152
MessageCheck.h
macros for messaging and checking status codes
APP_NAME
#define APP_NAME
Definition: BoostedXbbTag.cxx:23
Init.h
DQHistogramMergeRegExp.argc
argc
Definition: DQHistogramMergeRegExp.py:19
python.AthDsoLogger.fname
string fname
Definition: AthDsoLogger.py:66
ANA_CHECK_SET_TYPE
#define ANA_CHECK_SET_TYPE(TYPE)
set the type for ANA_CHECK to report failures
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:314
xAOD::Experimental::RFileChecker
Tool for running sanity checks on xAOD files.
Definition: RFileChecker.h:41
checker_macros.h
Define macros for attributes used to control the static checker.
RFileChecker.h
xAOD::Init
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.
Definition: Init.cxx:31
dumpTriggerInfo.checker
checker
Definition: dumpTriggerInfo.py:20