Message: Re: Counting number of particles in each zone of a Sensitive Detector Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Counting number of particles in each zone of a Sensitive Detector 

Forum: Event and Track Management
Re: Question Counting number of particles in each zone of a Sensitive Detector (Quique)
Re: Idea Re: Counting number of particles in each zone of a Sensitive Detector (Michael H. Kelsey)
Re: None Re: Counting number of particles in each zone of a Sensitive Detector (Quique)
Date: 23 Apr, 2015
From: Michael H. Kelsey <Michael H. Kelsey>

Quique writes:
> > > My problem is that I am not able to count the number of particles in each
> > > layer separatedly and without counting them more than once. Is there any
> > > method for doing this?
> > 
> > Yes, indeed! Get the G4Touchable from the G4Step, and ask it for the
> > copy number. That will tell you (see above) which layer was hit.
> 
> Thank you! But I had already done that. This way I can count the numbers
> of hits in each layer, but this way it would count a particle more than
> once. I mean, one track may have more than one step in a layer. What I
> would like to do is counting the number of particles, not the number of
> hits. Maybe you are right. Am I missing something??

Ah, I see what you're asking.  Pedro provides one solution.  Another method
is to record the track ID in your hit-data object, or (better) in a local
buffer, such as a std::list, which is part of the SD.  On each call, check
if the track ID has already been recorded.  With the local buffer, you would
clear it out using the G4VSensitiveDetector::Initialize() function.

     -- Michael Kelsey

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

1 None: Re: Counting number of particles in each zone of a Sensitive Detector   (Quique - 27 Apr, 2015)
 Add Message Add Message
to: "Re: Counting number of particles in each zone of a Sensitive Detector"

 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 ]