Skip to content

How to convert Geant4TrackID into MCParticle Parent ID #1514

@QuantumSlack

Description

@QuantumSlack

Good morning Andre,

Currently I am trying to find the lineage of the photons which are detected in the photo-detector. For that I want the track ID for the parent of that photon. So first I created two dictionaries. One is for relating the track-id with the pdg of the particle which was in the track and another one where I relate track-id with parents array which is stored in MCParticles. From that, I can now relate the track-id with both PDG and parents. Now, I added some fields in my SD Action to add the parent ID in my HitScin and HitCer (which store the cerenkov and scintillation photons which arrived). However, the parent ID stored in that array is different from the ones that I got from parents in MCParticles. Is there any way to relate Geant-4 ID and DD4hep MCParticle id?

I am attaching my code for creating the dictionary and log files for parents in MCParticles, dictionary created from those parents, and then finally parentID in the HitScin field which I stored by modifying the SD-Action file.

mc_parent_list.log

dicts_MCParticles.log

DRFNoSegment_HitScin_parentID.log

neutron_parent.py

Note:- in the log files, ignore the last two lists which are being printed

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions