CbmRoot
CbmStar2019ContFact.cxx
Go to the documentation of this file.
1 //
3 // CbmStar2019ContFact
4 //
5 // Factory for the parameter containers in libStar2019
6 //
8 
9 #include "CbmStar2019ContFact.h"
10 
11 #include "CbmStar2019TofPar.h"
12 
13 #include "FairRuntimeDb.h"
14 
16 
17  static CbmStar2019ContFact gCbmStar2019ContFact;
18 
20  // Constructor (called when the library is loaded)
21  fName = "CbmStar2019ContFact";
22  fTitle = "Factory for parameter containers for fles test library";
24  FairRuntimeDb::instance()->addContFactory(this);
25 }
26 
32  FairContainer* pTof = new FairContainer("CbmStar2019TofPar",
33  "TOF at MCBM 2018 Unpack Parameters",
34  "TestDefaultContext");
35  pTof->addContext("TestNonDefaultContext");
36 
37  containers->Add(pTof);
38 }
39 
40 FairParSet* CbmStar2019ContFact::createContainer(FairContainer* c) {
44  const char* name = c->GetName();
45  FairParSet* p = 0;
46 
47  if (strcmp(name, "CbmStar2019TofPar") == 0) {
48  p = new CbmStar2019TofPar(
49  c->getConcatName().Data(), c->GetTitle(), c->getContext());
50  }
51 
52  return p;
53 }
CbmStar2019ContFact::setAllContainers
void setAllContainers()
Definition: CbmStar2019ContFact.cxx:27
CbmStar2019ContFact::CbmStar2019ContFact
CbmStar2019ContFact()
Definition: CbmStar2019ContFact.cxx:19
ClassImp
ClassImp(CbmStar2019ContFact) static CbmStar2019ContFact gCbmStar2019ContFact
CbmStar2019ContFact.h
CbmStar2019ContFact::createContainer
FairParSet * createContainer(FairContainer *)
Definition: CbmStar2019ContFact.cxx:40
CbmStar2019ContFact
Definition: CbmStar2019ContFact.h:9
CbmStar2019TofPar.h
CbmStar2019TofPar
Definition: CbmStar2019TofPar.h:18