Skip to content
Snippets Groups Projects

Avoid removing particles from the GenEvent after SimHit creation has started

Merged John Derek Chapman requested to merge jchapman/athena:QSSimRefactor_23.0 into 23.0

In order to complete the switch from using GenParticle barcodes to GenParticle id to link GenParticles within a GenEvent to other persistent EDM objects (SimHits), then we cannot remove GenParticles from the GenEvent during the actual simulation process as this can alter the ids of other GenParticles which may have already been linked to SimHits. Any removal has to happen before the first SimHits are created.

Initial approach

  1. Read in BeamTruthEvent McEventCollection as previously. Copy BeamTruthEvent to shadowTruth McEventCollection (not saved to StoreGate).
  2. For each GenEvent in shadowTruth:
    a) Apply ZeroLifetimePositioner to deal with the issue of oscillating neutral mesons.
    b) Apply TruthPreselectionTool. This makes a copy of the GenEvent, identifies all particles (including quasi-stable particles) in the GenEvent held in the BeamTruthEvent McEventCollection which will be passed to the Simulators and add a ShadowParticleId Attribute holding the id of the GenParticle in the shadowTruth version of the GenEvent to them. It then loops over the GenParticle and GenVertex objects in the GenEvent copy and removes all objects with an ancestor which has the ShadowParticleId Attribute (effectively this removes the decay trees downstream of quasi-stable particles). This modified copy of the GenEvent is stored in the TruthEvent McEventCollection (saved to StoreGate).
  3. As previously pass the GenEvent object(s) in TruthEvent to InputConverter::convert. As the selection of GenParticle objects has already been done though, this now just creates ISFParticle objects from GenParticle objects with the ShadowParticleId Attribute.
  4. During the building of the G4Event, when converting a quasi-stable particle (identified as a GenParticle with status==2 and no end GenVertex) to a G4PrimaryParticle, the predefined decay chain is taken from the _shadowTruth GenEvent instead of the GenEvent from the TruthEvent McEventCollection. We also avoid linking G4PrimaryParticle objects in the predefined decay chain to any HepMC truth.
  5. Simulation then proceeds as before, the only difference is in the barcodes assigned to particles produced in predefined decays and in the ordering of GenParticle and GenVertex objects in the output GenEvent.

Notes:

  • The implementation of TruthPreselectionTool could be improved. Consider integrating with the InputConverter directly?
  • After this is validated and switched on by default it should be possible to simplify the TruthSvc implementation considerably.
Edited by John Derek Chapman

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • John Derek Chapman added 200 commits

    added 200 commits

    • 5492a12f...76eefd35 - 193 commits from branch atlas:23.0
    • 0f8b6e23 - Initial commit of DropQSParticleDaughters Algorithm. Possibly not the most...
    • c7174b71 - New-style InputConverter
    • 0c51dd48 - Update SimulatorTool interface (incomplete)
    • 7191d445 - Update SimKernelMT
    • 5458542e - GenParticleSimWhiteList: Do not throw for status 2 GenParticles without an end vertex
    • 0804359a - Enable ShadowTruthEvents for FullG4MT
    • 450bf6ef - Migrate ISimulatorTool implementations to new interfaces

    Compare with previous version

  • added 7 commits

    • ff7db1a3 - Update ISimulatorTool interface and ISimulatorTool implementations
    • 5e1fdd63 - Update SimKernelMT
    • 0ec15718 - GenParticleSimWhiteList: Do not throw for status 2 GenParticles without an end vertex
    • 6b0ac885 - Enable ShadowTruthEvents for FullG4MT
    • e856f874 - ActsFatrasSimTool bugfix
    • b70343dd - DropQSParticleDaughters optimize
    • 187630a4 - TruthSvc update

    Compare with previous version

  • John Derek Chapman resolved all threads

    resolved all threads

  • John Derek Chapman changed title from Draft: Initial commit of DropQSParticleDaughters Algorithm. Possibly not the most... to Draft: Avoid removing particles from the GenEvent after SimHit creation has started

    changed title from Draft: Initial commit of DropQSParticleDaughters Algorithm. Possibly not the most... to Draft: Avoid removing particles from the GenEvent after SimHit creation has started

  • added 1 commit

    • 9c968afe - Add AssociatedParticle Attribute to link quasi-stable particles in filtered...

    Compare with previous version

  • added 1 commit

    • 6bf6467c - Add AssociatedParticle Attribute to link quasi-stable particles in filtered...

    Compare with previous version

  • John Derek Chapman mentioned in merge request !63108 (merged)

    mentioned in merge request !63108 (merged)

  • John Derek Chapman mentioned in merge request !63138 (merged)

    mentioned in merge request !63138 (merged)

  • John Derek Chapman added 112 commits

    added 112 commits

    • 6bf6467c...f5667c6c - 103 commits from branch atlas:23.0
    • c3db2f1d - Add new ShadowParticle Attribute for linking between GenEvents
    • 97bb18f2 - Add DropQSParticleDaughters Algorithm.
    • e27ec3ed - New-style InputConverter
    • c90d936d - Update ISimulatorTool interface and ISimulatorTool implementations
    • f1a4adf3 - ActsFatrasSimTool bugfix
    • 0d5de60e - Update SimKernelMT
    • 07041d4e - GenParticleSimWhiteList: Do not throw for status 2 GenParticles without an end vertex
    • fa4fbd1f - Enable ShadowTruthEvents for FullG4MT
    • 9f8b096e - TruthSvc update

    Compare with previous version

  • John Derek Chapman added 25 commits

    added 25 commits

    • fc5e7179 - InputConverter: Clean-up ahead of refactoring
    • 671d7192 - InputConverter: Refactoring
    • aae3e5d2 - InputConverter: Make the linking of G4PrimaryParticles in pre-defined decay-chains optional
    • adda1e45 - CaloOnly sequence using menusequenceCA wrapped for legacy config
    • 065b5797 - increment version to 23.0.30 in relevant projects
    • 02cf36c7 - athena:23.0-coverity-L1CaloFEXSim
    • 7a2651b2 - 23.0-cleanup-InDetAlignGenAlgs
    • 54ac58d4 - JetEventCleaningAlg - Clean up the pointer managerment
    • 751e79f2 - Check if LumiBlock containers exist before recording
    • 47506918 - fixed a bug where 1e5 used instead of 1e6 and modified to use MagicNumber constant instead
    • af378eba - Update Calibration Hit Configuration Code
    • 2da4502d - egammaTruthAlg::isAccepted changed 100000 to SIM_REGENERATION_THRESHOLD (1000000)
    • a0050d39 - Fix a bug in GeneratorFilters: do not assume barcode-ordered vertices
    • 17c3cc40 - 23.0-coverity-SCT_ConditionsTools
    • 8113ebd1 - Rewrite LArNoiseCorrelationMonAlg to reduce complexity
    • 1918a26a - Update Run1 Digitization jobs to use OFLCOND-RUN12-SDR-31-01 (ATLASSIM-6559)
    • 982695ef - Add new ShadowParticle Attribute for linking between GenEvents
    • b353dee0 - Add DropQSParticleDaughters Algorithm.
    • 049e233e - New-style InputConverter
    • 304365e6 - Update ISimulatorTool interface and ISimulatorTool implementations
    • 8918aa41 - ActsFatrasSimTool bugfix
    • 4801c7f2 - Update SimKernelMT
    • 5d4ab3c1 - GenParticleSimWhiteList: Do not throw for status 2 GenParticles without an end vertex
    • a4619aa2 - Enable ShadowTruthEvents for FullG4MT
    • 0ab9f563 - TruthSvc update

    Compare with previous version

  • John Derek Chapman added 23 commits

    added 23 commits

    • f717faff - InputConverter: Make the linking of G4PrimaryParticles in pre-defined decay-chains optional
    • a124ad83 - CaloOnly sequence using menusequenceCA wrapped for legacy config
    • 09c0063f - increment version to 23.0.30 in relevant projects
    • 8b5fd3dd - athena:23.0-coverity-L1CaloFEXSim
    • 96dba3a5 - 23.0-cleanup-InDetAlignGenAlgs
    • 019994d7 - JetEventCleaningAlg - Clean up the pointer managerment
    • d6af4f4b - Check if LumiBlock containers exist before recording
    • dc87b03e - fixed a bug where 1e5 used instead of 1e6 and modified to use MagicNumber constant instead
    • e0886e72 - Update Calibration Hit Configuration Code
    • eded2dc3 - egammaTruthAlg::isAccepted changed 100000 to SIM_REGENERATION_THRESHOLD (1000000)
    • 50bc2ec6 - Fix a bug in GeneratorFilters: do not assume barcode-ordered vertices
    • 9a0732fe - 23.0-coverity-SCT_ConditionsTools
    • 3ca78de8 - Rewrite LArNoiseCorrelationMonAlg to reduce complexity
    • b6a5e90d - Update Run1 Digitization jobs to use OFLCOND-RUN12-SDR-31-01 (ATLASSIM-6559)
    • 93e38b9b - Add new ShadowParticle Attribute for linking between GenEvents
    • 6d28c2ab - Add DropQSParticleDaughters Algorithm.
    • e35a9569 - New-style InputConverter
    • b8dc9d7d - Update ISimulatorTool interface and ISimulatorTool implementations
    • 08236939 - ActsFatrasSimTool bugfix
    • c517ee2b - Update SimKernelMT
    • 7e3e9671 - GenParticleSimWhiteList: Do not throw for status 2 GenParticles without an end vertex
    • f98a7332 - Enable ShadowTruthEvents for FullG4MT
    • e6105588 - TruthSvc update

    Compare with previous version

  • John Derek Chapman added 25 commits

    added 25 commits

    • aeb0bb31 - InputConverter: Refactoring
    • 6f8bd3c8 - InputConverter: Make the linking of G4PrimaryParticles in pre-defined decay-chains optional
    • f9d2bff7 - CaloOnly sequence using menusequenceCA wrapped for legacy config
    • b84d1499 - increment version to 23.0.30 in relevant projects
    • 2219b13b - athena:23.0-coverity-L1CaloFEXSim
    • d6ff7a71 - 23.0-cleanup-InDetAlignGenAlgs
    • 7858eefa - JetEventCleaningAlg - Clean up the pointer managerment
    • 40282ad8 - Check if LumiBlock containers exist before recording
    • 17793e4a - fixed a bug where 1e5 used instead of 1e6 and modified to use MagicNumber constant instead
    • 8aebf92e - Update Calibration Hit Configuration Code
    • 2d1d0c54 - egammaTruthAlg::isAccepted changed 100000 to SIM_REGENERATION_THRESHOLD (1000000)
    • c021c929 - Fix a bug in GeneratorFilters: do not assume barcode-ordered vertices
    • b91d05f0 - 23.0-coverity-SCT_ConditionsTools
    • 95acaa0f - Rewrite LArNoiseCorrelationMonAlg to reduce complexity
    • e1c61a30 - Update Run1 Digitization jobs to use OFLCOND-RUN12-SDR-31-01 (ATLASSIM-6559)
    • a34f4ed2 - Add new ShadowParticle Attribute for linking between GenEvents
    • fbe5894f - Add DropQSParticleDaughters Algorithm.
    • 3fc62e0c - New-style InputConverter
    • 17ec4d1b - Update ISimulatorTool interface and ISimulatorTool implementations
    • ba9d2aeb - ActsFatrasSimTool bugfix
    • cee981cd - Update SimKernelMT
    • 0b25345e - GenParticleSimWhiteList: Do not throw for status 2 GenParticles without an end vertex
    • 0ea926dd - Enable ShadowTruthEvents for FullG4MT
    • 7cde72a8 - TruthSvc update
    • b703629d - fixup

    Compare with previous version

  • John Derek Chapman added 38 commits

    added 38 commits

    • b703629d...f5667c6c - 25 commits from branch atlas:23.0
    • 90ba6e5e - InputConverter: Clean-up ahead of refactoring
    • d940c8e8 - InputConverter: Refactoring
    • f50943fa - InputConverter: Make the linking of G4PrimaryParticles in pre-defined decay-chains optional
    • a1fec2f3 - Add new ShadowParticle Attribute for linking between GenEvents
    • 132e2389 - Add DropQSParticleDaughters Algorithm.
    • ffdc0916 - New-style InputConverter
    • 1e71070b - Update ISimulatorTool interface and ISimulatorTool implementations
    • 4d2fad94 - ActsFatrasSimTool bugfix
    • ee1d60ce - Update SimKernelMT
    • 03ad6b8b - GenParticleSimWhiteList: Do not throw for status 2 GenParticles without an end vertex
    • 25a50e4d - Enable ShadowTruthEvents for FullG4MT
    • 8f32ec8f - TruthSvc update
    • 7afa964f - fixup

    Compare with previous version

  • added 7 commits

    • 129022d6 - New-style InputConverter
    • 603f7448 - Update ISimulatorTool interface and ISimulatorTool implementations
    • 76282606 - ActsFatrasSimTool bugfix
    • 0c3f3e31 - Update SimKernelMT
    • 68b22421 - GenParticleSimWhiteList: Do not throw for status 2 GenParticles without an end vertex
    • be37459f - Enable ShadowTruthEvents for FullG4MT
    • d7d41c76 - TruthSvc update

    Compare with previous version

  • added 5 commits

    • ef0d5486 - Update ISimulatorTool interface and ISimulatorTool implementations
    • 20251f26 - Update SimKernelMT
    • db40ca75 - GenParticleSimWhiteList: Do not throw for status 2 GenParticles without an end vertex
    • 180068ea - Enable ShadowTruthEvents for FullG4MT
    • fc187406 - TruthSvc update

    Compare with previous version

  • added 5 commits

    • f8671aca - Update ISimulatorTool interface and ISimulatorTool implementations
    • 1819134d - Update SimKernelMT
    • 950b9f34 - GenParticleSimWhiteList: Do not throw for status 2 GenParticles without an end vertex
    • 8562cf3e - Enable ShadowTruthEvents for FullG4MT
    • c83605f0 - TruthSvc update

    Compare with previous version

  • John Derek Chapman changed the description

    changed the description

  • John Derek Chapman added 54 commits

    added 54 commits

    • c83605f0...2f028f99 - 44 commits from branch atlas:23.0
    • d5f19cf8 - InputConverter: Refactoring
    • bd11261c - InputConverter: Make the linking of G4PrimaryParticles in pre-defined decay-chains optional
    • a2eeacb4 - Add DropQSParticleDaughters Algorithm.
    • 94e0db1f - New-style InputConverter
    • a6b4b7b9 - Update ISimulatorTool interface and ISimulatorTool implementations
    • 480ad583 - Update SimKernelMT
    • 1deb0062 - GenParticleSimWhiteList: Do not throw for status 2 GenParticles without an end vertex
    • af4ff0e2 - Enable ShadowTruthEvents for FullG4MT
    • 8744496b - TruthSvc update
    • 996abce2 - DropQSParticleDaughters: Refactor

    Compare with previous version

  • added 2 commits

    • 1218f022 - DropQSParticleDaughters: Add ShadowParticleId attribute to all GenParticles...
    • be62f3d3 - InputConverter: Use ShadowParticleId Attribute to find particles which should be simulated

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading