CbmRoot
Loading...
Searching...
No Matches
CbmTrdContFact.cxx
Go to the documentation of this file.
1/* Copyright (C) 2006-2021 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Florian Uhlig, Denis Bertini [committer] */
4
5//*-- AUTHOR : Ilse Koenig
6//*-- Created : 25/10/2004
7
9//
10// CbmTrdContFact
11//
12// Factory for the parameter containers in libTrd
13//
15#include "CbmTrdContFact.h"
16
17#include "CbmMcbm2020TrdTshiftPar.h" // for CbmMcbm2020TrdTshiftPar
18#include "CbmTrdParSetAsic.h" // for CbmTrdParSetAsic
19#include "CbmTrdParSetDigi.h" // for CbmTrdParSetDigi
20#include "CbmTrdParSetGain.h" // for CbmTrdParSetGain
21#include "CbmTrdParSetGas.h" // for CbmTrdParSetGas
22#include "CbmTrdParSetGeo.h" // for CbmTrdParSetGeo
23
24#include <FairContFact.h> // for FairContainer
25#include <FairRuntimeDb.h> // for FairRuntimeDb
26#include <Logger.h> // for Logger, LOG
27
28#include <TList.h> // for TList
29#include <TString.h> // for TString
30
31#include <string.h> // for strcmp
32
34
35 static CbmTrdContFact gCbmTrdContFact;
36
38{
39 // Constructor (called when the library is loaded)
40 fName = "CbmTrdContFact";
41 fTitle = "Factory for parameter containers in libTrd";
43 FairRuntimeDb::instance()->addContFactory(this);
44}
45
47{
51 // AB
52 FairContainer* par(nullptr);
53 // ASIC parametsr
54 par = new FairContainer("CbmTrdParSetAsic", "Trd ASIC Parameters", "TestDefaultContext");
55 par->addContext("TestNonDefaultContext");
56 containers->Add(par);
57 // read-out parameters
58 par = new FairContainer("CbmTrdParSetDigi", "Trd Read-Out Parameters", "TestDefaultContext");
59 par->addContext("TestNonDefaultContext");
60 containers->Add(par);
61 // gas parameters
62 par = new FairContainer("CbmTrdParSetGas", "Trd Gas Parameters", "TestDefaultContext");
63 par->addContext("TestNonDefaultContext");
64 containers->Add(par);
65 // gain parameters
66 par = new FairContainer("CbmTrdParSetGain", "Trd Gain Parameters", "TestDefaultContext");
67 par->addContext("TestNonDefaultContext");
68 containers->Add(par);
69 // geometry parameters
70 par = new FairContainer("CbmTrdParSetGeo", "Trd Geometry Parameters", "TestDefaultContext");
71 par->addContext("TestNonDefaultContext");
72 containers->Add(par);
73
74 FairContainer* pTrd =
75 new FairContainer("CbmMcbm2020TrdTshiftPar", "TRD timeshift unpacker parameters mCbm 2020", "Default");
76 pTrd->addContext("Default");
77 containers->Add(pTrd);
78}
79
80FairParSet* CbmTrdContFact::createContainer(FairContainer* c)
81{
85 const char* name = c->GetName();
86 LOG(info) << GetName() << "::createContainer :" << name;
87
88 FairParSet* p(nullptr);
89 if (strcmp(name, "CbmTrdParSetAsic") == 0)
90 p = new CbmTrdParSetAsic(c->getConcatName().Data(), c->GetTitle(), c->getContext());
91 else if (strcmp(name, "CbmTrdParSetDigi") == 0)
92 p = new CbmTrdParSetDigi(c->getConcatName().Data(), c->GetTitle(), c->getContext());
93 else if (strcmp(name, "CbmTrdParSetGas") == 0)
94 p = new CbmTrdParSetGas(c->getConcatName().Data(), c->GetTitle(), c->getContext());
95 else if (strcmp(name, "CbmTrdParSetGain") == 0)
96 p = new CbmTrdParSetGain(c->getConcatName().Data(), c->GetTitle(), c->getContext());
97 else if (strcmp(name, "CbmTrdParSetGeo") == 0)
98 p = new CbmTrdParSetGeo(c->getConcatName().Data(), c->GetTitle(), c->getContext());
99 else if (strcmp(name, "CbmMcbm2020TrdTshiftPar") == 0) {
100 p = new CbmMcbm2020TrdTshiftPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
101 }
102
103 return p;
104}
ClassImp(CbmTrdContFact) static CbmTrdContFact gCbmTrdContFact
FairParSet * createContainer(FairContainer *)
Describe TRD module ASIC settings (electronic gain, delays, etc)
Describe TRD module working settings (HV, etc)