|
1 | 1 | #include "WCSimDarkRateMessenger.hh" |
2 | | -#include "WCSimWCDigitizer.hh" |
3 | 2 | #include "WCSimWCAddDarkNoise.hh" |
4 | 3 |
|
5 | 4 | #include "G4UIdirectory.hh" |
|
8 | 7 | #include "G4UIcmdWithADouble.hh" |
9 | 8 | #include "G4UIcmdWithAnInteger.hh" |
10 | 9 |
|
11 | | -WCSimDarkRateMessenger::WCSimDarkRateMessenger(WCSimWCDigitizer* darkratepoint) |
12 | | - : WCSimDigitize(darkratepoint) |
13 | | -{ |
14 | | - //inform the DarkRateMessenger which constructor was called |
15 | | - constructor = 0; |
16 | | - |
17 | | - Initialize(); |
18 | | -} |
19 | | - |
20 | 10 | WCSimDarkRateMessenger::WCSimDarkRateMessenger(WCSimWCAddDarkNoise* darkratepoint) |
21 | 11 | : WCSimAddDarkNoise(darkratepoint) |
22 | 12 | { |
23 | | - //inform the DarkRateMessenger which constructor was called |
24 | | - constructor = 1; |
25 | | - |
26 | 13 | Initialize(); |
27 | 14 | } |
28 | 15 |
|
@@ -110,56 +97,34 @@ void WCSimDarkRateMessenger::SetNewValue(G4UIcommand* command,G4String newValue) |
110 | 97 | // Since kHz is 10e-3 for this class we must multiply by a 10e6 factor |
111 | 98 | // to make default units in kHz |
112 | 99 | double const conversion_to_kHz = 1000000; |
113 | | - if(constructor == 0) |
114 | | - WCSimDigitize->SetDarkRate(conversion_to_kHz * SetFrequency->GetNewDoubleValue(newValue)); |
115 | | - else if(constructor == 1) |
116 | | - WCSimAddDarkNoise->SetDarkRate(conversion_to_kHz * SetFrequency->GetNewDoubleValue(newValue)); |
| 100 | + WCSimAddDarkNoise->SetDarkRate(conversion_to_kHz * SetFrequency->GetNewDoubleValue(newValue)); |
117 | 101 | G4cout << "Setting Dark Rate " << conversion_to_kHz * SetFrequency->GetNewDoubleValue(newValue) |
118 | 102 | << initaliseString.c_str() << G4endl; |
119 | 103 | } |
120 | 104 | else if(command == SetConversionRate){ |
121 | | - if(constructor == 0) |
122 | | - WCSimDigitize->SetConversion(SetConversionRate->GetNewDoubleValue(newValue)); |
123 | | - else if(constructor == 1) |
124 | | - WCSimAddDarkNoise->SetConversion(SetConversionRate->GetNewDoubleValue(newValue)); |
| 105 | + WCSimAddDarkNoise->SetConversion(SetConversionRate->GetNewDoubleValue(newValue)); |
125 | 106 | G4cout << "Setting Dark Rate Conversion value " << SetConversionRate->GetNewDoubleValue(newValue) |
126 | 107 | << initaliseString.c_str() << G4endl; |
127 | 108 | } |
128 | 109 | else if(command == SetDarkMode){ |
129 | | - if(constructor == 0){ |
130 | | - } |
131 | | - else if(constructor == 1) { |
132 | | - WCSimAddDarkNoise->SetDarkMode(SetDarkMode->GetNewIntValue(newValue)); |
133 | | - G4cout << "Setting DarkMode value " << SetDarkMode->GetNewIntValue(newValue) |
134 | | - << initaliseString.c_str() << G4endl; |
135 | | - } |
| 110 | + WCSimAddDarkNoise->SetDarkMode(SetDarkMode->GetNewIntValue(newValue)); |
| 111 | + G4cout << "Setting DarkMode value " << SetDarkMode->GetNewIntValue(newValue) |
| 112 | + << initaliseString.c_str() << G4endl; |
136 | 113 | } |
137 | 114 | else if(command == SetDarkLow){ |
138 | | - if(constructor == 0){ |
139 | | - } |
140 | | - else if(constructor == 1) { |
141 | | - WCSimAddDarkNoise->SetDarkLow(SetDarkLow->GetNewDoubleValue(newValue)); |
142 | | - G4cout << "Setting DarkLow value " << SetDarkLow->GetNewDoubleValue(newValue) |
143 | | - << initaliseString.c_str() << G4endl; |
144 | | - } |
| 115 | + WCSimAddDarkNoise->SetDarkLow(SetDarkLow->GetNewDoubleValue(newValue)); |
| 116 | + G4cout << "Setting DarkLow value " << SetDarkLow->GetNewDoubleValue(newValue) |
| 117 | + << initaliseString.c_str() << G4endl; |
145 | 118 | } |
146 | 119 | else if(command == SetDarkHigh){ |
147 | | - if(constructor == 0) { |
148 | | - } |
149 | | - else if(constructor == 1) { |
150 | | - WCSimAddDarkNoise->SetDarkHigh(SetDarkHigh->GetNewDoubleValue(newValue)); |
151 | | - G4cout << "Setting DarkHigh value " << SetDarkHigh->GetNewDoubleValue(newValue) |
152 | | - << initaliseString.c_str() << G4endl; |
153 | | - } |
| 120 | + WCSimAddDarkNoise->SetDarkHigh(SetDarkHigh->GetNewDoubleValue(newValue)); |
| 121 | + G4cout << "Setting DarkHigh value " << SetDarkHigh->GetNewDoubleValue(newValue) |
| 122 | + << initaliseString.c_str() << G4endl; |
154 | 123 | } |
155 | 124 | else if(command == SetDarkWindow){ |
156 | | - if(constructor == 0){ |
157 | | - } |
158 | | - else if(constructor == 1) { |
159 | | - WCSimAddDarkNoise->SetDarkWindow(SetDarkWindow->GetNewDoubleValue(newValue)); |
160 | | - G4cout << "Setting DarkWindow value " << SetDarkWindow->GetNewDoubleValue(newValue) |
161 | | - << initaliseString.c_str() << G4endl; |
162 | | - } |
| 125 | + WCSimAddDarkNoise->SetDarkWindow(SetDarkWindow->GetNewDoubleValue(newValue)); |
| 126 | + G4cout << "Setting DarkWindow value " << SetDarkWindow->GetNewDoubleValue(newValue) |
| 127 | + << initaliseString.c_str() << G4endl; |
163 | 128 | } |
164 | 129 |
|
165 | 130 | } |
0 commit comments