Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DParticleID_factory.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DParticleID_factory.h
4 // Created: Mon Feb 28 13:47:49 EST 2011
5 // Creator: staylor (on Linux ifarml1 2.6.18-128.el5 x86_64)
6 //
7 
8 #ifndef _DParticleID_factory_
9 #define _DParticleID_factory_
10 
11 #include <JANA/JFactory.h>
12 #include <JANA/JEventLoop.h>
13 
14 #include "DParticleID.h"
15 
16 class DParticleID_factory:public jana::JFactory<DParticleID>{
17  public:
20 
21 
22  private:
23  jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber){
24  // This is a trivial class that simply implements a default
25  // factory. It is here so that the default can be changed
26  // easily by simply changing the tag here or on the command
27  // line.
28  vector<const DParticleID*> pid_algorithms;
29  eventLoop->Get(pid_algorithms,"PID1");
30  for(unsigned int i=0; i< pid_algorithms.size(); i++){
31  _data.push_back(const_cast<DParticleID*>(pid_algorithms[i]));
32  }
33  SetFactoryFlag(NOT_OBJECT_OWNER);
34 
35  return NOERROR;
36 
37  }; ///< Called every event.
38 };
39 
40 #endif // _DParticleID_factory_
41 
jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber)