ATLAS Offline Software
Loading...
Searching...
No Matches
xAODRNChecker.cxx File Reference
#include <cstring>
#include <memory>
#include "../Root/ROOTTypes.h"
#include <TError.h>
#include "AsgMessaging/MessageCheck.h"
#include "CxxUtils/checker_macros.h"
#include "xAODRootAccess/Init.h"
#include "xAODRootAccess/REvent.h"
#include "xAODRootAccess/tools/RFileChecker.h"
#include "xAODRootAccess/tools/ReturnCheck.h"

Go to the source code of this file.

Functions

int main ATLAS_NOT_THREAD_SAFE (int argc, char *argv[])

Function Documentation

◆ ATLAS_NOT_THREAD_SAFE()

int main ATLAS_NOT_THREAD_SAFE ( int argc,
char * argv[] )

Definition at line 23 of file xAODRNChecker.cxx.

23 {
24
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:
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:
60 ANA_CHECK( event.readFrom( fname ) );
61
62 // Run the sanity checks:
63 ANA_CHECK( checker.check( event ) );
64 }
65
66 // Return gracefully:
67 return 0;
68}
#define APP_NAME
#define ANA_CHECK(EXP)
check whether the given expression was successful
#define ANA_CHECK_SET_TYPE(TYPE)
set the type for ANA_CHECK to report failures
Tool for accessing xAOD files outside of Athena, version RNTuple.
Definition REvent.h:28
Tool for running sanity checks on xAOD files.
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.
Definition Init.cxx:31