FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairTutorialDet2ContFact.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"
12 #include "FairTutorialDet2GeoPar.h"
13 
14 #include <cstring> // strcmp
15 
17 
18 static FairTutorialDet2ContFact gFairTutorialDet2ContFact;
19 
21 {
23  fName = "FairTutorialDet2ContFact";
24  fTitle = "Factory for parameter containers in libTutorial1";
25  setAllContainers();
27 }
28 
29 void FairTutorialDet2ContFact::setAllContainers()
30 {
36  FairContainer* p1 =
37  new FairContainer("FairTutorialDet2GeoPar", "FairTutorialDet2 Geometry Parameters", "TestDefaultContext");
38  p1->addContext("TestNonDefaultContext");
39 
40  containers->Add(p1);
41 
42  FairContainer* p2 =
43  new FairContainer("FairTutorialDet2DigiPar", "Tutorial Det Digi Parameters", "TestDefaultContext");
44  p2->addContext("TestNonDefaultContext");
45 
46  containers->Add(p2);
47 }
48 
50 {
56  const char* name = c->GetName();
57  FairParSet* p = nullptr;
58  if (strcmp(name, "FairTutorialDet2GeoPar") == 0) {
59  p = new FairTutorialDet2GeoPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
60  }
61  if (strcmp(name, "FairTutorialDet2DigiPar") == 0) {
62  p = new FairTutorialDet2DigiPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
63  }
64 
65  return p;
66 }
static FairRuntimeDb * instance(void)
ClassImp(FairEventBuilder)
TList * containers
Definition: FairContFact.h:62
const char * getContext()
FairParSet * createContainer(FairContainer *)
TString getConcatName()
void addContFactory(FairContFact *)
void addContext(const char *)