Feature #18716
G4Helper: store the index of the true particle within MCTruth in the primary particle information
Description
Currently g4b::G4Helper
utilises g4b::ConvertMCTruthToG4
to convert the particle content of simb::MCTruth
into a list of particles to be fed to Geant4.
The converter saves extra information for each of these "primary" particles in g4b::PrimaryParticleInformation
instances, in particular the simb::MCTruth
it comes from, and the index of the MCTruth in the list. The information of which particle that is within that simb::MCTruth
is lost.
I would like the information of which particle it was to be retained.
Related issues
Associated revisions
Added which item in the truth record this particle matches
This solves issue #18716.
Added which item in the truth record this particle matches
This solves issue #18716.
Added which item in the truth record this particle matches
This solves issue #18716.
Added which item in the truth record this particle matches
This solves issue #18716.
Added which item in the truth record this particle matches
This solves issue #18716.
Added data types for support of issue #18716.
Merge tag 'v1_12_01' into develop
nusimdata/SimulationBase/simb.h for #18716 v1_12_01
Merge tag 'v2_21_01' into develop
nusimdata/SimulationBase/simb.h and nutools changes for #18716 v2_21_01
Merge tag 'v2_21_01' into develop
nusimdata/SimulationBase/simb.h and nutools changes for #18716 v2_21_01
Merge tag 'v2_21_01' into develop
nusimdata/SimulationBase/simb.h and nutools changes for #18716 v2_21_01
Merge tag 'v2_21_01' into develop
nusimdata/SimulationBase/simb.h and nutools changes for #18716 v2_21_01
Merge tag 'v2_21_01' into develop
nusimdata/SimulationBase/simb.h and nutools changes for #18716 v2_21_01
Merge tag 'v2_21_01' into develop
nusimdata/SimulationBase/simb.h and nutools changes for #18716 v2_21_01
History
#1 Updated by Gianluca Petrillo over 3 years ago
If the maintainers of nutools agree, I can implement this feature.
The idea would be simply to add a data member std::size_t g4b::PrimaryParticleInformation::fMCParticleIndex
(with accessor etc.) and have g4b::ConvertMCTruthToG4::GeneratePrimaries()
fill it with the already available value (variable p
in the current code: source:nutools/G4Base/ConvertMCTruthToG4.cxx#L116).
#2 Updated by Gianluca Petrillo over 3 years ago
- Blocks Feature #17804: Provide a way to associate MCParticles between generator and G4 steps added
#3 Updated by Brian Rebel over 3 years ago
The g4b::PrimaryParticleInformation is not stored in the output file, if I remember correctly. What does this change enable in that case for processing beyond the event generation step?
#4 Updated by Gianluca Petrillo over 3 years ago
You are correct in your recollection.
That object is bound by g4b::G4Helper
to the primary particle given to Geant4 for propagation. LArSoft (`LArG4`) can access that object when creating a new sim::MCParticle
(preTrackingAction()
hook) and save its information at the same time as the simb::MCParticle
itself. That information will be used at the end of `LArG4` module produce()
method to create an additional data product (an association, see issue #17804#note-7).
#5 Updated by Gianluca Petrillo about 3 years ago
- % Done changed from 0 to 90
Branch feature/gp_Issue18716 with a solution is pushed in nusimdata and nutools, updated to the HEAD of branch v2_19_branch
.
#6 Updated by Gianluca Petrillo about 3 years ago
- Status changed from New to Resolved
- % Done changed from 90 to 100
Merged in nutools v2_21_01
.
I'm welcome.
#7 Updated by Gianluca Petrillo about 3 years ago
- Status changed from Resolved to Closed
Added which item in the truth record this particle matches
This solves issue #18716.