4 // See the class description in the header file.
6 #include "AliDetConstructionMessenger.h"
7 #include "AliDetConstruction.h"
8 #include "AliGlobals.h"
10 #include <G4UIcmdWithABool.hh>
12 AliDetConstructionMessenger::AliDetConstructionMessenger(
13 AliDetConstruction* detConstruction)
14 : fDetConstruction(detConstruction)
18 = new G4UIcmdWithABool("/aliDet/setAllSensitive", this);
20 ->SetGuidance("If true: set all logical volumes sensitive.");
22 ->SetGuidance(" (Each logical is volume associated with a sensitive");
24 ->SetGuidance(" detector.)");
26 ->SetGuidance("If false: only volumes defined with a sensitive tracking");
28 ->SetGuidance(" medium are associated with a sensitive detector.");
29 fSetAllSensitiveCmd->SetParameterName("sensitivity", false);
30 fSetAllSensitiveCmd->AvailableForStates(PreInit);
33 = new G4UIcmdWithABool("/aliDet/readGeometry", this);
34 fSetReadGeometryCmd->SetGuidance("Read geometry from g3calls.dat files");
35 fSetReadGeometryCmd->SetParameterName("readGeometry", false);
36 fSetReadGeometryCmd->AvailableForStates(PreInit);
39 = new G4UIcmdWithABool("/aliDet/writeGeometry", this);
40 fSetWriteGeometryCmd->SetGuidance("Write geometry to g3calls.dat file");
41 fSetWriteGeometryCmd->SetParameterName("writeGeometry", false);
42 fSetWriteGeometryCmd->AvailableForStates(PreInit);
45 AliDetConstructionMessenger::AliDetConstructionMessenger() {
49 AliDetConstructionMessenger::AliDetConstructionMessenger(
50 const AliDetConstructionMessenger& right)
53 AliGlobals::Exception(
54 "AliDetConstructionMessenger is protected from copying.");
57 AliDetConstructionMessenger::~AliDetConstructionMessenger() {
59 delete fSetAllSensitiveCmd;
60 delete fSetReadGeometryCmd;
61 delete fSetWriteGeometryCmd;
66 AliDetConstructionMessenger&
67 AliDetConstructionMessenger::operator=(const AliDetConstructionMessenger& right)
69 // check assignement to self
70 if (this == &right) return *this;
72 AliGlobals::Exception(
73 "AliDetConstructionMessenger is protected from assigning.");
80 void AliDetConstructionMessenger::SetNewValue(G4UIcommand* command, G4String newValues)
82 // Applies command to the associated object.
85 if (command == fSetAllSensitiveCmd) {
86 fDetConstruction->SetAllLVSensitive(
87 fSetAllSensitiveCmd->GetNewBoolValue(newValues));
89 else if (command == fSetReadGeometryCmd) {
90 fDetConstruction->SetReadGeometry(newValues);
92 else if (command == fSetWriteGeometryCmd) {
93 fDetConstruction->SetWriteGeometry(newValues);