Channel / Crystal / Bar / Detector numbers [message #18981] |
Thu, 04 February 2016 11:29 |
Ralf Plag
Messages: 25 Registered: September 2015
|
continuous participant |
From: *gsi.de
|
|
Hi All,
how do we store channel / crystal / bar or detector numbers: 1-based or 0-based?
In other words: Should my 4 LOS channels count from 1..4 (nice for the user in front of root) or from 0..3 (nice for the programmer)?
Is there a already a rule?
Cheers,
Ralf
|
|
|
|
Re: Channel / Crystal / Bar / Detector numbers [message #18983 is a reply to message #18981] |
Fri, 05 February 2016 09:21 |
Ralf Plag
Messages: 25 Registered: September 2015
|
continuous participant |
From: *hsi13.unitymediagroup.de
|
|
Hi Dima,
right, they should not appear in final plots, but whenever you look at a cbmsim-Tree, they appear.
I have no preference, I only think we should stick to a standard to keep the confusion at a minimum level.
The output of ucesb depends on the mapping, so there we have the choice. As I have seen so far, channel numbers are 1-based there.
land02 was actually quite clever and automatically added +1 to channel numbers when writing into a TTree. So they were 0-based in the code and 1-based for the user in the TTree.
How is it done for Neuland, Califa, and others?
Cheers,
Ralf
|
|
|
|
|
Re: Channel / Crystal / Bar / Detector numbers [message #18986 is a reply to message #18985] |
Fri, 05 February 2016 11:14 |
Dmytro Kresan
Messages: 166 Registered: June 2004
|
first-grade participant |
From: *gsi.de
|
|
Content of data members of a class, as it is at the runtime, is directly streamed to the output tree. The only possibility is private data member having 1-based values, and public Getter() function making shift to 0, to be used in the code. Making things already not transparent.
Summary: mapping is mostly 1-based, CAD also, currently CALIFA and NeuLAND in r3broot as well, and users prefer 1-based as well. This makes 5 points for 1-based agains only my personal taste.
Let us fix and document "physical" indexing (starting at 1), and programmers have to take care when accessing arrays. I am not very much for implementing automatic conversion, as explained before.
Cheers,
Dima
|
|
|
|
|