Geant4  10.02.p01
HistoManagerMessenger.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 //
28 //
29 //
30 // $Id: HistoManagerMessenger.cc 70747 2013-06-05 11:56:02Z ihrivnac $
31 //
32 //
34 //
35 // HistoManagerMessenger
36 //
37 // Created: 20.06.08 V.Ivanchenko
38 //
39 // Modified:
40 //
42 //
43 
44 #include "HistoManagerMessenger.hh"
45 
46 #include "HistoManager.hh"
47 #include "G4UIdirectory.hh"
48 #include "G4UIcmdWithABool.hh"
49 #include "G4UIcmdWithAString.hh"
50 #include "G4UIcmdWithAnInteger.hh"
51 #include "G4UIcmdWith3Vector.hh"
54 #include "HistoManager.hh"
55 
56 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
57 
59 :G4UImessenger(), fHisto(p)
60 {
61  fbinCmd = new G4UIcmdWithAnInteger("/testhadr/nBinsE",this);
62  fbinCmd->SetGuidance("Set number of bins for energy");
63  fbinCmd->SetParameterName("NEbins",false);
65 
66  fnOfAbsCmd = new G4UIcmdWithAnInteger("/testhadr/nBinsP",this);
67  fnOfAbsCmd->SetGuidance("Set number of bins for momentum");
68  fnOfAbsCmd->SetParameterName("NPbins",false);
70 
71  fpartCmd = new G4UIcmdWithAString("/testhadr/particle",this);
72  fpartCmd->SetGuidance("Set particle name");
73  fpartCmd->SetParameterName("Particle",false);
75 
76  fcsCmd = new G4UIcmdWithAString("/testhadr/targetElm",this);
77  fcsCmd->SetGuidance("Set element name");
78  fcsCmd->SetParameterName("Elm",false);
80 
81  fe1Cmd = new G4UIcmdWithADoubleAndUnit("/testhadr/minEnergy",this);
82  fe1Cmd->SetGuidance("Set min kinetic energy");
83  fe1Cmd->SetParameterName("eMin",false);
84  fe1Cmd->SetUnitCategory("Energy");
86 
87  fe2Cmd = new G4UIcmdWithADoubleAndUnit("/testhadr/maxEnergy",this);
88  fe2Cmd->SetGuidance("Set max kinetic energy");
89  fe2Cmd->SetParameterName("eMax",false);
90  fe2Cmd->SetUnitCategory("Energy");
92 
93  fp1Cmd = new G4UIcmdWithADoubleAndUnit("/testhadr/minMomentum",this);
94  fp1Cmd->SetGuidance("Set min momentum");
95  fp1Cmd->SetParameterName("pMin",false);
96  fp1Cmd->SetUnitCategory("Energy");
98 
99  fp2Cmd = new G4UIcmdWithADoubleAndUnit("/testhadr/maxMomentum",this);
100  fp2Cmd->SetGuidance("Set max momentum");
101  fp2Cmd->SetParameterName("pMax",false);
102  fp2Cmd->SetUnitCategory("Energy");
104 
105  fverbCmd = new G4UIcmdWithAnInteger("/testhadr/verbose",this);
106  fverbCmd->SetGuidance("Set verbose for ");
107  fverbCmd->SetParameterName("verb",false);
109 
110  fFCmd = new G4UIcmdWithAString("/testhadr/fileName",this);
111  fFCmd->SetGuidance("set name for the histograms file");
112 }
113 
114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
115 
117 {
118  delete fnOfAbsCmd;
119  delete fpartCmd;
120  delete fcsCmd;
121  delete fe1Cmd;
122  delete fe2Cmd;
123  delete fp1Cmd;
124  delete fp2Cmd;
125  delete fverbCmd;
126  delete fFCmd;
127 }
128 
129 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
130 
132 {
133  if( command == fbinCmd ) {
135  } else if( command == fnOfAbsCmd ) {
137  } else if( command == fverbCmd ) {
139  } else if( command == fpartCmd ) {
140  fHisto->SetParticleName(newValue);
141  } else if( command == fcsCmd ) {
142  fHisto->SetElementName(newValue);
143  } else if( command == fe1Cmd ) {
145  } else if( command == fe2Cmd ) {
147  } else if( command == fp1Cmd ) {
149  } else if( command == fp2Cmd ) {
151  } else if( command == fFCmd ) {
152  fHisto->SetHistoName(newValue);
153  }
154 }
155 
156 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
157 
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWithAString * fpartCmd
G4UIcmdWithAString * fcsCmd
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4int GetNewIntValue(const char *paramString)
G4UIcmdWithADoubleAndUnit * fe1Cmd
void SetMinMomentum(G4double val)
G4UIcmdWithADoubleAndUnit * fe2Cmd
G4UIcmdWithADoubleAndUnit * fp1Cmd
G4UIcmdWithAnInteger * fnOfAbsCmd
void SetNumberOfBinsE(G4int val)
G4UIcmdWithADoubleAndUnit * fp2Cmd
void SetUnitCategory(const char *unitCategory)
static G4double GetNewDoubleValue(const char *paramString)
G4UIcmdWithAnInteger * fverbCmd
G4UIcmdWithAString * fFCmd
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void SetMaxMomentum(G4double val)
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:239
G4UIcmdWithAnInteger * fbinCmd
void SetMaxKinEnergy(G4double val)
void SetMinKinEnergy(G4double val)
void SetElementName(const G4String &)
virtual void SetNewValue(G4UIcommand *, G4String)
void SetVerbose(G4int val)
Definition: HistoManager.hh:95
void SetHistoName(G4String &val)
void SetParticleName(const G4String &)
HistoManagerMessenger(HistoManager *)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetNumberOfBinsP(G4int val)