GGS(GenericGEANT4Simulation)Software  2.6.0
 All Data Structures Namespaces Files Functions Variables Typedefs Macros
GGSIntHitSDMessenger.cpp
Go to the documentation of this file.
1 /*
2  * GGSIntHitSDMessenger.cpp
3  *
4  * Created on: 09/feb/2012
5  * Author: Nicola Mori
6  */
7 
10 #include "montecarlo/scoring/GGSIntHitSDMessenger.h"
11 
12 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
13 
15  _intHitSD(intHitSD) {
16 
17  // Create the directory for the commands: /GGS/scoring/<logvolname>.GGSIntHitSD.[optionstring]/
18  G4String dir("/GGS/scoring/");
19  dir.append(_intHitSD->GetName()).append("/");
20  _cmdDir = new G4UIdirectory(dir);
21 
22  _setTimeBinCmd = new G4UIcmdWithADoubleAndUnit(G4String(dir).append("setTimeBin"), this);
23  _setTimeBinCmd->SetGuidance("Set a time bin. Default unit: ns");
24  _setTimeBinCmd->SetUnitCategory("Time");
25  _setTimeBinCmd->SetDefaultUnit("ns");
26  _setTimeBinCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
27 
28  _setPosHitStorage = new G4UIcmdWithABool(G4String(dir).append("storePositionHits"), this);
29  _setPosHitStorage->SetGuidance("Enables the storage of position hits");
30  _setPosHitStorage->SetParameterName(G4String(dir).append(".storePositionHits"), true);
31  _setPosHitStorage->SetDefaultValue(true);
32  _setPosHitStorage->AvailableForStates(G4State_PreInit, G4State_Idle);
33 
34  _setPartHitStorage = new G4UIcmdWithABool(G4String(dir).append("storeParticleHits"), this);
35  _setPartHitStorage->SetGuidance("Enables the storage of particle hits");
36  _setPartHitStorage->SetParameterName(G4String(dir).append(".storeParticleHits"), true);
37  _setPartHitStorage->SetDefaultValue(true);
38  _setPartHitStorage->AvailableForStates(G4State_PreInit, G4State_Idle);
39 
40 }
41 
42 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43 
45 
46  delete _setTimeBinCmd;
47  delete _setPosHitStorage;
48  delete _setPartHitStorage;
49  delete _cmdDir;
50 }
51 
52 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
53 
54 void GGSIntHitSDMessenger::SetNewValue(G4UIcommand *command, G4String newValue) {
55 
56  if (command == _setTimeBinCmd) {
57  _intHitSD->SetTimeBin(_setTimeBinCmd->GetNewDoubleValue(newValue));
58  }
59 
60  if (command == _setPosHitStorage) {
61  _intHitSD->SetPosHitsStorage(_setPosHitStorage->GetNewBoolValue(newValue));
62  }
63 
64  if (command == _setPartHitStorage) {
65  _intHitSD->SetPartHitsStorage(_setPartHitStorage->GetNewBoolValue(newValue));
66  }
67 
68 }
69 
70 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Sensitive detector class for integrated hits.
Definition: GGSIntHitSD.h:28
GGSIntHitSDMessenger(GGSIntHitSD *intHitSD)
Constructor.
void SetTimeBin(G4double time)
Time bins setter.
Definition: GGSIntHitSD.h:70
void SetPosHitsStorage(bool store)
Turn on or off the storage (i.e. persistence) of position hits.
Definition: GGSIntHitSD.h:126
void SetPartHitsStorage(bool store)
Turn on or off the storage (i.e. persistency) of particle hits.
Definition: GGSIntHitSD.h:99
~GGSIntHitSDMessenger()
Destructor.
void SetNewValue(G4UIcommand *command, G4String newValue)
Concrete implementation of the SetNewValue methd of base class.