4 #include "G4UIdirectory.hh"
5 #include "G4UIcommand.hh"
6 #include "G4UIcmdWithADoubleAndUnit.hh"
7 #include "G4UIcmdWithADouble.hh"
8 #include "G4UIcmdWithAnInteger.hh"
9 #include "G4UIcmdWithAString.hh"
12 : WCSimAddDarkNoise(darkratepoint), WCSimDir(0), SetFrequency(0), SetConversionRate(0), SetDarkMode(0), SetDarkLow(0), SetDarkHigh(0), SetDarkWindow(0), SetDetectorElement(0)
31 G4cout <<
"Initializing Dark Rate Messenger for detector element " <<
detectorElement << G4endl;
32 initaliseString =
" (this is a default set; it may be overwritten by user commands)";
35 WCSimDir->SetGuidance(
"Commands to change the dark noise frequency of the simulation");
37 double const conversion_to_kHz = 1000000;
38 double defaultFrequency = 0;
40 SetFrequency->SetGuidance(
"Commands to change the dark noise frequency of the simulation");
42 SetFrequency->SetDefaultValue(defaultFrequency * conversion_to_kHz);
49 double defaultConvRate = 1;
51 SetConversionRate->SetGuidance(
"Calibrate the frequency of dark noise before applying the threshold (typically 0.25pe)");
58 int defaultDarkMode = 0;
60 SetDarkMode->SetGuidance(
"Set the mode of adding dark noise to the event");
65 double defaultDarkLow = 0;
67 SetDarkLow->SetGuidance(
"Set the lower GEANT time limit to add dark noise");
74 double defaultDarkHigh = 100000;
76 SetDarkHigh->SetGuidance(
"Set the upper GEANT time limit to add dark noise");
83 double defaultDarkWindow = 5000;
85 SetDarkWindow->SetGuidance(
"Set the window width to add dark noise");
92 G4String defaultDetectorElement =
"tank";
94 SetDetectorElement->SetGuidance(
"Set the detector element for which trigger settings will be applied");
95 G4String theguidance =
"Available choices are:\n";
96 G4String thecandidates=
"";
98 theguidance+=it->first; theguidance+=
"\n";
99 thecandidates+=it->first; thecandidates+=
" ";
129 double const conversion_to_kHz = 1000000;
131 G4cout <<
"Setting Dark Rate " << conversion_to_kHz *
SetFrequency->GetNewDoubleValue(newValue)
136 G4cout <<
"Setting Dark Rate Conversion value " <<
SetConversionRate->GetNewDoubleValue(newValue)
141 G4cout <<
"Setting DarkMode value " <<
SetDarkMode->GetNewIntValue(newValue)
146 G4cout <<
"Setting DarkLow value " <<
SetDarkLow->GetNewDoubleValue(newValue)
151 G4cout <<
"Setting DarkHigh value " <<
SetDarkHigh->GetNewDoubleValue(newValue)
156 G4cout <<
"Setting DarkWindow value " <<
SetDarkWindow->GetNewDoubleValue(newValue)
162 G4cout <<
"Setting detectorElement value " << newValue
170 G4cout<<
"new dark rate messenger for existing detector Element "<<detectorElementin<<G4endl;
172 G4cout<<
"added "<<detectorElementin<<
" to the DarkRateMessenger"<<G4endl;
173 darknoiseptrs.insert(std::pair<std::string,WCSimWCAddDarkNoise*>(detectorElementin,darkratepoint));
181 G4cout<<
"deleting dark rate messenger for detector Element "<<detectorElementin<<G4endl;
182 std::map<std::string, WCSimWCAddDarkNoise*>::iterator thepointer =
darknoiseptrs.find(detectorElementin);
186 G4cout<<
"Attempt to remove nonexistant element "<<detectorElementin<<
" from DarkRateMessenger!"<<G4endl;
std::map< std::string, WCSimWCAddDarkNoise * > darknoiseptrs
void SetDarkMode(int imode)
void SetDarkWindow(int idarkwindow)
G4UIcmdWithADoubleAndUnit * SetFrequency
G4UIcmdWithADoubleAndUnit * SetDarkWindow
void SetNewValue(G4UIcommand *command, G4String newValue)
~WCSimDarkRateMessenger()
void SetDarkLow(double idarklow)
G4UIcmdWithAString * SetDetectorElement
G4UIcmdWithADouble * SetConversionRate
G4UIcmdWithADoubleAndUnit * SetDarkLow
G4UIcmdWithAnInteger * SetDarkMode
static WCSimDarkRateMessenger * GetInstance()
void SetConversion(double iconvrate)
void SetDarkRate(double idarkrate)
WCSimDarkRateMessenger(WCSimWCAddDarkNoise *)
G4UIcmdWithADoubleAndUnit * SetDarkHigh
static WCSimDarkRateMessenger * iInstance
WCSimWCAddDarkNoise * WCSimAddDarkNoise
void SetDarkHigh(double idarkhigh)
void RemoveDarkRateInstance(G4String detectorElement)
void AddDarkRateInstance(WCSimWCAddDarkNoise *darkratepoint, G4String detectorElement)