CbmRoot
Loading...
Searching...
No Matches
CbmStar2019ContFact.cxx
Go to the documentation of this file.
1/* Copyright (C) 2018 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau [committer] */
4
6//
7// CbmStar2019ContFact
8//
9// Factory for the parameter containers in libStar2019
10//
12
13#include "CbmStar2019ContFact.h"
14
15#include "CbmStar2019TofPar.h"
16
17#include "FairRuntimeDb.h"
18
20
21 static CbmStar2019ContFact gCbmStar2019ContFact;
22
24{
25 // Constructor (called when the library is loaded)
26 fName = "CbmStar2019ContFact";
27 fTitle = "Factory for parameter containers for fles test library";
29 FairRuntimeDb::instance()->addContFactory(this);
30}
31
33{
38 FairContainer* pTof =
39 new FairContainer("CbmStar2019TofPar", "TOF at MCBM 2018 Unpack Parameters", "TestDefaultContext");
40 pTof->addContext("TestNonDefaultContext");
41
42 containers->Add(pTof);
43}
44
45FairParSet* CbmStar2019ContFact::createContainer(FairContainer* c)
46{
50 const char* name = c->GetName();
51 FairParSet* p = 0;
52
53 if (strcmp(name, "CbmStar2019TofPar") == 0) {
54 p = new CbmStar2019TofPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
55 }
56
57 return p;
58}
ClassImp(CbmStar2019ContFact) static CbmStar2019ContFact gCbmStar2019ContFact
FairParSet * createContainer(FairContainer *)