CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
BesRunAction Class Reference

#include <BesRunAction.hh>

+ Inheritance diagram for BesRunAction:

Public Member Functions

 BesRunAction ()
 
 ~BesRunAction ()
 
void BeginOfRunAction (const G4Run *)
 
void EndOfRunAction (const G4Run *)
 
G4int GetRunId ()
 
G4int GetMCTruthFlag ()
 
BesAsciiIOGetAsciiIO ()
 
BesRootIOGetRootIO ()
 
BesTuningIOGetTuningIO ()
 
G4bool GetTDSFlag ()
 
BesTDSWriterGetTDSWriter ()
 
void SetMCTruthFlag (G4int flag)
 
void SetAsciiFlag (std::string flag)
 
void SetAsciiFile (std::string file)
 
void SetRootFlag (G4bool flag)
 
void SetRootFile (std::string file)
 
void SetTuningFile (std::vector< std::string > file)
 
void SetTDSFlag (G4bool flag)
 

Detailed Description

Definition at line 24 of file BesRunAction.hh.

Constructor & Destructor Documentation

◆ BesRunAction()

BesRunAction::BesRunAction ( )

Definition at line 21 of file BesRunAction.cc.

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}

◆ ~BesRunAction()

BesRunAction::~BesRunAction ( )

Definition at line 29 of file BesRunAction.cc.

30{
31 //delete m_runMessenger;
32}

Member Function Documentation

◆ BeginOfRunAction()

void BesRunAction::BeginOfRunAction ( const G4Run * aRun)

Definition at line 34 of file BesRunAction.cc.

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[10];
42 G4int allflag=0;
43 for (G4int i=0;i<10;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],flag[8],flag[9],m_asciiFile);
50
51 if (m_rootFlag)
52 m_rootIO = new BesRootIO(1,1,1,1,1,1,1,1,1,1,m_rootFile);
53
54 if (m_TDSFlag)
55 m_TDSWriter = new BesTDSWriter;
56
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}
static G4int GetTuning()

◆ EndOfRunAction()

void BesRunAction::EndOfRunAction ( const G4Run * )

Definition at line 68 of file BesRunAction.cc.

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}

◆ GetAsciiIO()

BesAsciiIO * BesRunAction::GetAsciiIO ( )
inline

Definition at line 36 of file BesRunAction.hh.

36{return m_asciiIO;}

Referenced by BesEventAction::EndOfEventAction().

◆ GetMCTruthFlag()

G4int BesRunAction::GetMCTruthFlag ( )
inline

◆ GetRootIO()

BesRootIO * BesRunAction::GetRootIO ( )
inline

Definition at line 37 of file BesRunAction.hh.

37{return m_rootIO;}

Referenced by BesEventAction::EndOfEventAction().

◆ GetRunId()

G4int BesRunAction::GetRunId ( )
inline

Definition at line 34 of file BesRunAction.hh.

34{return m_runId;}

Referenced by BesEventAction::EndOfEventAction().

◆ GetTDSFlag()

G4bool BesRunAction::GetTDSFlag ( )
inline

Definition at line 40 of file BesRunAction.hh.

40{return m_TDSFlag;}

◆ GetTDSWriter()

BesTDSWriter * BesRunAction::GetTDSWriter ( )
inline

Definition at line 41 of file BesRunAction.hh.

41{return m_TDSWriter;}

Referenced by BesEventAction::EndOfEventAction().

◆ GetTuningIO()

BesTuningIO * BesRunAction::GetTuningIO ( )
inline

Definition at line 38 of file BesRunAction.hh.

38{return m_tuningIO;}

Referenced by BesEventAction::EndOfEventAction().

◆ SetAsciiFile()

void BesRunAction::SetAsciiFile ( std::string file)
inline

Definition at line 58 of file BesRunAction.hh.

58{m_asciiFile = file;}

Referenced by BesSim::initialize().

◆ SetAsciiFlag()

void BesRunAction::SetAsciiFlag ( std::string flag)
inline

Definition at line 57 of file BesRunAction.hh.

57{m_asciiFlag = flag;}

Referenced by BesSim::initialize().

◆ SetMCTruthFlag()

void BesRunAction::SetMCTruthFlag ( G4int flag)
inline

Definition at line 43 of file BesRunAction.hh.

43{m_MCTruthFlag = flag;}

Referenced by BesRunActionMessenger::SetNewValue().

◆ SetRootFile()

void BesRunAction::SetRootFile ( std::string file)
inline

Definition at line 60 of file BesRunAction.hh.

60{m_rootFile = file;}

Referenced by BesSim::initialize().

◆ SetRootFlag()

void BesRunAction::SetRootFlag ( G4bool flag)
inline

Definition at line 59 of file BesRunAction.hh.

59{m_rootFlag = flag;}

Referenced by BesSim::initialize().

◆ SetTDSFlag()

void BesRunAction::SetTDSFlag ( G4bool flag)
inline

Definition at line 63 of file BesRunAction.hh.

63{m_TDSFlag = flag;}

Referenced by BesSim::initialize().

◆ SetTuningFile()

void BesRunAction::SetTuningFile ( std::vector< std::string > file)
inline

Definition at line 61 of file BesRunAction.hh.

61{m_tuningFile = file;}

Referenced by BesSim::initialize().


The documentation for this class was generated from the following files: