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