Skip to content

Commit

Permalink
refactor: Enable Fatras interactions by default / make configurable i…
Browse files Browse the repository at this point in the history
…n addFatras(...) (#1631)

It turned out that all interactions in Fatras where turned off by default... This is not optimal I think. This PR enables these by default both on the C++ site and on the python side, to be explicit.

As a consequence, all root hashes relying on FATRAs should change...
  • Loading branch information
benjaminhuth committed Nov 4, 2022
1 parent 12c2774 commit 79cabe0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ class FatrasSimulation final : public BareAlgorithm {
/// Minimal absolute momentum for particles to be simulated.
double pMin = 0.5 * Acts::UnitConstants::GeV;
/// Simulate (multiple) scattering for charged particles.
bool emScattering = false;
bool emScattering = true;
/// Simulate ionisiation/excitation energy loss of charged particles.
bool emEnergyLossIonisation = false;
bool emEnergyLossIonisation = true;
/// Simulate radiative energy loss of charged particles.
bool emEnergyLossRadiation = false;
bool emEnergyLossRadiation = true;
/// Simulate electron-positron pair production by photon conversion.
bool emPhotonConversion = false;
bool emPhotonConversion = true;
/// Generate simulation hits on sensitive surfaces.
bool generateHitsOnSensitive = false;
bool generateHitsOnSensitive = true;
/// Generate simulation hits on surfaces with associated material.
bool generateHitsOnMaterial = false;
/// Generate simulation hits on passive surfaces, i.e neither sensitive nor
Expand Down
6 changes: 6 additions & 0 deletions Examples/Python/python/acts/examples/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ def addFatras(
outputDirRoot: Optional[Union[Path, str]] = None,
rnd: Optional[acts.examples.RandomNumbers] = None,
preselectParticles: Optional[ParticleSelectorConfig] = ParticleSelectorConfig(),
enableInteractions=False,
logLevel: Optional[acts.logging.Level] = None,
) -> None:
"""This function steers the detector simulation using Fatras
Expand All @@ -383,6 +384,7 @@ def addFatras(
ParticleSelector configuration to select particles as input to Fatras. Each range is specified as a tuple of (min,max).
Default of no selections specified in Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/ParticleSelector.hpp
Specify preselectParticles=None to inhibit ParticleSelector altogether.
enableInteractions : Enable the particle interactions in the simulation
"""

customLogLevel = acts.examples.defaultLogging(s, logLevel)
Expand Down Expand Up @@ -413,6 +415,10 @@ def addFatras(
trackingGeometry=trackingGeometry,
magneticField=field,
generateHitsOnSensitive=True,
emScattering=enableInteractions,
emEnergyLossIonisation=enableInteractions,
emEnergyLossRadiation=enableInteractions,
emPhotonConversion=enableInteractions,
)

# Sequencer
Expand Down
4 changes: 4 additions & 0 deletions Examples/Python/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,10 @@ def _factory(s):
trackingGeometry=trk_geo,
magneticField=field,
generateHitsOnSensitive=True,
emScattering=False,
emEnergyLossIonisation=False,
emEnergyLossRadiation=False,
emPhotonConversion=False,
)

s.addAlgorithm(simAlg)
Expand Down

0 comments on commit 79cabe0

Please sign in to comment.