Message: Re: Adding digis to extended/persistency example Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Agree Re: Adding digis to extended/persistency example 

Forum: Documentation and Examples
Re: None Adding digis to extended/persistency example (Emanuele Leonardi)
Date: 28 Apr, 2006
From: Witek Pokorski <Witek Pokorski>

Hi Emanuele,

I would like to propose you some different approach to your problem.

The 'root persistency' example that you mentioned (of which I am not the author and I have not really looked into the code that much) is based on previous versions of ROOT where the machinery that I will discuss here was not present. I am sure it would be possible to extend it to save digits in addition to hits, however, I think there is a better way for providing persistency for your objects.

Starting from ROOT5, there was a new package introduced, called Reflex. It allows to automatically generate dictionaries (reflection information) for any C++ classes. This is extremely useful because, together with some intermediate binding (technical detail) called Cintex (which will dissappear soon, and become part of 'core' ROOT) it allows ROOT to 'understand' any C++ classes not necesseraly deriving from TObject or TCollection. In particular, this means that you can use ROOT I/O to persistify your hit container without instrumenting it in any particular way nor writing any additional code (the dictionary generation is automatic!). Moreover, thanks to the dictionary information, you can even directly browse your containers using ROOT.

In other words, you can for instance have your hits in a normal std::vector, create dictionary for it (by calling 'genreflex' tool from ROOT) and save it in .root file.

If you are interested, I can prepare a simple example demonstrating this functionality (which I think, will be useful at some stage to include in the G4 distribution as an alternative 'persistency' example).

Regards, Witek

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

 Add Message Add Message
to: "Re: Adding digis to extended/persistency example"

 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 ]