CbmRoot
Loading...
Searching...
No Matches
CbmStsContFact.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: Denis Bertini [committer], Volker Friese, Florian Uhlig */
4
9#include "CbmStsContFact.h"
10
11#include "CbmMcbm2018StsPar.h" // for CbmMcbm2018StsPar
12#include "CbmStsParSetModule.h" // for CbmStsParSetModule
13#include "CbmStsParSetSensor.h" // for CbmStsParSetSensor
14#include "CbmStsParSetSensorCond.h" // for CbmStsParSetSensorCond
15#include "CbmStsParSim.h" // for CbmStsParSim
16
17#include <FairParSet.h> // for FairParSet
18#include <FairRuntimeDb.h> // for FairRuntimeDb
19#include <Logger.h> // for Logger, LOG
20
21#include <TList.h> // for TList
22#include <TString.h> // for TString
23
24#include <string.h> // for strcmp
25
27
28 static CbmStsContFact gCbmStsContFact;
29
30
31// ----- Constructor ----------------------------------------------------
33{
34 SetName("CbmStsContFact");
35 SetTitle("STS parameter container factory");
37 FairRuntimeDb::instance()->addContFactory(this);
38}
39// --------------------------------------------------------------------------
40
41
42// ----- Create a parameter set -----------------------------------------
43FairParSet* CbmStsContFact::createContainer(FairContainer* container)
44{
45
46 const char* contName = container->GetName();
47 FairParSet* parSet = nullptr;
48
49 // --- Simulation settings
50 if (strcmp(contName, "CbmStsParSim") == 0) {
51 parSet = new CbmStsParSim(container->getConcatName().Data(), container->GetTitle(), container->getContext());
52 }
53
54 // --- Module parameters
55 else if (strcmp(contName, "CbmStsParSetModule") == 0) {
56 parSet = new CbmStsParSetModule(container->getConcatName().Data(), container->GetTitle(), container->getContext());
57 }
58
59 // --- Sensor parameters
60 else if (strcmp(contName, "CbmStsParSetSensor") == 0) {
61 LOG(info) << "createContainer " << container->getConcatName().Data() << " " << container->GetTitle() << " "
62 << container->getContext();
63 parSet = new CbmStsParSetSensor(container->getConcatName().Data(), container->GetTitle(), container->getContext());
64 LOG(info) << "Done";
65 }
66
67 // --- Sensor conditions
68 else if (strcmp(contName, "CbmStsParSetSensorCond") == 0) {
69 parSet =
70 new CbmStsParSetSensorCond(container->getConcatName().Data(), container->GetTitle(), container->getContext());
71 }
72
73 // --- Beamtime parameters
74 else if (strcmp(contName, "CbmMcbm2018StsPar") == 0) {
75 parSet = new CbmMcbm2018StsPar(container->getConcatName().Data(), container->GetTitle(), container->getContext());
76 }
77
78 LOG(info) << GetName() << ": Create container " << contName << " with parameter set " << parSet->GetName();
79 return parSet;
80}
81// --------------------------------------------------------------------------
82
83
84// ---- Define containers and contexts ----------------------------------
86{
87
88 // --- Simulation settings
89 FairContainer* simPars = new FairContainer("CbmStsParSim", "STS simulation settings", "Default");
90 simPars->addContext("Default");
91 containers->Add(simPars);
92
93 // --- Module parameters
94 FairContainer* modulePars = new FairContainer("CbmStsParSetModule", "STS module parameters", "Default");
95 modulePars->addContext("Default");
96 containers->Add(modulePars);
97
98 // --- Sensor parameters
99 FairContainer* sensorPars = new FairContainer("CbmStsParSetSensor", "STS sensor parameters", "Default");
100 sensorPars->addContext("Default");
101 containers->Add(sensorPars);
102
103 // --- Sensor conditions
104 FairContainer* sensorCond = new FairContainer("CbmStsParSetSensorCond", "STS sensor conditions", "Default");
105 sensorCond->addContext("Default");
106 containers->Add(sensorCond);
107
108 // Beamtime parameters
109 FairContainer* beamPars = new FairContainer("CbmMcbm2018StsPar", "STS at MCBM 2018 Unpack Parameters", "Default");
110 beamPars->addContext("Default");
111 containers->Add(beamPars);
112}
113// --------------------------------------------------------------------------
ClassImp(CbmStsContFact) static CbmStsContFact gCbmStsContFact
Factory class for STS parameter container.
FairParSet * createContainer(FairContainer *)
Create a parameter set.
void setAllContainers()
Define parameter containers and their contexts.
CbmStsContFact()
Constructor.
Parameters container for CbmStsParModule.
Parameters container for CbmStsParSensorCond.
Parameters container for CbmStsParSensor.
Settings for STS simulation (digitizer)