BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSFieldQueryInfo.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) BDSIM Collaboration, 2001 - 2026.
3
4This file is part of BDSIM.
5
6BDSIM is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published
8by the Free Software Foundation version 3 of the License.
9
10BDSIM is distributed in the hope that it will be useful, but
11WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef BDSFIELDQUERYINFO_H
19#define BDSFIELDQUERYINFO_H
20
21#include "BDSFourVector.hh"
22
23#include "G4AffineTransform.hh"
24#include "G4String.hh"
25#include "G4Types.hh"
26
27#include <vector>
28
36{
37public:
39 {
42 QueryDimensionInfo(G4int nIn, G4double minIn, G4double maxIn):
43 n(nIn), min(minIn), max(maxIn)
44 {;}
45 QueryDimensionInfo(): n(1), min(0), max(0) {;}
46 G4int n = 1;
47 G4double min = 0;
48 G4double max = 0;
49 G4double StepSize() const {return (max - min)/n;}
50 };
51
53 BDSFieldQueryInfo(const G4String& nameIn,
54 const G4String& outfileMagneticIn,
55 const G4String& outfileElectricIn,
56 G4bool queryMagneticIn,
57 G4bool queryElectricIn,
58 QueryDimensionInfo xInfoIn,
59 QueryDimensionInfo yInfoIn,
60 QueryDimensionInfo zInfoIn,
61 QueryDimensionInfo tInfoIn,
62 const G4AffineTransform& globalTransformIn = G4AffineTransform(),
63 G4bool overwriteExistingFilesIn = false,
64 const G4String& fieldObjectIn = "",
65 G4bool printTransformIn = false,
66 G4bool checkParametersIn = true,
67 G4bool drawArrowsIn = true,
68 G4bool drawZeroValuePointsIn = true,
69 G4bool drawBoxesIn = true,
70 G4double boxAlphaIn = 0.2);
71
73 BDSFieldQueryInfo(const G4String& nameIn,
74 const G4String& outfileMagneticIn,
75 const G4String& outfileElectricIn,
76 G4bool queryMagneticIn,
77 G4bool queryElectricIn,
78 const std::vector<BDSFourVector<G4double>>& pointsToQueryIn,
79 const std::vector<G4String>& pointsColumnNamesIn,
80 G4bool overwriteExistingFilesIn = false,
81 const G4String& fieldObjectIn = "",
82 G4bool checkParametersIn = true,
83 G4bool drawArrowsIn = true,
84 G4bool drawZeroValuePointsIn = true,
85 G4bool drawBoxesIn = true,
86 G4double boxAlphaIn = 0.2);
88
89 G4String name;
90 G4String outfileMagnetic;
91 G4String outfileElectric;
92 G4bool queryMagnetic;
93 G4bool queryElectric;
94 QueryDimensionInfo xInfo;
95 QueryDimensionInfo yInfo;
96 QueryDimensionInfo zInfo;
97 QueryDimensionInfo tInfo;
98
99 std::vector<BDSFourVector<G4double>> pointsToQuery;
100 std::vector<G4String> pointsColumnNames;
101
102 G4AffineTransform globalTransform;
103
104 G4bool overwriteExistingFiles;
105 G4bool printTransform;
106
107 G4String fieldObject;
108
110
111 G4bool drawArrows;
112 G4bool drawZeroValuePoints;
113 G4bool drawBoxes;
114 G4double boxAlpha;
115
117 G4bool SpecificPoints() const {return !pointsToQuery.empty();}
118};
119
120#endif
Holder class for all information required for a field query.
G4bool checkParameters
For internal testing use only.
G4bool SpecificPoints() const
Whether to query a specific set of points.
G4String fieldObject
Optional for use in interpolator.
A simple templated four vector class.
QueryDimensionInfo(G4int nIn, G4double minIn, G4double maxIn)