GGS(GenericGEANT4Simulation)Software  2.7.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 
14 GGSIntHitSDMessenger::GGSIntHitSDMessenger(GGSIntHitSD *intHitSD) : _intHitSD(intHitSD) {
15 
16  // Create the directory for the commands: /GGS/scoring/<logvolname>.GGSIntHitSD.[optionstring]/
17  G4String dir("/GGS/scoring/");
18  dir.append(_intHitSD->GetName()).append("/");
19  _cmdDir = new G4UIdirectory(dir);
20 
21  _setTimeBinCmd = new G4UIcmdWithADoubleAndUnit(G4String(dir).append("setTimeBin"), this);
22  _setTimeBinCmd->SetGuidance("Set a time bin. Default unit: ns");
23  _setTimeBinCmd->SetUnitCategory("Time");
24  _setTimeBinCmd->SetDefaultUnit("ns");
25  _setTimeBinCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
26 
27  _setPosHitStorage = new G4UIcmdWithABool(G4String(dir).append("storePositionHits"), this);
28  _setPosHitStorage->SetGuidance("Enables the storage of position hits");
29  _setPosHitStorage->SetParameterName(G4String(dir).append(".storePositionHits"), true);
30  _setPosHitStorage->SetDefaultValue(true);
31  _setPosHitStorage->AvailableForStates(G4State_PreInit, G4State_Idle);
32 
33  _setPartHitStorage = new G4UIcmdWithABool(G4String(dir).append("storeParticleHits"), this);
34  _setPartHitStorage->SetGuidance("Enables the storage of particle hits");
35  _setPartHitStorage->SetParameterName(G4String(dir).append(".storeParticleHits"), true);
36  _setPartHitStorage->SetDefaultValue(true);
37  _setPartHitStorage->AvailableForStates(G4State_PreInit, G4State_Idle);
38 
39  _setTouchableIDComputer = new G4UIcmdWithAString(G4String(dir).append("setTouchableIDComputer"), this);
40  _setTouchableIDComputer->SetGuidance("Sets the class that will compute the touchable IDs");
41  _setTouchableIDComputer->AvailableForStates(G4State_PreInit, G4State_Idle);
42 }
43 
44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45 
47 
48  delete _setTimeBinCmd;
49  delete _setPosHitStorage;
50  delete _setPartHitStorage;
51  delete _cmdDir;
52 }
53 
54 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
55 
56 void GGSIntHitSDMessenger::SetNewValue(G4UIcommand *command, G4String newValue) {
57 
58  if (command == _setTimeBinCmd) {
59  _intHitSD->SetTimeBin(_setTimeBinCmd->GetNewDoubleValue(newValue));
60  }
61 
62  if (command == _setPosHitStorage) {
63  _intHitSD->SetPosHitsStorage(_setPosHitStorage->GetNewBoolValue(newValue));
64  }
65 
66  if (command == _setPartHitStorage) {
67  _intHitSD->SetPartHitsStorage(_setPartHitStorage->GetNewBoolValue(newValue));
68  }
69 
70  if (command == _setTouchableIDComputer) {
71  _intHitSD->SetTouchableIDComputer(newValue);
72  }
73 }
74 
75 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Sensitive detector class for integrated hits.
Definition: GGSIntHitSD.h:29
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:131
void SetPartHitsStorage(bool store)
Turn on or off the storage (i.e. persistency) of particle hits.
Definition: GGSIntHitSD.h:97
~GGSIntHitSDMessenger()
Destructor.
void SetNewValue(G4UIcommand *command, G4String newValue)
Concrete implementation of the SetNewValue methd of base class.
void SetTouchableIDComputer(const std::string &tidcClassName)
Sets the touchable ID computer class.