EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
PndSensorNameContFact.cxx
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PndSensorNameContFact.cxx
1
2
//
3
// PndSensorNameContFact
4
//
5
// Factory for the parameter containers in libPndMvd
6
//
8
9
//using namespace std;
10
#include "
PndSensorNameContFact.h
"
11
#include "
FairRuntimeDb.h
"
12
#include "
PndSensorNamePar.h
"
13
#include "
FairParRootFileIo.h
"
14
#include "
FairParAsciiFileIo.h
"
15
#include "TList.h"
16
#include "TObjString.h"
17
#include <iostream>
18
#include <iomanip>
19
20
ClassImp
(
PndSensorNameContFact
);
21
22
static
PndSensorNameContFact
gPndSensorNameContFact
;
23
24
PndSensorNameContFact::PndSensorNameContFact
(): fSensorParNames(), fContainerNames() {
25
// Constructor (called when the library is loaded)
26
fName=
"PndSensorNameContFact"
;
27
fTitle=
"Factory for parameter containers of the PndGeoHandler"
;
28
fSensorParNames
=
new
TList();
29
fContainerNames
.push_back(
"PndSensorNamePar"
);
30
setAllContainers
();
31
FairRuntimeDb::instance
()->
addContFactory
(
this
);
32
}
33
PndSensorNameContFact::~PndSensorNameContFact
(){
34
if
(0!=
fSensorParNames
)
35
{
36
fSensorParNames
->Delete();
37
delete
fSensorParNames
;
38
}
39
}
40
41
42
void
PndSensorNameContFact::setAllContainers
() {
45
for
(
unsigned
int
i = 0; i <
fContainerNames
.size(); i++){
46
std::string description =
"Match between GeoManager path and SensorId"
;
47
FairContainer
*
p
=
new
FairContainer
(
fContainerNames
[i].c_str(), description.c_str(),
"TestDefaultContext"
);
48
fSensorParNames
->Add(
new
TObjString(p->
getConcatName
()));
49
containers
->Add(p);
50
}
51
}
52
53
FairParSet
*
PndSensorNameContFact::createContainer
(
FairContainer
*
c
) {
57
const
char
*
name
=c->GetName();
58
FairParSet
*
p
=NULL;
59
60
for
(
unsigned
int
i = 0; i <
fContainerNames
.size(); i++){
61
if
(strcmp(name,
fContainerNames
[i].c_str())==0) {
62
p=
new
PndSensorNamePar
(c->
getConcatName
().Data(),c->GetTitle(),c->
getContext
());
63
return
p
;
64
}
65
}
66
return
p
;
67
}
EicRoot
blob
master
PndTools
generalTools
PndSensorNameContFact.cxx
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:37
using
1.8.2 with
EIC GitHub integration