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