BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
BesRunActionMessenger.cc
Go to the documentation of this file.
1//---------------------------------------------------------------------------//
2// BOOST --- BESIII Object_Oriented Simulation Tool //
3//---------------------------------------------------------------------------//
4//Description: passing parameters to event action
5//Author: Deng Ziyan
6//Created: Sep, 2004
7//Modified:
8//Comment:
9//---------------------------------------------------------------------------//
10
11#include "BesRunActionMessenger.hh"
12#include "BesRunAction.hh"
13#include "G4UIdirectory.hh"
14#include "G4UIcommand.hh"
15#include "G4UIcmdWithAnInteger.hh"
16#include "G4UIcmdWithAString.hh"
17#include "G4ios.hh"
18
20:m_runAction(runAction)
21{
22 m_runActionDirectory = new G4UIdirectory("/runAction/");
23 m_runActionDirectory->SetGuidance("BESIII run action");
24
25 //MCTruth command
26 m_MCTruthCmd = new G4UIcmdWithAnInteger("/runAction/MCTruth",this);
27 m_MCTruthCmd->SetGuidance("whether to save MC Truth information.");
28 m_MCTruthCmd->SetParameterName("MCTruthFlag",true);
29 m_MCTruthCmd->SetRange("MCTruthFlag>=0");
30 m_MCTruthCmd->SetDefaultValue(0);
31
32 //ascii I/O command
33 /*G4UIparameter* parameter;
34 G4bool omittable;
35
36 m_asciiCmd = new G4UIcommand("/runAction/ascii",this);
37 m_asciiCmd->SetGuidance("Ascii I/O in BES.");
38 m_asciiCmd->SetGuidance("mdcTruFlag, tofTruFlag, emcTruFlag, mucTruFlag,mdcDigiFlag, tofDigiFlag, emcDigiFlag, mucDigiFlag, asciiFileName");
39
40 parameter = new G4UIparameter("mdcTruFlag",'i',omittable = true);
41 parameter->SetGuidance("whether output mdc Truth information to asciiFile");
42 parameter->SetParameterRange("mdcTruFlag >= 0");
43 parameter->SetDefaultValue(1);
44 m_asciiCmd->SetParameter(parameter);
45
46 parameter = new G4UIparameter("tofTruFlag",'i',omittable = true);
47 parameter->SetGuidance("whether output tof truth information to asciiFile");
48 parameter->SetParameterRange("tofTruFlag >= 0");
49 parameter->SetDefaultValue(1);
50 m_asciiCmd->SetParameter(parameter);
51
52
53 parameter = new G4UIparameter("emcTruFlag",'i',omittable = true);
54 parameter->SetGuidance("whether output emc truth information to asciiFile");
55 parameter->SetParameterRange("emcTruFlag >= 0");
56 parameter->SetDefaultValue(1);
57 m_asciiCmd->SetParameter(parameter);
58
59 parameter = new G4UIparameter("mucTruFlag",'i',omittable = true);
60 parameter->SetGuidance("whether output muc truth information to asciiFile");
61 parameter->SetParameterRange("mucTruFlag >= 0");
62 parameter->SetDefaultValue(1);
63 m_asciiCmd->SetParameter(parameter);
64
65
66 parameter = new G4UIparameter("mdcDigiFlag",'i',omittable = true);
67 parameter->SetGuidance("whether output mdc digi information to asciiFile");
68 parameter->SetParameterRange("mdcDigiFlag >= 0");
69 parameter->SetDefaultValue(1);
70 m_asciiCmd->SetParameter(parameter);
71
72 parameter = new G4UIparameter("tofDigiFlag",'i',omittable = true);
73 parameter->SetGuidance("whether output tof digi information to asciiFile");
74 parameter->SetParameterRange("tofDigiFlag >= 0");
75 parameter->SetDefaultValue(1);
76 m_asciiCmd->SetParameter(parameter);
77
78
79 parameter = new G4UIparameter("emcDigiFlag",'i',omittable = true);
80 parameter->SetGuidance("whether output emc digi information to asciiFile");
81 parameter->SetParameterRange("emcDigiFlag >= 0");
82 parameter->SetDefaultValue(1);
83 m_asciiCmd->SetParameter(parameter);
84
85 parameter = new G4UIparameter("mucDigiFlag",'i',omittable = true);
86 parameter->SetGuidance("whether output muc digi information to asciiFile");
87 parameter->SetParameterRange("mucDigiFlag >= 0");
88 parameter->SetDefaultValue(1);
89 m_asciiCmd->SetParameter(parameter);
90
91 parameter = new G4UIparameter("asciiFileName",'s',omittable = true);
92 parameter->SetGuidance("specify the ascii file name");
93 parameter->SetDefaultValue("AsciiDmp_out.dat");
94 m_asciiCmd->SetParameter(parameter);
95 */
96
97}
98
100{
101 delete m_runActionDirectory;
102 delete m_MCTruthCmd;
103 delete m_asciiCmd;
104}
105
106void BesRunActionMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
107{
108 if( command == m_MCTruthCmd)
109 m_runAction->SetMCTruthFlag(m_MCTruthCmd->GetNewIntValue(newValue));
110
111 /*else if( command == m_asciiCmd)
112 {
113 G4int mdcTruFlag, tofTruFlag, emcTruFlag, mucTruFlag;
114 G4int mdcDigiFlag, tofDigiFlag, emcDigiFlag, mucDigiFlag;
115 G4String fileName;
116
117 std::istrstream is ((char*)newValue.data());
118 is >> mdcTruFlag >> tofTruFlag >> emcTruFlag >> mucTruFlag
119 >> mdcDigiFlag >> tofDigiFlag >> emcDigiFlag >> mucDigiFlag
120 >> fileName;
121 m_runAction->SetMdcTruFlag(mdcTruFlag);
122 m_runAction->SetTofTruFlag(tofTruFlag);
123 m_runAction->SetEmcTruFlag(emcTruFlag);
124 m_runAction->SetMucTruFlag(mucTruFlag);
125
126 m_runAction->SetMdcDigiFlag(mdcDigiFlag);
127 m_runAction->SetTofDigiFlag(tofDigiFlag);
128 m_runAction->SetEmcDigiFlag(emcDigiFlag);
129 m_runAction->SetMucDigiFlag(mucDigiFlag);
130
131 m_runAction->SetAsciiFile(fileName);
132 }*/
133}
134
135
136
137
138
139
140
141
142
143
144
145
146
147
BesRunActionMessenger(BesRunAction *runAction)
void SetNewValue(G4UIcommand *command, G4String newValues)