Hello !

I would like to follow up on the message that was posted last month here
http://sourceforge.net/mailarchive/forum.php?thread_id=19437345&forum_id=13760

My problem is a bit differently from the one presented there:

I have data in the following structure, representing a reconstructed
particle decay

Event
        List of Particles (variable number of entries in each event)
                3 daughters
                        momentum
                momentum
                other vectorial and scalar quantities

I hope the idea is clear from this clumsy description.
>From the example in the previous thread I understand how I can model
_one_ particle. However, I would like to be able to group the particles
by event.
The reason is that there can be only one particle per event, but I have
reconstructed many and don't know which one is the right one.

So I can think of two ways to implement this:
1) Simply do the same thing as in the previous thread, but add s.th.
like event_id to the particle.
2) Since persistence of an array of arbitrary classes is not supported,
I could unroll every member in the event, so that I
  a) have to find out the largest possible number of particles in an
event
  b) create for each member a FloatCol(shape=max)
In that case the event would look like this:
Event
        Particle_daughter_momentum_x = (list of max entries)
        Particle_daughter_momentum_y = (list of max entries)
        Particle_daughter_id = (list of max entries)
        Particle_mass = (list of max entries)
        Particle_daughter_mass = (list of max entries)
and so on and so forth for every member. max is then the highest number
of particles in any event.


1) has the advantage that it's easy to implement, but in principle I
would have to read over the whole dataset just to get the particles in
_one_ event. (I am thinking something
like: ...where(event_id==current_event) )

2) has the advantage that everything in the event is really grouped
together, but I am wondering i) about the waste of space, because I am
allocating the maximum number of particles for each event; ii) the
information is not really useful in the shape that I envision and I
would have to probably write something like an adaptor class to put the
information that belongs together back together.

I'm just getting started with pytables and numpy, so I am wondering if
there is another option.

Help in this matter is greatly appreciated.
Thanks,
        Jan


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Pytables-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to