#ifndef _DEventWriterREST_factory_ #define _DEventWriterREST_factory_ #include #include #include "HDDM/DEventWriterREST.h" class DEventWriterREST_factory : public jana::JFactory { public: DEventWriterREST_factory(){use_factory = 1;}; //prevents JANA from searching the input file for these objects ~DEventWriterREST_factory(){}; private: jerror_t init(void) { dOutputFileBaseName = "dana_rest"; gPARMS->SetDefaultParameter("rest:FILENAME", dOutputFileBaseName); return NOERROR; } jerror_t evnt(jana::JEventLoop *locEventLoop, int locEventNumber) { // Create single DEventWriterREST object and marks the factory as persistent so it doesn't get deleted every event. SetFactoryFlag(PERSISTANT); ClearFactoryFlag(WRITE_TO_OUTPUT); _data.push_back(new DEventWriterREST(locEventLoop, dOutputFileBaseName)); return NOERROR; } string dOutputFileBaseName; }; #endif // _DEventWriterREST_factory_