Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DLumi_factory.h
Go to the documentation of this file.
1 
2 #ifndef _DLumi_factory_
3 #define _DLumi_factory_
4 
5 #include <JANA/JFactory.h>
6 using namespace jana;
7 
8 #include "DLumi.h"
9 
10 class DLumi_factory:public JFactory<DLumi> {
11  public:
14 
15  DLumi *lumi = 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( lumi ) delete lumi;
27 
28  lumi = new DLumi(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( lumi ) _data.push_back( lumi );
40 
41  return NOERROR;
42  }
43 
44  //------------------
45  // erun
46  //------------------
47  jerror_t erun(void)
48  {
49  if( lumi ) delete lumi;
50  lumi = NULL;
51 
52  return NOERROR;
53  }
54 };
55 
56 #endif // _DLumi_factory_
jerror_t evnt(JEventLoop *loop, uint64_t eventnumber)
Definition: DLumi_factory.h:36
jerror_t erun(void)
Definition: DLumi_factory.h:47
jerror_t brun(JEventLoop *loop, int32_t runnumber)
Definition: DLumi_factory.h:20
Definition: DLumi.h:16