R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BPassiveContFact.cxx
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) 2009 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3 * Copyright (C) 2009-2026 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
14#include "R3BPassiveContFact.h"
15#include "R3BGeoPassivePar.h"
16#include "R3BLogger.h"
17#include "R3BTGeoPar.h"
18
19#include <TClass.h>
20
22
24{
25 // Constructor (called when the library is loaded)
26 fName = "R3BPassiveContFact";
27 fTitle = "Factory for parameter containers in libR3BPassive";
29 FairRuntimeDb::instance()->addContFactory(this);
30}
31
33{
34 auto p1 = new FairContainer("R3BGeoPassivePar", "Passive Geometry Parameters", "TestDefaultContext");
35 p1->addContext("TestNonDefaultContext");
36 containers->Add(p1);
37
38 auto p2 = new FairContainer("TargetGeoPar", "Target geometry parameters", "GeometryParameterContext");
39 p2->addContext("GeometryParameterContext");
40 containers->Add(p2);
41}
42
43FairParSet* R3BPassiveContFact::createContainer(FairContainer* c)
44{
45 const std::string name(c->GetName());
46 R3BLOG(info, "Create container name: " << name.c_str());
47
48 FairParSet* p = nullptr;
49 if (name == "R3BGeoPassivePar")
50 {
51 p = new R3BGeoPassivePar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
52 }
53 else if (name == "TargetGeoPar")
54 {
55 p = new R3BTGeoPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
56 }
57 return p;
58}
59
#define R3BLOG(severity, x)
Definition R3BLogger.h:33
ClassImp(R3B::Neuland::Cal2HitPar)
static R3BPassiveContFact gR3BPassiveContFact
FairParSet * createContainer(FairContainer *) override