#include <BesRunAction.hh>
Public Member Functions | |
BesRunAction () | |
~BesRunAction () | |
void | BeginOfRunAction (const G4Run *) |
void | EndOfRunAction (const G4Run *) |
G4int | GetRunId () |
G4int | GetMCTruthFlag () |
BesAsciiIO * | GetAsciiIO () |
BesRootIO * | GetRootIO () |
BesTuningIO * | GetTuningIO () |
G4bool | GetTDSFlag () |
BesTDSWriter * | GetTDSWriter () |
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) |
Private Attributes | |
G4int | m_runId |
G4int | m_MCTruthFlag |
std::string | m_asciiFlag |
std::string | m_asciiFile |
G4bool | m_rootFlag |
std::string | m_rootFile |
std::vector< std::string > | m_tuningFile |
BesAsciiIO * | m_asciiIO |
BesRootIO * | m_rootIO |
BesTuningIO * | m_tuningIO |
G4bool | m_TDSFlag |
BesTDSWriter * | m_TDSWriter |
BesRunActionMessenger * | m_runMessenger |
Definition at line 24 of file BesRunAction.hh.
BesRunAction::BesRunAction | ( | ) |
Definition at line 21 of file BesRunAction.cc.
00022 :m_runId(0), m_MCTruthFlag(1), 00023 m_asciiFlag(""),m_asciiFile(""),m_asciiIO(0),m_rootFlag(true),m_rootFile(""),m_rootIO(0), 00024 m_tuningIO(0),m_TDSFlag(false),m_TDSWriter(0) 00025 { 00026 //m_runMessenger = new BesRunActionMessenger(this); 00027 }
BesRunAction::~BesRunAction | ( | ) |
void BesRunAction::BeginOfRunAction | ( | const G4Run * | ) |
Definition at line 34 of file BesRunAction.cc.
References ReadBoostRoot::GetTuning(), genRecEmupikp::i, m_asciiFile, m_asciiFlag, m_asciiIO, m_rootFile, m_rootFlag, m_rootIO, m_runId, m_TDSFlag, m_TDSWriter, m_tuningFile, and m_tuningIO.
00035 { 00036 //set run Id, use old BES convention, -9 as default 00037 //aRun->SetRunID(runNumber); 00038 G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl; 00039 m_runId= aRun->GetRunID(); 00040 00041 G4int flag[8]; 00042 G4int allflag=0; 00043 for (G4int i=0;i<8;i++) 00044 { 00045 flag[i]=m_asciiFlag[i]-'0'; 00046 allflag += flag[i]; 00047 } 00048 if (allflag) 00049 m_asciiIO = new BesAsciiIO(flag[0],flag[1],flag[2],flag[3],flag[4],flag[5],flag[6],flag[7],m_asciiFile); 00050 00051 if (m_rootFlag) 00052 m_rootIO = new BesRootIO(1,1,1,1,1,1,1,1,m_rootFile); 00053 00054 if (m_TDSFlag) 00055 m_TDSWriter = new BesTDSWriter; 00056 00057 if (ReadBoostRoot::GetTuning()){ 00058 std::vector<std::string>::iterator pd; 00059 for (pd = m_tuningFile.begin(); pd != m_tuningFile.end(); pd++){ 00060 std::cout << "BesRunAction tuning File: " << *pd << std::endl; 00061 } 00062 00063 m_tuningIO = new BesTuningIO(m_tuningFile); 00064 } 00065 }
void BesRunAction::EndOfRunAction | ( | const G4Run * | ) |
Definition at line 68 of file BesRunAction.cc.
References m_asciiIO, m_rootIO, m_TDSFlag, m_TDSWriter, and m_tuningIO.
00069 { 00070 if (m_asciiIO) 00071 delete m_asciiIO; 00072 if (m_rootIO) 00073 delete m_rootIO; 00074 if (m_TDSFlag) 00075 delete m_TDSWriter; 00076 if (m_tuningIO) 00077 delete m_tuningIO; 00078 }
BesAsciiIO* BesRunAction::GetAsciiIO | ( | ) | [inline] |
Definition at line 36 of file BesRunAction.hh.
References m_asciiIO.
Referenced by BesEventAction::EndOfEventAction().
00036 {return m_asciiIO;}
G4int BesRunAction::GetMCTruthFlag | ( | ) | [inline] |
Definition at line 35 of file BesRunAction.hh.
References m_MCTruthFlag.
Referenced by BesEventAction::BeginOfEventAction(), BesEventAction::EndOfEventAction(), BesTrackingAction::PostUserTrackingAction(), and BesTrackingAction::PreUserTrackingAction().
00035 {return m_MCTruthFlag;}
BesRootIO* BesRunAction::GetRootIO | ( | ) | [inline] |
G4int BesRunAction::GetRunId | ( | ) | [inline] |
Definition at line 34 of file BesRunAction.hh.
References m_runId.
Referenced by BesEventAction::EndOfEventAction().
00034 {return m_runId;}
G4bool BesRunAction::GetTDSFlag | ( | ) | [inline] |
BesTDSWriter* BesRunAction::GetTDSWriter | ( | ) | [inline] |
Definition at line 41 of file BesRunAction.hh.
References m_TDSWriter.
Referenced by BesEventAction::EndOfEventAction().
00041 {return m_TDSWriter;}
BesTuningIO* BesRunAction::GetTuningIO | ( | ) | [inline] |
void BesRunAction::SetAsciiFile | ( | std::string | file | ) | [inline] |
Definition at line 56 of file BesRunAction.hh.
References m_asciiFile.
Referenced by BesSim::initialize().
00056 {m_asciiFile = file;}
void BesRunAction::SetAsciiFlag | ( | std::string | flag | ) | [inline] |
Definition at line 55 of file BesRunAction.hh.
References m_asciiFlag.
Referenced by BesSim::initialize().
00055 {m_asciiFlag = flag;}
void BesRunAction::SetMCTruthFlag | ( | G4int | flag | ) | [inline] |
Definition at line 43 of file BesRunAction.hh.
References m_MCTruthFlag.
Referenced by BesRunActionMessenger::SetNewValue().
00043 {m_MCTruthFlag = flag;}
void BesRunAction::SetRootFile | ( | std::string | file | ) | [inline] |
Definition at line 58 of file BesRunAction.hh.
References m_rootFile.
Referenced by BesSim::initialize().
00058 {m_rootFile = file;}
void BesRunAction::SetRootFlag | ( | G4bool | flag | ) | [inline] |
Definition at line 57 of file BesRunAction.hh.
References m_rootFlag.
Referenced by BesSim::initialize().
00057 {m_rootFlag = flag;}
void BesRunAction::SetTDSFlag | ( | G4bool | flag | ) | [inline] |
Definition at line 61 of file BesRunAction.hh.
References m_TDSFlag.
Referenced by BesSim::initialize().
void BesRunAction::SetTuningFile | ( | std::vector< std::string > | file | ) | [inline] |
Definition at line 59 of file BesRunAction.hh.
References m_tuningFile.
Referenced by BesSim::initialize().
00059 {m_tuningFile = file;}
std::string BesRunAction::m_asciiFile [private] |
Definition at line 78 of file BesRunAction.hh.
Referenced by BeginOfRunAction(), and SetAsciiFile().
std::string BesRunAction::m_asciiFlag [private] |
Definition at line 77 of file BesRunAction.hh.
Referenced by BeginOfRunAction(), and SetAsciiFlag().
BesAsciiIO* BesRunAction::m_asciiIO [private] |
Definition at line 83 of file BesRunAction.hh.
Referenced by BeginOfRunAction(), EndOfRunAction(), and GetAsciiIO().
G4int BesRunAction::m_MCTruthFlag [private] |
Definition at line 65 of file BesRunAction.hh.
Referenced by GetMCTruthFlag(), and SetMCTruthFlag().
std::string BesRunAction::m_rootFile [private] |
G4bool BesRunAction::m_rootFlag [private] |
BesRootIO* BesRunAction::m_rootIO [private] |
Definition at line 84 of file BesRunAction.hh.
Referenced by BeginOfRunAction(), EndOfRunAction(), and GetRootIO().
G4int BesRunAction::m_runId [private] |
Definition at line 90 of file BesRunAction.hh.
G4bool BesRunAction::m_TDSFlag [private] |
Definition at line 87 of file BesRunAction.hh.
Referenced by BeginOfRunAction(), EndOfRunAction(), GetTDSFlag(), and SetTDSFlag().
BesTDSWriter* BesRunAction::m_TDSWriter [private] |
Definition at line 88 of file BesRunAction.hh.
Referenced by BeginOfRunAction(), EndOfRunAction(), and GetTDSWriter().
std::vector<std::string> BesRunAction::m_tuningFile [private] |
Definition at line 81 of file BesRunAction.hh.
Referenced by BeginOfRunAction(), and SetTuningFile().
BesTuningIO* BesRunAction::m_tuningIO [private] |
Definition at line 85 of file BesRunAction.hh.
Referenced by BeginOfRunAction(), EndOfRunAction(), and GetTuningIO().