GGS(GenericGEANT4Simulation)Software  2.6.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 
35 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
36 
38 
39  delete _cmdDir;
40  delete _outBaseCmd;
41  delete _outTreeCmd;
42 }
43 
44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45 
46 void GGSMCTruthMessenger::SetNewValue(G4UIcommand* command, G4String newValue) {
47 
48  if (command == _outBaseCmd)
49  _action->SetOutputFileBase(newValue);
50 
51  if (command == _outTreeCmd)
52  _action->SetOutputTreeName(newValue);
53 }
54 
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.