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
FairRtdbRun.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file FairRtdbRun.h
1
#ifndef FAIRRTDBRUN_H
2
#define FAIRRTDBRUN_H
3
4
#include "TNamed.h"
5
#include "TList.h"
6
#include "TString.h"
7
8
//#include <iostream>
9
//#include <iomanip>
10
#include <fstream>
11
12
class
FairParVersion
:
public
TNamed
13
{
14
protected
:
15
Int_t
inputVersions
[3];
16
Int_t
rootVersion
;
// version of the parameter container in the ROOT output file
17
public
:
18
FairParVersion
() : TNamed(),
rootVersion
(0) {}
19
FairParVersion
(Text_t*
name
);
20
~FairParVersion
() {}
21
void
setInputVersion
(Int_t
v
=-1,Int_t i=0) {
22
if
(i>=0 && i<3) {
inputVersions
[i]=
v
; }
23
}
24
Int_t
getInputVersion
(Int_t i) {
25
if
(i>=0 && i<3) {
return
inputVersions
[i]; }
26
else
{
return
-1; }
27
}
28
void
resetInputVersions
() {
29
for
(Int_t i=0; i<3; i++) {
inputVersions
[i]=-1;}
30
}
31
void
setRootVersion
(Int_t
v
) {
rootVersion
=
v
;}
32
Int_t
getRootVersion
() {
return
rootVersion
;}
33
ClassDef(
FairParVersion
,1)
// Class for parameter versions
34
};
35
36
class
FairRtdbRun
:
public
TNamed
37
{
38
protected
:
39
TList*
parVersions
;
// List of container names with the versions
40
TString
refRun
;
41
public
:
42
FairRtdbRun
();
43
FairRtdbRun
(
const
Text_t*
name
,
const
Text_t* refName=
""
);
44
FairRtdbRun
(Int_t r,Int_t
rr
=-1);
45
FairRtdbRun
(
FairRtdbRun
&
run
);
46
~FairRtdbRun
();
47
inline
Int_t
getRunId
(
void
);
48
void
addParVersion
(
FairParVersion
* pv);
49
FairParVersion
*
getParVersion
(
const
Text_t*
name
);
50
TList*
getParVersions
() {
return
parVersions
;}
51
const
Text_t*
getRefRun
() {
return
refRun
.Data();}
52
void
setRefRun
(Text_t*
s
) {
refRun
=
s
;}
53
inline
void
setRefRun
(Int_t r);
54
void
resetInputVersions
();
55
void
resetOutputVersions
();
56
void
print
();
57
void
write
(std::fstream&);
58
59
private
:
60
FairRtdbRun
&
operator=
(
const
FairRtdbRun
&);
61
62
ClassDef(
FairRtdbRun
,1)
// Class for parameter version management of a run
63
};
64
65
// -------------------- inlines ---------------------------
66
67
inline
Int_t
FairRtdbRun::getRunId
(
void
)
68
{
69
Int_t r;
70
sscanf(GetName(),
"%i"
,&r);
71
return
r;
72
}
73
74
inline
void
FairRtdbRun::setRefRun
(Int_t r)
75
{
76
if
(r==-1) {
refRun
=
""
; }
77
else
{
78
char
name
[255];
79
sprintf(name,
"%i"
,r);
80
refRun
=
name
;
81
}
82
}
83
84
#endif
/* !FAIRRTDBRUN_H */
85
EicRoot
blob
master
parbase
FairRtdbRun.h
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:37
using
1.8.2 with
EIC GitHub integration