BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
BesMagneticFieldMessenger.cc
Go to the documentation of this file.
2#include "BesMagneticField.hh"
3
4#include "G4UIcmdWithADouble.hh"
5#include "G4UIcmdWithADoubleAndUnit.hh"
6#include "G4UIcmdWithAString.hh"
7#include "G4UIcmdWithAnInteger.hh"
8#include "G4UIcmdWithoutParameter.hh"
9#include "G4UIdirectory.hh"
10
11// The standard constructor
13 : fEMfieldSetup( pEMfieldSetup ) {
14 F01detDir = new G4UIdirectory( "/field/" );
15 F01detDir->SetGuidance( "Bes MagneticField tracking control." );
16
17 StepperCmd = new G4UIcmdWithAnInteger( "/field/SetStepperType", this );
18 StepperCmd->SetGuidance( "Select stepper type for magnetic field" );
19 StepperCmd->SetParameterName( "choice", true );
20 StepperCmd->SetDefaultValue( 4 );
21 StepperCmd->SetRange( "choice>=0&&choice<=9" );
22
23 MinStepCmd = new G4UIcmdWithADoubleAndUnit( "/field/SetMinStep", this );
24 MinStepCmd->SetGuidance( "Please change it carefully,it is better keep it const" );
25 MinStepCmd->SetParameterName( "MinStep", true );
26 MinStepCmd->SetDefaultUnit( "mm" );
27 MinStepCmd->SetDefaultValue( 0.01 );
28 MinStepCmd->SetRange( "MinStep>=0&&MinStep<=1" );
29
30 DeltaOneStepCmd = new G4UIcmdWithADoubleAndUnit( "/field/SetDeltaOneStep", this );
31 DeltaOneStepCmd->SetGuidance( "Set DeltaOneStep for tracking" );
32 DeltaOneStepCmd->SetParameterName( "DeltaOneStep", true );
33 DeltaOneStepCmd->SetDefaultUnit( "mm" );
34 DeltaOneStepCmd->SetDefaultValue( 0.01 );
35 DeltaOneStepCmd->SetRange( "DeltaOneStep>=0" );
36
37 DeltaIntersectionCmd = new G4UIcmdWithADoubleAndUnit( "/field/SetDeltaIntersection", this );
38 DeltaIntersectionCmd->SetGuidance( "Set DeltaIntersection for tracking" );
39 DeltaIntersectionCmd->SetParameterName( "DeltaIntersection", true );
40 DeltaIntersectionCmd->SetDefaultUnit( "mm" );
41 DeltaIntersectionCmd->SetDefaultValue( 0.001 );
42 DeltaIntersectionCmd->SetRange( "DeltaIntersection>=0" );
43
44 MinimumEpsilonStepCmd = new G4UIcmdWithADouble( "/field/SetMinimumEpsilonStep", this );
45 MinimumEpsilonStepCmd->SetGuidance( "Set Minimum Epsilon Step for tracking" );
46 MinimumEpsilonStepCmd->SetParameterName( "MinimumEpsilonStep", true );
47 MinimumEpsilonStepCmd->SetDefaultValue( 5.0e-5 );
48 MinimumEpsilonStepCmd->SetRange( "MinimumEpsilonStep>=0" );
49
50 MaximumEpsilonStepCmd = new G4UIcmdWithADouble( "/field/SetMaximumEpsilonStep", this );
51 MaximumEpsilonStepCmd->SetGuidance( "Set Maximum Epsilon Step for tracking" );
52 MaximumEpsilonStepCmd->SetParameterName( "MaximumEpsilonStep", true );
53 MaximumEpsilonStepCmd->SetDefaultValue( 1.0e-3 );
54 MaximumEpsilonStepCmd->SetRange( "MaximumEpsilonStep>=0" );
55}
56
58 delete MaximumEpsilonStepCmd;
59 delete MinimumEpsilonStepCmd;
60 delete DeltaIntersectionCmd;
61 delete DeltaOneStepCmd;
62 delete MinStepCmd;
63 delete StepperCmd;
64 delete F01detDir;
65}
66
67void BesMagneticFieldMessenger::SetNewValue( G4UIcommand* command, G4String newvalue ) {
68 // Please don't change the order of code ,it will make some parameters useless if you do
69 // that.
70 if ( command == StepperCmd )
71 {
72 fEMfieldSetup->SetStepperType( StepperCmd->GetNewIntValue( newvalue ) );
73 fEMfieldSetup->CreateStepperAndChordFinder();
74 }
75 if ( command == MinStepCmd )
76 {
77 fEMfieldSetup->SetMinStep( MinStepCmd->GetNewDoubleValue( newvalue ) );
78 fEMfieldSetup->CreateStepperAndChordFinder();
79 }
80 if ( command == DeltaOneStepCmd )
81 { fEMfieldSetup->SetDeltaOneStep( DeltaOneStepCmd->GetNewDoubleValue( newvalue ) ); }
82 if ( command == DeltaIntersectionCmd )
83 {
84 fEMfieldSetup->SetDeltaIntersection( DeltaIntersectionCmd->GetNewDoubleValue( newvalue ) );
85 }
86 if ( command == MinimumEpsilonStepCmd )
87 {
88 fEMfieldSetup->SetMinimumEpsilonStep(
89 MinimumEpsilonStepCmd->GetNewDoubleValue( newvalue ) );
90 }
91 if ( command == MaximumEpsilonStepCmd )
92 {
93 fEMfieldSetup->SetMaximumEpsilonStep(
94 MaximumEpsilonStepCmd->GetNewDoubleValue( newvalue ) );
95 }
96}
BesMagneticFieldMessenger(BesMagneticField *)
void SetNewValue(G4UIcommand *, G4String)