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