source: trunk/source/processes/electromagnetic/lowenergy/test/fluoTest/src/XrayFluoPrimaryGeneratorMessenger.cc @ 1199

Last change on this file since 1199 was 1199, checked in by garnier, 15 years ago

nvx fichiers dans CVS

File size: 4.5 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// $Id: XrayFluoPrimarygeneratorMessenger.cc
28// GEANT4 tag $Name: xray_fluo-V03-02-00
29//
30// Author: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
31//
32// History:
33// -----------
34// 28 Nov 2001 Elena Guardincerri     Created
35//
36// -------------------------------------------------------------------
37
38#include "XrayFluoPrimaryGeneratorMessenger.hh"
39#include "XrayFluoPrimaryGeneratorAction.hh"
40#include "G4UIcmdWithAString.hh"
41
42//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
43
44XrayFluoPrimaryGeneratorMessenger::XrayFluoPrimaryGeneratorMessenger(XrayFluoPrimaryGeneratorAction* XrayFluoGun)
45:XrayFluoAction(XrayFluoGun)
46{ 
47  RndmCmd = new G4UIcmdWithAString("/gun/random",this);
48  RndmCmd->SetGuidance("Shoot randomly the incident particle.");
49  RndmCmd->SetGuidance("  Choice : on(default), off");
50  RndmCmd->SetParameterName("choice",true);
51  RndmCmd->SetDefaultValue("on");
52  RndmCmd->SetCandidates("on off");
53  RndmCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
54
55  RndmVert = new G4UIcmdWithAString("/gun/randomVert",this);
56  RndmVert->SetGuidance("Shoot randomly the incident particle.");
57  RndmVert->SetGuidance("  Choice : on(default), off");
58  RndmVert->SetParameterName("choice",true);
59  RndmVert->SetDefaultValue("on");
60  RndmVert->SetCandidates("on off");
61  RndmVert->AvailableForStates(G4State_PreInit,G4State_Idle);
62
63  spectrum = new G4UIcmdWithAString("/gun/spectrum",this);
64  spectrum->SetGuidance("Shoot the incident particle with a certain energy spectrum.");
65  spectrum->SetGuidance("  Choice : on(default), off");
66  spectrum->SetParameterName("choice",true);
67  spectrum->SetDefaultValue("on");
68  spectrum->SetCandidates("on off");
69  spectrum->AvailableForStates(G4State_PreInit,G4State_Idle);
70
71  isoVert = new G4UIcmdWithAString("/gun/isoVert",this);
72  isoVert->SetGuidance("Shoot the incident particle from an isotrofic direction.");
73  isoVert->SetGuidance("  Choice : on(default), off");
74  isoVert->SetParameterName("choice",true);
75  isoVert->SetDefaultValue("on");
76  isoVert->SetCandidates("on off");
77  isoVert->AvailableForStates(G4State_PreInit,G4State_Idle);
78
79}
80
81//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
82
83XrayFluoPrimaryGeneratorMessenger::~XrayFluoPrimaryGeneratorMessenger()
84{
85  delete RndmCmd;
86  delete  RndmVert;
87  delete spectrum;
88  delete isoVert;
89}
90
91//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
92
93void XrayFluoPrimaryGeneratorMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
94{ 
95  if( command == RndmCmd )
96   { XrayFluoAction->SetRndmFlag(newValue);}
97 if( command == RndmVert )
98   { XrayFluoAction->SetRndmVert(newValue);}
99 if( command == spectrum )
100   { XrayFluoAction->SetSpectrum(newValue);} 
101 if( command == isoVert )
102   { XrayFluoAction->SetIsoVert(newValue);}
103}
104
105//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
106
Note: See TracBrowser for help on using the repository browser.