source: trunk/source/geometry/magneticfield/test/NTST/src/NTSTPhysicsListMessenger.cc@ 1331

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

nvx fichiers dans CVS

File size: 5.0 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// $Id: NTSTPhysicsListMessenger.cc,v 1.3 2006/06/29 18:26:24 gunter Exp $
27// GEANT4 tag $Name: HEAD $
28//
29//
30
31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
32//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
33
34#include "NTSTPhysicsListMessenger.hh"
35
36#include "NTSTPhysicsList.hh"
37#include "G4UIcmdWithoutParameter.hh"
38#include "G4UIcmdWithABool.hh"
39#include "G4UIcmdWithADoubleAndUnit.hh"
40
41//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
42
43NTSTPhysicsListMessenger::NTSTPhysicsListMessenger(NTSTPhysicsList * List)
44:NTSTList(List)
45{
46 ProcessCmd = new G4UIcmdWithoutParameter("/run/setEmProcess",this);
47 ProcessCmd->SetGuidance("select electromagnetic processes");
48 ProcessCmd->AvailableForStates(G4State_PreInit); // New-state
49 // ProcessCmd->AvailableForStates(PreInit); // Old-state
50
51 useBgsTranCmd = new G4UIcmdWithABool("/run/useBgsTran",this);
52 useBgsTranCmd->SetGuidance( "True if BgsTransportation to be used" );
53 useBgsTranCmd->AvailableForStates(G4State_PreInit); // New-state
54 // useBgsTranCmd->AvailableForStates(PreInit); // Old-state
55
56 MinimumEnergyCutCmd = new G4UIcmdWithADoubleAndUnit("/run/minEcut", this);
57 MinimumEnergyCutCmd->SetGuidance("ParticleWithCuts minimum energy cut (with unit)" );
58 MinimumEnergyCutCmd->AvailableForStates(G4State_PreInit); // New-state
59 // MinimumEnergyCutCmd->AvailableForStates(PreInit); // Old-state
60
61 MaximumEnergyCutCmd = new G4UIcmdWithADoubleAndUnit("/run/maxEcut", this);
62 MaximumEnergyCutCmd->SetGuidance("ParticleWithCuts maximum energy cut (with unit)" );
63 MaximumEnergyCutCmd->AvailableForStates(G4State_PreInit); // New-state
64 // MaximumEnergyCutCmd->AvailableForStates(PreInit); // Old-state
65
66 CutCmd = new G4UIcmdWithADoubleAndUnit("/run/cut", this);
67 CutCmd->SetGuidance("new cut value (with unit)" );
68 CutCmd->AvailableForStates(G4State_PreInit); // New-state
69 // CutCmd->AvailableForStates(PreInit); // Old-state
70
71 LooperCutCmd = new G4UIcmdWithADoubleAndUnit("/run/looperCut", this);
72 LooperCutCmd->SetGuidance("Kill loopers below this cut (with unit)" );
73 LooperCutCmd->AvailableForStates(G4State_PreInit); // New-state
74 // LooperCutCmd->AvailableForStates(PreInit); // Old-state
75}
76
77//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
78
79NTSTPhysicsListMessenger::~NTSTPhysicsListMessenger()
80{
81 delete ProcessCmd;
82 delete useBgsTranCmd;
83 delete MinimumEnergyCutCmd;
84 delete MaximumEnergyCutCmd;
85 delete CutCmd;
86 delete LooperCutCmd;
87}
88
89//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
90
91void NTSTPhysicsListMessenger::SetNewValue(G4UIcommand* command,G4String s)
92{
93 if(command == ProcessCmd) {
94 NTSTList->SetStatusEmProcess();
95 } else if (command == useBgsTranCmd) {
96 NTSTList->SetBgsTran( useBgsTranCmd->GetNewBoolValue(s) );
97 } else if (command == MinimumEnergyCutCmd) {
98 NTSTList->SetMinimumEnergyCut( MinimumEnergyCutCmd->GetNewDoubleValue(s));
99 } else if (command == MaximumEnergyCutCmd) {
100 NTSTList->SetMaximumEnergyCut( MaximumEnergyCutCmd->GetNewDoubleValue(s));
101 } else if (command == CutCmd) {
102 NTSTList->SetLengthCut( CutCmd->GetNewDoubleValue(s) );
103 } else if (command == LooperCutCmd) {
104 NTSTList->SetLooperCut( LooperCutCmd->GetNewDoubleValue(s) );
105 }
106}
107
108//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
109
110
111
112
113
114
115
Note: See TracBrowser for help on using the repository browser.