Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
exGPSAnalysisMessenger.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 #ifdef G4ANALYSIS_USE
30 
32 #include "exGPSAnalysisManager.hh"
33 
34 #include "G4UIdirectory.hh"
35 #include "G4UIcmdWithAString.hh"
37 
38 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
39 
40 exGPSAnalysisMessenger::exGPSAnalysisMessenger(exGPSAnalysisManager* analysisManager)
41  :fExGPSAnalysis(analysisManager)
42 
43 {
44  fExGPSAnalysisDir = new G4UIdirectory("/analysis/");
45  fExGPSAnalysisDir->SetGuidance("exGPS analysis control.");
46 
47  fFileNameCmd = new G4UIcmdWithAString("/analysis/filename",this);
48  fFileNameCmd->SetGuidance("Input the name for the AIDA output file.");
49  fFileNameCmd->SetParameterName("filename",true,true);
50  fFileNameCmd->SetDefaultValue("exgps.aida");
51 
52  fFileTypeCmd = new G4UIcmdWithAString("/analysis/filetype",this);
53  fFileTypeCmd->SetGuidance("Input the type (xml/hbook/root) for the AIDA output file.");
54  fFileTypeCmd->SetParameterName("filetype",true,true);
55  fFileTypeCmd->SetDefaultValue("xml");
56 
57  fMaxEngCmd = new G4UIcmdWithADoubleAndUnit("/analysis/maxeng",this);
58  fMaxEngCmd->SetGuidance("Sets the maximum energy of histo");
59  fMaxEngCmd->SetParameterName("maxeng",true,true);
60  fMaxEngCmd->SetDefaultUnit("keV");
61  fMaxEngCmd->SetUnitCandidates("eV keV MeV GeV TeV PeV");
62 
63  fMinEngCmd = new G4UIcmdWithADoubleAndUnit("/analysis/mineng",this);
64  fMinEngCmd->SetGuidance("Sets the minimum energy of histo");
65  fMinEngCmd->SetParameterName("mineng",true,true);
66  fMinEngCmd->SetDefaultUnit("keV");
67  fMinEngCmd->SetUnitCandidates("eV keV MeV GeV TeV PeV");
68 
69  fMaxPosCmd = new G4UIcmdWithADoubleAndUnit("/analysis/maxpos",this);
70  fMaxPosCmd->SetGuidance("Set max length of source position");
71  fMaxPosCmd->SetParameterName("maxpos",true,true);
72  fMaxPosCmd->SetDefaultUnit("cm");
73  fMaxPosCmd->SetUnitCandidates("micron mm cm m km");
74 
75  fMinPosCmd = new G4UIcmdWithADoubleAndUnit("/analysis/minpos",this);
76  fMinPosCmd->SetGuidance("Set min length of source position");
77  fMinPosCmd->SetParameterName("minpos",true,true);
78  fMinPosCmd->SetDefaultUnit("cm");
79  fMinPosCmd->SetUnitCandidates("micron mm cm m km");
80 
81 }
82 
83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
84 
85 exGPSAnalysisMessenger::~exGPSAnalysisMessenger()
86 {
87  delete fFileNameCmd;
88  delete fFileTypeCmd;
89  delete fMaxEngCmd;
90  delete fMinEngCmd;
91  delete fMaxPosCmd;
92  delete fMinPosCmd;
93 }
94 
95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
96 
97 void exGPSAnalysisMessenger::SetNewValue(G4UIcommand* command,
98  G4String newValue)
99 {
100 
101  // 1D Histograms
102 
103  if( command == fFileNameCmd )
104  {
105  fExGPSAnalysis->SetFileName(newValue);
106  }
107  else if ( command == fFileTypeCmd )
108  {
109  fExGPSAnalysis->SetFileType(newValue);
110  }
111  else if( command == fMaxPosCmd)
112  {
113  fExGPSAnalysis->SetPosMax(fMaxPosCmd->GetNewDoubleValue(newValue));
114  }
115  else if( command == fMinPosCmd)
116  {
117  fExGPSAnalysis->SetPosMin(fMinPosCmd->GetNewDoubleValue(newValue));
118  }
119  else if( command == fMaxEngCmd)
120  {
121  fExGPSAnalysis->SetEngMax(fMaxEngCmd->GetNewDoubleValue(newValue));
122  }
123  else if( command == fMinEngCmd)
124  {
125  fExGPSAnalysis->SetEngMin(fMinEngCmd->GetNewDoubleValue(newValue));
126  }
127 }
128 
129 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
130 
131 
132 #endif // G4ANALYSIS_USE