Using TFileService within respondToOpenInputFile() puts histograms in the wrong folder
I found that if I use TFileService within the respondToOpenInputFile() callback, everything I create with it there ends up in a folder in the output file named after my RootOutput label, rather than my module's label.
Possibly this is expected behaviour, but it seems a bit odd since I don't know any other ways to put things into this folder.
#1 Updated by Christopher Green almost 8 years ago
TFileService does not set the context at the right time for you to be in the correct folder as there is no
preModuleRespondToXXXX watchpoint for services.
There is no particular reason these watchpoints can't be added, but the work would need to be done.
#2 Updated by Rob Kutschke almost 8 years ago
Ages ago I had a similar issue: histograms created during EndJob ended up in the top level root directory, not in the directory named after the module label. I don't recall if it is fixed now or not. My solution was to save a TDirectory* in BeginJob and then manage the directories by hand in the EndJob, restoring the state before I left.
#3 Updated by Christopher Green over 7 years ago
- Tracker changed from Bug to Feature
- Due date set to 09/30/2013
- Category set to Event Loop
- Status changed from New to Accepted
- Target version set to 1.09.00
- Estimated time set to 8.00 h
- Scope set to Internal
- Experiment - added
- SSI Package art added
This issue is now linked to #946. We will add new watchpoints where appropriate and ensure that
TFileService takes advantage of them.
#9 Updated by Kyle Knoepfel almost 6 years ago
- Status changed from Assigned to Resolved
- % Done changed from 0 to 100
respondToXYZ...File(s) callbacks are now included in the
TFileService activity registry. The corresponding signals have been added and they are invoked in the
Implemented with 810b1426d33d2c22de3d9c5a61396595b8a25501.