BOSS
7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
BesRunAction.cc
Go to the documentation of this file.
1
//---------------------------------------------------------------------------//
2
// BOOST --- BESIII Object_Oriented Simulation Tool //
3
//---------------------------------------------------------------------------//
4
//Description: class for BesRunAction (simple)
5
//Author: Liuhm
6
//Created: May 25, 2003
7
//Modified:
8
//Comment:
9
//---------------------------------------------------------------------------//
10
11
#include "
BesRunAction.hh
"
12
#include "G4Run.hh"
13
//#include "BesRunActionMessenger.hh"
14
#include "
BesAsciiIO.hh
"
15
#include "
BesRootIO.hh
"
16
#include "
BesTDSWriter.hh
"
17
#include "
BesTuningIO.hh
"
18
19
#include "
ReadBoostRoot.hh
"
20
21
BesRunAction::BesRunAction
()
22
:m_runId(0), m_MCTruthFlag(1),
23
m_asciiFlag(
""
),m_asciiFile(
""
),m_asciiIO(0),m_rootFlag(
true
),m_rootFile(
""
),m_rootIO(0),
24
m_tuningIO(0),m_TDSFlag(
false
),m_TDSWriter(0)
25
{
26
//m_runMessenger = new BesRunActionMessenger(this);
27
}
28
29
BesRunAction::~BesRunAction
()
30
{
31
//delete m_runMessenger;
32
}
33
34
void
BesRunAction::BeginOfRunAction
(
const
G4Run* aRun)
35
{
36
//set run Id, use old BES convention, -9 as default
37
//aRun->SetRunID(runNumber);
38
G4cout <<
"### Run "
<< aRun->GetRunID() <<
" start."
<< G4endl;
39
m_runId= aRun->GetRunID();
40
41
G4int
flag
[8];
42
G4int allflag=0;
43
for
(G4int i=0;i<8;i++)
44
{
45
flag
[i]=m_asciiFlag[i]-
'0'
;
46
allflag +=
flag
[i];
47
}
48
if
(allflag)
49
m_asciiIO =
new
BesAsciiIO
(
flag
[0],
flag
[1],
flag
[2],
flag
[3],
flag
[4],
flag
[5],
flag
[6],
flag
[7],m_asciiFile);
50
51
if
(m_rootFlag)
52
m_rootIO =
new
BesRootIO
(1,1,1,1,1,1,1,1,m_rootFile);
53
54
if
(m_TDSFlag)
55
m_TDSWriter =
new
BesTDSWriter
;
56
57
if
(
ReadBoostRoot::GetTuning
()){
58
std::vector<std::string>::iterator pd;
59
for
(pd = m_tuningFile.begin(); pd != m_tuningFile.end(); pd++){
60
std::cout <<
"BesRunAction tuning File: "
<< *pd << std::endl;
61
}
62
63
m_tuningIO =
new
BesTuningIO
(m_tuningFile);
64
}
65
}
66
67
68
void
BesRunAction::EndOfRunAction
(
const
G4Run* )
69
{
70
if
(m_asciiIO)
71
delete
m_asciiIO;
72
if
(m_rootIO)
73
delete
m_rootIO;
74
if
(m_TDSFlag)
75
delete
m_TDSWriter;
76
if
(m_tuningIO)
77
delete
m_tuningIO;
78
}
BesAsciiIO.hh
true
#define true
Definition:
BesCxxPolicy/BesCxxPolicy-00-01-01/CxxFeatures/config.h:19
false
#define false
Definition:
BesCxxPolicy/BesCxxPolicy-00-01-01/CxxFeatures/config.h:22
BesRootIO.hh
BesRunAction.hh
BesTDSWriter.hh
BesTuningIO.hh
flag
long int flag
Definition:
Eepipi/Eepipi-00-00-06/src/ee2eepp/basesv5.1/f2c.h:39
ReadBoostRoot.hh
BesAsciiIO
Definition:
BesAsciiIO.hh:23
BesRootIO
Definition:
BesRootIO.hh:18
BesRunAction::~BesRunAction
~BesRunAction()
Definition:
BesRunAction.cc:29
BesRunAction::BesRunAction
BesRunAction()
Definition:
BesRunAction.cc:21
BesRunAction::EndOfRunAction
void EndOfRunAction(const G4Run *)
Definition:
BesRunAction.cc:68
BesRunAction::BeginOfRunAction
void BeginOfRunAction(const G4Run *)
Definition:
BesRunAction.cc:34
BesTDSWriter
Definition:
BesTDSWriter.hh:22
BesTuningIO
Definition:
BesTuningIO.hh:27
ReadBoostRoot::GetTuning
static G4int GetTuning()
Definition:
ReadBoostRoot.hh:19
source
Simulation
BOOST
BesSim
BesSim-00-01-24
src
BesRunAction.cc
Generated by
1.9.6