13 using namespace lcio ;
23 int main(
int argc,
char** argv ){
27 cout <<
" usage: anajob <input-file1> [[input-file2],...]" <<
endl <<
endl ;
28 cout <<
" set the environment variable LCIO_READ_COL_NAMES to a space separated list" <<
endl ;
29 cout <<
" of collection names that you would like to read (all are read if not set)" <<
endl ;
32 for(
int i=1 ; i < argc ; i++){
37 LCReader*
lcReader = LCFactory::getInstance()->createLCReader() ;
41 char* rColChar =
getenv (
"LCIO_READ_COL_NAMES");
43 if ( rColChar != 0 ) {
49 while( sts >> colName) {
54 lcReader->setReadCollectionNames( colSubset ) ;
62 cout <<
"anajob: will open and read from files: " <<
endl ;
64 for(
int i=0 ; i < nFiles ; i++){
66 lcReader->open( FILEN[i] ) ;
68 cout << endl <<
" " << FILEN[i]
69 <<
" [ number of runs: " << lcReader->getNumberOfRuns()
70 <<
", number of events: " << lcReader->getNumberOfEvents() <<
" ] "
79 lcReader->open( FILEN ) ;
88 while( ( runHdr = lcReader->readNextRunHeader() ) != 0 ){
90 LCTOOLS::dumpRunHeader( runHdr ) ;
96 }
catch(IOException& e){
97 cout <<
" io error when reading run data : " << e.what() <<
endl ;
106 lcReader->open( FILEN ) ;
109 cout <<
" will reopen and read from files: " <<
endl ;
110 for(
int i=0 ; i < nFiles ; i++){
119 while( (evt = lcReader->readNextEvent()) != 0 ) {
126 cout << endl <<
" " << nEvents <<
" events read from files: " <<
endl ;
127 for(
int i=0 ; i < nFiles ; i++){
static std::vector< std::string > FILEN
int main(int argc, char **argv)
Simple program that opens existing LCIO files and appends the records needed for direct access - if t...
void dumpEvent(EVENT::LCEvent *event)