PlasmaMLPALLAS
Loading...
Searching...
No Matches
PlasmaMLPALLASGeometryConstruction.hh
Go to the documentation of this file.
1#ifndef PlasmaMLPALLASGeometryConstruction_h
2#define PlasmaMLPALLASGeometryConstruction_h 1
3
19#include "Geometry.hh"
20#include "G4VUserDetectorConstruction.hh"
21#include "G4PVPlacement.hh"
22#include "G4VisAttributes.hh"
23#include "G4GeometryManager.hh"
24#include "G4PhysicalVolumeStore.hh"
25#include "G4LogicalVolumeStore.hh"
26#include "G4SolidStore.hh"
27#include "G4FieldManager.hh"
28#include "G4Mag_UsualEqRhs.hh"
29#include "G4ChordFinder.hh"
30#include "G4ClassicalRK4.hh"
33
34class Geometry;
35class G4FieldManager;
38
39
40class PlasmaMLPALLASGeometryConstruction final : public G4VUserDetectorConstruction
41{
42public:
45
48
51
52 void SetLogicalVolumeColor(G4LogicalVolume* LogicalVolume, G4String color);
53
56
59
62
65
67 void ConstructLIFPart();
68
71
74
77
80
83
86
89
92
94 void ConstructSDandField() override;
95
97 G4VPhysicalVolume *Construct() override;
98
100 static void Print();
102
105 void SetStatusDisplayGeometry(const G4int statusdisplay) {fStatusDisplayGeometry = statusdisplay;};
106 void SetStatusDisplayCollimators(const G4int statusdisplay) {fStatusDisplayCollimators = statusdisplay;};
107 void SetStatusDisplayQuadrupoles(const G4int statusdisplay) {fStatusDisplayQuadrupoles = statusdisplay;};
108
109 const int GetStatusDisplayGeometry() const {return fStatusDisplayGeometry;}
110 const int GetStatusDisplayCollimators() const {return fStatusDisplayCollimators;}
111 const int GetStatusDisplayQuadrupoles() const {return fStatusDisplayQuadrupoles;}
113
116 void SetQ1Length(const G4double QLength) {fQ1Length = QLength;};
117 void SetQ2Length(const G4double QLength) {fQ2Length = QLength;};
118 void SetQ3Length(const G4double QLength) {fQ3Length = QLength;};
119 void SetQ4Length(const G4double QLength) {fQ4Length = QLength;};
120 void SetSourceQ1Distance(const G4double distance) {fSourceQ1Distance = distance;};
121 void SetQ1Q2Distance(const G4double distance) {fQ1Q2Distance = distance;};
122 void SetQ2Q3Distance(const G4double distance) {fQ2Q3Distance = distance;};
123 void SetQ3Q4Distance(const G4double distance) {fQ3Q4Distance = distance;};
124 void SetSourceCollimatorsDistance(const G4double distance) {fSourceCollimatorsDistance = distance;};
125
126 const float GetQ1Length() const {return fQ1Length;}
127 const float GetQ2Length() const {return fQ2Length;}
128 const float GetQ3Length() const {return fQ3Length;}
129 const float GetQ4Length() const {return fQ4Length;}
130 const float GetSourceQ1Distance() const {return fSourceQ1Distance;}
131 const float GetQ1Q2Distance() const {return fQ1Q2Distance;}
132 const float GetQ2Q3Distance() const {return fQ2Q3Distance;}
133 const float GetQ3Q4Distance() const {return fQ3Q4Distance;}
134 const float GetSourceCollimatorsDistance() const {return fSourceCollimatorsDistance;}
136
139 void SetQ1Gradient(const G4double QGrad) {fQ1Gradient = QGrad;};
140 void SetQ2Gradient(const G4double QGrad) {fQ2Gradient = QGrad;};
141 void SetQ3Gradient(const G4double QGrad) {fQ3Gradient = QGrad;};
142 void SetQ4Gradient(const G4double QGrad) {fQ4Gradient = QGrad;};
143 void SetStatusMapBField(const G4int status) {fStatusMapBField = status;};
144 void SetConstantDipoleBField(const G4double BField) {fConstantDipoleBField = BField;};
145
146 const float GetQ1Gradient() const {return fQ1Gradient;}
147 const float GetQ2Gradient() const {return fQ2Gradient;}
148 const float GetQ3Gradient() const {return fQ3Gradient;}
149 const float GetQ4Gradient() const {return fQ4Gradient;}
150 const int GetStatusMapBField() const {return fStatusMapBField;}
151 const float GetConstantDipoleBField() const {return fConstantDipoleBField;}
153
154private:
156 std::unique_ptr<Geometry> Geom;
157
159 std::unique_ptr<PlasmaMLPALLASGeometryMessenger> fGeometryMessenger;
160
162 G4Material *Vacuum;
163 G4Material *Material;
164
166 G4int fStatusDisplayGeometry=0;
167 G4int fStatusDisplayCollimators=0;
168 G4int fStatusDisplayQuadrupoles=0;
169 G4int fStatusMapBField=0;
170
172 G4double fConstantDipoleBField =0.4*CLHEP::tesla;
173 G4double fQ1Length = 0.1*CLHEP::m;
174 G4double fQ2Length = 0.1*CLHEP::m;
175 G4double fQ3Length = 0.2*CLHEP::m;
176 G4double fQ4Length = 0.1*CLHEP::m;
177 G4double fQ1Gradient =0.0*CLHEP::tesla/CLHEP::m;
178 G4double fQ2Gradient =0.0*CLHEP::tesla/CLHEP::m;
179 G4double fQ3Gradient =0.0*CLHEP::tesla/CLHEP::m;
180 G4double fQ4Gradient =0.0*CLHEP::tesla/CLHEP::m;
181 G4double fSourceQ1Distance =0.152*CLHEP::m;
182 G4double fQ1Q2Distance = 0.168*CLHEP::m;
183 G4double fQ2Q3Distance = 0.23*CLHEP::m;
184 G4double fQ3Q4Distance = 0.751*CLHEP::m;
185 G4double fSourceCollimatorsDistance = 3000*CLHEP::mm;
186
188 G4VisAttributes *invis = nullptr; // init all the pointers
189 G4VisAttributes *white = nullptr;
190 G4VisAttributes *gray = nullptr;
191 G4VisAttributes *black = nullptr;
192 G4VisAttributes *red = nullptr;
193 G4VisAttributes *orange = nullptr;
194 G4VisAttributes *yellow = nullptr;
195 G4VisAttributes *green = nullptr;
196 G4VisAttributes *cyan = nullptr;
197 G4VisAttributes *blue = nullptr;
198 G4VisAttributes *magenta = nullptr;
199
201 G4LogicalVolume *LogicalWorld=nullptr;
202 G4LogicalVolume *LogicalHolder=nullptr;
203 G4LogicalVolume *LogicalFakeDiagsChamber=nullptr;
204 G4LogicalVolume *LogicalPALLAS_QuadrupoleQ3=nullptr;
205 G4LogicalVolume *LogicalPALLAS_QuadrupoleQ4=nullptr;
206 G4LogicalVolume *LogicalPALLAS_ASMRemovalChamber=nullptr;
207 G4LogicalVolume *LogicalPALLAS_BreadboardRemovalChamber=nullptr;
208 G4LogicalVolume *LogicalPALLAS_ChassisRemovalChamber=nullptr;
209 G4LogicalVolume *LogicalPALLAS_TubeISO1=nullptr;
210 G4LogicalVolume *LogicalPALLAS_TubeISO2=nullptr;
211 G4LogicalVolume *LogicalPALLAS_ATH500_DN100=nullptr;
212 G4LogicalVolume *LogicalPALLAS_BaseMarbre=nullptr;
213 G4LogicalVolume *LogicalPALLAS_ChambreISO=nullptr;
214 G4LogicalVolume *LogicalPALLAS_QuadrupoleQ1=nullptr;
215 G4LogicalVolume *LogicalPALLAS_QuadrupoleQ2=nullptr;
216 G4LogicalVolume *LogicalPALLAS_Croix=nullptr;
217 G4LogicalVolume *LogicalPALLAS_LIFHublot1=nullptr;
218 G4LogicalVolume *LogicalPALLAS_LIFHublot2=nullptr;
219 G4LogicalVolume *LogicalPALLAS_LIFHublot3=nullptr;
220 G4LogicalVolume *LogicalPALLAS_LIFHublot4=nullptr;
221 G4LogicalVolume *LogicalPALLAS_LIFHublot5=nullptr;
222 G4LogicalVolume *LogicalPALLAS_LIF_IBX_DD=nullptr;
223 G4LogicalVolume *LogicalPALLAS_LIF_SQLT=nullptr;
224 G4LogicalVolume *LogicalPALLAS_MarbreBreadboard1=nullptr;
225 G4LogicalVolume *LogicalPALLAS_MarbreBreadboard2=nullptr;
226 G4LogicalVolume *LogicalPALLAS_OptoMeK=nullptr;
227 G4LogicalVolume *LogicalPALLAS_ASMPoutre=nullptr;
228 G4LogicalVolume *LogicalPALLAS_StationYAG=nullptr;
229 G4LogicalVolume *LogicalPALLAS_BlindageBD=nullptr;
230 G4LogicalVolume *LogicalPALLAS_BlindageCBD=nullptr;
231 G4LogicalVolume *LogicalPALLAS_ChambreDipole=nullptr;
232 G4LogicalVolume *LogicalPALLAS_ChassisDipoleYAG=nullptr;
233 G4LogicalVolume *LogicalPALLAS_DiagsChamber=nullptr;
234 G4LogicalVolume *LogicalPALLAS_Dipole=nullptr;
235 G4LogicalVolume *LogicalPALLAS_BS1YAG=nullptr;
236 G4LogicalVolume *LogicalPALLAS_BSPEC1YAG=nullptr;
237 G4LogicalVolume *LogicalPALLAS_S4Tube=nullptr;
238 G4LogicalVolume *LogicalPALLAS_S4Tube1=nullptr;
239 G4LogicalVolume *LogicalPALLAS_S4Soufflet=nullptr;
240 G4LogicalVolume *LogicalPALLAS_S4Croix=nullptr;
241 G4LogicalVolume *LogicalPALLAS_Assemblage2Cellules=nullptr;
242 G4LogicalVolume *LogicalPALLAS_Collimator_H1=nullptr;
243 G4LogicalVolume *LogicalPALLAS_Collimator_H2=nullptr;
244 G4LogicalVolume *LogicalPALLAS_Collimator_Arbre_H=nullptr;
245 G4LogicalVolume *LogicalPALLAS_Collimator_Bride_H=nullptr;
246 G4LogicalVolume *LogicalPALLAS_Collimator_Palier_H=nullptr;
247 G4LogicalVolume *LogicalPALLAS_Collimator_Soufflet_H=nullptr;
248 G4LogicalVolume *LogicalPALLAS_Collimator_V1=nullptr;
249 G4LogicalVolume *LogicalPALLAS_Collimator_V2=nullptr;
250 G4LogicalVolume *LogicalPALLAS_Collimator_Arbre_V=nullptr;
251 G4LogicalVolume *LogicalPALLAS_Collimator_Bride_V=nullptr;
252 G4LogicalVolume *LogicalPALLAS_Collimator_Palier_V=nullptr;
253 G4LogicalVolume *LogicalPALLAS_Collimator_Soufflet_V=nullptr;
254
256 G4VPhysicalVolume *PhysicalWorld=nullptr;
257 G4VPhysicalVolume *PhysicalHolder=nullptr;
258 G4VPhysicalVolume *PhysicalFakeDiagsChamber=nullptr;
259 G4VPhysicalVolume *PhysicalPALLAS_QuadrupoleQ3=nullptr;
260 G4VPhysicalVolume *PhysicalPALLAS_QuadrupoleQ4=nullptr;
261 G4VPhysicalVolume *PhysicalPALLAS_ASMRemovalChamber=nullptr;
262 G4VPhysicalVolume *PhysicalPALLAS_BreadboardRemovalChamber=nullptr;
263 G4VPhysicalVolume *PhysicalPALLAS_ChassisRemovalChamber=nullptr;
264 G4VPhysicalVolume *PhysicalPALLAS_TubeISO1=nullptr;
265 G4VPhysicalVolume *PhysicalPALLAS_TubeISO2=nullptr;
266 G4VPhysicalVolume *PhysicalPALLAS_ATH500_DN100=nullptr;
267 G4VPhysicalVolume *PhysicalPALLAS_BaseMarbre=nullptr;
268 G4VPhysicalVolume *PhysicalPALLAS_ChambreISO=nullptr;
269 G4VPhysicalVolume *PhysicalPALLAS_QuadrupoleQ1=nullptr;
270 G4VPhysicalVolume *PhysicalPALLAS_QuadrupoleQ2=nullptr;
271 G4VPhysicalVolume *PhysicalPALLAS_Croix=nullptr;
272 G4VPhysicalVolume *PhysicalPALLAS_LIFHublot1=nullptr;
273 G4VPhysicalVolume *PhysicalPALLAS_LIFHublot2=nullptr;
274 G4VPhysicalVolume *PhysicalPALLAS_LIFHublot3=nullptr;
275 G4VPhysicalVolume *PhysicalPALLAS_LIFHublot4=nullptr;
276 G4VPhysicalVolume *PhysicalPALLAS_LIFHublot5=nullptr;
277 G4VPhysicalVolume *PhysicalPALLAS_LIF_IBX_DD=nullptr;
278 G4VPhysicalVolume *PhysicalPALLAS_LIF_SQLT=nullptr;
279 G4VPhysicalVolume *PhysicalPALLAS_MarbreBreadboard1=nullptr;
280 G4VPhysicalVolume *PhysicalPALLAS_MarbreBreadboard2=nullptr;
281 G4VPhysicalVolume *PhysicalPALLAS_OptoMeK=nullptr;
282 G4VPhysicalVolume *PhysicalPALLAS_ASMPoutre=nullptr;
283 G4VPhysicalVolume *PhysicalPALLAS_StationYAG=nullptr;
284 G4VPhysicalVolume *PhysicalPALLAS_BlindageBD=nullptr;
285 G4VPhysicalVolume *PhysicalPALLAS_BlindageCBD=nullptr;
286 G4VPhysicalVolume *PhysicalPALLAS_ChambreDipole=nullptr;
287 G4VPhysicalVolume *PhysicalPALLAS_ChassisDipoleYAG=nullptr;
288 G4VPhysicalVolume *PhysicalPALLAS_DiagsChamber=nullptr;
289 G4VPhysicalVolume *PhysicalPALLAS_Dipole=nullptr;
290 G4VPhysicalVolume *PhysicalPALLAS_BS1YAG=nullptr;
291 G4VPhysicalVolume *PhysicalPALLAS_BSPEC1YAG=nullptr;
292 G4VPhysicalVolume *PhysicalPALLAS_S4Tube=nullptr;
293 G4VPhysicalVolume *PhysicalPALLAS_S4Tube1=nullptr;
294 G4VPhysicalVolume *PhysicalPALLAS_S4Soufflet=nullptr;
295 G4VPhysicalVolume *PhysicalPALLAS_S4Croix=nullptr;
296 G4VPhysicalVolume *PhysicalPALLAS_Assemblage2Cellules=nullptr;
297 G4VPhysicalVolume *PhysicalPALLAS_Collimator_H1=nullptr;
298 G4VPhysicalVolume *PhysicalPALLAS_Collimator_H2=nullptr;
299 G4VPhysicalVolume *PhysicalPALLAS_Collimator_Arbre_H=nullptr;
300 G4VPhysicalVolume *PhysicalPALLAS_Collimator_Bride_H=nullptr;
301 G4VPhysicalVolume *PhysicalPALLAS_Collimator_Palier_H=nullptr;
302 G4VPhysicalVolume *PhysicalPALLAS_Collimator_Soufflet_H=nullptr;
303 G4VPhysicalVolume *PhysicalPALLAS_Collimator_V1=nullptr;
304 G4VPhysicalVolume *PhysicalPALLAS_Collimator_V2=nullptr;
305 G4VPhysicalVolume *PhysicalPALLAS_Collimator_Arbre_V=nullptr;
306 G4VPhysicalVolume *PhysicalPALLAS_Collimator_Bride_V=nullptr;
307 G4VPhysicalVolume *PhysicalPALLAS_Collimator_Palier_V=nullptr;
308 G4VPhysicalVolume *PhysicalPALLAS_Collimator_Soufflet_V=nullptr;
309
311 G4RotationMatrix DontRotate;
312 G4RotationMatrix Flip;
313 G4RotationMatrix* RotationMatrix;
314
316 static G4ThreadLocal PlasmaMLPALLASMagneticField* fMagneticField;
317 static G4ThreadLocal G4FieldManager* fFieldMgr;
318
319};
320#endif
Definition of the Geometry class for the PALLAS project.
Definition Geometry.hh:36
Defines the detector geometry and magnetic fields for the PALLAS simulation.
Definition PlasmaMLPALLASGeometryConstruction.hh:41
void ConstructCollimators()
Construct all collimators.
Definition PlasmaMLPALLASGeometryConstruction.cc:600
void SetSourceQ1Distance(const G4double distance)
Definition PlasmaMLPALLASGeometryConstruction.hh:120
const float GetQ2Q3Distance() const
Definition PlasmaMLPALLASGeometryConstruction.hh:132
void ConstructQuadrupoles()
Place quadrupoles into the geometry.
Definition PlasmaMLPALLASGeometryConstruction.cc:230
const int GetStatusDisplayQuadrupoles() const
Definition PlasmaMLPALLASGeometryConstruction.hh:111
void SetStatusDisplayCollimators(const G4int statusdisplay)
Definition PlasmaMLPALLASGeometryConstruction.hh:106
static void Print()
Print geometry parameters.
Definition PlasmaMLPALLASGeometryConstruction.cc:84
void ConstructSimplifiedPALLASGeometry()
Build a simplified version of the PALLAS geometry.
Definition PlasmaMLPALLASGeometryConstruction.cc:858
const float GetQ1Length() const
Definition PlasmaMLPALLASGeometryConstruction.hh:126
void SetQ1Q2Distance(const G4double distance)
Definition PlasmaMLPALLASGeometryConstruction.hh:121
void ConstructLIFPart()
Construct the LIF (Laser Induced Fluorescence) section.
Definition PlasmaMLPALLASGeometryConstruction.cc:292
const float GetQ4Gradient() const
Definition PlasmaMLPALLASGeometryConstruction.hh:149
const float GetQ1Gradient() const
Definition PlasmaMLPALLASGeometryConstruction.hh:146
void SetQ3Gradient(const G4double QGrad)
Definition PlasmaMLPALLASGeometryConstruction.hh:141
void SetQ4Gradient(const G4double QGrad)
Definition PlasmaMLPALLASGeometryConstruction.hh:142
PlasmaMLPALLASGeometryConstruction()
Default constructor.
Definition PlasmaMLPALLASGeometryConstruction.cc:69
const float GetSourceQ1Distance() const
Definition PlasmaMLPALLASGeometryConstruction.hh:130
const int GetStatusDisplayGeometry() const
Definition PlasmaMLPALLASGeometryConstruction.hh:109
void SetStatusMapBField(const G4int status)
Definition PlasmaMLPALLASGeometryConstruction.hh:143
const float GetQ2Gradient() const
Definition PlasmaMLPALLASGeometryConstruction.hh:147
void SetStatusDisplayGeometry(const G4int statusdisplay)
Definition PlasmaMLPALLASGeometryConstruction.hh:105
~PlasmaMLPALLASGeometryConstruction() override
Destructor.
void ConstructCellulePart()
Construct the "Cellule" part of the setup.
Definition PlasmaMLPALLASGeometryConstruction.cc:270
const float GetQ3Length() const
Definition PlasmaMLPALLASGeometryConstruction.hh:128
void SetConstantDipoleBField(const G4double BField)
Definition PlasmaMLPALLASGeometryConstruction.hh:144
void SetQ3Q4Distance(const G4double distance)
Definition PlasmaMLPALLASGeometryConstruction.hh:123
void SetQ4Length(const G4double QLength)
Definition PlasmaMLPALLASGeometryConstruction.hh:119
void SetQ3Length(const G4double QLength)
Definition PlasmaMLPALLASGeometryConstruction.hh:118
void ConstructQuadrupolesVolume()
Build quadrupole logical volumes.
Definition PlasmaMLPALLASGeometryConstruction.cc:189
const float GetQ4Length() const
Definition PlasmaMLPALLASGeometryConstruction.hh:129
void SetQ1Length(const G4double QLength)
Definition PlasmaMLPALLASGeometryConstruction.hh:116
const float GetQ3Gradient() const
Definition PlasmaMLPALLASGeometryConstruction.hh:148
const float GetQ2Length() const
Definition PlasmaMLPALLASGeometryConstruction.hh:127
void CreateWorldAndHolder()
Create world and base holder.
Definition PlasmaMLPALLASGeometryConstruction.cc:164
void ConstructSection1Part()
Construct Section 1.
Definition PlasmaMLPALLASGeometryConstruction.cc:375
const float GetSourceCollimatorsDistance() const
Definition PlasmaMLPALLASGeometryConstruction.hh:134
G4VPhysicalVolume * Construct() override
Construct method required by Geant4 kernel.
Definition PlasmaMLPALLASGeometryConstruction.cc:884
const float GetConstantDipoleBField() const
Definition PlasmaMLPALLASGeometryConstruction.hh:151
void SetQ1Gradient(const G4double QGrad)
Definition PlasmaMLPALLASGeometryConstruction.hh:139
void SetQ2Gradient(const G4double QGrad)
Definition PlasmaMLPALLASGeometryConstruction.hh:140
void SetQ2Length(const G4double QLength)
Definition PlasmaMLPALLASGeometryConstruction.hh:117
void ConstructSection3Part()
Construct Section 3.
Definition PlasmaMLPALLASGeometryConstruction.cc:472
const int GetStatusDisplayCollimators() const
Definition PlasmaMLPALLASGeometryConstruction.hh:110
void ConstructSection4Part()
Construct Section 4.
Definition PlasmaMLPALLASGeometryConstruction.cc:502
void SetSourceCollimatorsDistance(const G4double distance)
Definition PlasmaMLPALLASGeometryConstruction.hh:124
void SetStatusDisplayQuadrupoles(const G4int statusdisplay)
Definition PlasmaMLPALLASGeometryConstruction.hh:107
void SetQ2Q3Distance(const G4double distance)
Definition PlasmaMLPALLASGeometryConstruction.hh:122
const int GetStatusMapBField() const
Definition PlasmaMLPALLASGeometryConstruction.hh:150
const float GetQ1Q2Distance() const
Definition PlasmaMLPALLASGeometryConstruction.hh:131
const float GetQ3Q4Distance() const
Definition PlasmaMLPALLASGeometryConstruction.hh:133
void ConstructSDandField() override
Construct sensitive detectors and magnetic fields.
Definition PlasmaMLPALLASGeometryConstruction.cc:790
void ConstructSection2Part()
Construct Section 2.
Definition PlasmaMLPALLASGeometryConstruction.cc:414
void SetLogicalVolumeColor(G4LogicalVolume *LogicalVolume, G4String color)
Set color for a given logical volume.
Definition PlasmaMLPALLASGeometryConstruction.cc:97
void ConstructSection4DumpPart()
Construct dump section in Section 4.
Definition PlasmaMLPALLASGeometryConstruction.cc:739
void ConstructFullPALLASGeometry()
Build the full detailed PALLAS geometry.
Definition PlasmaMLPALLASGeometryConstruction.cc:842
UI messenger for the Geometry constrcution in PALLAS simulation.
Definition PlasmaMLPALLASGeometryMessenger.hh:28
Defines the magnetic field model for the PALLAS simulation.
Definition PlasmaMLPALLASMagneticField.hh:46