BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnDchContFact.cxx
Go to the documentation of this file.
1/////////////////////////////////////////////////////////////
2//
3// BmnDchContFact
4//
5// Factory for the parameter containers in libDCH
6//
7/////////////////////////////////////////////////////////////
8
9#include "BmnDchContFact.h"
10
11#include "BmnDchGeoPar.h"
12#include "FairRuntimeDb.h"
13
14#include <iomanip>
15#include <iostream>
16using namespace std;
17
19
21{
22 // Constructor (called when the library is loaded)
23 fName = "BmnDchContFact";
24 fTitle = "Factory for parameter containers in libDCH";
26 FairRuntimeDb::instance()->addContFactory(this);
27}
28
30{
31 /** Creates the Container objects with all accepted contexts and adds them to
32 * the list of containers for the Tof library.*/
33
34 FairContainer* p = new FairContainer("BmnDchGeoPar", "DCH Geometry Parameters", "TestDefaultContext");
35 p->addContext("TestNonDefaultContext");
36
37 containers->Add(p);
38}
39
41{
42 /** Calls the constructor of the corresponding parameter container.
43 * For an actual context, which is not an empty string and not the default context
44 * of this container, the name is concatinated with the context. */
45 const char* name = c->GetName();
46 // cout << " -I container name " << name << endl;
47 FairParSet* p = 0;
48 if (strcmp(name, "BmnDchGeoPar") == 0) {
49 p = new BmnDchGeoPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
50 }
51 return p;
52}
static BmnDchContFact gBmnDchContFact
FairParSet * createContainer(FairContainer *)
Definition json.hpp:4446