ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
F01FieldMessenger.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file F01FieldMessenger.cc
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 //
28 //
29 //
30 //
31 //
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34 
35 #include "F01FieldMessenger.hh"
36 
37 #include "F01FieldSetup.hh"
38 #include "G4UIcmdWithAnInteger.hh"
42 
43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44 
46  : G4UImessenger(),
47  fEMfieldSetup(fieldSetup),
48  fFieldDir(0),
49  fStepperCmd(0),
50  fMagFieldZCmd(0),
51  fMagFieldCmd(0),
52  fMinStepCmd(0),
53  fUpdateCmd(0)
54 {
55  fFieldDir = new G4UIdirectory("/field/");
56  fFieldDir->SetGuidance("F01 field tracking control.");
57 
58  fStepperCmd = new G4UIcmdWithAnInteger("/field/setStepperType",this);
59  fStepperCmd->SetGuidance("Select stepper type for magnetic field");
60  fStepperCmd->SetParameterName("choice",true);
63 
64  fUpdateCmd = new G4UIcmdWithoutParameter("/field/update",this);
65  fUpdateCmd->SetGuidance("Update calorimeter geometry.");
66  fUpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
67  fUpdateCmd->SetGuidance("if you changed geometrical value(s).");
69 
70  fMagFieldZCmd = new G4UIcmdWithADoubleAndUnit("/field/setFieldZ",this);
71  fMagFieldZCmd->SetGuidance("Define magnetic field.");
72  fMagFieldZCmd->SetGuidance("Magnetic field will be in Z direction.");
73  fMagFieldZCmd->SetParameterName("Bz",false,false);
74  fMagFieldZCmd->SetDefaultUnit("tesla");
76 
77  fMagFieldCmd = new G4UIcmdWith3VectorAndUnit("/field/setField",this);
78  fMagFieldCmd->SetGuidance("Define magnetic field.");
79  fMagFieldCmd->SetParameterName("Bx", "By", "Bz" ,false,false);
80  fMagFieldCmd->SetDefaultUnit("tesla");
82 
83  fMinStepCmd = new G4UIcmdWithADoubleAndUnit("/field/setMinStep",this);
84  fMinStepCmd->SetGuidance("Define minimal step");
85  fMinStepCmd->SetGuidance("Magnetic field will be in Z direction.");
86  fMinStepCmd->SetParameterName("min step",false,false);
89 }
90 
91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
92 
94 {
95  delete fStepperCmd;
96  delete fMagFieldZCmd;
97  delete fMagFieldCmd;
98  delete fMinStepCmd;
99  delete fFieldDir;
100  delete fUpdateCmd;
101 }
102 
103 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
104 
106 {
107  if( command == fStepperCmd )
109  if( command == fUpdateCmd )
111  if( command == fMagFieldZCmd )
113  if( command == fMagFieldCmd )
115  if( command == fMinStepCmd )
117 }
118 
119 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......