|Message: Re: Reference object of new class in Sensitive Detector||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
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" <Schuebel@stud.uni-heidelberg.de> wrote: > >*** Discussion title: Event and Track Management > >Hello, > >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 hypernews.slac.stanford.edu message (to reply or >unsubscribe) at: >http://hypernews.slac.stanford.edu/HyperNews/geant4/get/eventtrackmanage/1 >168.html [ MIME part of type application/ms-tnef stripped ]
|Inline Depth:||Outline Depth:||Add message:|