Message: Re: Getting Secondary Particle Number Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Getting Secondary Particle Number 

Forum: Particles
Re: None Getting Secondary Particle Number (Katherin Shtejer)
Date: 22 Feb, 2007
From: Anton <Anton>

Hello Katherin,

> I am interested on counting the number of secondary particles produced
> in my sensitive detectors...

you can use this code in your realization of G4VSensitiveDetector::ProcessHits :

G4bool userSD::ProcessHits(G4Step* step, G4TouchableHistory*)
{
  G4Track* track = step->GetTrack();
  G4int stepNumber = track->GetCurrentStepNumber();

  // increasing of counter of the number of secondary particles produced in sensitive detectors
  if (stepNumber == 0) n++;

  return true;
}

-- 
Best regards,
 Anton                            mailto:tosha_korneev@tut.by

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

1 None: Re: Getting Secondary Particle Number   (Katherin Shtejer - 23 Feb, 2007)
(_ None: Re[2]: Getting Secondary Particle Number   (Anton Korneev - 23 Feb, 2007)
(_ None: Re: Re[2]: Getting Secondary Particle Number   (Katherin Shtejer - 24 Feb, 2007)
 Add Message Add Message
to: "Re: Getting Secondary Particle Number"

 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 ]