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
EIC Software
Deprecated List
Modules
Namespaces
Classes
Files
File List
acts
BeastMagneticField
delphes_EIC
Doxygen_Assist
east
eic-smear
EicRoot
blob
master
base
cbmbase
cbmdata
dbase
dbInterface
dbUtils
dbValidation
Detector.cxx
Detector.h
Experiment.cxx
Experiment.h
SimFlag.cxx
SimFlag.h
ValContext.cxx
ValContext.h
ValRange.cxx
ValRange.h
ValTimeStamp.cxx
ValTimeStamp.h
ValValidate.cxx
ValValidate.h
FairDBLinkDef.h
eic
eventdisplay
examples
fairtools
field
gconfig
geane
genfit
GenfitTools
geobase
geometry
input
littrack
parbase
passive
pCDR-2018
pid
pnddata
PndTools
rich
trackbase
eicsmear-jetexample
eicsmeardetectors
EicToyModel
estarlight
Fun4All-lmon
fun4all_coresoftware
fun4all_eic_qa
fun4all_eic_tutorials
fun4all_eicdetectors
fun4all_eicmacros
fun4all_g4jleic
fun4all_GenFit
fun4all_macros
fun4all_tutorials
g4exampledetector
g4lblvtx
online_distribution
PEPSI
doxygen_mainpage.h
File Members
External Links
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
ValContext.cxx
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file ValContext.cxx
1
#include "
ValContext.h
"
2
3
4
ClassImp
(
ValContext
)
5
6
7
ValContext
::
ValContext
()
8
: fDetector(Detector::
kUnknown
),
9
fSimFlag(SimFlag::kUnknown),
10
fTimeStamp()
11
{
12
// Default constructor (unknown experiment, simflag, timestamp=now)
13
}
14
15
ValContext::~ValContext
() { ; }
16
17
18
19
20
//_____________________________________________________________________________
21
std::ostream&
operator<<
(std::ostream& os,
const
ValContext
& vldc)
22
{
23
if
(os.good()) {
24
if
(os.tie()) { os.tie()->flush(); }
// instead of opfx
25
os << vldc.
AsString
();
26
}
27
// instead of os.osfx()
28
if
(os.flags() & std::ios::unitbuf) { os.flush(); }
29
return
os;
30
}
31
32
//_____________________________________________________________________________
33
ValContext::ValContext
(
const
Detector::Detector_t
& detector,
34
const
SimFlag::SimFlag_t
mcFlag,
35
const
ValTimeStamp
& tstamp)
36
:
TObject
(),
37
fDetector(detector),
38
fSimFlag(mcFlag),
39
fTimeStamp(tstamp)
40
{
41
// normal constructor
42
}
43
44
//_____________________________________________________________________________
45
const
char
*
ValContext::AsString
(Option_t* option)
const
46
{
47
// Return a formatted string of the contents of this object
48
// User should copy result because it points to a
49
// statically allocated string.
50
51
static
char
newstring[80] =
" "
;
52
53
switch
(option[0]) {
54
case
'c'
:
55
case
'C'
:
56
sprintf(newstring,
"{%c%c %s}"
,
57
Detector::AsString
(
GetDetector
())[0],
58
SimFlag::AsString
(
GetSimFlag
())[0],
59
fTimeStamp
.
AsString
(
"c"
));
60
break
;
61
default
:
62
sprintf(newstring,
"{%6.6s|%6.6s|%s}"
,
63
Detector::AsString
(
GetDetector
()),
64
SimFlag::AsString
(
GetSimFlag
()),
65
fTimeStamp
.
AsString
(
"c"
));
66
}
67
68
return
newstring;
69
}
70
71
//_____________________________________________________________________________
72
void
ValContext::Print
(Option_t* option)
const
73
{
74
printf
(
"%s\n"
,
AsString
(option));
75
}
76
77
//_____________________________________________________________________________
78
Bool_t
ValContext::IsNull
()
const
79
{
80
// Return true if this was initialized by default ctor
81
// we can only test detector type and simflag
82
return
fDetector
==
Detector::kUnknown
&&
fSimFlag
==
SimFlag::kUnknown
;
83
84
}
85
86
//_____________________________________________________________________________
87
EicRoot
blob
master
dbase
dbValidation
ValContext.cxx
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:33
using
1.8.2 with
EIC GitHub integration