Message: Using Data from SteppingAction in EndOfEventAction() Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Using Data from SteppingAction in EndOfEventAction() 

Forum: Event and Track Management
Date: 09 Jun, 2014
From: Zach Miller <Zach Miller>

Hello,

I have perhaps a basic c++ question, by google has failed me while attempting to find a simple answer, so I am going to ask here.

I am using a UserSteppingAction function to score my output. In this, I am counting deposited energy for secondary particles in my detector volume. I want to, at the end of an event, add that value to some histograms I'm generating with the analysis manager. The problem I have is, I'm unsure how to get the deposited energy value from SteppingAction and pass it along to the "EventAction.hh" Class which handles the output at the end of the event.

I've attempted adding a pointer to the SteppingAction class to my EventAction.hh file and then trying to access the "EnergyDeposited" value using a function that returns it's value (eg: SteppingAction* SA; SA->GetEnergy();) but that returns a Segmentation Fault.

Unfortunately, I have been unable to resolve that SegFault and do not know enough C++ to find an acceptable work around. Is there a simple way to solve this problem?

Thank you, Zach

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

1 Feedback: Re: Using Data from SteppingAction in EndOfEventAction()   (Gumplinger Peter - 09 Jun, 2014)
 Add Message Add Message
to: "Using Data from SteppingAction in EndOfEventAction()"

 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 ]