FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PixelContFact.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 
9 #include "PixelContFact.h"
10 
11 #include "FairRuntimeDb.h" // for FairRuntimeDb
12 #include "PixelDigiPar.h" // for PixelDigiPar
13 #include "PixelGeoPar.h" // for PixelGeoPar
14 
15 #include <TList.h> // for TList
16 #include <TString.h> // for TString
17 #include <cstring> // for strcmp
18 
19 class FairParSet;
20 
22 
23 static PixelContFact gPixelContFact;
24 
26  : FairContFact()
27 {
29  fName = "PixelContFact";
30  fTitle = "Factory for parameter containers in libPixel";
31  setAllContainers();
33 }
34 
35 void PixelContFact::setAllContainers()
36 {
42  FairContainer* p = new FairContainer("PixelGeoPar", "Pixel Geometry Parameters", "TestDefaultContext");
43  p->addContext("TestNonDefaultContext");
44 
45  containers->Add(p);
46 
47  FairContainer* p2 = new FairContainer("PixelDigiParameters", "Pixel digi parameters", "TestDefaultContext");
48  p2->addContext("TestNonDefaultContext");
49 
50  containers->Add(p2);
51 }
52 
54 {
60  const char* name = c->GetName();
61  FairParSet* p = nullptr;
62  if (strcmp(name, "PixelGeoPar") == 0) {
63  p = new PixelGeoPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
64  }
65  if (strcmp(name, "PixelDigiParameters") == 0) {
66  p = new PixelDigiPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
67  }
68  return p;
69 }
TString fName
Definition: FairParSet.h:21
static FairRuntimeDb * instance(void)
ClassImp(FairEventBuilder)
Digitization Parameter Class for Pixel detector.
Definition: PixelDigiPar.h:24
FairParSet * createContainer(FairContainer *)
TList * containers
Definition: FairContFact.h:62
const char * getContext()
TString getConcatName()
void addContFactory(FairContFact *)
void addContext(const char *)
TString fTitle
Definition: FairParSet.h:22