]>
Commit | Line | Data |
---|---|---|
676fb573 | 1 | // $Id$ |
2 | // Category: geometry | |
3 | // | |
4 | // See the class description in the header file. | |
5 | ||
6 | #include "AliSingleModuleConstructionMessenger.h" | |
7 | #include "AliSingleModuleConstruction.h" | |
8 | #include "AliGlobals.h" | |
9 | ||
10 | #include <G4UIcmdWithABool.hh> | |
11 | ||
12 | AliSingleModuleConstructionMessenger::AliSingleModuleConstructionMessenger( | |
13 | AliSingleModuleConstruction* moduleConstruction, G4String moduleName) | |
14 | : fModuleConstruction(moduleConstruction) | |
15 | { | |
16 | // | |
17 | G4String dirName = "/aliDet/"; | |
18 | dirName = dirName + moduleName + "/"; | |
19 | ||
20 | G4String commandPath = dirName + "setAllSensitive"; | |
21 | fSetAllSensitiveCmd = new G4UIcmdWithABool(commandPath, this); | |
22 | G4String guidance = "If true: set all " + moduleName; | |
23 | guidance = guidance + "logical volumes sensitive.\n"; | |
24 | guidance = guidance + " (Each logical is volume associated with "; | |
25 | guidance = guidance + "a sensitive detector.)"; | |
26 | guidance = guidance + "If false: only volumes defined with a sensitive "; | |
27 | guidance = guidance + "tracking medium\n"; | |
28 | guidance = guidance + "are associated with a sensitive detector."; | |
29 | fSetAllSensitiveCmd->SetGuidance(guidance); | |
30 | fSetAllSensitiveCmd->SetParameterName("detSensitivity", false); | |
31 | fSetAllSensitiveCmd->AvailableForStates(PreInit, Init); | |
32 | } | |
33 | ||
34 | AliSingleModuleConstructionMessenger::AliSingleModuleConstructionMessenger() { | |
35 | // | |
36 | } | |
37 | ||
38 | AliSingleModuleConstructionMessenger::AliSingleModuleConstructionMessenger( | |
39 | const AliSingleModuleConstructionMessenger& right) { | |
40 | // | |
41 | AliGlobals::Exception( | |
42 | "AliSingleModuleConstructionMessenger is protected from copying."); | |
43 | } | |
44 | ||
45 | AliSingleModuleConstructionMessenger::~AliSingleModuleConstructionMessenger() { | |
46 | // | |
47 | delete fSetAllSensitiveCmd; | |
48 | } | |
49 | ||
50 | // operators | |
51 | ||
52 | AliSingleModuleConstructionMessenger& | |
53 | AliSingleModuleConstructionMessenger::operator=( | |
54 | const AliSingleModuleConstructionMessenger& right) | |
55 | { | |
56 | // check assignement to self | |
57 | if (this == &right) return *this; | |
58 | ||
59 | AliGlobals::Exception( | |
60 | "AliSingleModuleConstructionMessenger is protected from assigning."); | |
61 | ||
62 | return *this; | |
63 | } | |
64 | ||
65 | // public methods | |
66 | ||
67 | void AliSingleModuleConstructionMessenger::SetNewValue(G4UIcommand* command, | |
68 | G4String newValues) | |
69 | { | |
70 | // Applies command to the associated object. | |
71 | // --- | |
72 | ||
73 | if (command == fSetAllSensitiveCmd) { | |
74 | fModuleConstruction | |
75 | ->SetAllLVSensitive(fSetAllSensitiveCmd->GetNewBoolValue(newValues)); | |
76 | } | |
77 | } | |
78 |