8 #include "EVENT/LCIO.h"
16 using namespace lcio ;
26 LCWriter* lcWrt{NULL} ;
28 unsigned int _nFiles{0} ;
35 RunEventProcessor(
const char* outFileName,
unsigned int nFiles) : nEvent(0), _nFiles(nFiles) {
38 lcWrt = LCFactory::getInstance()->createLCWriter() ;
40 try{ lcWrt->open( outFileName , LCIO::WRITE_NEW ) ; }
42 catch(IOException& e){
43 cout <<
"[RunEventProcessor()] Can't open file for writing - "
53 cout <<
"merged " << nEvent <<
" events from " << _nFiles <<
" input files." <<
endl ;
61 lcWrt->writeEvent( evt ) ;
75 lcWrt->writeRunHeader( run ) ;
84 int main(
int argc,
char** argv ){
91 cout <<
"usage: " << argv[0] <<
" <output-file> <input-file1> [[input-file2],...]" <<
endl ;
96 outFileName = argv[1] ;
98 unsigned int nFiles = argc - 2 ;
100 for(
unsigned int i=0 ; i < nFiles ; i++){
105 LCReader*
lcReader = LCFactory::getInstance()->createLCReader() ;
108 lcReader->open( FILEN ) ;
110 catch( IOException& e){
111 cout <<
"Can't open files : " << e.what() <<
endl ;
121 lcReader->registerLCRunListener( &evtProc ) ;
122 lcReader->registerLCEventListener( &evtProc ) ;
124 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)
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)
RunEventProcessor(const char *outFileName, unsigned int nFiles)
static std::vector< std::string > FILEN
void modifyRunHeader(LCRunHeader *)