Message: Re: Problem with GetProcessName() Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Problem with GetProcessName() 

Forum: Event and Track Management
Re: None Problem with GetProcessName() (Aram)
Date: 26 May, 2008
From: Marc Verderi <Marc Verderi>

Hello Aram,

Have you checked that "aTrack->GetCreatorProcess() != 0" ? I would guess 
that primary particles (ie the ones produced by the generator, which are 
those having aTrack->GetTrack() == 1) do not have a 
"GetProcessCreator()" defined.

Cheers,
Marc

PS : I am a bit surprised that the lines :

///  
  G4Track* aTrack = aStep->GetTrack();
  if(aTrack->GetTrackID()==1)
    aTrack->GetCreatorProcess()->GetProcessName();
///

do not show the problem... Do you confirm you don't have problems with 
these lines ?


Aram a écrit :
> *** Discussion title: Event and Track Management
> Email replies to PublicHyperNews@slac.stanford.edu must include:
>   In-Reply-To: <"/eventtrackmanage/816"@geant4-hn.slac.stanford.edu>
>   Subject: ...change this to be about your reply.
>
> Hi All,
>
> If I call aTrack->GetCreatorProcess()->GetProcessName() in a ProcessHits
> function of a sensitive detector or in the SteppingAction my program
> crashes.
>
> ///  
>   G4Track* aTrack = aStep->GetTrack();
>   if(aTrack->GetTrackID()==1)
>     G4cout<<aTrack->GetCreatorProcess()->GetProcessName()<<G4endl;
> ///
>
> if I modify the above shown lines to look like:
>
> ///  
>   G4Track* aTrack = aStep->GetTrack();
>   if(aTrack->GetTrackID()==1)
>     aTrack->GetCreatorProcess()->GetProcessName();
> ///
>
> the problem goes away. I noticed that the program is crashing only for tackID=1.
>  I am puzzled.. is this the intended behavior for GetProcessName?
>
> thanks you,
>
> -Aram
>   


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

1 None: Re: Problem with GetProcessName()   (Aram - 26 May, 2008)
 Add Message Add Message
to: "Re: Problem with GetProcessName()"

 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 ]