-
Notifications
You must be signed in to change notification settings - Fork 35
Saving GENIE tree to caf [release/SBN2023A_NuMI] #426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Saving GENIE tree to caf [release/SBN2023A_NuMI] #426
Conversation
…i0228/sbncode into HEAD
PetrilloAtWork
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not look at the code too much in detail, but it's not clear to me how you avoid duplicate GENIE matching indices. Each job will start with index 0 and go on, right?
Yes, |
|
In general the concern is that the newly introduced index is not enforced to be unique, which demands a specific workflow in order to make the matching between entries in the new tree ("GENIE tree") and in the rest of the data ("CAF tree"). @jedori0228 is providing a tool that can generate a reindexed tree: as long as this is used, joining the trees is possible. Also, the index can be used for fast lookup of the needed entry. This works only if the order of the entries in the tree is never changed (if for example the input is a file list, the order of the files must not be changed, or the lookup will silently pick a wrong entry). My recommendation to address this fragility is to introduce a unique identifier for each entry in the CAF tree, and replicate it in all the "auxiliary" trees (in this case, the GENIE tree). As a candidate for the unique identifier, I suggest the couple of entries: the original input file name, and the index of the event in that file. To make this more practical, I would use instead of the actual file name its hash code (just from For fast lookup, nothing really beats the absolute index of the entry in the tree. Yet, a feature of ROOT trees is the ability to build an index that can then be used for lookup. This index can for example map the |
|
Thanks @PetrilloAtWork ! I pushed few more commits with updated structure;
I tested this by running CAFMaker on two stage1 files, which has 34 and 36 true neutrinos, respectively. I merged ( You can see the first file, which has file hash of |
|
Plan is to make a copy-PR of this against develop once this PR is approved and merged. |
PetrilloAtWork
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of details to be fixed...
The PR seems, in general, good.
sbncode/CAFMaker/CAFMaker_module.cc
Outdated
| //delete fGenieEvtRec; | ||
| //delete fGenieTree; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were these causing double-freeing or some other trouble?
Shouldn't the flat versions also be here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a commit where I now delete fGenieEvtRec and fFlatGenieEvtRec. But I found fGenieTree or fFlatGenieTree is deleted when the Record is delete.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After investigation, the conclusion is that the trees are deleted when the ROOT file objects they are associated to (e.g. fFile) are deleted.
In addition, the fGenieEvtRec should be deleted by us since, according to ROOT documentation ("If addr is not zero, but the pointer addr points at is zero" paragraph), we passed an address variable that has null content at branch address setting time, the record was allocated by ROOT but it still considered owned by us, and it should be explicitly deleted with delete.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! In 1c47597, I properly deleted all the GENIE objects.
|
trigger build SBNSoftware/sbnanaobj#124 LArSoft/lar*@LARSOFT_SUITE_v09_72_00_01 SBNSoftware/sbndaq-artdaq-core@v1_06_00of0 SBNSoftware/*@release/SBN2023A_NuMI |
|
❌ CI build for LArSoft Failed at phase build LArSoft on slf7 for e26:prof -- details available through the CI dashboard 🚨 For more details about the failed phase, check the build LArSoft phase logs |
|
❌ CI build for LArSoft Failed at phase build LArSoft on slf7 for c14:prof -- details available through the CI dashboard 🚨 For more details about the failed phase, check the build LArSoft phase logs |
|
❌ CI build for LArSoft Failed at phase build LArSoft on slf7 for e20:prof -- details available through the CI dashboard 🚨 For more details about the failed phase, check the build LArSoft phase logs |
|
✔️ CI build for LArSoft Succeeded on slf7 for e20:prof -- details available through the CI dashboard |
|
❌ CI build for SBND Failed at phase build SBND on slf7 for e20:prof -- details available through the CI dashboard 🚨 For more details about the failed phase, check the build SBND phase logs parent CI build details are available through the CI dashboard |
|
❌ CI build for ICARUS Failed at phase build ICARUS on slf7 for e20:prof -- details available through the CI dashboard 🚨 For more details about the failed phase, check the build ICARUS phase logs parent CI build details are available through the CI dashboard |
|
🚨 For more details about the warning phase, check the ci_tests ICARUS phase logs parent CI build details are available through the CI dashboard |
|
✔️ CI build for LArSoft Succeeded on slf7 for e20:prof -- details available through the CI dashboard |
|
❌ CI build for SBND Failed at phase build SBND on slf7 for e20:prof -- details available through the CI dashboard 🚨 For more details about the failed phase, check the build SBND phase logs parent CI build details are available through the CI dashboard |
|
🚨 For more details about the warning phase, check the ci_tests ICARUS phase logs parent CI build details are available through the CI dashboard |
Saving genie::EventRecord as a separate TTree into CAFs. By default we do not save it, and we turn this feature by adding
physics.producers.cafmaker.SaveGENIEEventRecord: truein fhicls. I will create another PR on develop.The matching between a
SRTrueInteractionobject fromrecTreeandgenie::EventRecordis done by the index of genie tree,genie_evtrec_idx, which is introduced in SBNSoftware/sbnanaobj#124; This PRs requires SBNSoftware/sbnanaobj#124