CbmRoot
CbmMuchContFact.cxx
Go to the documentation of this file.
1
10
#include "
CbmMuchContFact.h
"
11
12
#include "
CbmGeoMuchPar.h
"
// for CbmGeoMuchPar
13
14
#include <FairContFact.h>
// for FairContainer
15
#include <FairLogger.h>
// for LOG
16
#include <FairRuntimeDb.h>
// for FairRuntimeDb
17
18
#include <TList.h>
// for TList
19
#include <TString.h>
// for TString
20
21
#include <string.h>
// for strcmp
22
23
ClassImp
(
CbmMuchContFact
)
24
25
static
CbmMuchContFact
gCbmMuchContFact;
26
27
CbmMuchContFact::CbmMuchContFact
() {
28
// Constructor (called when the library is loaded)
29
fName =
"CbmMuchContFact"
;
30
fTitle =
"Factory for parameter containers in libMuch"
;
31
setAllContainers
();
32
FairRuntimeDb::instance()->addContFactory(
this
);
33
}
34
35
void
CbmMuchContFact::setAllContainers
() {
38
// FairContainer* p1= new FairContainer("CbmMuchDigiPar",
39
// "Much Digitization Parameters",
40
// "TestDefaultContext");
41
// p1->addContext("TestNonDefaultContext");
42
43
FairContainer* p2 =
new
FairContainer(
44
"CbmGeoMuchPar"
,
"Much Geometry Parameters"
,
"TestDefaultContext"
);
45
p2->addContext(
"TestNonDefaultContext"
);
46
47
// containers->Add(p1);
48
containers->Add(p2);
49
}
50
51
FairParSet*
CbmMuchContFact::createContainer
(FairContainer* c) {
55
const
char
* name = c->GetName();
56
LOG(info) <<
" -I container name "
<< name;
57
FairParSet* p = 0;
58
if
(strcmp(name,
"CbmGeoMuchPar"
) == 0) {
59
p =
new
CbmGeoMuchPar
(
60
c->getConcatName().Data(), c->GetTitle(), c->getContext());
61
}
62
return
p;
63
}
64
65
void
CbmMuchContFact::activateParIo
(FairParIo*) {
66
// activates the input/output class for the parameters
67
// needed by the MuCh
68
// if (strcmp(io->IsA()->GetName(),"FairParRootFileIo")==0) {
69
// CbmMuchParRootFileIo* p=new CbmMuchParRootFileIo(((FairParRootFileIo*)io)->getParRootFile());
70
// io->setDetParIo(p);
71
// }
72
// else if (strcmp(io->IsA()->GetName(),"FairParAsciiFileIo")==0) {
73
// CbmMuchParAsciiFileIo* p=new CbmMuchParAsciiFileIo(((FairParAsciiFileIo*)io)->getFile());
74
// io->setDetParIo(p);
75
// }
76
}
ClassImp
ClassImp(CbmMuchContFact) static CbmMuchContFact gCbmMuchContFact
CbmMuchContFact::setAllContainers
void setAllContainers()
Definition:
CbmMuchContFact.cxx:35
CbmGeoMuchPar
Definition:
CbmGeoMuchPar.h:25
CbmMuchContFact
Definition:
CbmMuchContFact.h:22
CbmMuchContFact::activateParIo
void activateParIo(FairParIo *io)
Definition:
CbmMuchContFact.cxx:65
CbmGeoMuchPar.h
CbmMuchContFact::createContainer
FairParSet * createContainer(FairContainer *)
Definition:
CbmMuchContFact.cxx:51
CbmMuchContFact::CbmMuchContFact
CbmMuchContFact()
Definition:
CbmMuchContFact.cxx:27
CbmMuchContFact.h
core
detectors
much
CbmMuchContFact.cxx
Generated on Wed Oct 28 2020 15:11:42 for CbmRoot by
1.8.18