BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
optionsBase.h
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2023.
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 verboseSensitivity;
89
90 bool circular;
91 int seed;
92 std::string randomEngine;
94 bool recreate;
95 std::string recreateFileName;
99 std::string seedStateFileName;
100
103
106 std::string exportType;
107 std::string exportFileName;
109
112 std::string bdsimPath;
113
115 std::string physicsList;
116 bool physicsVerbose;
117 int physicsVerbosity;
118 double physicsEnergyLimitLow;
119 double physicsEnergyLimitHigh;
120 bool g4PhysicsUseBDSIMRangeCuts;
121 bool g4PhysicsUseBDSIMCutsAndLimits;
122
125
126 double elossHistoBinWidth;
127
129 double ffact;
130
132 double beamlineX;
133 double beamlineY;
134 double beamlineZ;
143 double beamlineS;
145
146 int eventNumberOffset;
147
151 double xsize, ysize;
152
155 std::string outerMaterialName;
156 double horizontalWidth; // formerly outerDiameter
157 double thinElementLength;
158 bool hStyle;
159 double vhRatio;
160 double coilWidthFraction;
161 double coilHeightFraction;
162 bool ignoreLocalMagnetGeometry;
163 bool buildPoleFaceGeometry;
164
167 bool preprocessGDMLSchema;
168
171
172 bool yokeFields;
173 bool yokeFieldsMatchLHCGeometry;
174 bool useOldMultipoleOuterFields;
175 double scalingFieldOuter;
176
177 bool includeFringeFields;
178 bool includeFringeFieldsCavities;
179
182 std::string apertureType;
183 double aper1;
184 double aper2;
185 double aper3;
186 double aper4;
187 std::string beampipeMaterial;
190
191 std::string vacMaterial;
192 std::string emptyMaterial;
193 std::string worldMaterial;
194 std::string worldGeometryFile;
195 bool autoColourWorldGeometryFile;
196 std::string importanceWorldGeometryFile;
197 std::string importanceVolumeMap;
198 // see verboseImportance
199
201
202 double vacuumPressure;
203
207 std::string tunnelType;
210 std::string tunnelMaterial;
211 std::string soilMaterial;
221
222 bool removeTemporaryFiles;
223 std::string temporaryDirectory;
224
225 // sampler options
226 double samplerDiameter;
227
234
258
269
270 // biasing options
271 std::string defaultBiasVacuum;
272 std::string defaultBiasMaterial;
273 std::string biasForWorldVolume;
274 std::string biasForWorldContents;
275 std::string biasForWorldVacuum;
276 std::string worldVacuumVolumeNames;
277
278 // tracking related parameters
279 std::string integratorSet;
280 std::string fieldModulator;
281 double lengthSafety;
282 double lengthSafetyLarge;
286 double chordStepMinimum;
287 double chordStepMinimumYoke;
288 double deltaIntersection;
289 double minimumEpsilonStep;
290 double maximumEpsilonStep;
291 double deltaOneStep;
292 bool stopSecondaries;
293 bool killNeutrinos;
294 bool killedParticlesMassAddedToEloss;
296 bool sampleElementsWithPoleface;
299 double dEThresholdForScattering;
301
302 // hit generation - only two parts that go in the same collection / branch
303 bool sensitiveOuter;
304 bool sensitiveBeamPipe;
305
306 // output related options
307 int numberOfEventsPerNtuple;
308
309 bool storeMinimalData;
310
311 bool storeApertureImpacts;
312 bool storeApertureImpactsIons;
313 bool storeApertureImpactsAll;
314 bool storeApertureImpactsHistograms;
315 double apertureImpactsMinimumKE;
316 bool storeCavityInfo;
317 bool storeCollimatorInfo;
318 bool storeCollimatorHits;
319 bool storeCollimatorHitsLinks;
320 bool storeCollimatorHitsIons;
321 bool storeCollimatorHitsAll;
322 double collimatorHitsMinimumKE;
323 bool storeEloss;
324 bool storeElossHistograms;
325 bool storeElossVacuum;
326 bool storeElossVacuumHistograms;
327 bool storeElossTunnel;
328 bool storeElossTunnelHistograms;
329 bool storeElossWorld;
330 bool storeElossWorldIntegral;
331 bool storeElossWorldContents;
332 bool storeElossWorldContentsIntegral;
333 bool storeElossTurn;
334 bool storeElossLinks;
335 bool storeElossLocal;
336 bool storeElossGlobal;
337 bool storeElossTime;
338 bool storeElossStepLength;
339 bool storeElossPreStepKineticEnergy;
340 bool storeElossModelID;
341 bool storeElossPhysicsProcesses;
342 bool storeParticleData;
343 bool storePrimaries;
344 bool storePrimaryHistograms;
345
346 bool storeTrajectory;
347 // filters
348 int storeTrajectoryDepth;
349 int storeTrajectoryStepPoints;
350 bool storeTrajectoryStepPointLast;
351 std::string storeTrajectoryParticle;
352 std::string storeTrajectoryParticleID;
353 bool storeTrajectorySecondaryParticles;
354 double storeTrajectoryEnergyThreshold;
355 std::string storeTrajectorySamplerID;
356 std::string storeTrajectoryELossSRange;
357
358 // for trajectories stored, what data is stored
359 bool storeTrajectoryTransportationSteps;
361 bool storeTrajectoryKineticEnergy;
362 bool storeTrajectoryMomentumVector;
363 bool storeTrajectoryProcesses;
364 bool storeTrajectoryTime;
365 bool storeTrajectoryLocal;
366 bool storeTrajectoryLinks;
367 bool storeTrajectoryIon;
368 bool storeTrajectoryMaterial;
369 bool storeTrajectoryAllVariables;
370
371 // filter logic
372 bool trajectoryFilterLogicAND;
373
374 bool storeSamplerAll;
375 bool storeSamplerPolarCoords;
376 bool storeSamplerCharge;
377 bool storeSamplerKineticEnergy;
378 bool storeSamplerMass;
379 bool storeSamplerRigidity;
380 bool storeSamplerIon;
381
382 double trajCutGTZ;
383 double trajCutLTR;
384 bool trajConnect;
385
386 bool storeModel;
387
388 int samplersSplitLevel;
389 int modelSplitLevel;
390 int uprootCompatible;
391
392 // circular options
393 int nturns;
394 std::string ptcOneTurnMapFileName;
395
396 double printFractionEvents;
397 double printFractionTurns;
398 bool printPhysicsProcesses;
399
400 // visualisation
402
403 // scoring Map
404 int nbinsx;
405 int nbinsy;
406 int nbinsz;
407 int nbinse;
408 double xmin;
409 double xmax;
410 double ymin;
411 double ymax;
412 double zmin;
413 double zmax;
414 double emin;
415 double emax;
416 bool useScoringMap;
417
419 void print() const;
420
422 std::vector<std::string> setKeys;
423 };
424}
425
426#endif
Basic options class independent of Geant4.
Definition: optionsBase.h:36
std::string bdsimPath
Definition: optionsBase.h:112
std::string seedStateFileName
Seed state file path.
Definition: optionsBase.h:99
std::string magnetGeometryType
default magnet geometry parameters
Definition: optionsBase.h:154
double beamlineZ
Initial beam line transform w.r.t. the world coordinate frame.
Definition: optionsBase.h:134
int nGenerate
The number of primary events to simulate.
Definition: optionsBase.h:93
std::string physicsList
list of physics processes
Definition: optionsBase.h:115
double muonSplittingThresholdParentEk2
physics parameters
Definition: optionsBase.h:265
double beamlineAngle
Initial beam line transform w.r.t. the world coordinate frame.
Definition: optionsBase.h:141
double beamlineS
Initial beam line transform w.r.t. the world coordinate frame.
Definition: optionsBase.h:143
bool survey
Parameter for survey.
Definition: optionsBase.h:55
double minimumRange
physics parameters
Definition: optionsBase.h:242
std::string outputFileName
Parameter for output format.
Definition: optionsBase.h:48
int muonSplittingFactor
physics parameters
Definition: optionsBase.h:262
double tunnelSoilThickness
tunnel geometry parameters
Definition: optionsBase.h:209
double minimumRadiusOfCurvature
Minimum allowed radius of curvature.
Definition: optionsBase.h:295
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:142
std::string exportFileName
Parameter for controlling geometry export.
Definition: optionsBase.h:107
int seed
The seed value for the random number generator.
Definition: optionsBase.h:91
double tunnelOffsetY
tunnel geometry parameters
Definition: optionsBase.h:218
double tunnelFloorOffset
tunnel geometry parameters
Definition: optionsBase.h:213
int verboseEventContinueFor
Event level verbosity.
Definition: optionsBase.h:73
bool hStyle
H Style dipoles (if not, C Style).
Definition: optionsBase.h:158
double xsize
for element specification
Definition: optionsBase.h:151
std::string particlesToExcludeFromCuts
physics parameters
Definition: optionsBase.h:243
double ffact
magnetic field flip (+1 default, -1: flip sign)
Definition: optionsBase.h:129
double tunnelMaxSegmentLength
tunnel geometry parameters
Definition: optionsBase.h:219
double muonSplittingThresholdParentEk
physics parameters
Definition: optionsBase.h:263
int verboseEventStart
Event level verbosity.
Definition: optionsBase.h:72
bool useLENDGammaNuclear
physics parameters
Definition: optionsBase.h:251
double maximumTrackingTime
Maximum tracking time per track [s].
Definition: optionsBase.h:283
bool dontSplitSBends
geometry debug, don't split bends into multiple segments
Definition: optionsBase.h:170
std::string tunnelMaterial
tunnel geometry parameters
Definition: optionsBase.h:210
bool useASCIISeedState
Whether to use the seed state from an ASCII file.
Definition: optionsBase.h:98
bool tunnelIsInfiniteAbsorber
physics parameters
Definition: optionsBase.h:261
bool verboseSteppingPrimaryOnly
Stepping level verbosity.
Definition: optionsBase.h:83
double muonSplittingExclusionWeight
physics parameters
Definition: optionsBase.h:267
bool collimatorsAreInfiniteAbsorbers
physics parameters
Definition: optionsBase.h:260
int verboseRunLevel
Run level verbosity.
Definition: optionsBase.h:67
bool turnOnOpticalSurface
Physics processes.
Definition: optionsBase.h:232
double prodCutProtons
physics parameters
Definition: optionsBase.h:248
int nSegmentsPerCircle
Number of facets per 2pi in visualisation.
Definition: optionsBase.h:401
std::string soilMaterial
tunnel geometry parameters
Definition: optionsBase.h:211
bool preprocessGDML
geometry control
Definition: optionsBase.h:166
int maximumBetaChangePerStep
physics parameters
Definition: optionsBase.h:238
bool batch
Flag for batch / interactive mode.
Definition: optionsBase.h:59
double minimumKineticEnergy
physics parameters
Definition: optionsBase.h:240
int eventOffset
Event number to start from when recreating from a root file.
Definition: optionsBase.h:123
int verboseTrackingLevel
Tracking verbosity.
Definition: optionsBase.h:76
bool circular
Flag for circular machine.
Definition: optionsBase.h:90
bool checkOverlaps
bdsim options
Definition: optionsBase.h:149
double neutronKineticEnergyLimit
physics parameters
Definition: optionsBase.h:250
double aper1
default beampipe parameters
Definition: optionsBase.h:183
double maximumTrackLength
Maximum permitted track length [m].
Definition: optionsBase.h:285
int verboseEventLevel
Event level verbosity.
Definition: optionsBase.h:71
bool restoreFTPFDiffractionForAGreater10
physics parameters
Definition: optionsBase.h:257
bool turnOnOpticalAbsorption
Physics processes.
Definition: optionsBase.h:229
bool buildTunnelStraight
tunnel geometry parameters
Definition: optionsBase.h:206
std::string inputFileName
Input filename.
Definition: optionsBase.h:40
long maximumTracksPerEvent
physics parameters
Definition: optionsBase.h:239
double backupStepperMomLimit
Fractional momentum limit for reverting to backup steppers.
Definition: optionsBase.h:300
double aper2
default beampipe parameters
Definition: optionsBase.h:184
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:135
double maximumStepLength
Maximum permitted step length in any volume.
Definition: optionsBase.h:284
std::string exportType
Parameter for controlling geometry export.
Definition: optionsBase.h:106
double neutronTimeLimit
physics parameters
Definition: optionsBase.h:249
bool recreateSeedState
Load seed state when recreating events.
Definition: optionsBase.h:124
std::string vacMaterial
vacuum material
Definition: optionsBase.h:191
bool verbose
General verbosity.
Definition: optionsBase.h:64
std::string recreateFileName
The file path to recreate a run from.
Definition: optionsBase.h:95
bool teleporterFullTransform
Whether to use the new Transform3D method for the teleporter.
Definition: optionsBase.h:298
bool buildTunnelFloor
tunnel geometry parameters
Definition: optionsBase.h:212
int startFromEvent
Event to start from when recreating.
Definition: optionsBase.h:96
std::string emptyMaterial
material in container volumes
Definition: optionsBase.h:192
bool muonSplittingExcludeWeight1Particles
physics parameters
Definition: optionsBase.h:266
double prodCutPhotons
physics parameters
Definition: optionsBase.h:245
bool generatePrimariesOnly
Whether to only generate primary coordinates and quit, or not.
Definition: optionsBase.h:102
double defaultRangeCut
physics parameters
Definition: optionsBase.h:244
double beamlineAxisY
Initial beam line transform w.r.t. the world coordinate frame.
Definition: optionsBase.h:139
double prodCutElectrons
physics parameters
Definition: optionsBase.h:246
double tunnelAper1
tunnel geometry parameters
Definition: optionsBase.h:214
bool verboseEventBDSIM
Event level verbosity.
Definition: optionsBase.h:70
int maximumPhotonsPerStep
physics parameters
Definition: optionsBase.h:237
std::string beampipeMaterial
default beampipe parameters
Definition: optionsBase.h:187
bool exportGeometry
Parameter for controlling geometry export.
Definition: optionsBase.h:105
int verboseSteppingLevel
Stepping level verbosity.
Definition: optionsBase.h:80
double beampipeThickness
default beampipe parameters
Definition: optionsBase.h:181
bool turnOnRayleighScattering
Physics processes.
Definition: optionsBase.h:231
std::string geant4PhysicsMacroFileName
Geant4 physics macro.
Definition: optionsBase.h:43
void print() const
print some properties
Definition: optionsBase.cc:379
std::string visMacroFileName
Visualisation filename.
Definition: optionsBase.h:41
double scintYieldFactor
physics parameters
Definition: optionsBase.h:236
bool beamPipeIsInfiniteAbsorber
physics parameters
Definition: optionsBase.h:259
double beamlineX
Initial beam line transform w.r.t. the world coordinate frame.
Definition: optionsBase.h:132
std::string apertureType
default beampipe parameters
Definition: optionsBase.h:182
bool verboseSteppingBDSIM
Stepping level verbosity.
Definition: optionsBase.h:79
bool useMuonNuclear
physics parameters
Definition: optionsBase.h:253
bool useElectroNuclear
physics parameters
Definition: optionsBase.h:252
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:422
bool recreate
Whether to recreate from a file or not.
Definition: optionsBase.h:94
double tunnelAper2
tunnel geometry parameters
Definition: optionsBase.h:215
bool turnOnMieScattering
Physics processes.
Definition: optionsBase.h:230
double beamlineY
Initial beam line transform w.r.t. the world coordinate frame.
Definition: optionsBase.h:133
double beamlineAxisX
Initial beam line transform w.r.t. the world coordinate frame.
Definition: optionsBase.h:138
double tunnelThickness
tunnel geometry parameters
Definition: optionsBase.h:208
std::string randomEngine
Name of random engine to use.
Definition: optionsBase.h:92
double prodCutPositrons
physics parameters
Definition: optionsBase.h:247
bool buildTunnel
tunnel geometry parameters
Definition: optionsBase.h:205
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:97
bool visDebug
Flag for visualisation debug.
Definition: optionsBase.h:45
bool useGammaToMuMu
physics parameters
Definition: optionsBase.h:254
double aper4
default beampipe parameters
Definition: optionsBase.h:186
double aper3
default beampipe parameters
Definition: optionsBase.h:185
double minimumKineticEnergyTunnel
physics parameters
Definition: optionsBase.h:241
double tunnelOffsetX
tunnel geometry parameters
Definition: optionsBase.h:217
bool usePositronToMuMu
physics parameters
Definition: optionsBase.h:255
std::string tunnelType
tunnel geometry parameters
Definition: optionsBase.h:207
double beamlineAxisZ
Initial beam line transform w.r.t. the world coordinate frame.
Definition: optionsBase.h:140
double beamlinePsi
Initial beam line transform w.r.t. the world coordinate frame.
Definition: optionsBase.h:137
std::string geant4MacroFileName
Geant4 macro to run.
Definition: optionsBase.h:42
bool trajNoTransportation
kept only for backwards compatibility.
Definition: optionsBase.h:360
bool usePositronToHadrons
physics parameters
Definition: optionsBase.h:256
bool tunnelVisible
tunnel geometry parameters
Definition: optionsBase.h:216
int muonSplittingFactor2
physics parameters
Definition: optionsBase.h:264
double worldVolumeMargin
Padding margin for world volume size.
Definition: optionsBase.h:200
double nominalMatrixRelativeMomCut
Momentum threshold for nominal dipole matrix tracking.
Definition: optionsBase.h:297
double beamlineTheta
Initial beam line transform w.r.t. the world coordinate frame.
Definition: optionsBase.h:136
bool ignoreLocalAperture
default beampipe parameters
Definition: optionsBase.h:188
Parser namespace for GMAD language. Combination of Geant4 and MAD.