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
FairParamList.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file FairParamList.h
1
#ifndef FAIRPARAMLIST_H
2
#define FAIRPARAMLIST_H
3
4
#include "TNamed.h"
5
#include "TString.h"
6
#include "TArrayI.h"
7
#include "TArrayC.h"
8
#include "TArrayF.h"
9
#include "TArrayD.h"
10
#include "TList.h"
11
#include "TFile.h"
12
#include "TROOT.h"
13
14
class
FairLogger
;
15
16
class
FairParamObj
:
public
TNamed
17
{
18
protected
:
19
UChar_t*
paramValue
;
// Pointer to binary array
20
Int_t
arraySize
;
// Size of binary array
21
TString
paramType
;
// Type of parameter value or class name
22
Bool_t
basicType
;
// kTRUE for C-types and C-type parameter arrays, kFALSE for classes
23
Int_t
bytesPerValue
;
// number of bytes per value
24
Int_t
classVersion
;
// Code version of classes stored as binary
25
UChar_t*
streamerInfo
;
// Pointer to binary array container the streamer info
26
Int_t
streamerInfoSize
;
// Size of streamer info array
27
public
:
28
FairParamObj
(
const
Text_t*
name
=
""
);
29
FairParamObj
(
FairParamObj
&);
30
FairParamObj
(
const
Text_t*,Int_t);
31
FairParamObj
(
const
Text_t*,Float_t);
32
FairParamObj
(
const
Text_t*,Double_t);
33
FairParamObj
(
const
Text_t*,
const
Int_t*,
const
Int_t);
34
FairParamObj
(
const
Text_t*,
const
Float_t*,
const
Int_t);
35
FairParamObj
(
const
Text_t*,
const
Double_t*,
const
Int_t);
36
FairParamObj
(
const
Text_t*,
const
Text_t*);
37
FairParamObj
(
const
Text_t*,
const
Char_t*,
const
Int_t);
38
FairParamObj
(
const
Text_t*,
const
UChar_t*,
const
Int_t);
39
~FairParamObj
();
40
void
setParamType
(
const
Text_t*
t
);
41
UChar_t*
setLength
(Int_t l);
42
void
setParamValue
(UChar_t*,
const
Int_t);
43
void
setClassVersion
(
const
Int_t
v
) {
classVersion
=
v
; }
44
UChar_t*
setStreamerInfoSize
(Int_t);
45
void
setStreamerInfo
(UChar_t*,
const
Int_t);
46
UChar_t*
getParamValue
() {
return
paramValue
; }
47
Bool_t
isBasicType
() {
return
basicType
; }
48
const
char
*
getParamType
() {
return
paramType
.Data(); }
49
Int_t
getBytesPerValue
() {
return
bytesPerValue
; }
50
Int_t
getClassVersion
() {
return
classVersion
; }
51
Int_t
getLength
() {
return
arraySize
; }
52
Int_t
getNumParams
();
53
UChar_t*
getStreamerInfo
() {
return
streamerInfo
; }
54
Int_t
getStreamerInfoSize
() {
return
streamerInfoSize
; }
55
void
print
();
56
protected
:
57
template
<
class
type>
void
printData
(type*,Int_t);
58
59
private
:
60
FairParamObj
&
operator=
(
const
FairParamObj
&);
61
62
ClassDef(
FairParamObj
,0)
// Class for binary parameter object (name + binary array)
63
};
64
65
66
class
FairParamList
:
public
TObject
67
{
68
protected
:
69
TList*
paramList
;
// List for parameters stored as string
70
FairLogger
*
fLogger
;
// FairRoot logging mechanism
71
class
FairParamTFile
:
public
TFile
72
{
73
public
:
74
FairParamTFile
() {
75
// Create StreamerInfo index
76
Int_t lenIndex = gROOT->GetListOfStreamerInfo()->GetSize()+1;
77
if
(lenIndex < 5000) { lenIndex = 5000; }
78
fClassIndex =
new
TArrayC(lenIndex);
79
}
80
~FairParamTFile
() {
81
delete
fClassIndex;
82
fClassIndex=0;
83
}
84
};
85
public
:
86
FairParamList
();
87
~FairParamList
();
88
void
add
(
FairParamObj
&);
89
void
add
(
const
Text_t*,
const
Text_t*);
90
void
add
(
const
Text_t*,Int_t);
91
void
add
(
const
Text_t*,Float_t);
92
void
add
(
const
Text_t*,Double_t);
93
void
add
(
const
Text_t*,TArrayI&);
94
void
add
(
const
Text_t*,TArrayC&);
95
void
add
(
const
Text_t*,TArrayF&);
96
void
add
(
const
Text_t*,TArrayD&);
97
void
add
(
const
Text_t*,
const
UChar_t*,
const
Int_t);
98
void
add
(
const
Text_t*,
const
Int_t*,
const
Int_t);
99
void
add
(
const
Text_t*,
const
Float_t*,
const
Int_t);
100
void
add
(
const
Text_t*,
const
Double_t*,
const
Int_t);
101
void
addObject
(
const
Text_t*,
TObject
*);
102
Bool_t
fill
(
const
Text_t*,Text_t*,
const
Int_t);
103
Bool_t
fill
(
const
Text_t*,Int_t*,
const
Int_t nValues=1);
104
Bool_t
fill
(
const
Text_t*,Float_t*,
const
Int_t nValues=1);
105
Bool_t
fill
(
const
Text_t*,Double_t*,
const
Int_t nValues=1);
106
Bool_t
fill
(
const
Text_t*,UChar_t*,
const
Int_t nValues=1);
107
Bool_t
fill
(
const
Text_t*,TArrayI*);
108
Bool_t
fill
(
const
Text_t*,TArrayC*);
109
Bool_t
fill
(
const
Text_t*,TArrayF*);
110
Bool_t
fill
(
const
Text_t*,TArrayD*);
111
Bool_t
fillObject
(
const
Text_t*,
TObject
*);
112
Int_t
replace
(
const
Text_t*,UChar_t*);
113
Int_t
replace
(
const
Text_t*,Int_t*);
114
Int_t
replace
(
const
Text_t*,Float_t*);
115
Int_t
replace
(
const
Text_t*,Double_t*);
116
void
print
();
117
FairParamObj
*
find
(
const
Text_t*
name
) {
118
return
(
FairParamObj
*)
paramList
->FindObject(name);
119
}
120
TList*
getList
() {
return
paramList
; }
121
private
:
122
FairParamList
(
const
FairParamList
&);
123
FairParamList
&
operator=
(
const
FairParamList
&);
124
125
ClassDef(
FairParamList
,2)
// Class for lists of parameters (of type FairParamObj)
126
};
127
128
#endif
/* !FAIRPARAMLIST_H */
129
EicRoot
blob
master
parbase
FairParamList.h
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:36
using
1.8.2 with
EIC GitHub integration