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