Message: Track lengths of secondaries and tertiaries Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Track lengths of secondaries and tertiaries 

Forum: Event and Track Management
Date: 04 Jul, 2017
From: Patrick Asenov <Patrick Asenov>

Good evening, my dear friends and comrades!

Lately I've been investigating a problem where a primary particle (hadron) is striking a series of detectors and I've been running the same process for a million iterations. While I have no problem in obtaining the energy deposit, energy from secondaries and energy from tertiaries graphs, the Root graphs for the respective track lengths (for primary, secondaries, tertiaries) is never getting filled.

Inside EventAction.hh I have the following voids:

    void AddPrimaryTrackLength(G4double strack)     {fPrimaryTrackLength  += strack;};
    void AddSecondaryTrackLength(G4double strack)     {fSecondaryTrackLength  += strack;};
    void AddTertiaryTrackLength(G4double strack)      {fTertiaryTrackLength  += strack;};

I fill the respective graphs inside EventAction.cc the same way I fill the energy graphs:

 analysisManager->FillH1(18, fSecondaryTrackLength);
 analysisManager->FillH1(19, fTertiaryTrackLength);

 analysisManager->FillH1(26, fPrimaryTrackLength);

I call the above voids from StackingAction::ClassifyNewTrack(const G4Track* track) of StackingAction.cc as follows:

  length = track->GetTrackLength();

  if (track->GetTrackID() == 1)  {
    fEventaction->AddPrimaryTrackLength(length);
  }

  if (track->GetParentID() == 1)  {
    fEventaction->AddSecondaryTrackLength(length);
  }

  if (track->GetParentID() > 1)  {
    fEventaction->AddTertiaryTrackLength(length);
  }

The same commands when applied to energies work just fine. I can't understand what am I getting wrong down here!

Any advice would be kindly appreciated! Thank you for your time!

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

1 None: Re: Track lengths of secondaries and tertiaries   (michel maire - 06 Jul, 2017)
(_ Agree: Re: Track lengths of secondaries and tertiaries   (Patrick Asenov - 06 Jul, 2017)
 Add Message Add Message
to: "Track lengths of secondaries and tertiaries"

 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 ]