FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairTutorialDet4ContFact.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 "FairRuntimeDb.h" // for FairRuntimeDb
11 #include "FairTutorialDet4GeoPar.h" // for FairTutorialDet4GeoPar
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 FairTutorialDet4ContFact gFairTutorialDet4ContFact;
23 
25  : FairContFact()
26 {
28  fName = "FairTutorialDet4ContFact";
29  fTitle = "Factory for parameter containers in libTutorial1";
30  setAllContainers();
32 }
33 
34 void FairTutorialDet4ContFact::setAllContainers()
35 {
41  FairContainer* p =
42  new FairContainer("FairTutorialDet4GeoPar", "FairTutorialDet4 Geometry Parameters", "TestDefaultContext");
43  p->addContext("TestNonDefaultContext");
44 
45  containers->Add(p);
46 
47  FairContainer* p1 = new FairContainer(
48  "FairTutorialDet4MissallignPar", "FairTutorialDet4 Missallignment Parameters", "TestDefaultContext");
49  p1->addContext("TestNonDefaultContext");
50 
51  containers->Add(p1);
52 }
53 
55 {
61  const char* name = c->GetName();
62  FairParSet* p = nullptr;
63  if (strcmp(name, "FairTutorialDet4GeoPar") == 0) {
64  p = new FairTutorialDet4GeoPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
65  }
66  if (strcmp(name, "FairTutorialDet4MissallignPar") == 0) {
67  p = new FairTutorialDet4MisalignPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
68  }
69  return p;
70 }
FairParSet * createContainer(FairContainer *)
TString fName
Definition: FairParSet.h:21
static FairRuntimeDb * instance(void)
ClassImp(FairEventBuilder)
TList * containers
Definition: FairContFact.h:62
const char * getContext()
TString getConcatName()
void addContFactory(FairContFact *)
void addContext(const char *)
TString fTitle
Definition: FairParSet.h:22