BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
FairPassiveContFact.cxx
Go to the documentation of this file.
1/********************************************************************************
2 * Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3 * *
4 * This software is distributed under the terms of the *
5 * GNU Lesser General Public Licence (LGPL) version 3, *
6 * copied verbatim in the file "LICENSE" *
7 ********************************************************************************/
8//*-- AUTHOR : Denis Bertini
9//*-- Created : 21/06/2005
10
11/////////////////////////////////////////////////////////////
12//
13// FairPassiveContFact
14//
15// Factory for the parameter containers in libPassive
16//
17/////////////////////////////////////////////////////////////
18#include "FairPassiveContFact.h"
19
20#include "FairGeoPassivePar.h" // for FairGeoPassivePar
21#include "FairRuntimeDb.h"
22
23#include <TList.h> // for TList
24#include <TString.h> // for TString
25#include <string.h> // for strcmp
26
27class FairParSet;
28
30
31#ifdef FairRoot_18_8_0
33 : FairContFact("FairPassiveContFact", "Factory for parameter containers in libPassive")
34{
35 // Constructor (called when the library is loaded)
36
37 /** Creates the Container objects with all accepted contexts and adds them to
38 * the list of containers for the STS library.*/
39
40 auto p = new FairContainer("FairGeoPassivePar", "Passive Geometry Parameters", "TestDefaultContext");
41 AddContainer(p);
42}
43#else
45 : FairContFact()
46{
47 // Constructor (called when the library is loaded)
48 fName = "FairPassiveContFact";
49 fTitle = "Factory for parameter containers in libPassive";
50 /** Creates the Container objects with all accepted contexts and adds them to
51 * the list of containers for the STS library.*/
52
53 FairContainer* p = new FairContainer("FairGeoPassivePar", "Passive Geometry Parameters", "TestDefaultContext");
54 p->addContext("TestNonDefaultContext");
55 containers->Add(p);
56
57 FairRuntimeDb::instance()->addContFactory(this);
58}
59#endif
60
62{
63 /** Calls the constructor of the corresponding parameter container.
64 * For an actual context, which is not an empty string and not the default context
65 * of this container, the name is concatinated with the context. */
66 const char* name = c->GetName();
67 FairParSet* p = nullptr;
68 if (strcmp(name, "FairGeoPassivePar") == 0) {
69 p = new FairGeoPassivePar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
70 }
71 return p;
72}
static FairPassiveContFact gFairPassiveContFact
FairParSet * createContainer(FairContainer *)