GGS(GenericGEANT4Simulation)Software  2.7.0
 All Data Structures Namespaces Files Functions Variables Typedefs Macros
GGSMCTruthMessenger.cpp
Go to the documentation of this file.
1 /*
2  * GGSMCTruthMessenger.cpp
3  *
4  * Created on: 17 Aug 2011
5  * Author: Nicola Mori
6  */
7 
10 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
11 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
12 
16 
17 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
18 
20 
21  _cmdDir = new G4UIdirectory("/GGS/userActions/MCTruthAction/");
22  _cmdDir->SetGuidance("Commands for hadronic interaction info action.");
23 
24  _outBaseCmd = new G4UIcmdWithAString("/GGS/userActions/MCTruthAction/fileBase", this);
25  _outBaseCmd->SetGuidance("Sets the base name for ROOT output file");
26  _outBaseCmd->SetGuidance(" Can be with or without extension (.root will be used automatically)");
27  _outBaseCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
28 
29  _outTreeCmd = new G4UIcmdWithAString("/GGS/userActions/MCTruthAction/treeName", this);
30  _outTreeCmd->SetGuidance("Set the name of the TTree object in the ROOT output file.");
31  _outTreeCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
32 }
33 
34 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
35 
37 
38  delete _cmdDir;
39  delete _outBaseCmd;
40  delete _outTreeCmd;
41 }
42 
43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44 
45 void GGSMCTruthMessenger::SetNewValue(G4UIcommand *command, G4String newValue) {
46 
47  if (command == _outBaseCmd)
48  _action->SetOutputFileBase(newValue);
49 
50  if (command == _outTreeCmd)
51  _action->SetOutputTreeName(newValue);
52 }
GGSMCTruthMessenger(GGSMCTruthAction *action)
Constructor.
void SetOutputFileBase(const std::string &outFileBase)
Sets the output file base name.
void SetOutputTreeName(const std::string &outTreeName)
Sets the output tree name.
void SetNewValue(G4UIcommand *command, G4String newValue)
Override of SetNewValue method.
~GGSMCTruthMessenger()
Destructor.
Saves MC truth for each event.