Loading...
Searching...
No Matches
F02FieldMessenger.cc
Go to the documentation of this file.
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/// \file field/field02/src/F02FieldMessenger.cc
27/// \brief Implementation of the F02FieldMessenger class
28//
29//
30//
31//
32//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34
35#include "F02FieldMessenger.hh"
36
38#include "G4UIcmdWithAnInteger.hh"
39#include "G4UIcmdWithADoubleAndUnit.hh"
40#include "G4UIcmdWith3VectorAndUnit.hh"
41#include "G4UIcmdWithoutParameter.hh"
42
43//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44
46 : fElFieldSetup(fieldSetup)
47{
48 fFieldDir = new G4UIdirectory("/field/");
49 fFieldDir->SetGuidance("F02 field tracking control.");
50
51 fStepperCmd = new G4UIcmdWithAnInteger("/field/setStepperType",this);
52 fStepperCmd->SetGuidance("Select stepper type for electric field");
53 fStepperCmd->SetParameterName("choice",true);
54 fStepperCmd->SetDefaultValue(4);
55 fStepperCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
56
57 fUpdateCmd = new G4UIcmdWithoutParameter("/field/update",this);
58 fUpdateCmd->SetGuidance("Update calorimeter geometry.");
59 fUpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
60 fUpdateCmd->SetGuidance("if you changed geometrical value(s).");
61 fUpdateCmd->AvailableForStates(G4State_Idle);
62
63 fElFieldZCmd = new G4UIcmdWithADoubleAndUnit("/field/setFieldZ",this);
64 fElFieldZCmd->SetGuidance("Define uniform Electric field.");
65 fElFieldZCmd->SetGuidance("Electric field will be in Z direction.");
66 fElFieldZCmd->SetGuidance("Value of Electric field has to be given in volt/m");
67 fElFieldZCmd->SetParameterName("Ez",false,false);
68 fElFieldZCmd->SetDefaultUnit("megavolt/m");
69 fElFieldZCmd->AvailableForStates(G4State_Idle);
70
71 fElFieldCmd = new G4UIcmdWith3VectorAndUnit("/field/setField",this);
72 fElFieldCmd->SetGuidance("Define uniform Electric field.");
73 fElFieldCmd->SetGuidance("Value of Electric field has to be given in volt/m");
74 fElFieldCmd->SetParameterName("Ex","Ey","Ez",false,false);
75 fElFieldCmd->SetDefaultUnit("megavolt/m");
76 fElFieldCmd->AvailableForStates(G4State_Idle);
77
78 fMinStepCmd = new G4UIcmdWithADoubleAndUnit("/field/setMinStep",this);
79 fMinStepCmd->SetGuidance("Define minimal step");
80 fMinStepCmd->SetParameterName("min step",false,false);
81 fMinStepCmd->SetDefaultUnit("mm");
82 fMinStepCmd->AvailableForStates(G4State_Idle);
83}
84
85//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
86
88{
89 delete fStepperCmd;
90 delete fElFieldZCmd;
91 delete fElFieldCmd;
92 delete fMinStepCmd;
93 delete fFieldDir;
94 delete fUpdateCmd;
95}
96
97//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
98
100{
101 if( command == fStepperCmd )
102 fElFieldSetup->SetStepperType(fStepperCmd->GetNewIntValue(newValue));
103 if( command == fUpdateCmd )
105 if( command == fElFieldZCmd )
106 fElFieldSetup->SetFieldZValue(fElFieldZCmd->GetNewDoubleValue(newValue));
107 if( command == fElFieldCmd )
108 fElFieldSetup->SetFieldValue(fElFieldCmd->GetNew3VectorValue(newValue));
109 if( command == fMinStepCmd )
110 fElFieldSetup->SetMinStep(fMinStepCmd->GetNewDoubleValue(newValue));
111}
112
113//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Definition of the F02ElectricFieldSetup class.
Definition of the F02FieldMessenger class.
A class for control of the Electric Field of the detector.
void SetFieldValue(G4ThreeVector fieldVector)
void SetFieldZValue(G4double fieldValue)
G4UIcmdWithoutParameter * fUpdateCmd
G4UIcmdWithADoubleAndUnit * fElFieldZCmd
void SetNewValue(G4UIcommand *, G4String) override
G4UIcmdWithADoubleAndUnit * fMinStepCmd
G4UIcmdWith3VectorAndUnit * fElFieldCmd
F02ElectricFieldSetup * fElFieldSetup
F02FieldMessenger(F02ElectricFieldSetup *)
G4UIdirectory * fFieldDir
~F02FieldMessenger() override
G4UIcmdWithAnInteger * fStepperCmd

Applications | User Support | Publications | Collaboration