Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Df250EmulatorAlgorithm_factory.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: Df250EmulatorAlgorithm_factory.h
4 // Created: Mar 20, 2016
5 // Creator: mstaib
6 //
7 
8 #ifndef _Df250EmulatorAlgorithm_factory_
9 #define _Df250EmulatorAlgorithm_factory_
10 
11 #include <JANA/JFactory.h>
13 
14 class Df250EmulatorAlgorithm_factory:public jana::JFactory<Df250EmulatorAlgorithm>{
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  // v1 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 = f250 code used until mid 2016
28  // v2 = f250 code used starting fall 2016
29  // v3 = f250 code used starting fall 2019 (hopefully)
30 
31  vector<const Df250EmulatorAlgorithm*> emulators;
32  /*
33  Df250EmulatorAlgorithm_factory *f250EmFac = static_cast<Df250EmulatorAlgorithm_factory*>(loop->GetFactory("Df250EmulatorAlgorithm","v1"));
34  if (f250EmFac) f250EmFac->Get(emulators);
35  for(unsigned int i=0; i< emulators.size(); i++){
36  _data.push_back(const_cast<Df250EmulatorAlgorithm*>(emulators[i]));
37  }
38 
39  // add the v2 factory for now as well
40  Df250EmulatorAlgorithm_factory *f250EmFacV2 = static_cast<Df250EmulatorAlgorithm_factory*>(loop->GetFactory("Df250EmulatorAlgorithm","v2"));
41  if (f250EmFacV2) f250EmFacV2->Get(emulators);
42  for(unsigned int i=0; i< emulators.size(); i++){
43  _data.push_back(const_cast<Df250EmulatorAlgorithm*>(emulators[i]));
44  }
45  */
46  // add the v3 factory
47  Df250EmulatorAlgorithm_factory *f250EmFacV3 = static_cast<Df250EmulatorAlgorithm_factory*>(loop->GetFactory("Df250EmulatorAlgorithm","v3"));
48  if (f250EmFacV3) f250EmFacV3->Get(emulators);
49  for(unsigned int i=0; i< emulators.size(); i++){
50  _data.push_back(const_cast<Df250EmulatorAlgorithm*>(emulators[i]));
51  }
52  SetFactoryFlag(NOT_OBJECT_OWNER);
53 
54  return NOERROR;
55  }
56 };
57 
58 #endif // _Df250EmulatorAlgorithm_factory_
59 
jerror_t evnt(jana::JEventLoop *loop, uint64_t eventnumber)