Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DBCALGeometry_factory.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DBCALGeometry_factory.h
4 // Created: Thu Nov 17 15:10:51 CST 2005
5 // Creator: gluexuser (on Linux hydra.phys.uregina.ca 2.4.20-8smp i686)
6 //
7 
8 #ifndef _DBCALGeometry_factory_
9 #define _DBCALGeometry_factory_
10 
11 #include <JANA/JFactory.h>
12 using namespace jana;
13 
14 #include <BCAL/DBCALGeometry.h>
15 
16 class DBCALGeometry_factory:public JFactory<DBCALGeometry>{
17  public:
18  DBCALGeometry_factory(){bcalgeometry=NULL;};
20 
21  DBCALGeometry *bcalgeometry = 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( bcalgeometry ) delete bcalgeometry;
33 
34  bcalgeometry = new DBCALGeometry(runnumber);
35 
36  return NOERROR;
37  }
38 
39  //------------------
40  // evnt
41  //------------------
42  jerror_t evnt(JEventLoop *loop, uint64_t eventnumber)
43  {
44  // Reuse existing DBCALGeometry object.
45  if( bcalgeometry ) _data.push_back( bcalgeometry );
46 
47  return NOERROR;
48  }
49 
50  //------------------
51  // erun
52  //------------------
53  jerror_t erun(void)
54  {
55  if( bcalgeometry ) delete bcalgeometry;
56  bcalgeometry = NULL;
57 
58  return NOERROR;
59  }
60 };
61 
62 #endif // _DBCALGeometry_factory_
63 
jerror_t brun(JEventLoop *loop, int32_t runnumber)
jerror_t evnt(JEventLoop *loop, uint64_t eventnumber)