#include <cstring>
#include <memory>
#include <vector>
#include <string>
#include <TFile.h>
#include <TError.h>
#include <TClass.h>
#include "xAODRootAccess/Init.h"
#include "xAODRootAccess/TEvent.h"
#include "xAODRootAccess/tools/Message.h"
Go to the source code of this file.
|
| int | main (int argc, char *argv[]) |
|
| static const char *const | APP_NAME = "xAODFileReadTest" |
| | The name of the application.
|
◆ R_CHECK
Value: do { \
if( !
result.isSuccess() ) { \
return 1; \
} \
} while( 0 )
Helper macro.
Definition at line 26 of file xAODFileReadTest.cxx.
26#define R_CHECK( EXP ) \
27 do { \
28 const auto result = EXP; \
29 if( ! result.isSuccess() ) { \
30 Error( APP_NAME, XAOD_MESSAGE( "Failed to execute: %s" ), #EXP ); \
31 return 1; \
32 } \
33 } while( 0 )
◆ main()
| int main |
( |
int | argc, |
|
|
char * | argv[] ) |
Definition at line 95 of file xAODFileReadTest.cxx.
95 {
96
97
99
100
101 if( ( argc < 2 ) ||
102 ( ! strcmp( argv[ 1 ], "-h" ) ) ||
103 ( ! strcmp( argv[ 1 ], "--help" ) ) ) {
110 return 1;
111 }
112
113
116 for(
int i = 1;
i <
argc; ++
i ) {
117 if( ! strcmp( argv[ i ], "-m" ) ) {
118 if( i + 1 >= argc ) {
121 return 1;
122 } else {
123 const long mode = ::strtol( argv[ i + 1 ], 0, 10 );
126 }
127 } else {
129 }
130 }
131
132
134
135
136 for( const std::string& fileName : fileNames ) {
137
138
139 std::unique_ptr< TFile >
ifile( TFile::Open(
fileName.c_str(),
"READ" ) );
140 if( ( !
ifile.get() ) ||
ifile->IsZombie() ) {
143 return 1;
144 }
146
147
149
150
151 const Long64_t
entries =
event.getEntries();
153
154
155 if(
event.getEntry( entry ) < 0 ) {
157 XAOD_MESSAGE(
"Failed to load entry %i from file: %s" ),
158 static_cast< int >( entry ),
fileName.c_str() );
159 return 1;
160 }
161
162
164
165
166 if( ( entry % 1000 == 0 ) || ( entry +1 ==
entries ) ) {
168 static_cast< int >( entry ),
static_cast< int >(
entries ) );
169 }
170 }
171 }
172
173
174 return 0;
175}
EAuxMode
Auxiliary store "mode".
@ kClassAccess
Access auxiliary data using the aux containers.
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.
#define R_CHECK(EXP)
Helper macro.
◆ APP_NAME
| const char* const APP_NAME = "xAODFileReadTest" |
|
static |