Closed zhaozhiwen closed 6 years ago
I'll test this tomorrow morning first thing.
On Nov 19, 2018, at 11:58 AM, zhaozhiwen notifications@github.com wrote:
It contains new versions of banks.h, banks.cc, and evio2root.cc.
New function getUserHeaderBankNames in banks.cc, to be called at first event, looks at the userHeader information in the evio file; it uses the largest node number found to establish how many variables to allow for and returns a vector of names for those variables: userVar001, userVar002, … .
New function getUserHeaderBank in banks.cc returns a map<string,double> of data found in the evioDOMTree indexed by the names generated by getUserHeaderBankNames.
evio2root.cc correctly sets up the userHeader tree, initially empty; on the first event it calls getUserHeaderBankNames and creates a branch for each userHeader variable name. Then on each event it calls getUserHeaderBank to get the data and fill the userHeader tree.
Note:
This assumes the number of entries in userHeader does not change from one event to another (or at least that the highest node number in the first event is the maximum node number ever seen).
In GEMC 2.3, two numbers in the first line of each Lund file entry (the number of particles and the beam polarization) were not added to the header, so there were 8 variables var1 through var8. In GEMC 2.8 every number in the first line is entered into a userHeader variable. So for instance the event weight would be userVar010, instead of var8
You can view, comment on, or merge this pull request online at:
https://github.com/maureeungaro/banks/pull/4 https://github.com/maureeungaro/banks/pull/4 Commit Summary
userHeader handling File Changes
M src/banks.cc https://github.com/maureeungaro/banks/pull/4/files#diff-0 (111) M src/banks.h https://github.com/maureeungaro/banks/pull/4/files#diff-1 (2) M src/evio2root.cc https://github.com/maureeungaro/banks/pull/4/files#diff-2 (32) Patch Links:
https://github.com/maureeungaro/banks/pull/4.patch https://github.com/maureeungaro/banks/pull/4.patch https://github.com/maureeungaro/banks/pull/4.diff https://github.com/maureeungaro/banks/pull/4.diff — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/maureeungaro/banks/pull/4, or mute the thread https://github.com/notifications/unsubscribe-auth/AHG0wb9W3_raYpXKUtsVAFbgMCOJw81Sks5uwuNMgaJpZM4YphDh.
It contains new versions of banks.h, banks.cc, and evio2root.cc.
New function getUserHeaderBankNames in banks.cc, to be called at first event, looks at the userHeader information in the evio file; it uses the largest node number found to establish how many variables to allow for and returns a vector of names for those variables: userVar001, userVar002, … .
New function getUserHeaderBank in banks.cc returns a map<string,double> of data found in the evioDOMTree indexed by the names generated by getUserHeaderBankNames.
evio2root.cc correctly sets up the userHeader tree, initially empty; on the first event it calls getUserHeaderBankNames and creates a branch for each userHeader variable name. Then on each event it calls getUserHeaderBank to get the data and fill the userHeader tree.
Note:
This assumes the number of entries in userHeader does not change from one event to another (or at least that the highest node number in the first event is the maximum node number ever seen).
In GEMC 2.3, two numbers in the first line of each Lund file entry (the number of particles and the beam polarization) were not added to the header, so there were 8 variables var1 through var8. In GEMC 2.8 every number in the first line is entered into a userHeader variable. So for instance the event weight would be userVar010, instead of var8