Project

General

Profile

Feature #18716

G4Helper: store the index of the true particle within MCTruth in the primary particle information

Added by Gianluca Petrillo almost 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Start date:
01/10/2018
Due date:
% Done:

100%

Estimated time:
Spent time:
Duration:

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

Blocks LArSoft - Feature #17804: Provide a way to associate MCParticles between generator and G4 stepsClosed10/01/2017

Associated revisions

Revision 3c981bdf (diff)
Added by Gianluca Petrillo over 1 year ago

Added which item in the truth record this particle matches

This solves issue #18716.

Revision 5d69ef3a
Added by Gianluca Petrillo over 1 year ago

Added which item in the truth record this particle matches

This solves issue #18716.

Revision cf2b39bc
Added by Gianluca Petrillo over 1 year ago

Added which item in the truth record this particle matches

This solves issue #18716.

Revision 3c981bdf (diff)
Added by Gianluca Petrillo over 1 year ago

Added which item in the truth record this particle matches

This solves issue #18716.

Revision 31653ab3 (diff)
Added by Gianluca Petrillo over 1 year ago

Added which item in the truth record this particle matches

This solves issue #18716.

Revision 3c981bdf (diff)
Added by Gianluca Petrillo over 1 year ago

Added which item in the truth record this particle matches

This solves issue #18716.

Revision 2a800da2 (diff)
Added by Gianluca Petrillo over 1 year ago

Added data types for support of issue #18716.

Revision d2d9e6de
Added by Lynn Garren over 1 year ago

Merge tag 'v1_12_01' into develop

nusimdata/SimulationBase/simb.h for #18716 v1_12_01

Revision 0a862ea4
Added by Lynn Garren over 1 year ago

Merge tag 'v2_21_01' into develop

nusimdata/SimulationBase/simb.h and nutools changes for #18716 v2_21_01

Revision a4a03b8a
Added by Lynn Garren over 1 year ago

Merge tag 'v2_21_01' into develop

nusimdata/SimulationBase/simb.h and nutools changes for #18716 v2_21_01

Revision c099280f
Added by Lynn Garren over 1 year ago

Merge tag 'v2_21_01' into develop

nusimdata/SimulationBase/simb.h and nutools changes for #18716 v2_21_01

Revision 0a862ea4
Added by Lynn Garren over 1 year ago

Merge tag 'v2_21_01' into develop

nusimdata/SimulationBase/simb.h and nutools changes for #18716 v2_21_01

Revision e4dcca7e
Added by Lynn Garren over 1 year ago

Merge tag 'v2_21_01' into develop

nusimdata/SimulationBase/simb.h and nutools changes for #18716 v2_21_01

Revision 0a862ea4
Added by Lynn Garren over 1 year ago

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 almost 2 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 almost 2 years ago

  • Blocks Feature #17804: Provide a way to associate MCParticles between generator and G4 steps added

#3 Updated by Brian Rebel almost 2 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 almost 2 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 over 1 year 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 over 1 year 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 over 1 year ago

  • Status changed from Resolved to Closed


Also available in: Atom PDF