WCSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WCSimTuningMessenger.cc
Go to the documentation of this file.
3 
4 #include "G4UIdirectory.hh"
5 #include "G4UIcommand.hh"
6 #include "G4UIparameter.hh"
7 #include "G4UIcmdWithADouble.hh"
8 #include "G4UIcmdWithABool.hh" //jl145
9 
10 
11 WCSimTuningMessenger::WCSimTuningMessenger(WCSimTuningParameters* WCTuningPars):WCSimTuningParams(WCTuningPars) {
12  WCSimDir = new G4UIdirectory("/WCSim/tuning/");
13  WCSimDir->SetGuidance("Commands to change tuning parameters");
14 
15  Rayff = new G4UIcmdWithADouble("/WCSim/tuning/rayff",this);
16  Rayff->SetGuidance("Set the Rayleigh scattering parameter");
17  Rayff->SetParameterName("Rayff",true);
18  Rayff->SetDefaultValue(0.75);
19 
20  Bsrff = new G4UIcmdWithADouble("/WCSim/tuning/bsrff",this);
21  Bsrff->SetGuidance("Set the Blacksheet reflection parameter");
22  Bsrff->SetParameterName("Bsrff",true);
23  Bsrff->SetDefaultValue(2.50);
24 
25  Abwff = new G4UIcmdWithADouble("/WCSim/tuning/abwff",this);
26  Abwff->SetGuidance("Set the water attenuation parameter");
27  Abwff->SetParameterName("Abwff",true);
28  Abwff->SetDefaultValue(1.30);
29 
30  Rgcff = new G4UIcmdWithADouble("/WCSim/tuning/rgcff",this);
31  Rgcff->SetGuidance("Set the cathode reflectivity parameter");
32  Rgcff->SetParameterName("Rgcff",true);
33  Rgcff->SetDefaultValue(0.32);
34 
35  Mieff = new G4UIcmdWithADouble("/WCSim/tuning/mieff",this);
36  Mieff->SetGuidance("Set the Mie scattering parameter");
37  Mieff->SetParameterName("Mieff",true);
38  Mieff->SetDefaultValue(0.0);
39 
40  //jl145 - for Top Veto
41  TVSpacing = new G4UIcmdWithADouble("/WCSim/tuning/tvspacing",this);
42  TVSpacing->SetGuidance("Set the Top Veto PMT Spacing, in cm.");
43  TVSpacing->SetParameterName("TVSpacing",true);
44  TVSpacing->SetDefaultValue(100.0);
45 
46  TopVeto = new G4UIcmdWithABool("/WCSim/tuning/topveto",this);
47  TopVeto->SetGuidance("Turn Top Veto simulation on/off");
48  TopVeto->SetParameterName("TopVeto",true);
49  TopVeto->SetDefaultValue(0);
50 
51 }
52 
54 {
55  delete Rayff;
56  delete Bsrff;
57  delete Abwff;
58  delete Rgcff;
59  delete Mieff;
60 
61  //jl145 - for Top Veto
62  delete TVSpacing;
63  delete TopVeto;
64 
65  delete WCSimDir;
66 }
67 
68 void WCSimTuningMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
69 {
70 
71  if(command == Rayff) {
72  // Set the Rayleigh scattering parameter
73  // printf("Input parameter %f\n",Rayff->GetNewDoubleValue(newValue));
74 
75  WCSimTuningParams->SetRayff(Rayff->GetNewDoubleValue(newValue));
76 
77  printf("Setting Rayleigh scattering parameter %f\n",Rayff->GetNewDoubleValue(newValue));
78 
79  }
80 
81  if(command == Bsrff) {
82  // Set the blacksheet reflection parameter
83  // printf("Input parameter %f\n",Bsrff->GetNewDoubleValue(newValue));
84 
85  WCSimTuningParams->SetBsrff(Bsrff->GetNewDoubleValue(newValue));
86 
87  printf("Setting blacksheet reflection parameter %f\n",Bsrff->GetNewDoubleValue(newValue));
88 
89  }
90 
91  if(command == Abwff) {
92  // Set the water attenuation parameter
93  // printf("Input parameter %f\n",Abwff->GetNewDoubleValue(newValue));
94 
95  WCSimTuningParams->SetAbwff(Abwff->GetNewDoubleValue(newValue));
96 
97  printf("Setting water attenuation parameter %f\n",Abwff->GetNewDoubleValue(newValue));
98 
99  }
100 
101  if(command == Rgcff) {
102  // Set the cathode reflectivity parameter
103  // printf("Input parameter %f\n",Rgcff->GetNewDoubleValue(newValue));
104 
105  WCSimTuningParams->SetRgcff(Rgcff->GetNewDoubleValue(newValue));
106 
107  printf("Setting cathode reflectivity parameter %f\n",Rgcff->GetNewDoubleValue(newValue));
108 
109  }
110 
111  if(command == Mieff) {
112  // Set the Mie scattering parameter
113  // printf("Input parameter %f\n",Mieff->GetNewDoubleValue(newValue));
114 
115  WCSimTuningParams->SetMieff(Mieff->GetNewDoubleValue(newValue));
116 
117  printf("Setting Mie scattering parameter %f\n",Mieff->GetNewDoubleValue(newValue));
118 
119  }
120 
121  //jl145 - For Top Veto
122 
123  else if(command == TVSpacing) {
124  // Set the Top Veto PMT Spacing
125  WCSimTuningParams->SetTVSpacing(TVSpacing->GetNewDoubleValue(newValue));
126  printf("Setting Top Veto PMT Spacing %f\n",TVSpacing->GetNewDoubleValue(newValue));
127  }
128 
129  else if(command == TopVeto) {
130  // Set the Top Veto on/off
131  WCSimTuningParams->SetTopVeto(TopVeto->GetNewBoolValue(newValue));
132  if(TopVeto->GetNewBoolValue(newValue))
133  printf("Setting Top Veto On\n");
134  else
135  printf("Setting Top Veto Off\n");
136  }
137 
138 
139 }
WCSimTuningParameters * WCSimTuningParams
G4UIcmdWithADouble * Abwff
void SetRgcff(G4double rparam)
G4UIcmdWithADouble * TVSpacing
void SetTopVeto(G4double tparam)
void SetAbwff(G4double rparam)
G4UIcmdWithADouble * Mieff
void SetBsrff(G4double rparam)
WCSimTuningMessenger(WCSimTuningParameters *)
void SetMieff(G4double rparam)
G4UIcmdWithADouble * Bsrff
void SetRayff(G4double rparam)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4UIcmdWithABool * TopVeto
G4UIcmdWithADouble * Rayff
G4UIcmdWithADouble * Rgcff
void SetTVSpacing(G4double tparam)