QwGeant4
QweakSimAnalysisMessenger.cc
Go to the documentation of this file.
1 /*
2  * QweakSimAnalysisMessenger.cc
3  *
4  * Created on: May 19, 2011
5  * Author: wdconinc
6  */
7 
8 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
9 
11 
12 // user includes
13 #include "QweakSimAnalysis.hh"
15 
16 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
17 
19 : pAnalysis(analysis)
20 {
21  G4cout << "###### Calling QweakSimAnalysisMessenger::QweakSimAnalysisMessenger() " << G4endl;
22 
23  fAnalysisDir = new G4UIdirectory("/Analysis/");
24  fAnalysisDir->SetGuidance("Analysis control");
25 
26  fRootFileStemCmd = new G4UIcmdWithAString("/Analysis/RootFileStem",this);
27  fRootFileStemCmd->SetGuidance("Set stem of file with output ROOT tree");
28  fRootFileStemCmd->SetParameterName("RootFileStem",false);
29  fRootFileStemCmd->SetDefaultValue("QwSim");
30  fRootFileStemCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
31 
32  fRootFileNameCmd = new G4UIcmdWithAString("/Analysis/RootFileName",this);
33  fRootFileNameCmd->SetGuidance("Set file name of output ROOT tree");
34  fRootFileNameCmd->SetParameterName("RootFileName",false);
35  fRootFileNameCmd->SetDefaultValue("QwSim.root");
36  fRootFileNameCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
37 
38  G4cout << "###### Leaving QweakSimAnalysisMessenger::QweakSimAnalysisMessenger() " << G4endl;
39 }
40 
42 {
43  G4cout << "###### Calling QweakSimAnalysisMessenger::~QweakSimAnalysisMessenger() " << G4endl;
44 
47  if (fAnalysisDir) delete fAnalysisDir;
48 
49  G4cout << "###### Leaving QweakSimAnalysisMessenger::~QweakSimAnalysisMessenger() " << G4endl;
50 }
51 
52 void QweakSimAnalysisMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
53 {
54  if (command == fRootFileStemCmd)
55  {
56  G4cout << "#### Messenger: Setting Analysis ROOT file stem to " << newValue << G4endl;
57  pAnalysis->SetRootFileStem(newValue);
58  }
59  if (command == fRootFileNameCmd)
60  {
61  G4cout << "#### Messenger: Setting Analysis ROOT file name to " << newValue << G4endl;
62  pAnalysis->SetRootFileName(newValue);
63  }
64 }
void SetRootFileName(const G4String &name)
Handling of the output ROOT file.
void SetRootFileStem(const G4String &stem)
void SetNewValue(G4UIcommand *, G4String)