ATLAS Offline Software
Functions
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 
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
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
APP_NAME
#define APP_NAME
Definition: BoostedXbbTag.cxx:23
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
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