CbmRoot
CbmMcbm2018ContFact.cxx
Go to the documentation of this file.
1 //
3 // CbmMcbm2018ContFact
4 //
5 // Factory for the parameter containers in libMcbm2018
6 //
8 
9 #include "CbmMcbm2018ContFact.h"
10 
11 #include "CbmMcbm2018HodoPar.h"
12 #include "CbmMcbm2018MuchPar.h"
13 #include "CbmMcbm2018PsdPar.h"
14 #include "CbmMcbm2018RichPar.h"
15 #include "CbmMcbm2018StsPar.h"
16 #include "CbmMcbm2018TofPar.h"
17 
18 #include "FairRuntimeDb.h"
19 
21 
22  static CbmMcbm2018ContFact gCbmMcbm2018ContFact;
23 
25  // Constructor (called when the library is loaded)
26  fName = "CbmMcbm2018ContFact";
27  fTitle = "Factory for parameter containers for fles test library";
29  FairRuntimeDb::instance()->addContFactory(this);
30 }
31 
36  FairContainer* pSts = new FairContainer("CbmMcbm2018StsPar",
37  "STS at MCBM 2018 Unpack Parameters",
38  "TestDefaultContext");
39  pSts->addContext("TestNonDefaultContext");
40  containers->Add(pSts);
41 
42  FairContainer* pMuch =
43  new FairContainer("CbmMcbm2018MuchPar",
44  "MUCH at MCBM 2018 Unpack Parameters",
45  "TestDefaultContext");
46  pMuch->addContext("TestNonDefaultContext");
47  containers->Add(pMuch);
48 
49 
50  FairContainer* pTof = new FairContainer("CbmMcbm2018TofPar",
51  "TOF at MCBM 2018 Unpack Parameters",
52  "TestDefaultContext");
53  pTof->addContext("TestNonDefaultContext");
54  containers->Add(pTof);
55 
56  FairContainer* pRich =
57  new FairContainer("CbmMcbm2018RichPar",
58  "RICH at MCBM 2018 Unpack Parameters",
59  "TestDefaultContext");
60  pRich->addContext("TestNonDefaultContext");
61  containers->Add(pRich);
62 
63  FairContainer* pHodo =
64  new FairContainer("CbmMcbm2018HodoPar",
65  "HODO at MCBM 2018 Unpack Parameters",
66  "TestDefaultContext");
67  pHodo->addContext("TestNonDefaultContext");
68  containers->Add(pHodo);
69 
70  FairContainer* pPsd = new FairContainer("CbmMcbm2018PsdPar",
71  "PSD at MCBM 2018 Unpack Parameters",
72  "TestDefaultContext");
73  pPsd->addContext("TestNonDefaultContext");
74  containers->Add(pPsd);
75 }
76 
77 FairParSet* CbmMcbm2018ContFact::createContainer(FairContainer* c) {
81  const char* name = c->GetName();
82  FairParSet* p = 0;
83 
84  if (strcmp(name, "CbmMcbm2018StsPar") == 0) {
85  p = new CbmMcbm2018StsPar(
86  c->getConcatName().Data(), c->GetTitle(), c->getContext());
87  }
88  if (strcmp(name, "CbmMcbm2018MuchPar") == 0) {
89  p = new CbmMcbm2018MuchPar(
90  c->getConcatName().Data(), c->GetTitle(), c->getContext());
91  }
92  if (strcmp(name, "CbmMcbm2018TofPar") == 0) {
93  p = new CbmMcbm2018TofPar(
94  c->getConcatName().Data(), c->GetTitle(), c->getContext());
95  }
96  if (strcmp(name, "CbmMcbm2018RichPar") == 0) {
97  p = new CbmMcbm2018RichPar(
98  c->getConcatName().Data(), c->GetTitle(), c->getContext());
99  }
100  if (strcmp(name, "CbmMcbm2018HodoPar") == 0) {
101  p = new CbmMcbm2018HodoPar(
102  c->getConcatName().Data(), c->GetTitle(), c->getContext());
103  }
104  if (strcmp(name, "CbmMcbm2018PsdPar") == 0) {
105  p = new CbmMcbm2018PsdPar(
106  c->getConcatName().Data(), c->GetTitle(), c->getContext());
107  }
108 
109  return p;
110 }
CbmMcbm2018RichPar.h
CbmMcbm2018MuchPar.h
CbmMcbm2018TofPar.h
CbmMcbm2018PsdPar.h
ClassImp
ClassImp(CbmMcbm2018ContFact) static CbmMcbm2018ContFact gCbmMcbm2018ContFact
CbmMcbm2018HodoPar.h
CbmMcbm2018RichPar
Definition: CbmMcbm2018RichPar.h:13
CbmMcbm2018ContFact::setAllContainers
void setAllContainers()
Definition: CbmMcbm2018ContFact.cxx:32
CbmMcbm2018PsdPar
Definition: CbmMcbm2018PsdPar.h:19
CbmMcbm2018ContFact.h
CbmMcbm2018MuchPar
Definition: CbmMcbm2018MuchPar.h:19
CbmMcbm2018StsPar
Definition: CbmMcbm2018StsPar.h:18
CbmMcbm2018TofPar
Definition: CbmMcbm2018TofPar.h:18
CbmMcbm2018ContFact::createContainer
FairParSet * createContainer(FairContainer *)
Definition: CbmMcbm2018ContFact.cxx:77
CbmMcbm2018StsPar.h
CbmMcbm2018ContFact
Definition: CbmMcbm2018ContFact.h:9
CbmMcbm2018HodoPar
Definition: CbmMcbm2018HodoPar.h:18
CbmMcbm2018ContFact::CbmMcbm2018ContFact
CbmMcbm2018ContFact()
Definition: CbmMcbm2018ContFact.cxx:24