11#include "BesMdcDigitizerMessenger.hh"
12#include "BesMdcDigitizer.hh"
13#include "G4UIdirectory.hh"
14#include "G4UIcommand.hh"
15#include "G4UIcmdWithAnInteger.hh"
16#include "G4UIcmdWithADouble.hh"
17#include "G4UIcmdWithAString.hh"
24 noiseDirectory =
new G4UIdirectory(
"/mdc/noise/");
25 noiseDirectory->SetGuidance(
"BESIII MDC noise control");
28 noiseFlag =
new G4UIcmdWithAnInteger(
"/mdc/noise/flag",
this);
29 noiseFlag->SetGuidance(
"whether to add noise to MdcDigi.");
30 noiseFlag->SetParameterName(
"MdcNoiseFlag",
false);
31 noiseFlag->SetRange(
"MdcNoiseFlag>=0");
35 noiseType =
new G4UIcmdWithAnInteger(
"/mdc/noise/type",
this);
36 noiseType->SetGuidance(
"select noise type.");
37 noiseType->SetParameterName(
"MdcNoiseType",
false);
38 noiseType->SetRange(
"MdcNoiseType>=0");
42 noiseLevel =
new G4UIcmdWithADouble(
"/mdc/noise/level",
this);
43 noiseLevel->SetGuidance(
"noise level");
44 noiseLevel->SetParameterName(
"MdcNoiseLevel",
false);
45 noiseLevel->SetRange(
"MdcNoiseLevel>=0.");
48 digiDirectory =
new G4UIdirectory(
"/mdc/digi/");
49 digiDirectory->SetGuidance(
"BESIII MDC digitizer control");
52 smearFlag =
new G4UIcmdWithAnInteger(
"/mdc/digi/smearflag",
this);
53 smearFlag->SetGuidance(
"whether to do T smear to MdcDigi.");
54 smearFlag->SetParameterName(
"MdcSmearFlag",
true);
55 smearFlag->SetRange(
"MdcSmearFlag>=0");
56 smearFlag->SetDefaultValue(1);
59 mdcDRes =
new G4UIcmdWithADouble(
"/mdc/digi/spaceres",
this);
60 mdcDRes->SetGuidance(
"value of space resolution");
61 mdcDRes->SetParameterName(
"MdcDRes",
false);
62 mdcDRes->SetRange(
"MdcDRes>0");
64 effDirectory =
new G4UIdirectory(
"/mdc/eff/");
65 effDirectory->SetGuidance(
"BESIII MDC wire efficiency control");
68 effFlag =
new G4UIcmdWithAnInteger(
"/mdc/eff/flag",
this);
69 effFlag->SetGuidance(
"Get eff. from 0: CalSvc; 1: mac file");
70 effFlag->SetParameterName(
"MdcEffFlag",
false);
71 effFlag->SetRange(
"MdcEffFlag>=0");
74 G4UIparameter* parameter;
78 layerEff =
new G4UIcommand(
"/mdc/eff/eff",
this);
79 layerEff->SetGuidance(
"Set eff. of MDC layers");
81 parameter =
new G4UIparameter(
"layer",
'i',omittable =
false);
82 parameter->SetGuidance(
"Which layer to be modified");
83 parameter->SetParameterRange(
"layer >= -1 && layer < 43");
84 parameter->SetDefaultValue(-1);
85 layerEff->SetParameter(parameter);
87 parameter =
new G4UIparameter(
"eff",
'd',omittable =
false);
88 parameter->SetGuidance(
"Eff. value");
89 parameter->SetParameterRange(
"eff >= 0. && eff <=1.");
90 parameter->SetDefaultValue(1.);
91 layerEff->SetParameter(parameter);
96 delete noiseDirectory;
100 delete digiDirectory;
110 if( command == noiseFlag) {
111 mdcDigitizer->
SetNoiseFlag(noiseFlag->GetNewIntValue(newValue));
112 }
else if(command==noiseType){
113 mdcDigitizer->
SetNoiseType(noiseType->GetNewIntValue(newValue));
114 }
else if(command==noiseLevel){
115 mdcDigitizer->
SetNoiseLevel(noiseLevel->GetNewDoubleValue(newValue));
116 }
else if(command==smearFlag){
117 mdcDigitizer->
SetSmearFlag(smearFlag->GetNewIntValue(newValue));
118 }
else if(command==mdcDRes){
119 mdcDigitizer->
SetMdcDRes(mdcDRes->GetNewDoubleValue(newValue));
120 }
else if(command==effFlag){
121 mdcDigitizer->
SetEffFlag(effFlag->GetNewIntValue(newValue));
122 }
else if(command==layerEff){
125 std::istringstream is ((
char*)newValue.data());
127 mdcDigitizer->
SetEff(layer, eff);
void SetNewValue(G4UIcommand *command, G4String newValues)
~BesMdcDigitizerMessenger()
BesMdcDigitizerMessenger(BesMdcDigitizer *)
void SetMdcDRes(G4double res)
void SetNoiseType(G4int type)
void SetNoiseFlag(G4int flag)
void SetEffFlag(G4int flag)
void SetNoiseLevel(G4double level)
void SetSmearFlag(G4int flag)
void SetEff(G4int layer, G4double eff)