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