ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
F04FieldMessenger.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file F04FieldMessenger.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 //
26 //
29 //
30 
31 #include "F04FieldMessenger.hh"
32 
33 #include "F04GlobalField.hh"
34 #include "G4UIdirectory.hh"
35 #include "G4UIcmdWithAString.hh"
36 #include "G4UIcmdWithAnInteger.hh"
39 
41 
42 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43 
45  F04DetectorConstruction* detector)
46  : fGlobalField(pEMfield)
47 {
48  fDetector = detector;
49 
50  fDetDir = new G4UIdirectory("/field/");
51  fDetDir->SetGuidance(" Field tracking control ");
52 
53  fCaptureB1Cmd = new G4UIcmdWithADoubleAndUnit("/field/SetCaptureB1",this);
54  fCaptureB1Cmd->SetGuidance("Set B1 of the Capture Magnet");
55  fCaptureB1Cmd->SetParameterName("CSizeB1",false,false);
56  fCaptureB1Cmd->SetDefaultUnit("tesla");
57  fCaptureB1Cmd->SetRange("CSizeB1>0.");
59 
60  fCaptureB2Cmd = new G4UIcmdWithADoubleAndUnit("/field/SetCaptureB2",this);
61  fCaptureB2Cmd->SetGuidance("Set B2 of the Capture Magnet");
62  fCaptureB2Cmd->SetParameterName("CSizeB2",false,false);
63  fCaptureB2Cmd->SetDefaultUnit("tesla");
64  fCaptureB2Cmd->SetRange("CSizeB2>0.");
66 
67  fTransferBCmd = new G4UIcmdWithADoubleAndUnit("/field/SetTransferB",this);
68  fTransferBCmd->SetGuidance("Set B of the Transfer Magnet");
69  fTransferBCmd->SetParameterName("TSizeB",false,false);
70  fTransferBCmd->SetDefaultUnit("tesla");
71  fTransferBCmd->SetRange("TSizeB>0.");
73 
74  fStepperCMD = new G4UIcmdWithAnInteger("/field/setStepperType",this);
75  fStepperCMD->SetGuidance("Select stepper type for field");
76  fStepperCMD->SetParameterName("choice",true);
79 
80  fMinStepCMD = new G4UIcmdWithADoubleAndUnit("/field/setMinStep",this);
81  fMinStepCMD->SetGuidance("Define minimal step");
82  fMinStepCMD->SetParameterName("min step",false,false);
85 
86  fDeltaChordCMD = new G4UIcmdWithADoubleAndUnit("/field/setDeltaChord",this);
87  fDeltaChordCMD->SetGuidance("Define delta chord");
88  fDeltaChordCMD->SetParameterName("delta chord",false,false);
91 
93  new G4UIcmdWithADoubleAndUnit("/field/setDeltaOneStep",this);
94  fDeltaOneStepCMD->SetGuidance("Define delta one step");
95  fDeltaOneStepCMD->SetParameterName("delta one step",false,false);
98 
100  new G4UIcmdWithADoubleAndUnit("/field/setDeltaIntersection",this);
101  fDeltaIntersectionCMD->SetGuidance("Define delta intersection");
102  fDeltaIntersectionCMD->SetParameterName("delta intersection",false,false);
105 
106  fEpsMinCMD = new G4UIcmdWithADoubleAndUnit("/field/setEpsMin",this);
107  fEpsMinCMD->SetGuidance("Define eps min");
108  fEpsMinCMD->SetParameterName("eps min",false,false);
109  fEpsMinCMD->SetDefaultUnit("mm");
111 
112  fEpsMaxCMD = new G4UIcmdWithADoubleAndUnit("/field/setEpsMax",this);
113  fEpsMaxCMD->SetGuidance("Define eps max");
114  fEpsMaxCMD->SetParameterName("eps max",false,false);
115  fEpsMaxCMD->SetDefaultUnit("mm");
117 }
118 
119 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
120 
122 {
123  delete fDetDir;
124 
125  delete fCaptureB1Cmd;
126  delete fCaptureB2Cmd;
127  delete fTransferBCmd;
128 
129  delete fStepperCMD;
130  delete fMinStepCMD;
131  delete fDeltaChordCMD;
132  delete fDeltaOneStepCMD;
133  delete fDeltaIntersectionCMD;
134  delete fEpsMinCMD;
135  delete fEpsMaxCMD;
136 }
137 
138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
139 
141 {
142 
143  if( command == fCaptureB1Cmd )
145 
146  if( command == fCaptureB2Cmd )
148 
149  if( command == fTransferBCmd )
151 
152  if( command == fStepperCMD )
153  {
155  }
156  if( command == fMinStepCMD )
157  {
159  }
160  if( command == fDeltaChordCMD )
161  {
163  }
164  if( command == fDeltaOneStepCMD )
165  {
166  fGlobalField->
167  SetDeltaOneStep(fDeltaOneStepCMD->GetNewDoubleValue(newValue));
168  }
169  if( command == fDeltaIntersectionCMD )
170  {
171  fGlobalField->
172  SetDeltaIntersection(fDeltaIntersectionCMD->GetNewDoubleValue(newValue));
173  }
174  if( command == fEpsMinCMD )
175  {
177  }
178  if( command == fEpsMaxCMD )
179  {
181  }
182 }