Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DEventWriterHDDM_factory.h
Go to the documentation of this file.
1 #ifndef _DEventWriterHDDM_factory_
2 #define _DEventWriterHDDM_factory_
3 
4 #include <JANA/JFactory.h>
5 #include <JANA/JEventLoop.h>
6 
8 
9 class DEventWriterHDDM_factory : public jana::JFactory<DEventWriterHDDM>
10 {
11  public:
12  DEventWriterHDDM_factory(){use_factory = 1;}; //prevents JANA from searching the input file for these objects
14 
15  private:
16  jerror_t init(void)
17  {
18  dOutputFileBaseName = "converted";
19  gPARMS->SetDefaultParameter("HDDMOUT:FILENAME", dOutputFileBaseName);
20  return NOERROR;
21  }
22 
23  jerror_t evnt(jana::JEventLoop *locEventLoop, uint64_t locEventNumber)
24  {
25  // Create single DEventWriterHDDM object and marks the factory as persistent so it doesn't get deleted every event.
26  SetFactoryFlag(PERSISTANT);
27  ClearFactoryFlag(WRITE_TO_OUTPUT);
28  _data.push_back(new DEventWriterHDDM(locEventLoop, dOutputFileBaseName));
29  return NOERROR;
30  }
32 };
33 
34 #endif // _DEventWriterHDDM_factory_
35 
jerror_t evnt(jana::JEventLoop *locEventLoop, uint64_t locEventNumber)