Message: Re: Reference object of new class in Sensitive Detector Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Reference object of new class in Sensitive Detector 

Forum: Event and Track Management
Re: Question Reference object of new class in Sensitive Detector (Armin Schuebel)
Date: 11 Dec, 2013
From: Makoto Asai <Makoto Asai>

Hi Armin,

I would suggest you to create your own Run class derived from
G4Run base class. In the constructor of your Run class, open
your file, and close it in the destructor of your Run class.
G4Run class has a virtual method that you have to overwrite,
G4Run::RecordEvent(const G4Event*).
Here you will get G4Event for every event, and you have full
access to all of your HitsCollections so that you can write
them to your file. In this way, you don't need to worry about
passing a pointer. Also, this is the cleanest way that works
as well without any modification when you migrate to multi-
threading that is offered in Geant4 version 10.0.

I note here that you still need your RunAction class to
instantiate your Run class.

Hope this helps,
Makoto Asai

On 12/11/13 4:42 AM, "Armin Schuebel" <>

>*** Discussion title: Event and Track Management
>I have some trouble handling the data I receive from my Sensitive
>Detector. My set-up is that I have a pixelated SD and then I want to
>store certain tracks and energy of hits for export. The geometry and SD
>works fine.
>I have written a export class to handle the data and file. I want to
>initialize the export object in the BeginOfRunAction and then fill it
>with data from the Sensitive Detector. Unfortunately I don't see a way
>to address the object I initialized in the RunAction. Basically I don't
>see how to get the pointer of the object in the SD. Is this possible in
>some way?
>Thank you in advanced! Armin
>Visit this GEANT4 at message (to reply or
>unsubscribe) at: 

 [ MIME part of type application/ms-tnef stripped ]

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

1 Agree: Re: Reference object of new class in Sensitive Detector   (Armin Schuebel - 11 Dec, 2013)
 Add Message Add Message
to: "Re: Reference object of new class in 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 ]