Geant4  10.01
G4H3Messenger.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id$
27 
28 // Author: Ivana Hrivnacova, 24/07/2014 (ivana@ipno.in2p3.fr)
29 
30 #include "G4H3Messenger.hh"
31 #include "G4VAnalysisManager.hh"
32 #include "G4AnalysisUtilities.hh"
33 
34 #include "G4UIdirectory.hh"
35 #include "G4UIcommand.hh"
36 #include "G4UIparameter.hh"
37 
38 #include <iostream>
39 
40 using namespace G4Analysis;
41 
42 namespace {
43 
44 void Exception(G4UIcommand* command, G4int nofParameters)
45 {
46  G4ExceptionDescription description;
47  description
48  << "Got wrong number of \"" << command->GetCommandName()
49  << "\" parameters: " << nofParameters
50  << " instead of " << command->GetParameterEntries()
51  << " expected" << G4endl;
52  G4Exception("G4H3Messenger::SetNewValue",
53  "Analysis_W013", JustWarning, description);
54 }
55 
56 }
57 
58 
59 //_____________________________________________________________________________
61  : G4UImessenger(),
62  fManager(manager),
63  fH3Dir(0),
64  fCreateH3Cmd(0),
65  fSetH3Cmd(0),
66  fSetH3TitleCmd(0),
67  fSetH3XAxisCmd(0),
68  fSetH3YAxisCmd(0)
69 {
70  fH3Dir = new G4UIdirectory("/analysis/h3/");
71  fH3Dir->SetGuidance("3D histograms control");
72 
73  CreateH3Cmd();
74  SetH3Cmd();
75 
76  SetH3TitleCmd();
77  SetH3XAxisCmd();
78  SetH3YAxisCmd();
79  SetH3ZAxisCmd();
80 }
81 
82 //_____________________________________________________________________________
84 {
85  delete fCreateH3Cmd;
86  delete fSetH3Cmd;
87  delete fSetH3TitleCmd;
88  delete fSetH3XAxisCmd;
89  delete fSetH3YAxisCmd;
90  delete fSetH3ZAxisCmd;
91  delete fH3Dir;
92 }
93 
94 //
95 // private functions
96 //
97 
98 //_____________________________________________________________________________
100 {
101  G4UIparameter* h3Name = new G4UIparameter("name", 's', false);
102  h3Name->SetGuidance("Histogram name (label)");
103 
104  G4UIparameter* h3Title = new G4UIparameter("title", 's', false);
105  h3Title->SetGuidance("Histogram title");
106 
107  G4UIparameter* h3xNbins0 = new G4UIparameter("xnbins0", 'i', true);
108  h3xNbins0->SetGuidance("Number of x-bins (default = 100)");
109  h3xNbins0->SetGuidance("Can be reset with /analysis/h3/set command");
110  h3xNbins0->SetDefaultValue(100);
111 
112  G4UIparameter* h3xValMin0 = new G4UIparameter("xvalMin0", 'd', true);
113  h3xValMin0->SetGuidance("Minimum x-value, expressed in unit (default = 0.)");
114  h3xValMin0->SetGuidance("Can be reset with /analysis/h3/set command");
115  h3xValMin0->SetDefaultValue(0.);
116 
117  G4UIparameter* h3xValMax0 = new G4UIparameter("xvalMax0", 'd', true);
118  h3xValMax0->SetGuidance("Maximum x-value, expressed in unit (default = 1.)");
119  h3xValMax0->SetGuidance("Can be reset with /analysis/h3/set command");
120  h3xValMax0->SetDefaultValue(1.);
121 
122  G4UIparameter* h3xValUnit0 = new G4UIparameter("xvalUnit0", 's', true);
123  h3xValUnit0->SetGuidance("The unit applied to filled x-values and xvalMin0, xvalMax0");
124  h3xValUnit0->SetDefaultValue("none");
125 
126  G4UIparameter* h3xValFcn0 = new G4UIparameter("xvalFcn0", 's', true);
127  G4String fcnxGuidance = "The function applied to filled x-values (log, log10, exp, none).";
128  h3xValFcn0->SetGuidance(fcnxGuidance);
129  h3xValFcn0->SetParameterCandidates("log log10 exp none");
130  h3xValFcn0->SetDefaultValue("none");
131 
132  G4UIparameter* h3xValBinScheme0 = new G4UIparameter("xvalBinScheme0", 's', true);
133  G4String xbinSchemeGuidance = "The binning scheme (linear, log).";
134  h3xValBinScheme0->SetParameterCandidates("linear log");
135  h3xValBinScheme0->SetGuidance(xbinSchemeGuidance);
136  h3xValBinScheme0->SetDefaultValue("linear");
137 
138  G4UIparameter* h3yNbins0 = new G4UIparameter("ynbins0", 'i', true);
139  h3yNbins0->SetGuidance("Number of y-bins (default = 100)");
140  h3yNbins0->SetGuidance("Can be reset with /analysis/h3/set command");
141  h3yNbins0->SetDefaultValue(100);
142 
143  G4UIparameter* h3yValMin0 = new G4UIparameter("yvalMin0", 'd', true);
144  h3yValMin0->SetGuidance("Minimum y-value, expressed in unit (default = 0.)");
145  h3yValMin0->SetGuidance("Can be reset with /analysis/h3/set command");
146  h3yValMin0->SetDefaultValue(0.);
147 
148  G4UIparameter* h3yValMax0 = new G4UIparameter("yvalMax0", 'd', true);
149  h3yValMax0->SetGuidance("Maximum y-value, expressed in unit (default = 1.)");
150  h3yValMax0->SetGuidance("Can be reset with /analysis/h3/set command");
151  h3yValMax0->SetDefaultValue(1.);
152 
153  G4UIparameter* h3yValUnit0 = new G4UIparameter("yvalUnit0", 's', true);
154  h3yValUnit0->SetGuidance("The unit applied to filled y-values and yvalMin0, yvalMax0");
155  h3yValUnit0->SetDefaultValue("none");
156 
157  G4UIparameter* h3yValFcn0 = new G4UIparameter("yvalFcn0", 's', true);
158  G4String fcnyGuidance = "The function applied to filled y-values (log, log10, exp, none).";
159  h3yValFcn0->SetGuidance(fcnyGuidance);
160  h3yValFcn0->SetParameterCandidates("log log10 exp none");
161  h3yValFcn0->SetDefaultValue("none");
162 
163  G4UIparameter* h3yValBinScheme0 = new G4UIparameter("yvalBinScheme0", 's', true);
164  G4String ybinSchemeGuidance = "The binning scheme (linear, log).";
165  h3yValBinScheme0->SetParameterCandidates("linear log");
166  h3yValBinScheme0->SetGuidance(ybinSchemeGuidance);
167  h3yValBinScheme0->SetDefaultValue("linear");
168 
169  G4UIparameter* h3zNbins0 = new G4UIparameter("znbins0", 'i', true);
170  h3zNbins0->SetGuidance("Number of z-bins (default = 100)");
171  h3zNbins0->SetGuidance("Can be reset with /analysis/h3/set command");
172  h3zNbins0->SetDefaultValue(100);
173 
174  G4UIparameter* h3zValMin0 = new G4UIparameter("zvalMin0", 'd', true);
175  h3zValMin0->SetGuidance("Minimum z-value, expressed in unit (default = 0.)");
176  h3zValMin0->SetGuidance("Can be reset with /analysis/h3/set command");
177  h3zValMin0->SetDefaultValue(0.);
178 
179  G4UIparameter* h3zValMax0 = new G4UIparameter("zvalMax0", 'd', true);
180  h3zValMax0->SetGuidance("Maximum z-value, expressed in unit (default = 1.)");
181  h3zValMax0->SetGuidance("Can be reset with /analysis/h3/set command");
182  h3zValMax0->SetDefaultValue(1.);
183 
184  G4UIparameter* h3zValUnit0 = new G4UIparameter("zvalUnit0", 's', true);
185  h3zValUnit0->SetGuidance("The unit applied to filled z-values and zvalMin0, zvalMax0");
186  h3zValUnit0->SetDefaultValue("none");
187 
188  G4UIparameter* h3zValFcn0 = new G4UIparameter("zvalFcn0", 's', true);
189  G4String fcnzGuidance = "The function applied to filled z-values (log, log10, exp, none).";
190  h3zValFcn0->SetGuidance(fcnzGuidance);
191  h3zValFcn0->SetParameterCandidates("log log10 exp none");
192  h3zValFcn0->SetDefaultValue("none");
193 
194  G4UIparameter* h3zValBinScheme0 = new G4UIparameter("zvalBinScheme0", 's', true);
195  G4String zbinSchemeGuidance = "The binning scheme (linear, log).";
196  h3zValBinScheme0->SetParameterCandidates("linear log");
197  h3zValBinScheme0->SetGuidance(zbinSchemeGuidance);
198  h3zValBinScheme0->SetDefaultValue("linear");
199 
200  fCreateH3Cmd = new G4UIcommand("/analysis/h3/create", this);
201  fCreateH3Cmd->SetGuidance("Create 3D histogram");
202  fCreateH3Cmd->SetParameter(h3Name);
203  fCreateH3Cmd->SetParameter(h3Title);
204  fCreateH3Cmd->SetParameter(h3xNbins0);
205  fCreateH3Cmd->SetParameter(h3xValMin0);
206  fCreateH3Cmd->SetParameter(h3xValMax0);
207  fCreateH3Cmd->SetParameter(h3xValUnit0);
208  fCreateH3Cmd->SetParameter(h3xValFcn0);
209  fCreateH3Cmd->SetParameter(h3xValBinScheme0);
210  fCreateH3Cmd->SetParameter(h3yNbins0);
211  fCreateH3Cmd->SetParameter(h3yValMin0);
212  fCreateH3Cmd->SetParameter(h3yValMax0);
213  fCreateH3Cmd->SetParameter(h3yValUnit0);
214  fCreateH3Cmd->SetParameter(h3yValFcn0);
215  fCreateH3Cmd->SetParameter(h3yValBinScheme0);
216  fCreateH3Cmd->SetParameter(h3zNbins0);
217  fCreateH3Cmd->SetParameter(h3zValMin0);
218  fCreateH3Cmd->SetParameter(h3zValMax0);
219  fCreateH3Cmd->SetParameter(h3zValUnit0);
220  fCreateH3Cmd->SetParameter(h3zValFcn0);
221  fCreateH3Cmd->SetParameter(h3zValBinScheme0);
223 }
224 
225 
226 //_____________________________________________________________________________
228 {
229  G4UIparameter* h3Id = new G4UIparameter("id", 'i', false);
230  h3Id->SetGuidance("Histogram id");
231  h3Id->SetParameterRange("id>=0");
232 
233  G4UIparameter* h3xNbins = new G4UIparameter("xnbins", 'i', false);
234  h3xNbins->SetGuidance("Number of x-bins");
235 
236  G4UIparameter* h3xValMin = new G4UIparameter("xvalMin", 'd', false);
237  h3xValMin->SetGuidance("Minimum x-value, expressed in unit");
238 
239  G4UIparameter* h3xValMax = new G4UIparameter("xvalMax", 'd', false);
240  h3xValMax->SetGuidance("Maximum x-value, expressed in unit");
241 
242  G4UIparameter* h3xValUnit = new G4UIparameter("xvalUnit", 's', false);
243  h3xValUnit->SetGuidance("The unit applied to filled x-values and xvalMin0, xvalMax0");
244  h3xValUnit->SetDefaultValue("none");
245 
246  G4UIparameter* h3xValFcn = new G4UIparameter("xvalFcn", 's', false);
247  h3xValFcn->SetParameterCandidates("log log10 exp none");
248  G4String fcnxGuidance = "The function applied to filled x-values (log, log10, exp, none).";
249  h3xValFcn->SetGuidance(fcnxGuidance);
250  h3xValFcn->SetDefaultValue("none");
251 
252  G4UIparameter* h3xValBinScheme = new G4UIparameter("xvalBinScheme", 's', true);
253  G4String xbinSchemeGuidance = "The binning scheme (linear, log).";
254  h3xValBinScheme->SetParameterCandidates("linear log");
255  h3xValBinScheme->SetGuidance(xbinSchemeGuidance);
256  h3xValBinScheme->SetDefaultValue("linear");
257 
258  G4UIparameter* h3yNbins = new G4UIparameter("nybins", 'i', false);
259  h3yNbins->SetGuidance("Number of y-bins");
260 
261  G4UIparameter* h3yValMin = new G4UIparameter("yvalMin", 'd', false);
262  h3yValMin->SetGuidance("Minimum y-value, expressed in unit");
263 
264  G4UIparameter* h3yValMax = new G4UIparameter("yvalMax", 'd', false);
265  h3yValMax->SetGuidance("Maximum y-value, expressed in unit");
266 
267  G4UIparameter* h3yValUnit = new G4UIparameter("yvalUnit", 's', true);
268  h3yValUnit->SetGuidance("The unit applied to filled y-values and yvalMin0, yvalMax0");
269  h3yValUnit->SetDefaultValue("none");
270 
271  G4UIparameter* h3yValFcn = new G4UIparameter("yvalFcn", 's', false);
272  h3yValFcn->SetParameterCandidates("log log10 exp none");
273  G4String fcnyGuidance = "The function applied to filled y-values (log, log10, exp, none).";
274  h3yValFcn->SetGuidance(fcnyGuidance);
275  h3yValFcn->SetDefaultValue("none");
276 
277  G4UIparameter* h3yValBinScheme = new G4UIparameter("yvalBinScheme", 's', true);
278  G4String ybinSchemeGuidance = "The binning scheme (linear, log).";
279  h3yValBinScheme->SetParameterCandidates("linear log");
280  h3yValBinScheme->SetGuidance(ybinSchemeGuidance);
281  h3yValBinScheme->SetDefaultValue("linear");
282 
283  G4UIparameter* h3zNbins = new G4UIparameter("nzbins", 'i', false);
284  h3zNbins->SetGuidance("Number of z-bins");
285 
286  G4UIparameter* h3zValMin = new G4UIparameter("zvalMin", 'd', false);
287  h3zValMin->SetGuidance("Minimum z-value, expressed in unit");
288 
289  G4UIparameter* h3zValMax = new G4UIparameter("zvalMax", 'd', false);
290  h3zValMax->SetGuidance("Maximum z-value, expressed in unit");
291 
292  G4UIparameter* h3zValUnit = new G4UIparameter("zvalUnit", 's', true);
293  h3zValUnit->SetGuidance("The unit applied to filled z-values and zvalMin0, zvalMax0");
294  h3zValUnit->SetDefaultValue("none");
295 
296  G4UIparameter* h3zValFcn = new G4UIparameter("zvalFcn", 's', false);
297  h3zValFcn->SetParameterCandidates("log log10 exp none");
298  G4String fcnzGuidance = "The function applied to filled z-values (log, log10, exp, none).";
299  h3zValFcn->SetGuidance(fcnzGuidance);
300  h3zValFcn->SetDefaultValue("none");
301 
302  G4UIparameter* h3zValBinScheme = new G4UIparameter("zvalBinScheme", 's', true);
303  G4String zbinSchemeGuidance = "The binning scheme (linear, log).";
304  h3zValBinScheme->SetParameterCandidates("linear log");
305  h3zValBinScheme->SetGuidance(zbinSchemeGuidance);
306  h3zValBinScheme->SetDefaultValue("linear");
307 
308  fSetH3Cmd = new G4UIcommand("/analysis/h3/set", this);
309  fSetH3Cmd->SetGuidance("Set parameters for the 3D histogram of #Id :");
310  fSetH3Cmd->SetGuidance(" nxbins; xvalMin; xvalMax; xunit; xfunction; xbinScheme");
311  fSetH3Cmd->SetGuidance(" nybins; yvalMin; yvalMax; yunit; yfunction; ybinScheme");
312  fSetH3Cmd->SetGuidance(" nzbins; zvalMin; zvalMax; zunit; zfunction; zbinScheme");
313  fSetH3Cmd->SetParameter(h3Id);
314  fSetH3Cmd->SetParameter(h3xNbins);
315  fSetH3Cmd->SetParameter(h3xValMin);
316  fSetH3Cmd->SetParameter(h3xValMax);
317  fSetH3Cmd->SetParameter(h3xValUnit);
318  fSetH3Cmd->SetParameter(h3xValFcn);
319  fSetH3Cmd->SetParameter(h3xValBinScheme);
320  fSetH3Cmd->SetParameter(h3yNbins);
321  fSetH3Cmd->SetParameter(h3yValMin);
322  fSetH3Cmd->SetParameter(h3yValMax);
323  fSetH3Cmd->SetParameter(h3yValUnit);
324  fSetH3Cmd->SetParameter(h3yValFcn);
325  fSetH3Cmd->SetParameter(h3yValBinScheme);
326  fSetH3Cmd->SetParameter(h3zNbins);
327  fSetH3Cmd->SetParameter(h3zValMin);
328  fSetH3Cmd->SetParameter(h3zValMax);
329  fSetH3Cmd->SetParameter(h3zValUnit);
330  fSetH3Cmd->SetParameter(h3zValFcn);
331  fSetH3Cmd->SetParameter(h3zValBinScheme);
333 }
334 
335 //_____________________________________________________________________________
337 {
338  G4UIparameter* h3Id = new G4UIparameter("idTitle", 'i', false);
339  h3Id->SetGuidance("Histogram id");
340  h3Id->SetParameterRange("idTitle>=0");
341 
342  G4UIparameter* h3Title = new G4UIparameter("h3Title", 's', true);
343  h3Title->SetGuidance("Histogram title");
344  h3Title->SetDefaultValue("none");
345 
346  fSetH3TitleCmd = new G4UIcommand("/analysis/h3/setTitle", this);
347  fSetH3TitleCmd->SetGuidance("Set title for the 3D histogram of #Id");
349  fSetH3TitleCmd->SetParameter(h3Title);
351 }
352 
353 //_____________________________________________________________________________
355 {
356  G4UIparameter* h3Id = new G4UIparameter("idXaxis", 'i', false);
357  h3Id->SetGuidance("Histogram id");
358  h3Id->SetParameterRange("idXaxis>=0");
359 
360  G4UIparameter* h3XAxis = new G4UIparameter("h3Xaxis", 's', true);
361  h3XAxis->SetGuidance("Histogram x-axis title");
362  h3XAxis->SetDefaultValue("none");
363 
364  fSetH3XAxisCmd = new G4UIcommand("/analysis/h3/setXaxis", this);
365  fSetH3XAxisCmd->SetGuidance("Set x-axis title for the 3D histogram of #Id");
367  fSetH3XAxisCmd->SetParameter(h3XAxis);
369 }
370 
371 //_____________________________________________________________________________
373 {
374  G4UIparameter* h3Id = new G4UIparameter("idYaxis", 'i', false);
375  h3Id->SetGuidance("Histogram id");
376  h3Id->SetParameterRange("idYaxis>=0");
377 
378  G4UIparameter* h3YAxis = new G4UIparameter("h3Yaxis", 's', true);
379  h3YAxis->SetGuidance("Histogram y-axis title");
380  h3YAxis->SetDefaultValue("none");
381 
382  fSetH3YAxisCmd = new G4UIcommand("/analysis/h3/setYaxis", this);
383  fSetH3YAxisCmd->SetGuidance("Set y-axis title for the 3D histogram of #Id");
385  fSetH3YAxisCmd->SetParameter(h3YAxis);
387 }
388 
389 //_____________________________________________________________________________
391 {
392  G4UIparameter* h3Id = new G4UIparameter("idYaxis", 'i', false);
393  h3Id->SetGuidance("Histogram id");
394  h3Id->SetParameterRange("idYaxis>=0");
395 
396  G4UIparameter* h3YAxis = new G4UIparameter("h3Yaxis", 's', true);
397  h3YAxis->SetGuidance("Histogram y-axis title");
398  h3YAxis->SetDefaultValue("none");
399 
400  fSetH3ZAxisCmd = new G4UIcommand("/analysis/h3/setZaxis", this);
401  fSetH3ZAxisCmd->SetGuidance("Set y-axis title for the 3D histogram of #Id");
403  fSetH3ZAxisCmd->SetParameter(h3YAxis);
405 }
406 
407 //
408 // public functions
409 //
410 
411 //_____________________________________________________________________________
413 {
414  // tokenize parameters in a vector
415  std::vector<G4String> parameters;
416  G4Analysis::Tokenize(newValues, parameters);
417  // check consistency
418  if ( G4int(parameters.size()) != command->GetParameterEntries() ) {
419  // Should never happen but let's check anyway for consistency
420  Exception(command, parameters.size());
421  return;
422  }
423 
424  if ( command == fCreateH3Cmd ) {
425  G4int counter = 0;
426  G4String name = parameters[counter++];
427  G4String title = parameters[counter++];
428  G4int xnbins = G4UIcommand::ConvertToInt(parameters[counter++]);
429  G4double xvmin = G4UIcommand::ConvertToDouble(parameters[counter++]);
430  G4double xvmax = G4UIcommand::ConvertToDouble(parameters[counter++]); ;
431  G4String xsunit = parameters[counter++];
432  G4String xsfcn = parameters[counter++];
433  G4String xsbinScheme = parameters[counter++];
434  G4double xunit = GetUnitValue(xsunit);
435  G4int ynbins = G4UIcommand::ConvertToInt(parameters[counter++]);
436  G4double yvmin = G4UIcommand::ConvertToDouble(parameters[counter++]);
437  G4double yvmax = G4UIcommand::ConvertToDouble(parameters[counter++]); ;
438  G4String ysunit = parameters[counter++];
439  G4String ysfcn = parameters[counter++];
440  G4String ysbinScheme = parameters[counter++];
441  G4double yunit = GetUnitValue(ysunit);
442  G4int znbins = G4UIcommand::ConvertToInt(parameters[counter++]);
443  G4double zvmin = G4UIcommand::ConvertToDouble(parameters[counter++]);
444  G4double zvmax = G4UIcommand::ConvertToDouble(parameters[counter++]); ;
445  G4String zsunit = parameters[counter++];
446  G4String zsfcn = parameters[counter++];
447  G4String zsbinScheme = parameters[counter++];
448  G4double zunit = GetUnitValue(zsunit);
449  fManager->CreateH3(name, title,
450  xnbins, xvmin*xunit, xvmax*xunit,
451  ynbins, yvmin*yunit, yvmax*yunit,
452  znbins, zvmin*zunit, zvmax*zunit,
453  xsunit, ysunit, zsunit, xsfcn, ysfcn, zsfcn,
454  xsbinScheme, ysbinScheme, zsbinScheme);
455  }
456  else if ( command == fSetH3Cmd ) {
457  G4int counter = 0;
458  G4int id = G4UIcommand::ConvertToInt(parameters[counter++]);
459  G4int xnbins = G4UIcommand::ConvertToInt(parameters[counter++]);
460  G4double xvmin = G4UIcommand::ConvertToDouble(parameters[counter++]);
461  G4double xvmax = G4UIcommand::ConvertToDouble(parameters[counter++]); ;
462  G4String xsunit = parameters[counter++];
463  G4String xsfcn = parameters[counter++];
464  G4String xsbinScheme = parameters[counter++];
465  G4double xunit = GetUnitValue(xsunit);
466  G4int ynbins = G4UIcommand::ConvertToInt(parameters[counter++]);
467  G4double yvmin = G4UIcommand::ConvertToDouble(parameters[counter++]);
468  G4double yvmax = G4UIcommand::ConvertToDouble(parameters[counter++]); ;
469  G4String ysunit = parameters[counter++];
470  G4String ysfcn = parameters[counter++];
471  G4String ysbinScheme = parameters[counter++];
472  G4double yunit = GetUnitValue(ysunit);
473  G4int znbins = G4UIcommand::ConvertToInt(parameters[counter++]);
474  G4double zvmin = G4UIcommand::ConvertToDouble(parameters[counter++]);
475  G4double zvmax = G4UIcommand::ConvertToDouble(parameters[counter++]); ;
476  G4String zsunit = parameters[counter++];
477  G4String zsfcn = parameters[counter++];
478  G4String zsbinScheme = parameters[counter++];
479  G4double zunit = GetUnitValue(zsunit);
480  fManager->SetH3(id,
481  xnbins, xvmin*xunit, xvmax*xunit,
482  ynbins, yvmin*yunit, yvmax*yunit,
483  znbins, zvmin*zunit, zvmax*zunit,
484  xsunit, ysunit, zsunit, xsfcn, ysfcn, zsfcn,
485  xsbinScheme, ysbinScheme, zsbinScheme);
486  }
487  else if ( command == fSetH3TitleCmd ) {
488  G4int counter = 0;
489  G4int id = G4UIcommand::ConvertToInt(parameters[counter++]);
490  G4String title = parameters[counter++];
491  fManager->SetH3Title(id, title);
492  }
493  else if ( command == fSetH3XAxisCmd ) {
494  G4int counter = 0;
495  G4int id = G4UIcommand::ConvertToInt(parameters[counter++]);
496  G4String xaxis = parameters[counter++];
497  fManager->SetH3XAxisTitle(id, xaxis);
498  }
499  else if ( command == fSetH3YAxisCmd ) {
500  G4int counter = 0;
501  G4int id = G4UIcommand::ConvertToInt(parameters[counter++]);
502  G4String yaxis = parameters[counter++];
503  fManager->SetH3YAxisTitle(id, yaxis);
504  }
505  else if ( command == fSetH3ZAxisCmd ) {
506  G4int counter = 0;
507  G4int id = G4UIcommand::ConvertToInt(parameters[counter++]);
508  G4String zaxis = parameters[counter++];
509  fManager->SetH3ZAxisTitle(id, zaxis);
510  }
511 }
G4int CreateH3(const G4String &name, const G4String &title, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, G4int nzbins, G4double zmin, G4double zmax, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &zunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &zfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear", const G4String &zbinSchemeName="linear")
void SetParameter(G4UIparameter *const newParameter)
Definition: G4UIcommand.hh:152
void SetH3XAxisCmd()
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
void SetH3ZAxisCmd()
G4H3Messenger(G4VAnalysisManager *manager)
G4UIcommand * fSetH3YAxisCmd
void SetParameterRange(const char *theRange)
void SetParameterCandidates(const char *theString)
G4UIcommand * fCreateH3Cmd
G4String name
Definition: TRTMaterials.hh:40
void SetDefaultValue(const char *theDefaultValue)
G4VAnalysisManager * fManager
Associated class.
int G4int
Definition: G4Types.hh:78
G4bool SetH3(G4int id, G4int nxbins, G4double xmin, G4double xmax, G4int nzbins, G4double zmin, G4double zmax, G4int nybins, G4double ymin, G4double ymax, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &zunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &zfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear", const G4String &zbinSchemeName="linear")
virtual ~G4H3Messenger()
G4UIcommand * fSetH3XAxisCmd
G4bool SetH3Title(G4int id, const G4String &title)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
static G4double ConvertToDouble(const char *st)
Definition: G4UIcommand.cc:443
void CreateH3Cmd()
G4UIcommand * fSetH3ZAxisCmd
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:239
G4double GetUnitValue(const G4String &unit)
static G4int ConvertToInt(const char *st)
Definition: G4UIcommand.cc:435
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
const G4String & GetCommandName() const
Definition: G4UIcommand.hh:141
void SetH3TitleCmd()
virtual void SetNewValue(G4UIcommand *command, G4String value)
void Tokenize(const G4String &line, std::vector< G4String > &tokens)
G4bool SetH3XAxisTitle(G4int id, const G4String &title)
#define G4endl
Definition: G4ios.hh:61
void Exception(const char *originOfException, const char *exceptionCode, ExceptionSeverity severity, int level, const char *description)
Definition: UUtils.cc:122
double G4double
Definition: G4Types.hh:76
void SetGuidance(const char *theGuidance)
G4UIcommand * fSetH3Cmd
G4bool SetH3ZAxisTitle(G4int id, const G4String &title)
G4UIcommand * fSetH3TitleCmd
G4int GetParameterEntries() const
Definition: G4UIcommand.hh:143
G4bool SetH3YAxisTitle(G4int id, const G4String &title)
G4UIdirectory * fH3Dir
void SetH3YAxisCmd()