R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BNeulandParFact.cxx
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3 * Copyright (C) 2019-2025 Members of R3B Collaboration *
4 * *
5 * This software is distributed under the terms of the *
6 * GNU General Public Licence (GPL) version 3, *
7 * copied verbatim in the file "LICENSE". *
8 * *
9 * In applying this license GSI does not waive the privileges and immunities *
10 * granted to it by virtue of its status as an Intergovernmental Organization *
11 * or submit itself to any jurisdiction. *
12 ******************************************************************************/
13
15//
16// R3BNeulandParFact
17//
18// Factory for the parameter containers
19//
21#include "R3BNeulandParFact.h"
22#include "FairLogger.h"
23#include "FairParSet.h" // for FairParSet
24#include "FairRuntimeDb.h" // for FairRuntimeDb
25#include "R3BNeulandHitPar.h"
27#include "R3BNeulandQCalPar.h"
28#include "TList.h" // for TList
29#include "TString.h" // for TString
30
31// #include <string.h> // for strcmp, NULL
32
34
36{
37 // Constructor (called when the library is loaded)
38 fName = "R3BNeulandParFact";
39 fTitle = "Tutorial factory for parameter containers"; // TODO
40 setAllContainers();
41 FairRuntimeDb::instance()->addContFactory(this);
42}
43
44void R3BNeulandParFact::setAllContainers()
45{
48
49 FairContainer* p1 = new FairContainer("NeulandHitPar", "NeuLAND Modul Parameters", "TestDefaultContext");
50 p1->addContext("TestNonDefaultContext");
51 containers->Add(p1);
52 FairContainer* p2 = new FairContainer("NeulandQCalPar", "NeuLAND Pedestal Parameters", "TestDefaultContext");
53 p2->addContext("TestNonDefaultContext");
54 containers->Add(p2);
55 FairContainer* p3 = new FairContainer("neulandMappingPar", "Neuland Mapping parameters", "neulandMappingContext");
56 p3->addContext("neulandMappingContext");
57 containers->Add(p3);
58}
59
60FairParSet* R3BNeulandParFact::createContainer(FairContainer* c)
61{
65
66 const char* name = c->GetName();
67 LOG(info) << "R3BNeulandParFact::createContainer : " << name;
68 FairParSet* p = NULL;
69
70 if (strcmp(name, "NeulandHitPar") == 0)
71 {
72 p = new R3BNeulandHitPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
73 }
74 else if (strcmp(name, "NeulandQCalPar") == 0)
75 {
76 p = new R3BNeulandQCalPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
77 }
78 else if (strcmp(name, "neulandMappingPar") == 0)
79 {
80 p = new R3BNeulandMappingPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
81 }
82
83 return p;
84}
85
static const Double_t c
static R3BNeulandParFact gR3BNeulandParFact
ClassImp(R3BNeulandParFact)
FairParSet * createContainer(FairContainer *c)
Method to create a parameter container.
R3BNeulandParFact()
Default constructor.