FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairTestDetectorContFact.cxx
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
9 
10 #include "FairConstPar.h" // for FairConstPar
11 #include "FairRuntimeDb.h" // for FairRuntimeDb
12 #include "FairTestDetectorGeoPar.h" // for FairTestDetectorGeoPar
13 
14 #include <TList.h> // for TList
15 #include <TString.h> // for TString
16 #include <cstring> // for strcmp
17 
18 class FairParSet;
19 
21 
22 static FairTestDetectorContFact gFairTestDetectorContFact;
23 
25  : FairContFact()
26 {
28  fName = "FairTestDetectorContFact";
29  fTitle = "Factory for parameter containers in libFairTestDetector";
30  setAllContainers();
32 }
33 
34 void FairTestDetectorContFact::setAllContainers()
35 {
41  FairContainer* p =
42  new FairContainer("FairTestDetectorGeoPar", "FairTestDetector Geometry Parameters", "TestDefaultContext");
43  p->addContext("TestNonDefaultContext");
44 
45  FairContainer* p1 = new FairContainer("FairConstPar", "Constant Field Parameters", "TestDefaultContext");
46  p1->addContext("TestNonDefaultContext");
47 
48  containers->Add(p);
49  containers->Add(p1);
50 }
51 
53 {
59  const char* name = c->GetName();
60  FairParSet* p = nullptr;
61  if (strcmp(name, "FairTestDetectorGeoPar") == 0) {
62  p = new FairTestDetectorGeoPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
63  }
64  if (strcmp(name, "FairConstPar") == 0) {
65  p = new FairConstPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
66  }
67 
68  return p;
69 }
TString fName
Definition: FairParSet.h:21
static FairRuntimeDb * instance(void)
ClassImp(FairEventBuilder)
TList * containers
Definition: FairContFact.h:62
FairParSet * createContainer(FairContainer *)
const char * getContext()
TString getConcatName()
void addContFactory(FairContFact *)
void addContext(const char *)
TString fTitle
Definition: FairParSet.h:22