-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathR3BSofAnaContFact.cxx
More file actions
88 lines (75 loc) · 3.09 KB
/
R3BSofAnaContFact.cxx
File metadata and controls
88 lines (75 loc) · 3.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// -------------------------------------------------------------------
// ----- R3BSofAnaContFact source file -----
// ----- Created 27/01/20 by J.L. Rodriguez-Sanchez -----
// -------------------------------------------------------------------
//
// R3BSofAnaContFact
//
// Factory for the parameter containers in libR3BSofAna
//
#include "R3BSofAnaContFact.h"
#include "R3BSofFragmentAnaPar.h"
#include "R3BSofFrsAnaPar.h"
#include "R3BSofGladFieldPar.h"
#include "R3BTGeoPar.h"
static R3BSofAnaContFact gR3BSofAnaContFact;
R3BSofAnaContFact::R3BSofAnaContFact()
{
// Constructor (called when the library is loaded)
fName = "R3BSofAnaContFact";
fTitle = "Factory for parameter containers in libR3BSofAna";
setAllContainers();
FairRuntimeDb::instance()->addContFactory(this);
}
void R3BSofAnaContFact::setAllContainers()
{
/** Creates the Container objects with all accepted contexts and adds them to
* the list of containers for the STS library.*/
FairContainer* p1 = new FairContainer("soffrsAnaPar", "FRS-S2-Cave-C Parameters", "SofFRSParContext");
p1->addContext("SofFRSParContext");
containers->Add(p1);
FairContainer* p2 =
new FairContainer("soffragmentAnaPar", "Fragment in Cave-C Parameters", "SofFragmentParContext");
p2->addContext("SofFragmentParContext");
containers->Add(p2);
FairContainer* p3 = new FairContainer("GladFieldPar", "Glad Field Parameters", "GladFieldParContext");
p3->addContext("GladFieldParContext");
containers->Add(p3);
FairContainer* p4 = new FairContainer("TargetGeoPar", "Target geometry parameters", "GeometryParameterContext");
p4->addContext("GeometryParameterContext");
containers->Add(p4);
FairContainer* p5 = new FairContainer("RoluGeoPar", "Rolu geometry parameters", "GeometryParameterContext");
p5->addContext("GeometryParameterContext");
containers->Add(p5);
}
FairParSet* R3BSofAnaContFact::createContainer(FairContainer* c)
{
/** Trails the constructor of the corresponding parameter container.
* For an actual context, which is not an empty string and not the default context
* of this container, the name is concatenated with the context. */
const char* name = c->GetName();
LOG(info) << "R3BSofAnaContFact: Create container name: " << name;
FairParSet* p = 0;
if (strcmp(name, "soffrsAnaPar") == 0)
{
p = new R3BSofFrsAnaPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
}
if (strcmp(name, "soffragmentAnaPar") == 0)
{
p = new R3BSofFragmentAnaPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
}
if (strcmp(name, "GladFieldPar") == 0)
{
p = new R3BSofGladFieldPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
}
if (strcmp(name, "TargetGeoPar") == 0)
{
p = new R3BTGeoPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
}
if (strcmp(name, "RoluGeoPar") == 0)
{
p = new R3BTGeoPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
}
return p;
}
ClassImp(R3BSofAnaContFact)