Message: Finding "mother particle" Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Finding "mother particle" 

Forum: Event and Track Management
Date: 31 Jul, 2009
From: Kyrre Ness Sjøbæk <Kyrre Ness Sjøbæk>


I am currently simulating an experimental setup with a Sr90 source. To do this, I use G4RadioactiveDecay, and a general particle source.

However, as 90Sr has a beta-decay to 90Y which again has another beta-decay (and then there are some gamma's etc), I get two betas per event. As I am using a G4PSEnergyDeposit to generate hits, this means that the energy in one single "real" hit could be over-estimated if both electrons hit the same SD in the same event, or the triggering (done in an external program by requiring that the energy deposit in a scintilator has to be larger than a set value) could be wrong if i get one electron in the trigger, and one in the "device under test".

Thus I have started to implement a G4VSDFilter (*very* much not finished!), shown below:

#ifndef FilterMotherIon_hh
#define FilterMotherIon_hh

#include "G4VSDFilter.hh"
#include "globals.hh"

 * Filter for a simple detector, in order to filter
 * hits depending on the originally decaying ion.

class FilterMotherIon : public G4VSDFilter {
  FilterMotherIon(G4String name, G4int z, G4int a) :
    G4VSDFilter(name), Z(z), A(a) {};

  G4bool Accept(const G4Step* origStep) const;

  G4int Z;
  G4int A;


#include "FilterMotherIon.hh"
#include "G4Track.hh"
#include "G4ParticleDefinition.hh"

G4bool FilterMotherIon::Accept(const G4Step* origStep) const {
   * Run down the particle tree until either condition is met:
   * - Correct particle is found (accept)
   * - Primary particle is found (not found - reject)
   * Remark: As the correct particle may be the primary particle,
   * check (1) before (2)!
  while (true) {
    G4ParticleDefinition* thisDef = origStep->GetTrack()->GetDefinition();
    if (thisDef->GetAtomicNumber() == Z && thisDef->GetAtomicMass() == A) {
      //G4cout << "GOLD!" << G4endl;
      return true;
    else {
      //Dig deeper?
      G4int parentID = origStep->GetTrack()->GetParentID();

      G4cout << parentID << G4endl;

However, while I can get the ID of the parent track, I do not know how to translate this into a G4ParticleDefinition of the parent track, which I need to do recursively...

--- Kyrre Ness Sjøbæk (Geant4 novice)

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Feedback: Re: Finding   (Gumplinger Peter - 31 Jul, 2009)
(_ Feedback: Re: Finding   (Gumplinger Peter - 31 Jul, 2009)
(_ None: Re: Finding (grand^n)mother particle of a track [solved]   (Kyrre Ness Sjøbæk - 01 Aug, 2009)
 Add Message Add Message
to: "Finding "mother particle""

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews

[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]