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) 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 OPTIONSBASE_H
19#define OPTIONSBASE_H
20
21#include <string>
22#include <vector>
23
24namespace GMAD
25{
35 {
36 public:
38
39 std::string inputFileName;
40 std::string visMacroFileName;
41 std::string geant4MacroFileName;
43 bool geant4PhysicsMacroFileNameFromExecOptions;
44 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 bool integrateKineticEnergyAlongBeamline;
177
178 std::string cavityFieldType;
179
180 bool includeFringeFields;
181 bool includeFringeFieldsCavities;
182
185 std::string apertureType;
186 double aper1;
187 double aper2;
188 double aper3;
189 double aper4;
190 std::string beampipeMaterial;
193
194 std::string vacMaterial;
195 std::string emptyMaterial;
196 std::string worldMaterial;
197 std::string worldGeometryFile;
198 bool autoColourWorldGeometryFile;
199 std::string importanceWorldGeometryFile;
200 std::string importanceVolumeMap;
201 // see verboseImportance
202
204
205 double vacuumPressure;
206
210 std::string tunnelType;
213 std::string tunnelMaterial;
214 std::string soilMaterial;
224
225 bool removeTemporaryFiles;
226 std::string temporaryDirectory;
227
228 // sampler options
229 double samplerDiameter;
230
237
261
275
276 // biasing options
277 double scaleFactorLaser;
278 std::string defaultBiasVacuum;
279 std::string defaultBiasMaterial;
280 std::string biasForWorldVolume;
281 std::string biasForWorldContents;
282 std::string biasForWorldVacuum;
283 std::string worldVacuumVolumeNames;
284
285 // tracking related parameters
286 std::string integratorSet;
287 std::string fieldModulator;
288 double lengthSafety;
289 double lengthSafetyLarge;
293 double chordStepMinimum;
294 double chordStepMinimumYoke;
295 double deltaIntersection;
296 double minimumEpsilonStep;
297 double maximumEpsilonStep;
298 double minimumEpsilonStepThin;
299 double maximumEpsilonStepThin;
300 double deltaOneStep;
301 bool stopSecondaries;
302 bool killNeutrinos;
303 bool killedParticlesMassAddedToEloss;
305 bool sampleElementsWithPoleface;
308 double dEThresholdForScattering;
310
311 // hit generation - only two parts that go in the same collection / branch
312 bool sensitiveOuter;
313 bool sensitiveBeamPipe;
314
315 // output related options
316 int numberOfEventsPerNtuple;
317
318 bool storeMinimalData;
319
320 bool storeApertureImpacts;
321 bool storeApertureImpactsIons;
322 bool storeApertureImpactsAll;
323 bool storeApertureImpactsHistograms;
324 double apertureImpactsMinimumKE;
325 bool storeCavityInfo;
326 bool storeCollimatorInfo;
327 bool storeCollimatorHits;
328 bool storeCollimatorHitsLinks;
329 bool storeCollimatorHitsIons;
330 bool storeCollimatorHitsAll;
331 double collimatorHitsMinimumKE;
332 bool storeEloss;
333 bool storeElossHistograms;
334 bool storeElossVacuum;
335 bool storeElossVacuumHistograms;
336 bool storeElossTunnel;
337 bool storeElossTunnelHistograms;
338 bool storeElossWorld;
339 bool storeElossWorldIntegral;
340 bool storeElossWorldContents;
341 bool storeElossWorldContentsIntegral;
342 bool storeElossTurn;
343 bool storeElossLinks;
344 bool storeElossLocal;
345 bool storeElossGlobal;
346 bool storeElossTime;
347 bool storeElossStepLength;
348 bool storeElossPreStepKineticEnergy;
349 bool storeElossModelID;
350 bool storeElossPhysicsProcesses;
351 bool storeParticleData;
352 bool storePrimaries;
353 bool storePrimaryHistograms;
354
355 bool storeTrajectory;
356 // filters
357 int storeTrajectoryDepth;
358 int storeTrajectoryStepPoints;
359 bool storeTrajectoryStepPointLast;
360 std::string storeTrajectoryParticle;
361 std::string storeTrajectoryParticleID;
362 bool storeTrajectorySecondaryParticles;
363 double storeTrajectoryEnergyThreshold;
364 std::string storeTrajectorySamplerID;
365 std::string storeTrajectoryELossSRange;
366
367 // for trajectories stored, what data is stored
368 bool storeTrajectoryTransportationSteps;
370 bool storeTrajectoryKineticEnergy;
371 bool storeTrajectoryMomentumVector;
372 bool storeTrajectoryProcesses;
373 bool storeTrajectoryTime;
374 bool storeTrajectoryLocal;
375 bool storeTrajectoryLinks;
376 bool storeTrajectoryIon;
377 bool storeTrajectoryMaterial;
378 bool storeTrajectoryAllVariables;
379
380 // filter logic
381 bool trajectoryFilterLogicAND;
382
383 bool storeSamplerAll;
384 bool storeSamplerPolarCoords;
385 bool storeSamplerCharge;
386 bool storeSamplerKineticEnergy;
387 bool storeSamplerMass;
388 bool storeSamplerRigidity;
389 bool storeSamplerIon;
390
391 double trajCutGTZ;
392 double trajCutLTR;
393 bool trajConnect;
394
395 bool storeModel;
396
397 bool storePerEventHistos;
398
399 int samplersSplitLevel;
400 int modelSplitLevel;
401 int uprootCompatible;
402
403 // circular options
404 int nturns;
405 std::string ptcOneTurnMapFileName;
406
407 double printFractionEvents;
408 double printFractionTurns;
409 bool printPhysicsProcesses;
410
411 // visualisation
413
414 // scoring Map
415 int nbinsx;
416 int nbinsy;
417 int nbinsz;
418 int nbinse;
419 double xmin;
420 double xmax;
421 double ymin;
422 double ymax;
423 double zmin;
424 double zmax;
425 double emin;
426 double emax;
427 bool useScoringMap;
428
429 // millicharge options
430 bool enableMillicharge;
431 std::string millichargeName;
432 double millichargeMass;
433 double millichargeCharge;
434 int millichargeID;
435
437 void print() const;
438
440 std::vector<std::string> setKeys;
441 };
442}
443
444#endif
Basic options class independent of Geant4.
Definition optionsBase.h:35
std::string bdsimPath
std::string seedStateFileName
Seed state file path.
Definition optionsBase.h:99
std::string magnetGeometryType
default magnet geometry parameters
double beamlineZ
Initial beam line transform w.r.t. the world coordinate frame.
int nGenerate
The number of primary events to simulate.
Definition optionsBase.h:93
std::string physicsList
list of physics processes
double muonSplittingThresholdParentEk2
physics parameters
double beamlineAngle
Initial beam line transform w.r.t. the world coordinate frame.
double beamlineS
Initial beam line transform w.r.t. the world coordinate frame.
bool survey
Parameter for survey.
Definition optionsBase.h:55
double minimumRange
physics parameters
std::string outputFileName
Parameter for output format.
Definition optionsBase.h:48
int muonSplittingFactor
physics parameters
double tunnelSoilThickness
tunnel geometry parameters
double minimumRadiusOfCurvature
Minimum allowed radius of curvature.
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.
std::string exportFileName
Parameter for controlling geometry export.
int seed
The seed value for the random number generator.
Definition optionsBase.h:91
double tunnelOffsetY
tunnel geometry parameters
double tunnelFloorOffset
tunnel geometry parameters
int verboseEventContinueFor
Event level verbosity.
Definition optionsBase.h:73
bool hStyle
H Style dipoles (if not, C Style).
double xsize
for element specification
std::string particlesToExcludeFromCuts
physics parameters
double ffact
magnetic field flip (+1 default, -1: flip sign)
double tunnelMaxSegmentLength
tunnel geometry parameters
double muonSplittingThresholdParentEk
physics parameters
int verboseEventStart
Event level verbosity.
Definition optionsBase.h:72
bool useLENDGammaNuclear
physics parameters
double maximumTrackingTime
Maximum tracking time per track [s].
bool dontSplitSBends
geometry debug, don't split bends into multiple segments
std::string tunnelMaterial
tunnel geometry parameters
bool useASCIISeedState
Whether to use the seed state from an ASCII file.
Definition optionsBase.h:98
bool tunnelIsInfiniteAbsorber
physics parameters
bool verboseSteppingPrimaryOnly
Stepping level verbosity.
Definition optionsBase.h:83
int visVerbosity
Geant4 vis system verbosity.
Definition optionsBase.h:45
double muonSplittingExclusionWeight
physics parameters
bool collimatorsAreInfiniteAbsorbers
physics parameters
int verboseRunLevel
Run level verbosity.
Definition optionsBase.h:67
bool turnOnOpticalSurface
Physics processes.
double prodCutProtons
physics parameters
int nSegmentsPerCircle
Number of facets per 2pi in visualisation.
std::string soilMaterial
tunnel geometry parameters
bool preprocessGDML
geometry control
bool batch
Flag for batch / interactive mode.
Definition optionsBase.h:59
double minimumKineticEnergy
physics parameters
int eventOffset
Event number to start from when recreating from a root file.
int verboseTrackingLevel
Tracking verbosity.
Definition optionsBase.h:76
bool circular
Flag for circular machine.
Definition optionsBase.h:90
bool checkOverlaps
bdsim options
double neutronKineticEnergyLimit
physics parameters
double aper1
default beampipe parameters
double maximumTrackLength
Maximum permitted track length [m].
int verboseEventLevel
Event level verbosity.
Definition optionsBase.h:71
bool restoreFTPFDiffractionForAGreater10
physics parameters
bool turnOnOpticalAbsorption
Physics processes.
bool buildTunnelStraight
tunnel geometry parameters
std::string inputFileName
Input filename.
Definition optionsBase.h:39
long maximumTracksPerEvent
physics parameters
double backupStepperMomLimit
Fractional momentum limit for reverting to backup steppers.
double aper2
default beampipe parameters
int outputCompressionLevel
Parameter for output format.
Definition optionsBase.h:51
double beamlinePhi
Initial beam line transform w.r.t. the world coordinate frame.
double maximumBetaChangePerStep
physics parameters
double maximumStepLength
Maximum permitted step length in any volume.
std::string exportType
Parameter for controlling geometry export.
double neutronTimeLimit
physics parameters
bool recreateSeedState
Load seed state when recreating events.
std::string vacMaterial
vacuum material
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.
bool buildTunnelFloor
tunnel geometry parameters
int startFromEvent
Event to start from when recreating.
Definition optionsBase.h:96
std::string emptyMaterial
material in container volumes
bool muonSplittingExcludeWeight1Particles
physics parameters
double prodCutPhotons
physics parameters
bool generatePrimariesOnly
Whether to only generate primary coordinates and quit, or not.
double defaultRangeCut
physics parameters
double beamlineAxisY
Initial beam line transform w.r.t. the world coordinate frame.
double prodCutElectrons
physics parameters
double tunnelAper1
tunnel geometry parameters
bool verboseEventBDSIM
Event level verbosity.
Definition optionsBase.h:70
int maximumPhotonsPerStep
physics parameters
std::string beampipeMaterial
default beampipe parameters
bool exportGeometry
Parameter for controlling geometry export.
int verboseSteppingLevel
Stepping level verbosity.
Definition optionsBase.h:80
double beampipeThickness
default beampipe parameters
bool turnOnRayleighScattering
Physics processes.
bool turnOffMuonDecay
physics parameters
std::string geant4PhysicsMacroFileName
Geant4 physics macro.
Definition optionsBase.h:42
void print() const
print some properties
std::string visMacroFileName
Visualisation filename.
Definition optionsBase.h:40
double scintYieldFactor
physics parameters
bool beamPipeIsInfiniteAbsorber
physics parameters
double beamlineX
Initial beam line transform w.r.t. the world coordinate frame.
std::string apertureType
default beampipe parameters
bool verboseSteppingBDSIM
Stepping level verbosity.
Definition optionsBase.h:79
bool useMuonNuclear
physics parameters
bool useElectroNuclear
physics parameters
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.
bool recreate
Whether to recreate from a file or not.
Definition optionsBase.h:94
double tunnelAper2
tunnel geometry parameters
bool turnOnMieScattering
Physics processes.
double beamlineY
Initial beam line transform w.r.t. the world coordinate frame.
double beamlineAxisX
Initial beam line transform w.r.t. the world coordinate frame.
double tunnelThickness
tunnel geometry parameters
std::string randomEngine
Name of random engine to use.
Definition optionsBase.h:92
bool extendPionDecayChannels
physics parameters
double prodCutPositrons
physics parameters
bool buildTunnel
tunnel geometry parameters
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:44
bool useGammaToMuMu
physics parameters
double aper4
default beampipe parameters
double aper3
default beampipe parameters
double minimumKineticEnergyTunnel
physics parameters
double tunnelOffsetX
tunnel geometry parameters
bool usePositronToMuMu
physics parameters
std::string tunnelType
tunnel geometry parameters
double beamlineAxisZ
Initial beam line transform w.r.t. the world coordinate frame.
double beamlinePsi
Initial beam line transform w.r.t. the world coordinate frame.
std::string geant4MacroFileName
Geant4 macro to run.
Definition optionsBase.h:41
bool trajNoTransportation
kept only for backwards compatibility.
double xrayAllSurfaceRoughness
physics parameters
bool usePositronToHadrons
physics parameters
bool tunnelVisible
tunnel geometry parameters
int muonSplittingFactor2
physics parameters
double worldVolumeMargin
Padding margin for world volume size.
double nominalMatrixRelativeMomCut
Momentum threshold for nominal dipole matrix tracking.
double beamlineTheta
Initial beam line transform w.r.t. the world coordinate frame.
bool ignoreLocalAperture
default beampipe parameters
Parser namespace for GMAD language. Combination of Geant4 and MAD.