Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DPSGeometry_factory.h
Go to the documentation of this file.
1 
2 #ifndef _DPSGeometry_factory_
3 #define _DPSGeometry_factory_
4 
5 #include <JANA/JFactory.h>
6 using namespace jana;
7 
8 #include "DPSGeometry.h"
9 
10 class DPSGeometry_factory:public JFactory<DPSGeometry> {
11  public:
12  DPSGeometry_factory(){psgeometry=NULL;};
14 
15  DPSGeometry *psgeometry = nullptr;
16 
17  //------------------
18  // brun
19  //------------------
20  jerror_t brun(JEventLoop *loop, int32_t runnumber)
21  {
22  // (See DTAGHGeometry_factory.h)
23  SetFactoryFlag(NOT_OBJECT_OWNER);
24  ClearFactoryFlag(WRITE_TO_OUTPUT);
25 
26  if( psgeometry ) delete psgeometry;
27 
28  psgeometry = new DPSGeometry(loop);
29 
30  return NOERROR;
31  }
32 
33  //------------------
34  // evnt
35  //------------------
36  jerror_t evnt(JEventLoop *loop, uint64_t eventnumber)
37  {
38  // Reuse existing DBCALGeometry object.
39  if( psgeometry ) _data.push_back( psgeometry );
40 
41  return NOERROR;
42  }
43 
44  //------------------
45  // erun
46  //------------------
47  jerror_t erun(void)
48  {
49  if( psgeometry ) delete psgeometry;
50  psgeometry = NULL;
51 
52  return NOERROR;
53  }
54 };
55 
56 #endif // _DPSGeometry_factory_
jerror_t brun(JEventLoop *loop, int32_t runnumber)
jerror_t evnt(JEventLoop *loop, uint64_t eventnumber)