er  dev
ERDetectorContFact.cxx
1 #include "ERDetectorContFact.h"
2 
3 #include "ERDetectorGeoPar.h"
4 
5 #include "FairRuntimeDb.h"
6 
7 #include <iostream>
8 using namespace std;
9 
10 static ERDetectorContFact gERDetectorContFact;
11 
13 {
15  fName="ERDetectorContFact";
16  fTitle="Factory for parameter containers in libTutorial1";
17  setAllContainers();
18  FairRuntimeDb::instance()->addContFactory(this);
19 }
20 
22 {
28  FairContainer* p1= new FairContainer("ERDetectorGeoPar",
29  "ERDetectorGeoPar",
30  "TestDefaultContext");
31  p1->addContext("TestNonDefaultContext");
32 
33  containers->Add(p1);
34 }
35 
36 FairParSet* ERDetectorContFact::createContainer(FairContainer* c)
37 {
38  const char* name=c->GetName();
39  FairParSet* p=NULL;
40  if (strcmp(name,"ERDetectorGeoPar")==0) {
41  p=new ERDetectorGeoPar(c->getConcatName().Data(),
42  c->GetTitle(),c->getContext());
43  }
44  return p;
45 }
46 
47 ClassImp(ERDetectorContFact)