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
PndSensorNamePar.cxx
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PndSensorNamePar.cxx
1
#include <iostream>
2
#include "
PndSensorNamePar.h
"
3
4
PndSensorNamePar::PndSensorNamePar
(
const
char
*
name
,
const
char
*
title
,
const
char
* context)
5
:
FairParGenericSet
(name,title,context), fSensorNames()
6
{
7
clear
();
8
fSensorNames
=
new
TObjArray();
9
fSensorNames
->SetOwner(kTRUE);
10
11
}
12
13
PndSensorNamePar::PndSensorNamePar
(
const
PndSensorNamePar
&
L
)
14
{
15
fSensorNames
=
new
TObjArray(*(L.
GetSensorNames
()));
16
}
17
18
PndSensorNamePar
&
PndSensorNamePar::operator=
(
const
PndSensorNamePar
&
L
)
19
{
20
fSensorNames
=
new
TObjArray(*(L.
GetSensorNames
()));
21
return
*
this
;
22
}
23
24
void
PndSensorNamePar::putParams
(
FairParamList
*
list
)
25
{
26
if
(!list)
return
;
27
list->
addObject
(
"SensorNames"
,
fSensorNames
);
28
}
29
30
Bool_t
PndSensorNamePar::getParams
(
FairParamList
*
list
)
31
{
32
if
(!list)
return
kFALSE;
33
if
(!list->
fillObject
(
"SensorNames"
,
fSensorNames
))
return
kFALSE;
34
FillMap
();
35
return
kTRUE;
36
}
37
38
Int_t
PndSensorNamePar::AddSensorName
(TObjString*
name
)
39
{
40
if
(
SensorInList
(name) < 0) {
41
fSensorNames
->AddLast(name);
42
this->
setChanged
();
43
FairRun
*fRun =
FairRun::Instance
();
44
this->
setInputVersion
(fRun->
GetRunId
(), 1);
45
fMapOfSensorNames
[name->GetString()] =
fSensorNames
->GetEntries() - 1;
46
fMapOfSensorIndizes
[
fSensorNames
->GetEntries() - 1] = name->GetString();
47
48
return
fSensorNames
->GetEntries() - 1;
49
}
else
50
return
SensorInList
(name);
51
52
}
53
54
ClassImp
(
PndSensorNamePar
);
55
56
void
PndSensorNamePar::Print
()
57
{
58
std::cout<<
"SensorNames:"
<<std::endl;
59
std::cout<<
"Entries: "
<<
fSensorNames
->GetEntries() << std::endl;
60
// for (int i = 0; i < fSensorNames->GetEntries(); i++){
61
// TObjString* mySensName = (TObjString*)fSensorNames->At(i);
62
// std::cout << i << ": " << mySensName->GetString().Data() << std::endl;
63
// }
64
for
(std::map<Int_t, TString>::iterator iter =
fMapOfSensorIndizes
.begin(); iter !=
fMapOfSensorIndizes
.end(); iter++){
65
std::cout << iter->first <<
": "
<< iter->second.Data() << std::endl;
66
}
67
}
EicRoot
blob
master
PndTools
generalTools
PndSensorNamePar.cxx
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:37
using
1.8.2 with
EIC GitHub integration