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