// Author: David Lawrence Dec. 9, 2005 // // // DEventSinkJIL.cc // #include using namespace std; #ifdef JILIO #include "hd_serializers.h" #include "JILStreamPBF.h" #include "DEventSinkJIL.h" #include "DFactory_base.h" #include "DEvent.h" //------------------------------------------------------------------ // init -Open output file here (e.g. a ROOT file) //------------------------------------------------------------------ derror_t DEventSinkJIL::init(void) { s= new JILStreamPBF(filename, "w", true); s->SetPointerTracking(JILStream::PTR_NONE); return NOERROR; } //------------------------------------------------------------------ // brun_sink //------------------------------------------------------------------ derror_t DEventSinkJIL::brun_sink(DEventLoop *loop, int runnumber) { AddAllToWriteList(loop); RemoveFromWriteList("DFCALShower", ""); RemoveFromWriteList("DFCALGeometry", ""); RemoveFromWriteList("DFCALMCResponse", ""); RemoveFromWriteList("DTOFGeometry", ""); RemoveFromWriteList("DTOFPoint", ""); RemoveFromWriteList("DTrack", ""); RemoveFromWriteList("DTrackHit", "MC"); RemoveFromWriteList("DTrackCandidate", ""); RemoveFromWriteList("DTrackEfficiency", ""); PrintWriteList(); return NOERROR; } //------------------------------------------------------------------ // evnt -Fill histograms here //------------------------------------------------------------------ derror_t DEventSinkJIL::evnt(DEventLoop *loop, int eventnumber) { // Get list of all factories vector factories = loop->GetFactories(); // Lock out other threads and write out the event LockSink(); s->StartNamedWrite("Event"); for(unsigned int i=0; idataClassName(), factories[i]->Tag()))continue; if(factories[i]->GetNrows()==0)continue; // This actually invokes the factory factories[i]->StreamToOutput(s); } (*s)<