Geant4  10.00.p03
exGPSHistoMessenger.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: exGPSHistoMessenger.cc 70972 2013-06-07 16:12:12Z gcosmo $
27 //
30 //
31 
32 
33 
34 #include "exGPSHistoMessenger.hh"
35 #include "exGPSHistoManager.hh"
36 
37 #include "G4UIdirectory.hh"
38 #include "G4UIcmdWithAString.hh"
40 
41 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42 
44  (exGPSHistoManager* histoManager)
45  :G4UImessenger(),
46  fExGPSHisto(histoManager),
47  fFileNameCmd(0),
48  fMaxEngCmd(0),
49  fMinEngCmd(0),
50  fMaxPosCmd(0),
51  fMinPosCmd(0)
52 
53 {
54  fExGPSHistoDir = new G4UIdirectory("/analysis/");
55  fExGPSHistoDir->SetGuidance("exGPS analysis control.");
56 
57  fFileNameCmd = new G4UIcmdWithAString("/analysis/filename",this);
58  fFileNameCmd->SetGuidance("Input the name for the ROOT output file.");
59  fFileNameCmd->SetParameterName("filename",true,true);
60  fFileNameCmd->SetDefaultValue("exgps");
61 
62 
63  fMaxEngCmd = new G4UIcmdWithADoubleAndUnit("/analysis/maxeng",this);
64  fMaxEngCmd->SetGuidance("Sets the maximum energy of histo");
65  fMaxEngCmd->SetParameterName("maxeng",true,true);
66  fMaxEngCmd->SetDefaultUnit("keV");
67  fMaxEngCmd->SetUnitCandidates("eV keV MeV GeV TeV PeV");
68 
69  fMinEngCmd = new G4UIcmdWithADoubleAndUnit("/analysis/mineng",this);
70  fMinEngCmd->SetGuidance("Sets the minimum energy of histo");
71  fMinEngCmd->SetParameterName("mineng",true,true);
72  fMinEngCmd->SetDefaultUnit("keV");
73  fMinEngCmd->SetUnitCandidates("eV keV MeV GeV TeV PeV");
74 
75  fMaxPosCmd = new G4UIcmdWithADoubleAndUnit("/analysis/maxpos",this);
76  fMaxPosCmd->SetGuidance("Set max length of source position");
77  fMaxPosCmd->SetParameterName("maxpos",true,true);
78  fMaxPosCmd->SetDefaultUnit("cm");
79  fMaxPosCmd->SetUnitCandidates("micron mm cm m km");
80 
81  fMinPosCmd = new G4UIcmdWithADoubleAndUnit("/analysis/minpos",this);
82  fMinPosCmd->SetGuidance("Set min length of source position");
83  fMinPosCmd->SetParameterName("minpos",true,true);
84  fMinPosCmd->SetDefaultUnit("cm");
85  fMinPosCmd->SetUnitCandidates("micron mm cm m km");
86 
87 }
88 
89 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
90 
92 {
93  delete fFileNameCmd;
94  delete fMaxEngCmd;
95  delete fMinEngCmd;
96  delete fMaxPosCmd;
97  delete fMinPosCmd;
98 }
99 
100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
101 
103  G4String newValue)
104 {
105 
106  // 1D Histograms
107 
108  if( command == fFileNameCmd )
109  {
110  fExGPSHisto->SetFileName(newValue);
111  }
112  else if( command == fMaxPosCmd)
113  {
115  }
116  else if( command == fMinPosCmd)
117  {
119  }
120  else if( command == fMaxEngCmd)
121  {
123  }
124  else if( command == fMinEngCmd)
125  {
127  }
128 }
129 
130 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
131 
132 
exGPSHistoManager * fExGPSHisto
Definition of the exGPSHistoMessenger class.
G4UIcmdWithAString * fFileNameCmd
static G4double GetNewDoubleValue(const char *paramString)
G4UIcmdWithADoubleAndUnit * fMaxPosCmd
void SetFileName(G4String name)
void SetEMax(G4double emax)
G4UIcmdWithADoubleAndUnit * fMaxEngCmd
virtual void SetNewValue(G4UIcommand *, G4String)
Definition of the exGPSHistoManager class.
exGPSHistoMessenger(exGPSHistoManager *)
void SetPosMin(G4double posmin)
void SetPosMax(G4double posmax)
G4UIcmdWithADoubleAndUnit * fMinPosCmd
void SetEMin(G4double emin)
G4UIcmdWithADoubleAndUnit * fMinEngCmd