BmnRoot
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
12//
13// FairPassiveContFact
14//
15// Factory for the parameter containers in libPassive
16//
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
29static FairPassiveContFact gFairPassiveContFact;
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
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";
53 FairContainer* p= new FairContainer("FairGeoPassivePar",
54 "Passive Geometry Parameters",
55 "TestDefaultContext");
56 p->addContext("TestNonDefaultContext");
57 containers->Add(p);
58
59 FairRuntimeDb::instance()->addContFactory(this);
60}
61#endif
62
63FairParSet* FairPassiveContFact::createContainer(FairContainer* c)
64{
68 const char* name = c->GetName();
69 FairParSet* p = nullptr;
70 if (strcmp(name, "FairGeoPassivePar") == 0) {
71 p = new FairGeoPassivePar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
72 }
73 return p;
74}
FairParSet * createContainer(FairContainer *)