Files
geant4/examples/extended/electromagnetic/TestEm8/src/Em8PhysicsListMessenger.cc
T
2016-06-08 16:10:37 +02:00

121 lines
4.6 KiB
C++

//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: Em8PhysicsListMessenger.cc,v 1.2.4.1 2001/06/28 19:07:12 gunter Exp $
// GEANT4 tag $Name: $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "Em8PhysicsListMessenger.hh"
#include "Em8PhysicsList.hh"
#include "G4UIcmdWithoutParameter.hh"
#include "G4UIcmdWithADouble.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em8PhysicsListMessenger::Em8PhysicsListMessenger(Em8PhysicsList * List)
:Em8List(List)
{
cutGCmd = new G4UIcmdWithADoubleAndUnit("/calor/cutG",this);
cutGCmd->SetGuidance("Set cut values by RANGE for Gamma.");
cutGCmd->SetParameterName("range",true);
cutGCmd->SetDefaultValue(1.);
cutGCmd->SetDefaultUnit("mm");
cutGCmd->AvailableForStates(Idle);
cutECmd = new G4UIcmdWithADoubleAndUnit("/calor/cutE",this);
cutECmd->SetGuidance("Set cut values by RANGE for e- e+.");
cutECmd->SetParameterName("range",true);
cutECmd->SetDefaultValue(1.);
cutECmd->SetDefaultUnit("mm");
cutECmd->AvailableForStates(Idle);
cutPCmd = new G4UIcmdWithADoubleAndUnit("/calor/cutP",this);
cutPCmd->SetGuidance("Set cut values by RANGE for proton and others.");
cutPCmd->SetParameterName("range",true);
cutPCmd->SetDefaultValue(1.);
cutPCmd->SetDefaultUnit("mm");
cutPCmd->AvailableForStates(Idle);
eCmd = new G4UIcmdWithADoubleAndUnit("/calor/cutEnergy",this);
eCmd->SetGuidance("Set cut values by ENERGY for charged particles.");
eCmd->SetParameterName("energy",true);
eCmd->SetDefaultValue(10.);
eCmd->SetDefaultUnit("keV");
eCmd->AvailableForStates(Idle);
rCmd = new G4UIcmdWithADoubleAndUnit("/calor/range",this);
rCmd->SetGuidance("Display the RANGE of Electron for the current material.");
rCmd->SetParameterName("energy",true);
rCmd->SetDefaultValue(10.);
rCmd->SetDefaultUnit("keV");
rCmd->AvailableForStates(Idle);
setMaxStepCmd = new G4UIcmdWithADoubleAndUnit("/step/setMaxStep",this);
setMaxStepCmd->SetGuidance("Set max. step length in the detector");
setMaxStepCmd->SetParameterName("mxStep",true);
setMaxStepCmd->SetDefaultUnit("mm");
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em8PhysicsListMessenger::~Em8PhysicsListMessenger()
{
delete setMaxStepCmd;
delete cutGCmd;
delete cutECmd;
delete cutPCmd;
delete rCmd;
delete eCmd;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em8PhysicsListMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
{
if(command == cutGCmd)
{ Em8List->SetGammaCut(cutGCmd->GetNewDoubleValue(newValue));}
if(command == cutECmd)
{ Em8List->SetElectronCut(eCmd->GetNewDoubleValue(newValue));}
if(command == cutPCmd)
{ Em8List->SetProtonCut(eCmd->GetNewDoubleValue(newValue));}
if(command == eCmd)
{ Em8List->SetCutsByEnergy(cutECmd->GetNewDoubleValue(newValue));}
if(command == rCmd)
{ Em8List->GetRange(rCmd->GetNewDoubleValue(newValue));}
if(command == setMaxStepCmd)
{ Em8List->SetMaxStep(setMaxStepCmd->GetNewDoubleValue(newValue));}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....