source: trunk/examples/advanced/cosmicray_charging/src/LISASteppingActionMessenger.cc

Last change on this file was 807, checked in by garnier, 16 years ago

update

File size: 3.9 KB
Line 
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// * LISASteppingActionMessenger class                                *
35// *                                                                  *
36// ********************************************************************
37//
38// HISTORY
39// 22/02/2004: migrated from LISA-V04
40//
41// ********************************************************************
42
43#include "LISASteppingActionMessenger.hh"
44
45#include <sstream>
46
47#include "LISASteppingAction.hh"
48
49
50LISASteppingActionMessenger::LISASteppingActionMessenger
51  (LISASteppingAction* stepAct) : steppingAction(stepAct){
52
53
54  newDir = new G4UIdirectory("/surveys/");
55  newDir->SetGuidance("Particle survey control commands.");
56
57  // set flag for spectrum saving
58  SetFlagSpectrum = new G4UIcmdWithABool("/surveys/surveyTestMasses",this);
59  SetFlagSpectrum->SetGuidance("Dump energies (eV) for e- and hadrons");
60  SetFlagSpectrum->SetGuidance("entering and leaving the test masses.");
61  SetFlagSpectrum->SetGuidance("'electrons_in.out' : e- entering TM");
62  SetFlagSpectrum->SetGuidance("'electrons_out.out': e- leaving TM");
63  SetFlagSpectrum->SetGuidance("'hadrons_in.out'   : hadrons entering TM");
64  SetFlagSpectrum->SetGuidance("'hadrons_out.out'  : hadrons leaving TM");
65  SetFlagSpectrum->SetGuidance("Default = false");
66  SetFlagSpectrum->SetParameterName("FlagSpectrum", false);
67  SetFlagSpectrum->AvailableForStates(G4State_Idle);
68
69}
70
71
72LISASteppingActionMessenger::~LISASteppingActionMessenger() {
73
74  delete SetFlagSpectrum; 
75  delete newDir;
76
77}
78
79
80void LISASteppingActionMessenger::SetNewValue
81   (G4UIcommand* command, G4String newValue) { 
82
83  if(command == SetFlagSpectrum) {
84    G4int vl;
85    const char* t = newValue;
86    std::istringstream is(t);
87    is >> vl;
88    steppingAction->SetFlagSpectrum(vl!=0);
89  }
90
91
92
93}
94
Note: See TracBrowser for help on using the repository browser.