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);
194 publish(
"verboseImportanceSampling", &Options::verboseImportanceSampling);
213 publish(
"physicsVerbose", &Options::physicsVerbose);
214 publish(
"physicsVerbosity", &Options::physicsVerbosity);
215 publish(
"physicsEnergyLimitLow", &Options::physicsEnergyLimitLow);
216 publish(
"physicsEnergyLimitHigh", &Options::physicsEnergyLimitHigh);
217 publish(
"g4PhysicsUseBDSIMRangeCuts", &Options::g4PhysicsUseBDSIMRangeCuts);
218 publish(
"g4PhysicsUseBDSIMCutsAndLimits", &Options::g4PhysicsUseBDSIMCutsAndLimits);
224 publish(
"elossHistoBinWidth",&Options::elossHistoBinWidth);
243 publish(
"eventNumberOffset", &Options::eventNumberOffset);
244 publish(
"vacuumPressure", &Options::vacuumPressure);
246 publish(
"ysize", &Options::ysize);
250 publish(
"outerMaterial", &Options::outerMaterialName);
251 publish(
"horizontalWidth", &Options::horizontalWidth);
252 publish(
"outerDiameter", &Options::horizontalWidth);
253 publish(
"boxSize", &Options::horizontalWidth);
254 publish(
"yokeFields", &Options::yokeFields);
255 publish(
"includeIronMagFields", &Options::yokeFields);
256 publish(
"yokeFieldsMatchLHCGeometry", &Options::yokeFieldsMatchLHCGeometry);
257 publish(
"useOldMultipoleOuterFields", &Options::useOldMultipoleOuterFields);
258 publish(
"scalingFieldOuter", &Options::scalingFieldOuter);
259 publish(
"includeFringeFields", &Options::includeFringeFields);
260 publish(
"includeFringeFieldsCavities", &Options::includeFringeFieldsCavities);
272 publish(
"worldMaterial", &Options::worldMaterial);
273 publish(
"worldGeometryFile", &Options::worldGeometryFile);
274 publish(
"autoColourWorldGeometryFile", &Options::autoColourWorldGeometryFile);
275 publish(
"importanceWorldGeometryFile", &Options::importanceWorldGeometryFile);
276 publish(
"importanceVolumeMap", &Options::importanceVolumeMap);
279 publish(
"thinElementLength", &Options::thinElementLength);
281 publish(
"vhRatio", &Options::vhRatio);
282 publish(
"coilWidthFraction", &Options::coilWidthFraction);
283 publish(
"coilHeightFraction", &Options::coilHeightFraction);
284 publish(
"ignoreLocalMagnetGeometry", &Options::ignoreLocalMagnetGeometry);
285 publish(
"buildPoleFaceGeometry", &Options::buildPoleFaceGeometry);
287 publish(
"preprocessGDMLSchema", &Options::preprocessGDMLSchema);
308 publish(
"removeTemporaryFiles", &Options::removeTemporaryFiles);
309 publish(
"temporaryDirectory", &Options::temporaryDirectory);
311 publish(
"samplerDiameter",&Options::samplerDiameter);
351 publish(
"defaultBiasVacuum", &Options::defaultBiasVacuum);
352 publish(
"defaultBiasMaterial", &Options::defaultBiasMaterial);
353 publish(
"biasForWorldVolume", &Options::biasForWorldVolume);
354 publish(
"biasForWorldContents",&Options::biasForWorldContents);
355 publish(
"biasForWorldVacuum", &Options::biasForWorldVacuum);
356 publish(
"worldVacuumVolumeNames",&Options::worldVacuumVolumeNames);
359 publish(
"integratorSet", &Options::integratorSet);
360 publish(
"lengthSafety", &Options::lengthSafety);
361 publish(
"lengthSafetyLarge", &Options::lengthSafetyLarge);
366 publish(
"chordStepMinimum", &Options::chordStepMinimum);
367 publish(
"chordStepMinimumYoke", &Options::chordStepMinimumYoke);
368 publish(
"deltaIntersection", &Options::deltaIntersection);
369 publish(
"minimumEpsilonStep", &Options::minimumEpsilonStep);
370 publish(
"maximumEpsilonStep", &Options::maximumEpsilonStep);
371 publish(
"deltaOneStep", &Options::deltaOneStep);
372 publish(
"stopSecondaries", &Options::stopSecondaries);
373 publish(
"killNeutrinos", &Options::killNeutrinos);
374 publish(
"killedParticlesMassAddedToEloss", &Options::killedParticlesMassAddedToEloss);
376 publish(
"sampleElementsWithPoleface", &Options::sampleElementsWithPoleface);
379 publish(
"dEThresholdForScattering", &Options::dEThresholdForScattering);
383 publish(
"sensitiveOuter", &Options::sensitiveOuter);
384 publish(
"sensitiveBeamlineComponents", &Options::sensitiveOuter);
385 publish(
"sensitiveBeamPipe", &Options::sensitiveBeamPipe);
386 publish(
"sensitiveBeampipe", &Options::sensitiveBeamPipe);
387 publish(
"sensitiveTunnel", &Options::storeElossTunnel);
388 publish(
"tunnelSensitive", &Options::storeElossTunnel);
391 publish(
"nperfile", &Options::numberOfEventsPerNtuple);
393 publish(
"storeMinimalData", &Options::storeMinimalData);
395 publish(
"storeApertureImpacts", &Options::storeApertureImpacts);
396 publish(
"storeApertureImpactsIons", &Options::storeApertureImpactsIons);
397 publish(
"storeApertureImpactsAll", &Options::storeApertureImpactsAll);
398 publish(
"storeApertureImpactsHistograms", &Options::storeApertureImpactsHistograms);
399 publish(
"apertureImpactsMinimumKE", &Options::apertureImpactsMinimumKE);
400 publish(
"storeCollimatorInfo", &Options::storeCollimatorInfo);
401 publish(
"storeCollimatorHits", &Options::storeCollimatorHits);
402 publish(
"storeCollimatorHitsLinks", &Options::storeCollimatorHitsLinks);
403 publish(
"storeCollimatorHitsLinks", &Options::storeCollimatorHitsLinks);
404 publish(
"storeCollimatorHitsIons", &Options::storeCollimatorHitsIons);
405 publish(
"storeCollimatorHitsAll", &Options::storeCollimatorHitsAll);
406 publish(
"collimatorHitsMinimumKE", &Options::collimatorHitsMinimumKE);
407 publish(
"storeEloss", &Options::storeEloss);
408 publish(
"storeELoss", &Options::storeEloss);
409 publish(
"storeElossHistograms", &Options::storeElossHistograms);
410 publish(
"storeELossHistograms", &Options::storeElossHistograms);
411 publish(
"storeElossVacuum", &Options::storeElossVacuum);
412 publish(
"storeELossVacuum", &Options::storeElossVacuum);
413 publish(
"storeElossVacuumHistograms", &Options::storeElossVacuumHistograms);
414 publish(
"storeELossVacuumHistograms", &Options::storeElossVacuumHistograms);
415 publish(
"storeElossTunnel", &Options::storeElossTunnel);
416 publish(
"storeELossTunnel", &Options::storeElossTunnel);
417 publish(
"storeElossTunnelHistograms", &Options::storeElossTunnelHistograms);
418 publish(
"storeELossTunnelHistograms", &Options::storeElossTunnelHistograms);
419 publish(
"storeElossWorld", &Options::storeElossWorld);
420 publish(
"storeELossWorld", &Options::storeElossWorld);
421 publish(
"storeElossWorldContents", &Options::storeElossWorldContents);
422 publish(
"storeELossWorldContents", &Options::storeElossWorldContents);
423 publish(
"storeElossTurn", &Options::storeElossTurn);
424 publish(
"storeELossTurn", &Options::storeElossTurn);
425 publish(
"storeElossLinks", &Options::storeElossLinks);
426 publish(
"storeELossLinks", &Options::storeElossLinks);
427 publish(
"storeElossLocal", &Options::storeElossLocal);
428 publish(
"storeELossLocal", &Options::storeElossLocal);
429 publish(
"storeElossGlobal", &Options::storeElossGlobal);
430 publish(
"storeELossGlobal", &Options::storeElossGlobal);
431 publish(
"storeElossTime", &Options::storeElossTime);
432 publish(
"storeELossTime", &Options::storeElossTime);
433 publish(
"storeElossStepLength", &Options::storeElossStepLength);
434 publish(
"storeELossStepLength", &Options::storeElossStepLength);
435 publish(
"storeElossPreStepKineticEnergy", &Options::storeElossPreStepKineticEnergy);
436 publish(
"storeELossPreStepKineticEnergy", &Options::storeElossPreStepKineticEnergy);
437 publish(
"storeElossModelID", &Options::storeElossModelID);
438 publish(
"storeELossModelID", &Options::storeElossModelID);
439 publish(
"storeElossPhysicsProcesses", &Options::storeElossPhysicsProcesses);
440 publish(
"storeELossPhysicsProcesses", &Options::storeElossPhysicsProcesses);
441 publish(
"storeParticleData", &Options::storeParticleData);
442 publish(
"storeGeant4Data", &Options::storeParticleData);
443 publish(
"storePrimaries", &Options::storePrimaries);
444 publish(
"storePrimaryHistograms", &Options::storePrimaryHistograms);
445 publish(
"writePrimaries", &Options::storePrimaries);
447 publish(
"storeTrajectory", &Options::storeTrajectory);
448 publish(
"storeTrajectories", &Options::storeTrajectory);
449 publish(
"storeTrajectoryDepth", &Options::storeTrajectoryDepth);
450 publish(
"storeTrajectoryStepPoints", &Options::storeTrajectoryStepPoints);
451 publish(
"storeTrajectoryStepPointLast", &Options::storeTrajectoryStepPointLast);
452 publish(
"storeTrajectoryParticle", &Options::storeTrajectoryParticle);
453 publish(
"storeTrajectoryParticleID", &Options::storeTrajectoryParticleID);
454 publish(
"storeTrajectoryEnergyThreshold", &Options::storeTrajectoryEnergyThreshold);
455 publish(
"storeTrajectorySamplerID", &Options::storeTrajectorySamplerID);
456 publish(
"storeTrajectoryELossSRange", &Options::storeTrajectoryELossSRange);
458 publish(
"storeTrajectoryTransportationSteps", &Options::storeTrajectoryTransportationSteps);
460 publish(
"storeTrajectoryKineticEnergy", &Options::storeTrajectoryKineticEnergy);
461 publish(
"storeTrajectoryMomentumVector", &Options::storeTrajectoryMomentumVector);
462 publish(
"storeTrajectoryProcesses", &Options::storeTrajectoryProcesses);
463 publish(
"storeTrajectoryTime", &Options::storeTrajectoryTime);
464 publish(
"storeTrajectoryLocal", &Options::storeTrajectoryLocal);
465 publish(
"storeTrajectoryLinks", &Options::storeTrajectoryLinks);
466 publish(
"storeTrajectoryIon", &Options::storeTrajectoryIon);
467 publish(
"storeTrajectoryIons", &Options::storeTrajectoryIon);
468 publish(
"storeTrajectoryMaterial", &Options::storeTrajectoryMaterial);
469 publish(
"storeTrajectoryAllVariables", &Options::storeTrajectoryAllVariables);
470 publish(
"trajectoryFilterLogicAND", &Options::trajectoryFilterLogicAND);
472 publish(
"storeSamplerAll", &Options::storeSamplerAll);
473 publish(
"storeSamplerPolarCoords", &Options::storeSamplerPolarCoords);
474 publish(
"storeSamplerPolarCoordinates", &Options::storeSamplerPolarCoords);
475 publish(
"storeSamplerCharge", &Options::storeSamplerCharge);
476 publish(
"storeSamplerKineticEnergy", &Options::storeSamplerKineticEnergy);
477 publish(
"storeSamplerMass", &Options::storeSamplerMass);
478 publish(
"storeSamplerRigidity", &Options::storeSamplerRigidity);
479 publish(
"storeSamplerIon", &Options::storeSamplerIon);
481 publish(
"trajConnect", &Options::trajConnect);
482 publish(
"trajectoryConnect", &Options::trajConnect);
483 publish(
"trajCutGTZ", &Options::trajCutGTZ);
484 publish(
"trajCutLTR", &Options::trajCutLTR);
486 publish(
"storeModel", &Options::storeModel);
488 publish(
"samplersSplitLevel", &Options::samplersSplitLevel);
491 publish(
"nturns", &Options::nturns);
492 publish(
"ptcOneTurnMapFileName", &Options::ptcOneTurnMapFileName);
494 publish(
"printModuloFraction", &Options::printFractionEvents);
495 publish(
"printFractionEvents", &Options::printFractionEvents);
496 publish(
"printFractionTurns", &Options::printFractionTurns);
497 publish(
"printPhysicsProcesses", &Options::printPhysicsProcesses);
503 publish(
"nbinsx", &Options::nbinsx);
504 publish(
"nbinsy", &Options::nbinsy);
505 publish(
"nbinsz", &Options::nbinsz);
506 publish(
"nbinse" , &Options::nbinse);
507 publish(
"xmin", &Options::xmin);
508 publish(
"xmax", &Options::xmax);
509 publish(
"ymin", &Options::ymin);
510 publish(
"ymax", &Options::ymax);
511 publish(
"zmin", &Options::zmin);
512 publish(
"zmax", &Options::zmax);
513 publish(
"emin", &Options::emin);
514 publish(
"emax", &Options::emax);
515 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 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.