18 using namespace lcio ;
23 int main(
int argc,
char** argv ){
34 cout <<
" usage: dumpevent filename runNum evtNum " <<
endl ;
35 cout <<
" or: dumpevent filename n " <<
endl ;
36 cout <<
" where the first dumps the event with the specified run and event number" <<
endl ;
37 cout <<
" and the second simply dumps the n-th event in the file" << endl <<
endl ;
38 cout <<
" set the environment variable LCIO_READ_COL_NAMES to a space separated list" <<
endl ;
39 cout <<
" of collection names that you would like to dump (all are dumped if not set)" <<
endl ;
46 bool dumpNthEvent( argc == 3 ) ;
51 nthEvent =
atoi( argv[2] ) ;
55 cout <<
" usage: dumpevent filename n - whith n > 0 ! " <<
endl ;
62 runNumber =
atoi( argv[2] ) ;
63 evtNumber =
atoi( argv[3] ) ;
74 lcReader = LCFactory::getInstance()->createLCReader() ;
76 lcReader = LCFactory::getInstance()->createLCReader(LCReader::directAccess) ;
81 char* rColChar =
getenv (
"LCIO_READ_COL_NAMES");
83 if ( rColChar != 0 ) {
89 while( sts >> colName) {
94 lcReader->setReadCollectionNames( colSubset ) ;
104 lcReader->open( FILEN ) ;
109 lcReader->skipNEvents( nthEvent - 1 ) ;
111 evt = lcReader->readNextEvent() ;
115 evt = lcReader->readEvent(runNumber, evtNumber) ;
128 cout <<
" less than " << nthEvent <<
" events in file " << FILEN <<
endl ;
132 cout <<
" couldn't find event " << evtNumber <<
" - run " << runNumber
133 <<
" in file " << FILEN <<
endl ;
139 LCTOOLS::dumpEventDetailed( evt ) ;
145 catch( IOException& e) {
int main(int argc, char **argv)
Simple program that opens existing LCIO files and appends the records needed for direct access - if t...
static std::vector< std::string > FILEN