40double Options::get_value(std::string property_name)
const{
43 value = get<double>(
this,property_name);
45 catch (
const std::runtime_error&) {
48 value = (double)get<int>(
this,property_name);
50 catch (
const std::runtime_error&) {
53 value = (double)get<long>(
this,property_name);
55 catch (
const std::runtime_error&) {
56 std::cerr <<
"options.cc> Error: unknown property \"" << property_name <<
"\" (only works on numerical properties)" << std::endl;
64std::string Options::get_value_string(std::string property_name)
const
67 double value = get<double>(
this, property_name);
68 std::ostringstream strs;
74 int value = get<int>(
this, property_name);
75 std::ostringstream strs;
81 std::string value = get<std::string>(
this, property_name);
86 bool value = get<bool>(
this, property_name);
87 std::ostringstream strs;
88 strs << std::boolalpha << value;
92 {std::cerr <<
"Error " << property_name << std::endl; exit(1);}
102 for (
auto const& key : optionsIn.
setKeys)
106 set(
this, &optionsIn, key);
109 catch (
const std::runtime_error&)
111 std::cerr <<
"Error: Amalgamate unknown option \"" << key <<
"\"" << std::endl;
118 for (
auto const& key : optionsIn.
setKeys)
121 auto result = std::find(ok.begin(), ok.end(), key);
122 if (result == ok.end())
126 set(
this, &optionsIn, key);
129 catch (
const std::runtime_error&)
131 std::cerr <<
"Error: Amalgamate unknown option \"" << key <<
"\"" << std::endl;
151 publish(
"geant4PhysicsMacroFileNameFromExecOptions", &Options::geant4PhysicsMacroFileNameFromExecOptions);
196 publish(
"verboseImportanceSampling", &Options::verboseImportanceSampling);
197 publish(
"verboseSensitivity", &Options::verboseSensitivity);
216 publish(
"physicsVerbose", &Options::physicsVerbose);
217 publish(
"physicsVerbosity", &Options::physicsVerbosity);
218 publish(
"physicsEnergyLimitLow", &Options::physicsEnergyLimitLow);
219 publish(
"physicsEnergyLimitHigh", &Options::physicsEnergyLimitHigh);
220 publish(
"g4PhysicsUseBDSIMRangeCuts", &Options::g4PhysicsUseBDSIMRangeCuts);
221 publish(
"g4PhysicsUseBDSIMCutsAndLimits", &Options::g4PhysicsUseBDSIMCutsAndLimits);
227 publish(
"elossHistoBinWidth",&Options::elossHistoBinWidth);
246 publish(
"eventNumberOffset", &Options::eventNumberOffset);
247 publish(
"vacuumPressure", &Options::vacuumPressure);
249 publish(
"ysize", &Options::ysize);
253 publish(
"outerMaterial", &Options::outerMaterialName);
254 publish(
"horizontalWidth", &Options::horizontalWidth);
255 publish(
"outerDiameter", &Options::horizontalWidth);
256 publish(
"boxSize", &Options::horizontalWidth);
257 publish(
"yokeFields", &Options::yokeFields);
258 publish(
"includeIronMagFields", &Options::yokeFields);
259 publish(
"yokeFieldsMatchLHCGeometry", &Options::yokeFieldsMatchLHCGeometry);
260 publish(
"useOldMultipoleOuterFields", &Options::useOldMultipoleOuterFields);
261 publish(
"scalingFieldOuter", &Options::scalingFieldOuter);
262 publish(
"includeFringeFields", &Options::includeFringeFields);
263 publish(
"includeFringeFieldsCavities", &Options::includeFringeFieldsCavities);
275 publish(
"worldMaterial", &Options::worldMaterial);
276 publish(
"worldGeometryFile", &Options::worldGeometryFile);
277 publish(
"autoColourWorldGeometryFile", &Options::autoColourWorldGeometryFile);
278 publish(
"importanceWorldGeometryFile", &Options::importanceWorldGeometryFile);
279 publish(
"importanceVolumeMap", &Options::importanceVolumeMap);
282 publish(
"thinElementLength", &Options::thinElementLength);
284 publish(
"vhRatio", &Options::vhRatio);
285 publish(
"coilWidthFraction", &Options::coilWidthFraction);
286 publish(
"coilHeightFraction", &Options::coilHeightFraction);
287 publish(
"ignoreLocalMagnetGeometry", &Options::ignoreLocalMagnetGeometry);
288 publish(
"buildPoleFaceGeometry", &Options::buildPoleFaceGeometry);
290 publish(
"preprocessGDMLSchema", &Options::preprocessGDMLSchema);
311 publish(
"removeTemporaryFiles", &Options::removeTemporaryFiles);
312 publish(
"temporaryDirectory", &Options::temporaryDirectory);
314 publish(
"samplerDiameter",&Options::samplerDiameter);
355 publish(
"defaultBiasVacuum", &Options::defaultBiasVacuum);
356 publish(
"defaultBiasMaterial", &Options::defaultBiasMaterial);
357 publish(
"biasForWorldVolume", &Options::biasForWorldVolume);
358 publish(
"biasForWorldContents",&Options::biasForWorldContents);
359 publish(
"biasForWorldVacuum", &Options::biasForWorldVacuum);
360 publish(
"worldVacuumVolumeNames",&Options::worldVacuumVolumeNames);
363 publish(
"integratorSet", &Options::integratorSet);
364 publish(
"fieldModulator", &Options::fieldModulator);
365 publish(
"lengthSafety", &Options::lengthSafety);
366 publish(
"lengthSafetyLarge", &Options::lengthSafetyLarge);
371 publish(
"chordStepMinimum", &Options::chordStepMinimum);
372 publish(
"chordStepMinimumYoke", &Options::chordStepMinimumYoke);
373 publish(
"deltaIntersection", &Options::deltaIntersection);
374 publish(
"minimumEpsilonStep", &Options::minimumEpsilonStep);
375 publish(
"maximumEpsilonStep", &Options::maximumEpsilonStep);
376 publish(
"deltaOneStep", &Options::deltaOneStep);
377 publish(
"stopSecondaries", &Options::stopSecondaries);
378 publish(
"killNeutrinos", &Options::killNeutrinos);
379 publish(
"killedParticlesMassAddedToEloss", &Options::killedParticlesMassAddedToEloss);
381 publish(
"sampleElementsWithPoleface", &Options::sampleElementsWithPoleface);
384 publish(
"dEThresholdForScattering", &Options::dEThresholdForScattering);
388 publish(
"sensitiveOuter", &Options::sensitiveOuter);
389 publish(
"sensitiveBeamlineComponents", &Options::sensitiveOuter);
390 publish(
"sensitiveBeamPipe", &Options::sensitiveBeamPipe);
391 publish(
"sensitiveBeampipe", &Options::sensitiveBeamPipe);
392 publish(
"sensitiveTunnel", &Options::storeElossTunnel);
393 publish(
"tunnelSensitive", &Options::storeElossTunnel);
396 publish(
"nperfile", &Options::numberOfEventsPerNtuple);
398 publish(
"storeMinimalData", &Options::storeMinimalData);
400 publish(
"storeApertureImpacts", &Options::storeApertureImpacts);
401 publish(
"storeApertureImpactsIons", &Options::storeApertureImpactsIons);
402 publish(
"storeApertureImpactsAll", &Options::storeApertureImpactsAll);
403 publish(
"storeApertureImpactsHistograms", &Options::storeApertureImpactsHistograms);
404 publish(
"apertureImpactsMinimumKE", &Options::apertureImpactsMinimumKE);
405 publish(
"storeCavityInfo", &Options::storeCavityInfo);
406 publish(
"storeCollimatorInfo", &Options::storeCollimatorInfo);
407 publish(
"storeCollimatorHits", &Options::storeCollimatorHits);
408 publish(
"storeCollimatorHitsLinks", &Options::storeCollimatorHitsLinks);
409 publish(
"storeCollimatorHitsLinks", &Options::storeCollimatorHitsLinks);
410 publish(
"storeCollimatorHitsIons", &Options::storeCollimatorHitsIons);
411 publish(
"storeCollimatorHitsAll", &Options::storeCollimatorHitsAll);
412 publish(
"collimatorHitsMinimumKE", &Options::collimatorHitsMinimumKE);
413 publish(
"storeEloss", &Options::storeEloss);
414 publish(
"storeELoss", &Options::storeEloss);
415 publish(
"storeElossHistograms", &Options::storeElossHistograms);
416 publish(
"storeELossHistograms", &Options::storeElossHistograms);
417 publish(
"storeElossVacuum", &Options::storeElossVacuum);
418 publish(
"storeELossVacuum", &Options::storeElossVacuum);
419 publish(
"storeElossVacuumHistograms", &Options::storeElossVacuumHistograms);
420 publish(
"storeELossVacuumHistograms", &Options::storeElossVacuumHistograms);
421 publish(
"storeElossTunnel", &Options::storeElossTunnel);
422 publish(
"storeELossTunnel", &Options::storeElossTunnel);
423 publish(
"storeElossTunnelHistograms", &Options::storeElossTunnelHistograms);
424 publish(
"storeELossTunnelHistograms", &Options::storeElossTunnelHistograms);
425 publish(
"storeElossWorld", &Options::storeElossWorld);
426 publish(
"storeELossWorld", &Options::storeElossWorld);
427 publish(
"storeElossWorldIntegral", &Options::storeElossWorldIntegral);
428 publish(
"storeELossWorldIntegral", &Options::storeElossWorldIntegral);
429 publish(
"storeElossWorldContents", &Options::storeElossWorldContents);
430 publish(
"storeELossWorldContents", &Options::storeElossWorldContents);
431 publish(
"storeElossWorldContentsIntegral",&Options::storeElossWorldContentsIntegral);
432 publish(
"storeELossWorldContentsIntegral",&Options::storeElossWorldContentsIntegral);
433 publish(
"storeElossTurn", &Options::storeElossTurn);
434 publish(
"storeELossTurn", &Options::storeElossTurn);
435 publish(
"storeElossLinks", &Options::storeElossLinks);
436 publish(
"storeELossLinks", &Options::storeElossLinks);
437 publish(
"storeElossLocal", &Options::storeElossLocal);
438 publish(
"storeELossLocal", &Options::storeElossLocal);
439 publish(
"storeElossGlobal", &Options::storeElossGlobal);
440 publish(
"storeELossGlobal", &Options::storeElossGlobal);
441 publish(
"storeElossTime", &Options::storeElossTime);
442 publish(
"storeELossTime", &Options::storeElossTime);
443 publish(
"storeElossStepLength", &Options::storeElossStepLength);
444 publish(
"storeELossStepLength", &Options::storeElossStepLength);
445 publish(
"storeElossPreStepKineticEnergy", &Options::storeElossPreStepKineticEnergy);
446 publish(
"storeELossPreStepKineticEnergy", &Options::storeElossPreStepKineticEnergy);
447 publish(
"storeElossModelID", &Options::storeElossModelID);
448 publish(
"storeELossModelID", &Options::storeElossModelID);
449 publish(
"storeElossPhysicsProcesses", &Options::storeElossPhysicsProcesses);
450 publish(
"storeELossPhysicsProcesses", &Options::storeElossPhysicsProcesses);
451 publish(
"storeParticleData", &Options::storeParticleData);
452 publish(
"storeGeant4Data", &Options::storeParticleData);
453 publish(
"storePrimaries", &Options::storePrimaries);
454 publish(
"storePrimaryHistograms", &Options::storePrimaryHistograms);
455 publish(
"writePrimaries", &Options::storePrimaries);
457 publish(
"storeTrajectory", &Options::storeTrajectory);
458 publish(
"storeTrajectories", &Options::storeTrajectory);
459 publish(
"storeTrajectoryDepth", &Options::storeTrajectoryDepth);
460 publish(
"storeTrajectoryStepPoints", &Options::storeTrajectoryStepPoints);
461 publish(
"storeTrajectoryStepPointLast", &Options::storeTrajectoryStepPointLast);
462 publish(
"storeTrajectoryParticle", &Options::storeTrajectoryParticle);
463 publish(
"storeTrajectoryParticleID", &Options::storeTrajectoryParticleID);
464 publish(
"storeTrajectorySecondaryParticles", &Options::storeTrajectorySecondaryParticles);
465 publish(
"storeTrajectoryEnergyThreshold", &Options::storeTrajectoryEnergyThreshold);
466 publish(
"storeTrajectorySamplerID", &Options::storeTrajectorySamplerID);
467 publish(
"storeTrajectoryELossSRange", &Options::storeTrajectoryELossSRange);
469 publish(
"storeTrajectoryTransportationSteps", &Options::storeTrajectoryTransportationSteps);
471 publish(
"storeTrajectoryKineticEnergy", &Options::storeTrajectoryKineticEnergy);
472 publish(
"storeTrajectoryMomentumVector", &Options::storeTrajectoryMomentumVector);
473 publish(
"storeTrajectoryProcesses", &Options::storeTrajectoryProcesses);
474 publish(
"storeTrajectoryTime", &Options::storeTrajectoryTime);
475 publish(
"storeTrajectoryLocal", &Options::storeTrajectoryLocal);
476 publish(
"storeTrajectoryLinks", &Options::storeTrajectoryLinks);
477 publish(
"storeTrajectoryIon", &Options::storeTrajectoryIon);
478 publish(
"storeTrajectoryIons", &Options::storeTrajectoryIon);
479 publish(
"storeTrajectoryMaterial", &Options::storeTrajectoryMaterial);
480 publish(
"storeTrajectoryAllVariables", &Options::storeTrajectoryAllVariables);
481 publish(
"trajectoryFilterLogicAND", &Options::trajectoryFilterLogicAND);
483 publish(
"storeSamplerAll", &Options::storeSamplerAll);
484 publish(
"storeSamplerPolarCoords", &Options::storeSamplerPolarCoords);
485 publish(
"storeSamplerPolarCoordinates", &Options::storeSamplerPolarCoords);
486 publish(
"storeSamplerCharge", &Options::storeSamplerCharge);
487 publish(
"storeSamplerKineticEnergy", &Options::storeSamplerKineticEnergy);
488 publish(
"storeSamplerMass", &Options::storeSamplerMass);
489 publish(
"storeSamplerRigidity", &Options::storeSamplerRigidity);
490 publish(
"storeSamplerIon", &Options::storeSamplerIon);
492 publish(
"trajConnect", &Options::trajConnect);
493 publish(
"trajectoryConnect", &Options::trajConnect);
494 publish(
"trajCutGTZ", &Options::trajCutGTZ);
495 publish(
"trajCutLTR", &Options::trajCutLTR);
497 publish(
"storeModel", &Options::storeModel);
499 publish(
"samplersSplitLevel", &Options::samplersSplitLevel);
500 publish(
"modelSplitLevel", &Options::modelSplitLevel);
501 publish(
"uprootCompatible", &Options::uprootCompatible);
504 publish(
"nturns", &Options::nturns);
505 publish(
"ptcOneTurnMapFileName", &Options::ptcOneTurnMapFileName);
507 publish(
"printModuloFraction", &Options::printFractionEvents);
508 publish(
"printFractionEvents", &Options::printFractionEvents);
509 publish(
"printFractionTurns", &Options::printFractionTurns);
510 publish(
"printPhysicsProcesses", &Options::printPhysicsProcesses);
516 publish(
"nbinsx", &Options::nbinsx);
517 publish(
"nbinsy", &Options::nbinsy);
518 publish(
"nbinsz", &Options::nbinsz);
519 publish(
"nbinse" , &Options::nbinse);
520 publish(
"xmin", &Options::xmin);
521 publish(
"xmax", &Options::xmax);
522 publish(
"ymin", &Options::ymin);
523 publish(
"ymax", &Options::ymax);
524 publish(
"zmin", &Options::zmin);
525 publish(
"zmax", &Options::zmax);
526 publish(
"emin", &Options::emin);
527 publish(
"emax", &Options::emax);
528 publish(
"useScoringMap", &Options::useScoringMap);
Basic options class independent of Geant4.
std::string seedStateFileName
Seed state file path.
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.
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.
double minimumRange
physics parameters
std::string outputFileName
Parameter for output format.
int muonSplittingFactor
physics parameters
double tunnelSoilThickness
tunnel geometry parameters
double minimumRadiusOfCurvature
Minimum allowed radius of curvature.
std::string outputFormat
Parameter for output format.
int verboseSteppingEventContinueFor
Stepping level verbosity.
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.
double tunnelOffsetY
tunnel geometry parameters
double tunnelFloorOffset
tunnel geometry parameters
int verboseEventContinueFor
Event level verbosity.
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.
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.
bool tunnelIsInfiniteAbsorber
physics parameters
bool verboseSteppingPrimaryOnly
Stepping level verbosity.
double muonSplittingExclusionWeight
physics parameters
bool collimatorsAreInfiniteAbsorbers
physics parameters
int verboseRunLevel
Run level verbosity.
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
int maximumBetaChangePerStep
physics parameters
bool batch
Flag for batch / interactive mode.
double minimumKineticEnergy
physics parameters
int eventOffset
Event number to start from when recreating from a root file.
int verboseTrackingLevel
Tracking verbosity.
bool circular
Flag for circular machine.
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.
bool restoreFTPFDiffractionForAGreater10
physics parameters
bool turnOnOpticalAbsorption
Physics processes.
bool buildTunnelStraight
tunnel geometry parameters
std::string inputFileName
Input filename.
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.
double beamlinePhi
Initial beam line transform w.r.t. the world coordinate frame.
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.
std::string recreateFileName
The file path to recreate a run from.
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.
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.
int maximumPhotonsPerStep
physics parameters
std::string beampipeMaterial
default beampipe parameters
bool exportGeometry
Parameter for controlling geometry export.
int verboseSteppingLevel
Stepping level verbosity.
double beampipeThickness
default beampipe parameters
bool turnOnRayleighScattering
Physics processes.
std::string geant4PhysicsMacroFileName
Geant4 physics macro.
std::string visMacroFileName
Visualisation filename.
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.
bool useMuonNuclear
physics parameters
bool useElectroNuclear
physics parameters
int verboseSteppingEventStart
Stepping level verbosity.
std::string surveyFileName
Parameter for survey.
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.
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.
double prodCutPositrons
physics parameters
bool buildTunnel
tunnel geometry parameters
bool outputDoublePrecision
Parameter for output format.
bool writeSeedState
Write the seed state each event to a text file.
bool visDebug
Flag for visualisation debug.
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.
bool trajNoTransportation
kept only for backwards compatibility.
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
void Amalgamate(const Options &optionsIn, bool override)
void PublishMembers()
publish members so these can be looked up from parser
bool HasBeenSet(const std::string &name) const
Whether a parameter has been set using the set_value method or not.
void publish(const std::string &name, T C::*mp)
Make pointer to member from class C and type T with accessible with a name.
void set(OptionsBase *instance, const std::string &name, double value)
Parser namespace for GMAD language. Combination of Geant4 and MAD.