[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 | // ******************************************************************** |
---|
| 27 | // * * |
---|
| 28 | // * cosmicray_charging advanced example for Geant4 * |
---|
| 29 | // * (adapted simulation of test-mass charging in the LISA mission) * |
---|
| 30 | // * * |
---|
| 31 | // * Henrique Araujo (h.araujo@imperial.ac.uk) & Peter Wass * |
---|
| 32 | // * Imperial College London * |
---|
| 33 | // * * |
---|
| 34 | // * LISAStackingActionMessenger class * |
---|
| 35 | // * * |
---|
| 36 | // ******************************************************************** |
---|
| 37 | // |
---|
| 38 | // HISTORY |
---|
| 39 | // 22/02/2004: migrated from LISA-V04 |
---|
| 40 | // |
---|
| 41 | // ******************************************************************** |
---|
| 42 | |
---|
| 43 | |
---|
| 44 | #include "LISAStackingActionMessenger.hh" |
---|
| 45 | |
---|
| 46 | #include <sstream> |
---|
| 47 | |
---|
| 48 | #include "LISAStackingAction.hh" |
---|
| 49 | |
---|
| 50 | |
---|
| 51 | LISAStackingActionMessenger::LISAStackingActionMessenger |
---|
| 52 | (LISAStackingAction* stackAct) : stackingAction(stackAct){ |
---|
| 53 | |
---|
| 54 | // set flag for primaries survey |
---|
| 55 | SetPriSurvey = new G4UIcmdWithABool("/surveys/surveyPrimaries",this); |
---|
| 56 | SetPriSurvey->SetGuidance |
---|
| 57 | ("Dump primary energies (MeV) to file 'primaries.out'"); |
---|
| 58 | SetPriSurvey->SetGuidance("Default = false"); |
---|
| 59 | SetPriSurvey->SetParameterName("SurveyPrimariesFlag", false); |
---|
| 60 | SetPriSurvey->AvailableForStates(G4State_Idle); |
---|
| 61 | |
---|
| 62 | // set flag for particle survey |
---|
| 63 | SetPartSurvey = new G4UIcmdWithABool("/surveys/surveyParticles",this); |
---|
| 64 | SetPartSurvey->SetGuidance("Dump particle energies to different files"); |
---|
| 65 | SetPartSurvey->SetGuidance("Fragments and nuclei in MeV/nucleon, other in MeV."); |
---|
| 66 | SetPartSurvey->SetGuidance("'gammas.out': gammas above 1 MeV"); |
---|
| 67 | SetPartSurvey->SetGuidance("'electrons.out': e- and e+ above 1 MeV"); |
---|
| 68 | SetPartSurvey->SetGuidance("'neutrons.out': all neutrons"); |
---|
| 69 | SetPartSurvey->SetGuidance("'pions.out': all pions"); |
---|
| 70 | SetPartSurvey->SetGuidance("'muons.out': all muons"); |
---|
| 71 | SetPartSurvey->SetGuidance("'kaons.out': all kaons"); |
---|
| 72 | SetPartSurvey->SetGuidance("'fragments.out': 2H, 3H, He3, alphas"); |
---|
| 73 | SetPartSurvey->SetGuidance("'nuclei.out': all nuclei"); |
---|
| 74 | SetPartSurvey->SetGuidance("'others.out': others above 1 MeV"); |
---|
| 75 | SetPartSurvey->SetGuidance("Default = false"); |
---|
| 76 | SetPartSurvey->SetParameterName("SurveyParticlesFlag", false); |
---|
| 77 | SetPartSurvey->AvailableForStates(G4State_Idle); |
---|
| 78 | |
---|
| 79 | } |
---|
| 80 | |
---|
| 81 | |
---|
| 82 | LISAStackingActionMessenger::~LISAStackingActionMessenger() { |
---|
| 83 | |
---|
| 84 | delete SetPriSurvey; |
---|
| 85 | delete SetPartSurvey; |
---|
| 86 | |
---|
| 87 | } |
---|
| 88 | |
---|
| 89 | |
---|
| 90 | void LISAStackingActionMessenger::SetNewValue |
---|
| 91 | (G4UIcommand* command, G4String newValue) { |
---|
| 92 | |
---|
| 93 | if(command == SetPriSurvey) { |
---|
| 94 | G4int vl; |
---|
| 95 | const char* t = newValue; |
---|
| 96 | std::istringstream is(t); |
---|
| 97 | is >> vl; |
---|
| 98 | stackingAction->SetPrimarySurvey(vl!=0); |
---|
| 99 | } |
---|
| 100 | |
---|
| 101 | else if(command == SetPartSurvey) { |
---|
| 102 | G4int vl; |
---|
| 103 | const char* t = newValue; |
---|
| 104 | std::istringstream is(t); |
---|
| 105 | is >> vl; |
---|
| 106 | stackingAction->SetParticleSurvey(vl!=0); |
---|
| 107 | } |
---|
| 108 | |
---|
| 109 | |
---|
| 110 | |
---|
| 111 | } |
---|
| 112 | |
---|