BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
BesMagneticFieldMessenger.cc
Go to the documentation of this file.
2#include "BesMagneticField.hh"
3
4#include "G4UIdirectory.hh"
5#include "G4UIcmdWithAString.hh"
6#include "G4UIcmdWithAnInteger.hh"
7#include "G4UIcmdWithADouble.hh"
8#include "G4UIcmdWithADoubleAndUnit.hh"
9#include "G4UIcmdWithoutParameter.hh"
10
11//The standard constructor
13{
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{
59 delete MaximumEpsilonStepCmd;
60 delete MinimumEpsilonStepCmd;
61 delete DeltaIntersectionCmd;
62 delete DeltaOneStepCmd;
63 delete MinStepCmd;
64 delete StepperCmd;
65 delete F01detDir;
66}
67
68void BesMagneticFieldMessenger::SetNewValue( G4UIcommand* command, G4String newvalue)
69{
70//Please don't change the order of code ,it will make some parameters useless if you do that.
71 if(command==StepperCmd)
72 {
73 fEMfieldSetup->SetStepperType(StepperCmd->GetNewIntValue(newvalue));
74 fEMfieldSetup->CreateStepperAndChordFinder();
75 }
76 if(command==MinStepCmd)
77 {
78 fEMfieldSetup->SetMinStep(MinStepCmd->GetNewDoubleValue(newvalue));
79 fEMfieldSetup->CreateStepperAndChordFinder();
80 }
81 if(command==DeltaOneStepCmd)
82 {
83 fEMfieldSetup->SetDeltaOneStep(DeltaOneStepCmd->GetNewDoubleValue(newvalue));
84 }
85 if(command==DeltaIntersectionCmd)
86 {
87 fEMfieldSetup->SetDeltaIntersection(DeltaIntersectionCmd->GetNewDoubleValue(newvalue));
88 }
89 if(command==MinimumEpsilonStepCmd)
90 {
91 fEMfieldSetup->SetMinimumEpsilonStep(MinimumEpsilonStepCmd->GetNewDoubleValue(newvalue));
92 }
93 if(command==MaximumEpsilonStepCmd)
94 {
95 fEMfieldSetup->SetMaximumEpsilonStep(MaximumEpsilonStepCmd->GetNewDoubleValue(newvalue));
96 }
97
98}
BesMagneticFieldMessenger(BesMagneticField *)
void SetNewValue(G4UIcommand *, G4String)
void SetMaximumEpsilonStep(double newvalue)
void CreateStepperAndChordFinder()
void SetDeltaIntersection(double newvalue)
void SetStepperType(G4int i)
void SetMinimumEpsilonStep(double newvalue)
void SetMinStep(G4double s)
void SetDeltaOneStep(double newvalue)