er  dev
ERFieldContFact.cxx
1 // -------------------------------------------------------------------------
2 // ----- ERFieldContFact source file -----
3 // ----- Created 20/02/06 by V. Friese -----
4 // -------------------------------------------------------------------------
5 #include "ERFieldContFact.h"
6 
7 #include "FairParSet.h"
8 #include "FairRuntimeDb.h"
9 #include "FairLogger.h"
10 
11 #include <iostream>
12 using std::cout;
13 using std::endl;
14 
15 #include "ERFieldPar.h"
16 
17 static ERFieldContFact gERFieldContFact;
18 // ----- Constructor ---------------------------------------------------
20  fName = "ERFieldContFact";
21  fTitle = "Factory for field parameter containers";
23  FairRuntimeDb::instance()->addContFactory(this);
24 }
25 // -------------------------------------------------------------------------
26 // ----- Destructor ----------------------------------------------------
28 // -------------------------------------------------------------------------
29 // ----- Create containers ---------------------------------------------
30 FairParSet* ERFieldContFact::createContainer(FairContainer* container) {
31  const char* name = container->GetName();
32  LOG(INFO) << "create ERFieldPar container " << name << FairLogger::endl;
33  FairParSet* set = NULL;
34  if ( strcmp(name, "ERFieldPar") == 0 )
35  set = new ERFieldPar( container->getConcatName().Data(),
36  container->GetTitle(),
37  container->getContext() );
38  return set;
39 }
40 // -------------------------------------------------------------------------
41 // ----- Set all containers (private) ----------------------------------
43  FairContainer* container = new FairContainer("ERFieldPar",
44  "Field parameter container",
45  "Default field");
46  containers->Add(container);
47 }
48 // -------------------------------------------------------------------------
49 ClassImp(ERFieldContFact)
FairParSet * createContainer(FairContainer *container)