FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairTutorialDet1ContFact.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 "FairTutorialDet1GeoPar.h" // for FairTutorialDet1GeoPar
12 
13 #include <TList.h> // for TList
14 #include <TString.h> // for TString
15 #include <cstring> // for strcmp
16 
17 class FairParSet;
18 
20 
21 static FairTutorialDet1ContFact gFairTutorialDet1ContFact;
22 
24  : FairContFact()
25 {
27  fName = "FairTutorialDet1ContFact";
28  fTitle = "Factory for parameter containers in libTutorial1";
29  setAllContainers();
31 }
32 
33 void FairTutorialDet1ContFact::setAllContainers()
34 {
40  FairContainer* p =
41  new FairContainer("FairTutorialDet1GeoPar", "FairTutorialDet1 Geometry Parameters", "TestDefaultContext");
42  p->addContext("TestNonDefaultContext");
43 
44  containers->Add(p);
45 }
46 
48 {
54  const char* name = c->GetName();
55  FairParSet* p = nullptr;
56  if (strcmp(name, "FairTutorialDet1GeoPar") == 0) {
57  p = new FairTutorialDet1GeoPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
58  }
59  return p;
60 }
TString fName
Definition: FairParSet.h:21
static FairRuntimeDb * instance(void)
FairParSet * createContainer(FairContainer *)
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