8 #include "EVENT/LCIO.h"
16 using namespace lcio ;
26 LCWriter* lcWrt{NULL} ;
37 lcWrt =
new LCSplitWriter( LCFactory::getInstance()->createLCWriter(), splitSize ) ;
39 try{ lcWrt->open( outFileName ) ; }
41 catch(IOException& e){
42 cout <<
"[RunEventProcessor()] Can't open file for writing - "
52 cout <<
endl <<
" " << nEvent <<
" events copied ! " <<
endl ;
60 lcWrt->writeEvent( evt ) ;
72 lcWrt->writeRunHeader( run ) ;
81 int main(
int argc,
char** argv ){
89 LCReader*
lcReader = LCFactory::getInstance()->createLCReader() ;
92 cout <<
" usage: lcio_splitfile infilename outfilename sizeInBytes \n"
93 <<
" e.g.: lcio_split_file simjob.slcio splitjob.slcio 200000 \n"
98 inFileName = argv[1] ;
99 outFileName = argv[2] ;
104 try{ lcReader->open( inFileName ) ; }
106 catch( IOException& e){
107 cout <<
"Can't open file : " << e.what() <<
endl ;
116 lcReader->registerLCRunListener( &evtProc ) ;
117 lcReader->registerLCEventListener( &evtProc ) ;
119 lcReader->readStream() ;
void modifyEvent(LCEvent *)
Little tool that copies LCIO files on an event by event and run by run basis, thus fixing files that ...
void processEvent(LCEvent *evt)
RunEventProcessor(const char *outFileName, int splitSize)
int main(int argc, char **argv)
Simple program that opens existing LCIO files and appends the records needed for direct access - if t...
void processRunHeader(LCRunHeader *run)
void modifyRunHeader(LCRunHeader *)