source: trunk/examples/novice/N06/src/ExN06PhysicsListMessenger.cc @ 1287

Last change on this file since 1287 was 1230, checked in by garnier, 14 years ago

update to geant4.9.3

File size: 3.7 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: ExN06PhysicsListMessenger.cc,v 1.3 2006/06/29 17:54:25 gunter Exp $
28// GEANT4 tag $Name: geant4-09-03-cand-01 $
29//
30//
31
32//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34
35#include "ExN06PhysicsListMessenger.hh"
36
37#include "ExN06PhysicsList.hh"
38#include "G4UIdirectory.hh"
39#include "G4UIcmdWithAnInteger.hh"
40
41//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42
43ExN06PhysicsListMessenger::ExN06PhysicsListMessenger(ExN06PhysicsList* pPhys)
44:pPhysicsList(pPhys)
45{
46  N06Dir = new G4UIdirectory("/N06/");
47  N06Dir->SetGuidance("UI commands of this example");
48 
49  physDir = new G4UIdirectory("/N06/phys/");
50  physDir->SetGuidance("PhysicsList control");
51 
52  verboseCmd = new G4UIcmdWithAnInteger("/N06/phys/verbose",this); 
53  verboseCmd->SetGuidance("set verbose for physics processes");
54  verboseCmd->SetParameterName("verbose",true);
55  verboseCmd->SetDefaultValue(1);
56  verboseCmd->SetRange("verbose>=0");
57  verboseCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
58 
59  cerenkovCmd = new G4UIcmdWithAnInteger("/N06/phys/cerenkovMaxPhotons",this); 
60  cerenkovCmd->SetGuidance("set max nb of photons per step");
61  cerenkovCmd->SetParameterName("MaxNumber",false);
62  cerenkovCmd->SetRange("MaxNumber>=0");
63  cerenkovCmd->AvailableForStates(G4State_Idle); 
64}
65
66//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
67
68ExN06PhysicsListMessenger::~ExN06PhysicsListMessenger()
69{
70  delete verboseCmd;
71  delete cerenkovCmd;
72  delete physDir;
73  delete N06Dir;
74}
75
76//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
77
78void ExN06PhysicsListMessenger::SetNewValue(G4UIcommand* command,
79                                          G4String newValue)
80{       
81  if( command == verboseCmd )
82   { pPhysicsList->SetVerbose(verboseCmd->GetNewIntValue(newValue));}
83   
84  if( command == cerenkovCmd )
85   {pPhysicsList->SetNbOfPhotonsCerenkov(cerenkovCmd->GetNewIntValue(newValue));}
86}
87
88//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Note: See TracBrowser for help on using the repository browser.