BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
optionsBase.h
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2022.
4
5This file is part of BDSIM.
6
7BDSIM is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published
9by the Free Software Foundation version 3 of the License.
10
11BDSIM is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
18*/
19#ifndef OPTIONSBASE_H
20#define OPTIONSBASE_H
21
22#include <string>
23#include <vector>
24
25namespace GMAD
26{
36 {
37 public:
39
40 std::string inputFileName;
41 std::string visMacroFileName;
42 std::string geant4MacroFileName;
44 bool geant4PhysicsMacroFileNameFromExecOptions;
45 bool visDebug;
46
48 std::string outputFileName;
49 std::string outputFormat;
53
55 bool survey;
56 std::string surveyFileName;
58
59 bool batch;
60
61 // verbosity here done in hierarchy of simulation - overall, run, event
62 // track, step
64 bool verbose;
65
68
70 bool verboseEventBDSIM; // for bdsim print out
71 int verboseEventLevel; // for geant4 print out
75
77
79 bool verboseSteppingBDSIM; // for bdsim print out
80 int verboseSteppingLevel; // for geant4 print out
85
86 int verboseImportanceSampling;
87
88 bool circular;
89 int seed;
90 std::string randomEngine;
92 bool recreate;
93 std::string recreateFileName;
97 std::string seedStateFileName;
98
101
104 std::string exportType;
105 std::string exportFileName;
107
110 std::string bdsimPath;
111
113 std::string physicsList;
114 bool physicsVerbose;
115 int physicsVerbosity;
116 double physicsEnergyLimitLow;
117 double physicsEnergyLimitHigh;
118 bool g4PhysicsUseBDSIMRangeCuts;
119 bool g4PhysicsUseBDSIMCutsAndLimits;
120
123
124 double elossHistoBinWidth;
125
127 double ffact;
128
130 double beamlineX;
131 double beamlineY;
132 double beamlineZ;
141 double beamlineS;
143
144 int eventNumberOffset;
145
149 double xsize, ysize;
150
153 std::string outerMaterialName;
154 double horizontalWidth; // formerly outerDiameter
155 double thinElementLength;
156 bool hStyle;
157 double vhRatio;
158 double coilWidthFraction;
159 double coilHeightFraction;
160 bool ignoreLocalMagnetGeometry;
161 bool buildPoleFaceGeometry;
162
165 bool preprocessGDMLSchema;
166
169
170 bool yokeFields;
171 bool yokeFieldsMatchLHCGeometry;
172 bool useOldMultipoleOuterFields;
173 double scalingFieldOuter;
174
175 bool includeFringeFields;
176 bool includeFringeFieldsCavities;
177
180 std::string apertureType;
181 double aper1;
182 double aper2;
183 double aper3;
184 double aper4;
185 std::string beampipeMaterial;
188
189 std::string vacMaterial;
190 std::string emptyMaterial;
191 std::string worldMaterial;
192 std::string worldGeometryFile;
193 bool autoColourWorldGeometryFile;
194 std::string importanceWorldGeometryFile;
195 std::string importanceVolumeMap;
196 // see verboseImportance
197
199
200 double vacuumPressure;
201
205 std::string tunnelType;
208 std::string tunnelMaterial;
209 std::string soilMaterial;
219
220 bool removeTemporaryFiles;
221 std::string temporaryDirectory;
222
223 // sampler options
224 double samplerDiameter;
225
232
265
266 // biasing options
267 std::string defaultBiasVacuum;
268 std::string defaultBiasMaterial;
269 std::string biasForWorldVolume;
270 std::string biasForWorldContents;
271 std::string biasForWorldVacuum;
272 std::string worldVacuumVolumeNames;
273
274 // tracking related parameters
275 std::string integratorSet;
276 double lengthSafety;
277 double lengthSafetyLarge;
281 double chordStepMinimum;
282 double chordStepMinimumYoke;
283 double deltaIntersection;
284 double minimumEpsilonStep;
285 double maximumEpsilonStep;
286 double deltaOneStep;
287 bool stopSecondaries;
288 bool killNeutrinos;
289 bool killedParticlesMassAddedToEloss;
291 bool sampleElementsWithPoleface;
294 double dEThresholdForScattering;
296
297 // hit generation - only two parts that go in the same collection / branch
298 bool sensitiveOuter;
299 bool sensitiveBeamPipe;
300
301 // output related options
302 int numberOfEventsPerNtuple;
303
304 bool storeMinimalData;
305
306 bool storeApertureImpacts;
307 bool storeApertureImpactsIons;
308 bool storeApertureImpactsAll;
309 bool storeApertureImpactsHistograms;
310 double apertureImpactsMinimumKE;
311 bool storeCollimatorInfo;
312 bool storeCollimatorHits;
313 bool storeCollimatorHitsLinks;
314 bool storeCollimatorHitsIons;
315 bool storeCollimatorHitsAll;
316 double collimatorHitsMinimumKE;
317 bool storeEloss;
318 bool storeElossHistograms;
319 bool storeElossVacuum;
320 bool storeElossVacuumHistograms;
321 bool storeElossTunnel;
322 bool storeElossTunnelHistograms;
323 bool storeElossWorld;
324 bool storeElossWorldContents;
325 bool storeElossTurn;
326 bool storeElossLinks;
327 bool storeElossLocal;
328 bool storeElossGlobal;
329 bool storeElossTime;
330 bool storeElossStepLength;
331 bool storeElossPreStepKineticEnergy;
332 bool storeElossModelID;
333 bool storeElossPhysicsProcesses;
334 bool storeParticleData;
335 bool storePrimaries;
336 bool storePrimaryHistograms;
337
338 bool storeTrajectory;
339 // filters
340 int storeTrajectoryDepth;
341 int storeTrajectoryStepPoints;
342 bool storeTrajectoryStepPointLast;
343 std::string storeTrajectoryParticle;
344 std::string storeTrajectoryParticleID;
345 double storeTrajectoryEnergyThreshold;
346 std::string storeTrajectorySamplerID;
347 std::string storeTrajectoryELossSRange;
348
349 // for trajectories stored, what data is stored
350 bool storeTrajectoryTransportationSteps;
352 bool storeTrajectoryKineticEnergy;
353 bool storeTrajectoryMomentumVector;
354 bool storeTrajectoryProcesses;
355 bool storeTrajectoryTime;
356 bool storeTrajectoryLocal;
357 bool storeTrajectoryLinks;
358 bool storeTrajectoryIon;
359 bool storeTrajectoryMaterial;
360 bool storeTrajectoryAllVariables;
361
362 // filter logic
363 bool trajectoryFilterLogicAND;
364
365 bool storeSamplerAll;
366 bool storeSamplerPolarCoords;
367 bool storeSamplerCharge;
368 bool storeSamplerKineticEnergy;
369 bool storeSamplerMass;
370 bool storeSamplerRigidity;
371 bool storeSamplerIon;
372
373 double trajCutGTZ;
374 double trajCutLTR;
375 bool trajConnect;
376
377 bool storeModel;
378
379 int samplersSplitLevel;
380
381 // circular options
382 int nturns;
383 std::string ptcOneTurnMapFileName;
384
385 double printFractionEvents;
386 double printFractionTurns;
387 bool printPhysicsProcesses;
388
389 // visualisation
391
392 // scoring Map
393 int nbinsx;
394 int nbinsy;
395 int nbinsz;
396 int nbinse;
397 double xmin;
398 double xmax;
399 double ymin;
400 double ymax;
401 double zmin;
402 double zmax;
403 double emin;
404 double emax;
405 bool useScoringMap;
406
408 void print() const;
409
411 std::vector<std::string> setKeys;
412 };
413}
414
415#endif
Basic options class independent of Geant4.
Definition: optionsBase.h:36
std::string bdsimPath
Definition: optionsBase.h:110
std::string seedStateFileName
Seed state file path.
Definition: optionsBase.h:97
std::string magnetGeometryType
default magnet geometry parameters
Definition: optionsBase.h:152
double beamlineZ
Initial beam line transform w.r.t. the world coordinate frame.
Definition: optionsBase.h:132
int nGenerate
The number of primary events to simulate.
Definition: optionsBase.h:91
std::string physicsList
list of physics processes
Definition: optionsBase.h:113
double muonSplittingThresholdParentEk2
physics parameters
Definition: optionsBase.h:261
double beamlineAngle
Initial beam line transform w.r.t. the world coordinate frame.
Definition: optionsBase.h:139
double beamlineS
Initial beam line transform w.r.t. the world coordinate frame.
Definition: optionsBase.h:141
bool survey
Parameter for survey.
Definition: optionsBase.h:55
double minimumRange
physics parameters
Definition: optionsBase.h:240
std::string outputFileName
Parameter for output format.
Definition: optionsBase.h:48
int muonSplittingFactor
physics parameters
Definition: optionsBase.h:258
double tunnelSoilThickness
tunnel geometry parameters
Definition: optionsBase.h:207
double minimumRadiusOfCurvature
Minimum allowed radius of curvature.
Definition: optionsBase.h:290
std::string outputFormat
Parameter for output format.
Definition: optionsBase.h:49
int verboseSteppingEventContinueFor
Stepping level verbosity.
Definition: optionsBase.h:82
bool beamlineAxisAngle
Initial beam line transform w.r.t. the world coordinate frame.
Definition: optionsBase.h:140
std::string exportFileName
Parameter for controlling geometry export.
Definition: optionsBase.h:105
int seed
The seed value for the random number generator.
Definition: optionsBase.h:89
double tunnelOffsetY
tunnel geometry parameters
Definition: optionsBase.h:216
double tunnelFloorOffset
tunnel geometry parameters
Definition: optionsBase.h:211
int verboseEventContinueFor
Event level verbosity.
Definition: optionsBase.h:73
bool hStyle
H Style dipoles (if not, C Style).
Definition: optionsBase.h:156
double xsize
for element specification
Definition: optionsBase.h:149
std::string particlesToExcludeFromCuts
physics parameters
Definition: optionsBase.h:241
double ffact
magnetic field flip (+1 default, -1: flip sign)
Definition: optionsBase.h:127
double tunnelMaxSegmentLength
tunnel geometry parameters
Definition: optionsBase.h:217
double muonSplittingThresholdParentEk
physics parameters
Definition: optionsBase.h:259
int verboseEventStart
Event level verbosity.
Definition: optionsBase.h:72
bool useLENDGammaNuclear
physics parameters
Definition: optionsBase.h:249
double maximumTrackingTime
Maximum tracking time per track [s].
Definition: optionsBase.h:278
bool dontSplitSBends
geometry debug, don't split bends into multiple segments
Definition: optionsBase.h:168
std::string tunnelMaterial
tunnel geometry parameters
Definition: optionsBase.h:208
bool useASCIISeedState
Whether to use the seed state from an ASCII file.
Definition: optionsBase.h:96
bool tunnelIsInfiniteAbsorber
physics parameters
Definition: optionsBase.h:257
bool verboseSteppingPrimaryOnly
Stepping level verbosity.
Definition: optionsBase.h:83
double muonSplittingExclusionWeight
physics parameters
Definition: optionsBase.h:263
bool collimatorsAreInfiniteAbsorbers
physics parameters
Definition: optionsBase.h:256
int verboseRunLevel
Run level verbosity.
Definition: optionsBase.h:67
bool turnOnOpticalSurface
Physics processes.
Definition: optionsBase.h:230
double prodCutProtons
physics parameters
Definition: optionsBase.h:246
int nSegmentsPerCircle
Number of facets per 2pi in visualisation.
Definition: optionsBase.h:390
std::string soilMaterial
tunnel geometry parameters
Definition: optionsBase.h:209
bool preprocessGDML
geometry control
Definition: optionsBase.h:164
int maximumBetaChangePerStep
physics parameters
Definition: optionsBase.h:236
bool batch
Flag for batch / interactive mode.
Definition: optionsBase.h:59
double minimumKineticEnergy
physics parameters
Definition: optionsBase.h:238
int eventOffset
Event number to start from when recreating from a root file.
Definition: optionsBase.h:121
int verboseTrackingLevel
Tracking verbosity.
Definition: optionsBase.h:76
bool circular
Flag for circular machine.
Definition: optionsBase.h:88
bool checkOverlaps
bdsim options
Definition: optionsBase.h:147
double neutronKineticEnergyLimit
physics parameters
Definition: optionsBase.h:248
double aper1
default beampipe parameters
Definition: optionsBase.h:181
double maximumTrackLength
Maximum permitted track length [m].
Definition: optionsBase.h:280
int verboseEventLevel
Event level verbosity.
Definition: optionsBase.h:71
bool turnOnOpticalAbsorption
Physics processes.
Definition: optionsBase.h:227
bool buildTunnelStraight
tunnel geometry parameters
Definition: optionsBase.h:204
std::string inputFileName
Input filename.
Definition: optionsBase.h:40
long maximumTracksPerEvent
physics parameters
Definition: optionsBase.h:237
double backupStepperMomLimit
Fractional momentum limit for reverting to backup steppers.
Definition: optionsBase.h:295
double aper2
default beampipe parameters
Definition: optionsBase.h:182
int outputCompressionLevel
Parameter for output format.
Definition: optionsBase.h:51
double beamlinePhi
Initial beam line transform w.r.t. the world coordinate frame.
Definition: optionsBase.h:133
double maximumStepLength
Maximum permitted step length in any volume.
Definition: optionsBase.h:279
std::string exportType
Parameter for controlling geometry export.
Definition: optionsBase.h:104
double neutronTimeLimit
physics parameters
Definition: optionsBase.h:247
bool recreateSeedState
Load seed state when recreating events.
Definition: optionsBase.h:122
std::string vacMaterial
vacuum material
Definition: optionsBase.h:189
bool verbose
General verbosity.
Definition: optionsBase.h:64
std::string recreateFileName
The file path to recreate a run from.
Definition: optionsBase.h:93
bool teleporterFullTransform
Whether to use the new Transform3D method for the teleporter.
Definition: optionsBase.h:293
bool buildTunnelFloor
tunnel geometry parameters
Definition: optionsBase.h:210
int startFromEvent
Event to start from when recreating.
Definition: optionsBase.h:94
std::string emptyMaterial
material in container volumes
Definition: optionsBase.h:190
bool muonSplittingExcludeWeight1Particles
physics parameters
Definition: optionsBase.h:262
double prodCutPhotons
physics parameters
Definition: optionsBase.h:243
bool generatePrimariesOnly
Whether to only generate primary coordinates and quit, or not.
Definition: optionsBase.h:100
double defaultRangeCut
physics parameters
Definition: optionsBase.h:242
double beamlineAxisY
Initial beam line transform w.r.t. the world coordinate frame.
Definition: optionsBase.h:137
double prodCutElectrons
physics parameters
Definition: optionsBase.h:244
double tunnelAper1
tunnel geometry parameters
Definition: optionsBase.h:212
bool verboseEventBDSIM
Event level verbosity.
Definition: optionsBase.h:70
int maximumPhotonsPerStep
physics parameters
Definition: optionsBase.h:235
std::string beampipeMaterial
default beampipe parameters
Definition: optionsBase.h:185
bool exportGeometry
Parameter for controlling geometry export.
Definition: optionsBase.h:103
int verboseSteppingLevel
Stepping level verbosity.
Definition: optionsBase.h:80
double beampipeThickness
default beampipe parameters
Definition: optionsBase.h:179
bool turnOnRayleighScattering
Physics processes.
Definition: optionsBase.h:229
std::string geant4PhysicsMacroFileName
Geant4 physics macro.
Definition: optionsBase.h:43
void print() const
print some properties
Definition: optionsBase.cc:368
std::string visMacroFileName
Visualisation filename.
Definition: optionsBase.h:41
double scintYieldFactor
physics parameters
Definition: optionsBase.h:234
bool beamPipeIsInfiniteAbsorber
physics parameters
Definition: optionsBase.h:255
double beamlineX
Initial beam line transform w.r.t. the world coordinate frame.
Definition: optionsBase.h:130
std::string apertureType
default beampipe parameters
Definition: optionsBase.h:180
bool verboseSteppingBDSIM
Stepping level verbosity.
Definition: optionsBase.h:79
bool useMuonNuclear
physics parameters
Definition: optionsBase.h:251
bool useElectroNuclear
physics parameters
Definition: optionsBase.h:250
int verboseSteppingEventStart
Stepping level verbosity.
Definition: optionsBase.h:81
std::string surveyFileName
Parameter for survey.
Definition: optionsBase.h:56
std::vector< std::string > setKeys
A list of all the keys that have been set in this instance.
Definition: optionsBase.h:411
bool recreate
Whether to recreate from a file or not.
Definition: optionsBase.h:92
double tunnelAper2
tunnel geometry parameters
Definition: optionsBase.h:213
bool turnOnMieScattering
Physics processes.
Definition: optionsBase.h:228
double beamlineY
Initial beam line transform w.r.t. the world coordinate frame.
Definition: optionsBase.h:131
double beamlineAxisX
Initial beam line transform w.r.t. the world coordinate frame.
Definition: optionsBase.h:136
double tunnelThickness
tunnel geometry parameters
Definition: optionsBase.h:206
std::string randomEngine
Name of random engine to use.
Definition: optionsBase.h:90
double prodCutPositrons
physics parameters
Definition: optionsBase.h:245
bool buildTunnel
tunnel geometry parameters
Definition: optionsBase.h:203
bool outputDoublePrecision
Parameter for output format.
Definition: optionsBase.h:50
bool writeSeedState
Write the seed state each event to a text file.
Definition: optionsBase.h:95
bool visDebug
Flag for visualisation debug.
Definition: optionsBase.h:45
bool useGammaToMuMu
physics parameters
Definition: optionsBase.h:252
double aper4
default beampipe parameters
Definition: optionsBase.h:184
double aper3
default beampipe parameters
Definition: optionsBase.h:183
double minimumKineticEnergyTunnel
physics parameters
Definition: optionsBase.h:239
double tunnelOffsetX
tunnel geometry parameters
Definition: optionsBase.h:215
bool usePositronToMuMu
physics parameters
Definition: optionsBase.h:253
std::string tunnelType
tunnel geometry parameters
Definition: optionsBase.h:205
double beamlineAxisZ
Initial beam line transform w.r.t. the world coordinate frame.
Definition: optionsBase.h:138
double beamlinePsi
Initial beam line transform w.r.t. the world coordinate frame.
Definition: optionsBase.h:135
std::string geant4MacroFileName
Geant4 macro to run.
Definition: optionsBase.h:42
bool trajNoTransportation
kept only for backwards compatibility.
Definition: optionsBase.h:351
bool usePositronToHadrons
physics parameters
Definition: optionsBase.h:254
bool tunnelVisible
tunnel geometry parameters
Definition: optionsBase.h:214
int muonSplittingFactor2
physics parameters
Definition: optionsBase.h:260
double worldVolumeMargin
Padding margin for world volume size.
Definition: optionsBase.h:198
double nominalMatrixRelativeMomCut
Momentum threshold for nominal dipole matrix tracking.
Definition: optionsBase.h:292
double beamlineTheta
Initial beam line transform w.r.t. the world coordinate frame.
Definition: optionsBase.h:134
bool ignoreLocalAperture
default beampipe parameters
Definition: optionsBase.h:186
Parser namespace for GMAD language. Combination of Geant4 and MAD.