CbmRoot
CbmTrdContFact.cxx
Go to the documentation of this file.
1 //*-- AUTHOR : Ilse Koenig
2 //*-- Created : 25/10/2004
3 
5 //
6 // CbmTrdContFact
7 //
8 // Factory for the parameter containers in libTrd
9 //
11 #include "CbmTrdContFact.h"
12 
13 #include "CbmTrdParSetAsic.h" // for CbmTrdParSetAsic
14 #include "CbmTrdParSetDigi.h" // for CbmTrdParSetDigi
15 #include "CbmTrdParSetGain.h" // for CbmTrdParSetGain
16 #include "CbmTrdParSetGas.h" // for CbmTrdParSetGas
17 #include "CbmTrdParSetGeo.h" // for CbmTrdParSetGeo
18 
19 #include <FairContFact.h> // for FairContainer
20 #include <FairLogger.h> // for Logger, LOG
21 #include <FairRuntimeDb.h> // for FairRuntimeDb
22 
23 #include <TList.h> // for TList
24 #include <TString.h> // for TString
25 
26 #include <string.h> // for strcmp
27 
29 
30  static CbmTrdContFact gCbmTrdContFact;
31 
33  // Constructor (called when the library is loaded)
34  fName = "CbmTrdContFact";
35  fTitle = "Factory for parameter containers in libTrd";
37  FairRuntimeDb::instance()->addContFactory(this);
38 }
39 
44  // AB
45  FairContainer* par(nullptr);
46  // ASIC parametsr
47  par = new FairContainer(
48  "CbmTrdParSetAsic", "Trd ASIC Parameters", "TestDefaultContext");
49  par->addContext("TestNonDefaultContext");
50  containers->Add(par);
51  // read-out parameters
52  par = new FairContainer(
53  "CbmTrdParSetDigi", "Trd Read-Out Parameters", "TestDefaultContext");
54  par->addContext("TestNonDefaultContext");
55  containers->Add(par);
56  // gas parameters
57  par = new FairContainer(
58  "CbmTrdParSetGas", "Trd Gas Parameters", "TestDefaultContext");
59  par->addContext("TestNonDefaultContext");
60  containers->Add(par);
61  // gain parameters
62  par = new FairContainer(
63  "CbmTrdParSetGain", "Trd Gain Parameters", "TestDefaultContext");
64  par->addContext("TestNonDefaultContext");
65  containers->Add(par);
66  // geometry parameters
67  par = new FairContainer(
68  "CbmTrdParSetGeo", "Trd Geometry Parameters", "TestDefaultContext");
69  par->addContext("TestNonDefaultContext");
70  containers->Add(par);
71 }
72 
73 FairParSet* CbmTrdContFact::createContainer(FairContainer* c) {
77  const char* name = c->GetName();
78  LOG(info) << GetName() << "::createContainer :" << name;
79 
80  FairParSet* p(nullptr);
81  if (strcmp(name, "CbmTrdParSetAsic") == 0)
82  p = new CbmTrdParSetAsic(
83  c->getConcatName().Data(), c->GetTitle(), c->getContext());
84  else if (strcmp(name, "CbmTrdParSetDigi") == 0)
85  p = new CbmTrdParSetDigi(
86  c->getConcatName().Data(), c->GetTitle(), c->getContext());
87  else if (strcmp(name, "CbmTrdParSetGas") == 0)
88  p = new CbmTrdParSetGas(
89  c->getConcatName().Data(), c->GetTitle(), c->getContext());
90  else if (strcmp(name, "CbmTrdParSetGain") == 0)
91  p = new CbmTrdParSetGain(
92  c->getConcatName().Data(), c->GetTitle(), c->getContext());
93  else if (strcmp(name, "CbmTrdParSetGeo") == 0)
94  p = new CbmTrdParSetGeo(
95  c->getConcatName().Data(), c->GetTitle(), c->getContext());
96  return p;
97 }
CbmTrdParSetGas
Describe TRD module working settings (HV, etc)
Definition: CbmTrdParSetGas.h:15
CbmTrdParSetGeo.h
CbmTrdContFact::CbmTrdContFact
CbmTrdContFact()
Definition: CbmTrdContFact.cxx:32
CbmTrdParSetAsic
Describe TRD module ASIC settings (electronic gain, delays, etc)
Definition: CbmTrdParSetAsic.h:18
CbmTrdParSetAsic.h
CbmTrdParSetGain
Definition: CbmTrdParSetGain.h:16
CbmTrdParSetGain.h
CbmTrdParSetGeo
Definition: CbmTrdParSetGeo.h:9
CbmTrdContFact
Definition: CbmTrdContFact.h:11
CbmTrdParSetDigi.h
CbmTrdParSetDigi
Definition: CbmTrdParSetDigi.h:15
ClassImp
ClassImp(CbmTrdContFact) static CbmTrdContFact gCbmTrdContFact
CbmTrdContFact::createContainer
FairParSet * createContainer(FairContainer *)
Definition: CbmTrdContFact.cxx:73
CbmTrdParSetGas.h
CbmTrdContFact::setAllContainers
void setAllContainers()
Definition: CbmTrdContFact.cxx:40
CbmTrdContFact.h