Skip to content
Snippets Groups Projects
Commit a8085ef6 authored by Andre Sailer's avatar Andre Sailer
Browse files

Always store lcio collections, even if they are empty

parent 509e8910
No related branches found
No related tags found
No related merge requests found
...@@ -281,12 +281,10 @@ void Geant4Output2LCIO::saveCollection(OutputContext<G4Event>& /* ctxt */, G4VHi ...@@ -281,12 +281,10 @@ void Geant4Output2LCIO::saveCollection(OutputContext<G4Event>& /* ctxt */, G4VHi
size_t nhits = collection->GetSize(); size_t nhits = collection->GetSize();
std::string hc_nam = collection->GetName(); std::string hc_nam = collection->GetName();
print("+++ Saving LCIO collection %s with %d entries....",hc_nam.c_str(),int(nhits)); print("+++ Saving LCIO collection %s with %d entries....",hc_nam.c_str(),int(nhits));
if ( nhits > 0 ) { typedef pair<const Geant4Context*,G4VHitsCollection*> _Args;
typedef pair<const Geant4Context*,G4VHitsCollection*> _Args; typedef Geant4Conversion<lcio::LCCollectionVec,_Args> _C;
typedef Geant4Conversion<lcio::LCCollectionVec,_Args> _C; const _C& cnv = _C::converter(typeid(Geant4HitCollection));
const _C& cnv = _C::converter(typeid(Geant4HitCollection)); lcio::LCEventImpl* evt = context()->event().extension<lcio::LCEventImpl>();
lcio::LCEventImpl* evt = context()->event().extension<lcio::LCEventImpl>(); lcio::LCCollectionVec* col = cnv(_Args(context(),collection));
lcio::LCCollectionVec* col = cnv(_Args(context(),collection)); evt->addCollection(col,hc_nam);
evt->addCollection(col,hc_nam);
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment