11 using namespace lcio ;
16 int main(
int argc,
char** argv ){
20 cout <<
" usage: readmcparticles input-file" <<
endl <<
endl ;
25 LCReader*
lcReader = LCFactory::getInstance()->createLCReader() ;
26 lcReader->open( FILEN ) ;
35 while( (evt = lcReader->readNextEvent()) != 0 ) {
38 LCCollection* col = evt->getCollection(
"MCParticle") ;
42 for(
unsigned i=0,N=col->getNumberOfElements() ; i< N ; ++i){
44 MCParticle* p = (MCParticle*) col->getElementAt(i) ;
46 if( p->getGeneratorStatus() == 1)
47 e_mcp += p->getEnergy() ;
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