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
FairAnaSelector.cxx
FairAnaSelector.h
FairBaseContFact.cxx
FairBaseContFact.h
FairBaseParSet.cxx
FairBaseParSet.h
FairDetector.cxx
FairDetector.h
FairDoubleHit.cxx
FairDoubleHit.h
FairEventHeader.cxx
FairEventHeader.h
FairField.cxx
FairField.h
FairFieldFactory.cxx
FairFieldFactory.h
FairFileHeader.cxx
FairFileHeader.h
FairFileInfo.cxx
FairFileInfo.h
FairGeaneApplication.cxx
FairGeaneApplication.h
FairGenerator.cxx
FairGenerator.h
FairGenericStack.cxx
FairGenericStack.h
FairHit.cxx
FairHit.h
FairIon.cxx
FairIon.h
FairLink.cxx
FairLink.h
FairLinkDef.h
FairMCApplication.cxx
FairMCApplication.h
FairMCEventHeader.cxx
FairMCEventHeader.h
FairMCPoint.cxx
FairMCPoint.h
FairMesh.cxx
FairMesh.h
FairModule.cxx
FairModule.h
FairMultiLinkedData.cxx
FairMultiLinkedData.h
FairParticle.cxx
FairParticle.h
FairPrimaryGenerator.cxx
FairPrimaryGenerator.h
FairRadGridManager.cxx
FairRadGridManager.h
FairRadLenManager.cxx
FairRadLenManager.h
FairRadLenPoint.cxx
FairRadLenPoint.h
FairRadMapManager.cxx
FairRadMapManager.h
FairRadMapPoint.cxx
FairRadMapPoint.h
FairRingSorter.cxx
FairRingSorter.h
FairRingSorterTask.cxx
FairRingSorterTask.h
FairRKPropagator.cxx
FairRKPropagator.h
FairRootManager.cxx
FairRootManager.h
FairRun.cxx
FairRun.h
FairRunAna.cxx
FairRunAna.h
FairRunIdGenerator.cxx
FairRunIdGenerator.h
FairRunInfo.cxx
FairRunInfo.h
FairRunSim.cxx
FairRunSim.h
FairTask.cxx
FairTask.h
FairTimeStamp.cxx
FairTimeStamp.h
FairTrackParam.cxx
FairTrackParam.h
FairTrajFilter.cxx
FairTrajFilter.h
FairTSBufferFunctional.cxx
FairTSBufferFunctional.h
FairVolume.cxx
FairVolume.h
FairVolumeList.cxx
FairVolumeList.h
FairVTrack.cxx
FairVTrack.h
FairWriteoutBuffer.cxx
FairWriteoutBuffer.h
FairWriteoutBufferAbsBasis.h
cbmbase
cbmdata
dbase
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
FairRun.cxx
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file FairRun.cxx
1
// -------------------------------------------------------------------------
2
// ----- FairRun source file -----
3
// ----- Created 06/01/04 by M. Al-Turany -----
4
// -------------------------------------------------------------------------
5
6
7
#include "
FairRun.h
"
8
#include "
FairTask.h
"
9
#include "
FairRootManager.h
"
10
#include "
FairRuntimeDb.h
"
11
#include "
FairEventHeader.h
"
12
#include "
FairFileHeader.h
"
13
#include <iostream>
14
15
bool
FairRun::mJanaPluginMode
=
false
;
16
17
//_____________________________________________________________________________
18
FairRun
*
FairRun::fRunInstance
= 0;
19
//_____________________________________________________________________________
20
FairRun
*
FairRun::Instance
()
21
{
22
return
fRunInstance
;
23
}
24
//_____________________________________________________________________________
25
FairRun::FairRun
()
26
:TNamed(),
27
fNTasks(0),
28
fLogger(
FairLogger
::GetLogger()),
29
fRtdb(
FairRuntimeDb
::instance()),
30
fTask(new
FairTask
(
"FairTaskList"
)),
31
fOutname(
""
),
32
fRootManager(new
FairRootManager
()),
33
fOutFile(0),
34
fRunId(0),
35
fAna(kFALSE),
36
fEvHead(NULL),
37
fFileHeader(new
FairFileHeader
()),
38
fWriteRunInfo(kTRUE),
39
mEvCurrent(-1)
40
{
41
if
(
fRunInstance
) {
42
Fatal(
"FairRun"
,
"Singleton instance already exists."
);
43
return
;
44
}
45
fRunInstance
=
this
;
46
fRootManager
->
SetFileHeader
(
fFileHeader
);
47
}
48
//_____________________________________________________________________________
49
FairRun::~FairRun
()
50
{
51
fLogger
->
Debug
(
MESSAGE_ORIGIN
,
" Enter Destructor of FairRun "
);
52
if
(
fTask
) {
53
delete
fTask
;
// There is another tasklist in MCApplication,
54
}
55
// but this should be independent
56
if
(
fRtdb
) {
57
delete
fRtdb
;
// who is responsible for the RuntimeDataBase
58
}
59
if
(
fRootManager
) {
60
delete
fRootManager
;
// who is responsible
61
fRootManager
=0;
62
}
63
if
(
fEvHead
) {
64
delete
fEvHead
;
65
}
66
}
67
//_____________________________________________________________________________
68
69
//_____________________________________________________________________________
70
void
FairRun::SetOutputFile
(
const
char
* fname)
71
{
72
fOutname
=fname;
73
fOutFile
=
fRootManager
->
OpenOutFile
(
fOutname
);
74
75
}
76
//_____________________________________________________________________________
77
78
//_____________________________________________________________________________
79
void
FairRun::SetOutputFile
(TFile* f)
80
{
81
fOutname
=f->GetName();
82
fRootManager
->
OpenOutFile
(f);
83
fOutFile
= f;
84
85
}
86
//_____________________________________________________________________________
87
88
//_____________________________________________________________________________
89
void
FairRun::AddTask
(
FairTask
*
t
)
90
{
91
fTask
->Add(t);
92
fNTasks
++;
93
fFileHeader
->
AddTaskClassName
(t->ClassName());
94
}
95
//_____________________________________________________________________________
96
void
FairRun::SetTask
(
FairTask
*
t
)
97
{
98
if
(
fTask
) {
delete
fTask
; }
99
fTask
=
t
;
100
fFileHeader
->
AddTaskClassName
(t->ClassName());
101
}
102
//_____________________________________________________________________________
103
void
FairRun::CreateGeometryFile
(
const
char
* geofile)
104
{
105
fRootManager
->
CreateGeometryFile
(geofile);
106
}
107
//_____________________________________________________________________________
108
FairTask
*
FairRun::GetTask
(
const
char
* taskName)
109
{
110
TList* taskList =
fTask
->GetListOfTasks();
111
TObject
* task = taskList->FindObject(taskName);
112
return
dynamic_cast<
FairTask
*
>
(task);
113
}
114
//_____________________________________________________________________________
115
FairEventHeader
*
FairRun::GetEventHeader
()
116
{
117
if
( NULL ==
fEvHead
) {
118
fEvHead
=
new
FairEventHeader
();
119
}
120
return
fEvHead
;
121
}
122
//_____________________________________________________________________________
123
ClassImp
(
FairRun
)
124
125
EicRoot
blob
master
base
FairRun.cxx
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:32
using
1.8.2 with
EIC GitHub integration