Message: Re: GetRadLen, write in ROOT file -> Seg Fault Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Disagree Re: GetRadLen, write in ROOT file -> Seg Fault 

Forum: Run Management
Re: Question GetRadLen, write in ROOT file -> Seg Fault (Katalin Nikolics)
Date: 20 Apr, 2010
From: Gumplinger Peter <Gumplinger Peter>

Hello Kati,

Your code cannot work. There is one fundamental flaw that tells me that you do not grasp significant aspects of C++:

G4Step* step = new G4Step();

Ok, now you've got a pointer to such an object, but who do you think has put any informtion into this object? For example,

G4StepPoint* point1 = step->GetPreStepPoint(); G4Material* material1 = point1 ->GetMaterial();

who put a G4StepPoint* pointer into your 'step' object. This pointer is probably NULL and then you use it to retrieve material1. You can't do that with a NULL pointer.

I suspect that G4 may already allow you to do what you want via the commands:

/control/matScan

see Attachment:
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2010/04/20/11.30-12020-_control_matScan_.html

 Add Message Add Message
to: "Re: GetRadLen, write in ROOT file -> Seg Fault"

 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 ]