// // ******************************************************************** // * 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: F02FieldMessenger.cc,v 1.3 2001/10/15 17:20:43 gcosmo Exp $ // GEANT4 tag $Name: geant4-04-00 $ // // #include "F02FieldMessenger.hh" #include "F02ElectroMagneticField.hh" #include "G4UIdirectory.hh" #include "G4UIcmdWithAString.hh" #include "G4UIcmdWithAnInteger.hh" #include "G4UIcmdWithADoubleAndUnit.hh" #include "G4UIcmdWithoutParameter.hh" ////////////////////////////////////////////////////////////////////////////// F02FieldMessenger::F02FieldMessenger(F02ElectroMagneticField* pEMfield) :fEMfield(pEMfield) { F02detDir = new G4UIdirectory("/field/"); F02detDir->SetGuidance("F02 field tracking control."); StepperCmd = new G4UIcmdWithAnInteger("/field/setStepperType",this); StepperCmd->SetGuidance("Select stepper type for electric field"); StepperCmd->SetParameterName("choice",true); StepperCmd->SetDefaultValue(4); StepperCmd->AvailableForStates(PreInit,Idle); UpdateCmd = new G4UIcmdWithoutParameter("/field/update",this); UpdateCmd->SetGuidance("Update calorimeter geometry."); UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" "); UpdateCmd->SetGuidance("if you changed geometrical value(s)."); UpdateCmd->AvailableForStates(Idle); MagFieldCmd = new G4UIcmdWithADoubleAndUnit("/field/setFieldZ",this); MagFieldCmd->SetGuidance("Define magnetic field."); MagFieldCmd->SetGuidance("Magnetic field will be in Z direction."); MagFieldCmd->SetParameterName("Bz",false,false); MagFieldCmd->SetDefaultUnit("tesla"); MagFieldCmd->AvailableForStates(Idle); MinStepCmd = new G4UIcmdWithADoubleAndUnit("/field/setMinStep",this); MinStepCmd->SetGuidance("Define minimal step"); MinStepCmd->SetGuidance("Magnetic field will be in Z direction."); MinStepCmd->SetParameterName("min step",false,false); MinStepCmd->SetDefaultUnit("mm"); MinStepCmd->AvailableForStates(Idle); AbsMaterCmd = new G4UIcmdWithAString("/field/setAbsMat",this); AbsMaterCmd->SetGuidance("Select Material of the Absorber."); AbsMaterCmd->SetParameterName("choice",true); AbsMaterCmd->SetDefaultValue("Xe"); AbsMaterCmd->AvailableForStates(Idle); } /////////////////////////////////////////////////////////////////////////////// F02FieldMessenger::~F02FieldMessenger() { delete StepperCmd; delete MagFieldCmd; delete MinStepCmd; delete F02detDir; delete UpdateCmd; delete AbsMaterCmd; } //////////////////////////////////////////////////////////////////////////// // // void F02FieldMessenger::SetNewValue( G4UIcommand* command, G4String newValue) { if( command == StepperCmd ) { fEMfield->SetStepperType(StepperCmd->GetNewIntValue(newValue)); } if( command == UpdateCmd ) { fEMfield->UpdateField(); } if( command == MagFieldCmd ) { fEMfield->SetFieldValue(MagFieldCmd->GetNewDoubleValue(newValue)); } if( command == MinStepCmd ) { fEMfield->SetMinStep(MinStepCmd->GetNewDoubleValue(newValue)); } } // // /////////////////////////////////////////////////////////////////////////