Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Df125EmulatorAlgorithm_factory.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: Df125EmulatorAlgorithm_factory.h
4 // Created: Mar 20, 2016
5 // Creator: mstaib
6 //
7 
8 #ifndef _Df125EmulatorAlgorithm_factory_
9 #define _Df125EmulatorAlgorithm_factory_
10 
11 #include <JANA/JFactory.h>
13 
14 class Df125EmulatorAlgorithm_factory:public jana::JFactory<Df125EmulatorAlgorithm>{
15  public:
18 
19  private:
20  jerror_t evnt(jana::JEventLoop *loop, uint64_t eventnumber){
21 
22  // This is a trivial class that simply implements the
23  // v2 tagged factory as the default. It is here so
24  // that the default can be changed easily by simply
25  // changing the tag here or on the command line.
26 
27  // v1 = ported f250 code (has not been implemented)
28  // v2 = firmware using the upsampling technique.
29 
30  vector<const Df125EmulatorAlgorithm*> emulators;
31  Df125EmulatorAlgorithm_factory *f125EmFac = static_cast<Df125EmulatorAlgorithm_factory*>(loop->GetFactory("Df125EmulatorAlgorithm","v2"));
32  if(f125EmFac) f125EmFac->Get(emulators);
33  for(unsigned int i=0; i< emulators.size(); i++){
34  _data.push_back(const_cast<Df125EmulatorAlgorithm*>(emulators[i]));
35  }
36  SetFactoryFlag(NOT_OBJECT_OWNER);
37 
38  return NOERROR;
39  }
40 };
41 
42 #endif // _Df125EmulatorAlgorithm_factory_
43 
jerror_t evnt(jana::JEventLoop *loop, uint64_t eventnumber)