Closed sdobbs closed 5 years ago
Hello Sean,
There are two ways to do this, each one with pluses and minuses.
Both of these have been used by GlueX at different times. The advantage of
significant figures, whereas #2 is more efficient if you want the full precision of float (4 bytes/element) or double (8 bytes/element). These examples envision an array of individual hit times, but it could be any type of repeated variable.
method 1, the prototype:
method 1, example output from hddm-xml:
method 2, the prototype:
method 2, an example output from hddm-xml:
On Tue, Mar 5, 2019 at 4:19 PM Sean Dobbs notifications@github.com wrote:
From Eugene:
It would be good to have a user-defined variable length array field.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/JeffersonLab/halld_sim/issues/44, or mute the thread https://github.com/notifications/unsubscribe-auth/AHeFWDkzBMdegkkVViIACHkbOkCg8XWyks5vTt9tgaJpZM4bfhac .
Thank for the guidance, Richard. I took a shot at this in the following pull request: https://github.com/JeffersonLab/halld_recon/pull/148
This opens the door for future generator development...
Sean,
That looks good, it would make it even better to have a string attribute for "meaning" that might include something about what is stored and the units, etc. If you put the string in the mother tag rather than the child, that would avoid a copy of the string being added to every element of userDataField if it is an array. The purpose here is to stick to one of the guiding principles behind hddm that the data should be self-describing.
-Richard Jones
On Fri, Apr 5, 2019 at 1:11 PM Sean Dobbs notifications@github.com wrote:
Thank for the guidance, Richard. I took a shot at this in the following pull request: JeffersonLab/halld_recon#148 https://github.com/JeffersonLab/halld_recon/pull/148
This opens the door for future generator development...
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JeffersonLab/halld_sim/issues/44#issuecomment-480352203, or mute the thread https://github.com/notifications/unsubscribe-auth/AHeFWJQsuhXiJs7pq8J4kWkYdu7O5CwOks5vd4OtgaJpZM4bfhac .
PS. Sean, if you add minOccurs="0" maxOccurs="unbounded" to this userData tag (the outer one, not just the inner one) then you will (a) save space in output files that do not need any userData by not requiring an empty element in every event (that is what your current definition does) and also allow users to add more than one of these array-valued entries.
-Richard
On Fri, Apr 5, 2019 at 2:22 PM Richard Jones rjones30@gmail.com wrote:
Sean,
That looks good, it would make it even better to have a string attribute for "meaning" that might include something about what is stored and the units, etc. If you put the string in the mother tag rather than the child, that would avoid a copy of the string being added to every element of userDataField if it is an array. The purpose here is to stick to one of the guiding principles behind hddm that the data should be self-describing.
-Richard Jones
On Fri, Apr 5, 2019 at 1:11 PM Sean Dobbs notifications@github.com wrote:
Thank for the guidance, Richard. I took a shot at this in the following pull request: JeffersonLab/halld_recon#148 https://github.com/JeffersonLab/halld_recon/pull/148
This opens the door for future generator development...
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JeffersonLab/halld_sim/issues/44#issuecomment-480352203, or mute the thread https://github.com/notifications/unsubscribe-auth/AHeFWJQsuhXiJs7pq8J4kWkYdu7O5CwOks5vd4OtgaJpZM4bfhac .
From Eugene:
It would be good to have a user-defined variable length array field.