diff --git a/DDG4/lcio/Geant4Output2LCIO.cpp b/DDG4/lcio/Geant4Output2LCIO.cpp index 248b04b4dcaa6fb5dc07328fa32debde16db0bee..d2e47ca56a66c0fcdef76b56bd95e5700d06759a 100644 --- a/DDG4/lcio/Geant4Output2LCIO.cpp +++ b/DDG4/lcio/Geant4Output2LCIO.cpp @@ -281,12 +281,10 @@ void Geant4Output2LCIO::saveCollection(OutputContext<G4Event>& /* ctxt */, G4VHi size_t nhits = collection->GetSize(); std::string hc_nam = collection->GetName(); print("+++ Saving LCIO collection %s with %d entries....",hc_nam.c_str(),int(nhits)); - if ( nhits > 0 ) { - typedef pair<const Geant4Context*,G4VHitsCollection*> _Args; - typedef Geant4Conversion<lcio::LCCollectionVec,_Args> _C; - const _C& cnv = _C::converter(typeid(Geant4HitCollection)); - lcio::LCEventImpl* evt = context()->event().extension<lcio::LCEventImpl>(); - lcio::LCCollectionVec* col = cnv(_Args(context(),collection)); - evt->addCollection(col,hc_nam); - } + typedef pair<const Geant4Context*,G4VHitsCollection*> _Args; + typedef Geant4Conversion<lcio::LCCollectionVec,_Args> _C; + const _C& cnv = _C::converter(typeid(Geant4HitCollection)); + lcio::LCEventImpl* evt = context()->event().extension<lcio::LCEventImpl>(); + lcio::LCCollectionVec* col = cnv(_Args(context(),collection)); + evt->addCollection(col,hc_nam); }