Sorting objects [message #18870] |
Fri, 08 January 2016 17:03 |
Marcel Tiemens
Messages: 47 Registered: January 2014
|
continuous participant |
From: *kvi-cart.rug.nl
|
|
Hello everyone, it's me again, with hopefully a simple problem:
- I have a tree with some objects in it (in my case, EmcClusters), where each event in the tree has some of these objects in it.
- Next, I would like to sort them all (not just within an event) in some way.
- And then write the sorted stream of objects back into a tree, where I group the objects in some way to form a new event for that tree.
That was it. I know there is something called FairRingSorter, but does that also work for objects that aren't hits? And one more thing, there is second branch with objects that are linked to the objects I would like to sort. Will the sorting respect those links?
Cheers,
Marcel
|
|
|
|
Re: Sorting objects [message #18875 is a reply to message #18872] |
Mon, 11 January 2016 11:27 |
Marcel Tiemens
Messages: 47 Registered: January 2014
|
continuous participant |
From: *kvi-cart.rug.nl
|
|
Hi Tobias,
Thanks for replying so quickly. Yes, I would like to sort using the timestamp. I'm not sure if the object derives from FairTimeStamp, but I think so, since the tasks creating the EmcClusters use calls like FairRunAna::Instance()->IsTimeStamp()... If this isn't related, can you tell me if there's an easy way to check this? And if it does use FairTimeStamp, then how do you use the RingSorter?
Thank you for the GapEventBuilder suggestion, I was aware that I would need to run an additional algorithm for the packaging.
I indeed intend to use FairLinks for the linking, but have no idea if it's bidirectional or not. I use something like cluster->SetLink(FairLink("EmcDigi", iDigi)) to make the links for each cluster (and use the corresponding AddLink function for digis that are added to this cluster). It would go from the sorted branch to the unsorted one.
|
|
|
|
|
|
|
|
Re: Sorting objects [message #19264 is a reply to message #18974] |
Thu, 19 May 2016 14:00 |
Marcel Tiemens
Messages: 47 Registered: January 2014
|
continuous participant |
From: *kvi-cart.rug.nl
|
|
Hi everyone,
An update and a follow-up on this topic. Update: With the help of Tobias, the sorting is working. Thanks again!
Then, the follow-up. After sorting the EmcCluster objects, I want to group them according to their timestamp. Each new group is put as an entry into a new ROOT tree - this seems to work. However, it looks like I lose the connection to the digis that belong to each cluster. That association is made when the clusters are created. After this, the cluster objects are sorted and regrouped, and I would expect that the association is maintained. But it looks like this is not the case. Does anyone know how to remedy this?
|
|
|