CbmRoot
Loading...
Searching...
No Matches
CbmTofContFact.cxx
Go to the documentation of this file.
1/* Copyright (C) 2020-2021 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Florian Uhlig [committer] */
4
5//*-- AUTHOR : Ilse Koenig
6//*-- Created : 25/10/2004
7
9//
10// CbmTofContFact
11//
12// Factory for the parameter containers in libTof
13//
15#include "CbmTofContFact.h"
16
17#include "CbmMcbm2018TofPar.h" // for CbmMcbm2018TofPar
18#include "CbmTofDigiBdfPar.h" // for CbmTofDigiBdfPar
19#include "CbmTofDigiPar.h" // for CbmTofDigiPar
20
21#include <FairContFact.h> // for FairContainer
22#include <FairRuntimeDb.h> // for FairRuntimeDb
23#include <Logger.h> // for LOG
24
25#include <TList.h> // for TList
26#include <TString.h> // for TString
27
28#include <string.h> // for strcmp
29
31
32 static CbmTofContFact gCbmTofContFact;
33
35{
36 // Constructor (called when the library is loaded)
37 fName = "CbmTofContFact";
38 fTitle = "Factory for parameter containers in libTof";
40 FairRuntimeDb::instance()->addContFactory(this);
41}
42
44{
48 FairContainer* p1 = new FairContainer("CbmTofDigiPar", "TOF Digitization parameters", "TestDefaultContext");
49 p1->addContext("TestNonDefaultContext");
50
51 containers->Add(p1);
52
53 FairContainer* p2 = new FairContainer("CbmTofDigiBdfPar", "TOF BDF Digitization parameters", "TestDefaultContext");
54 p2->addContext("TestNonDefaultContext");
55
56 containers->Add(p2);
57
58 FairContainer* beamPars = new FairContainer("CbmMcbm2018TofPar", "TOF at MCBM 2018 Unpack Parameters", "Default");
59 beamPars->addContext("Default");
60 containers->Add(beamPars);
61
62 FairContainer* beamParsBmon = new FairContainer(
63 "CbmMcbm2018BmonPar", "BMon at MCBM 2022+ Unpack Parameters, interim for dual instances", "Default");
64 beamParsBmon->addContext("Default");
65 containers->Add(beamParsBmon);
66}
67
68FairParSet* CbmTofContFact::createContainer(FairContainer* c)
69{
73 const char* name = c->GetName();
74 LOG(info) << "container name " << name;
75 FairParSet* p = nullptr;
76 if (strcmp(name, "CbmTofDigiPar") == 0) {
77 p = new CbmTofDigiPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
78 }
79 else if (strcmp(name, "CbmTofDigiBdfPar") == 0) {
80 p = new CbmTofDigiBdfPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
81 }
82 else if (strcmp(name, "CbmMcbm2018TofPar") == 0) {
83 p = new CbmMcbm2018TofPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
84 }
85 else if (strcmp(name, "CbmMcbm2018BmonPar") == 0) {
86 p = new CbmMcbm2018BmonPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
87 }
88
89 return p;
90}
ClassImp(CbmTofContFact) static CbmTofContFact gCbmTofContFact
FairParSet * createContainer(FairContainer *)
Parameters class for the CBM ToF digitizer using beam data distributions.