FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairPassiveContFact.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  ********************************************************************************/
8 //*-- AUTHOR : Denis Bertini
9 //*-- Created : 21/06/2005
10 
12 //
13 // FairPassiveContFact
14 //
15 // Factory for the parameter containers in libPassive
16 //
18 #include "FairPassiveContFact.h"
19 
20 #include "FairGeoPassivePar.h" // for FairGeoPassivePar
21 #include "FairRuntimeDb.h" // for FairRuntimeDb
22 
23 #include <TList.h> // for TList
24 #include <TString.h> // for TString
25 #include <string.h> // for strcmp
26 
27 class FairParSet;
28 
29 using namespace std;
30 
32 
33 static FairPassiveContFact gFairPassiveContFact;
34 
36  : FairContFact()
37 {
38  // Constructor (called when the library is loaded)
39  fName = "FairPassiveContFact";
40  fTitle = "Factory for parameter containers in libPassive";
41  setAllContainers();
43 }
44 
45 void FairPassiveContFact::setAllContainers()
46 {
50  FairContainer* p = new FairContainer("FairGeoPassivePar", "Passive Geometry Parameters", "TestDefaultContext");
51  p->addContext("TestNonDefaultContext");
52 
53  containers->Add(p);
54 }
55 
57 {
61  const char* name = c->GetName();
62  FairParSet* p = nullptr;
63  if (strcmp(name, "FairGeoPassivePar") == 0) {
64  p = new FairGeoPassivePar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
65  }
66  return p;
67 }
TString fName
Definition: FairParSet.h:21
FairParSet * createContainer(FairContainer *)
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