Repository navigation
Take the fIsRealData that was previously hard-coded to false and set … - #209
Conversation
|
I'm fine with the basic idea. I think nova's equivalent variables is filled automatically by just checking for the presence of any MCTruth objects in the file. Is it the creation of the ServiceHandle object itself that throws the exception, or the first attempt to dereference it (in this case calling |
|
It seemed to be the creation of the service handle itself. |
|
For what it's worth, I re-ran cafmaker in my test area using In my I can repeat the test with one of the data files I was looking at too, using standard v09_37_01 and my test area. I guess because of the difference in filling/not filling certain variables that there might be more "diffs" to parse through. |
|
Looks like there are some more SR initialization cases that need to be patched, for fields that always get filled by CAFMaker for MC, but are left uninitialized in the data mode. |
|
@cjbackhouse This is a sim file above. I talked with @henrylay97 and CRTHit planes and Trk IDs are in the set of instances he was looking at. I pointed out the shower one to him. We'll see what the data one turns up to your point about additional SR initialization cases. |
PetrilloAtWork
left a comment
There was a problem hiding this comment.
Three general comments:
- The presence of a default value for the new parameter is questionable (not wrong: just questionable), and I suggest to think a moment about that and take a pondered decision (which maybe already happened without me knowing, which is also fine); this is the reason why I don't straight approve the pull request, but I let you proceed if you think the current choice is good.
- Given the usage current pattern, I would have chosen a
fIsSimulationvariable, since all instances I can see use!fIsRealData; of course, if in the future data-only features will be added (beam quality? calibrations?), that argument would not stand. - As Bruce wrote elsewhere,
ServiceHandleconstruction will throw if the service can't be found. To be even more explicit: all configured services are constructed at the beginning of the job and before all modules. CallingServiceHandleonly picks the pointer to the service object, which exists already. So the overhead for creating and for dereferencing a service handle is very low, and (a) the first construction ofServiceHandleis the one which needs error checking and (b) constructing handles multiple times does not trigger service reinitialization or anything beside some lookup in art service registry.
It might have also had sense to save either a pointer or an std::optional to the two backtracking service objects as class data members to be conditionally filled at module construction time, but that's matter of choice.
Finally and foremost, thanks Bruce for taking care of this.
| art::ServiceHandle<cheat::BackTrackerService> bt_serv; | ||
|
|
||
| id_to_ide_map = PrepSimChannels(simchannels, *geometry); | ||
| id_to_truehit_map = PrepTrueHits(hits, clock_data, *bt_serv.get()); |
There was a problem hiding this comment.
The .get() should not be necessary here:
| id_to_truehit_map = PrepTrueHits(hits, clock_data, *bt_serv.get()); | |
| id_to_truehit_map = PrepTrueHits(hits, clock_data, *bt_serv); |
(ServiceHandle::operator * will return a reference to the service object directly).
I suggest removal.
There was a problem hiding this comment.
Sure - I just copied the previous function call into the loop, but I can make this change. Are the other instances of .get() similar? (I thought I spotted a few last night...)
There was a problem hiding this comment.
Indeed there were multiple and multiple *pi_serv.get(). But since they are all service handle .get() calls with the * operator, I assume they can all be changed in this fashion. If this is not the case let me know!
| Atom<bool> IsRealData { | ||
| Name("IsRealData"), | ||
| Comment("Set true for a data file."), | ||
| false |
There was a problem hiding this comment.
Topic for discussion: do we really want a default value here?
Beside making the transition easier (which may still be a value, but IMO should not make things harder till the end of time), I am not sure there is a good reason to assume the input to be simulation.
There was a problem hiding this comment.
Happy to change but this would mean we need to add the false setting to the current workflows in ICARUS/SBND for CAFs from simulation. I wasn't sure about tampering with the default workflow, but if the sentiment is to go for it then we can 😅
|
I responded to point 1 in the comments. Ultimately I say it's not my choice, but am happy to participate in discussion! Having the default be There was already an (Tagging @PetrilloAtWork directly because I will shortly be making another post with info from the |
|
Ran a single data event through a version with default CAFMaker and just a somewhat edited fhicl, meant to be more in-line with the current state of my I took a very quick look and report a few things below. Are the following sorts of behaviors, or any others that people spot in that file or other testing, considered reasonable enough behavior? Of course, most of the diffs are related to "truth" information, which makes some sense since in one we moved a lot of fills behind a check on
The lines not matching to "truth" ( |
|
The most interesting differences would be any you see between two runs over the same mode in isRealData mode. Those will be missing initializations we'd want to clean up for diff_cafs to be properly useful. |
|
After adding back in the stubs, can see they appear to have similar printouts to the other stuff in terms of before/after changing how this filling happens. They also have some interesting truth parent printouts like To @cjbackhouse point in the most recent comment: not a bad idea. I compared the one I made for this test and one I made yesterday and filtered out the lines matching |
ContextThis comment is in the current CAFMaker around the fIsRealData param: However I believe this is vestigial and left-over from NOvA's CAFMaker (especially given that it was previously just being hard-coded to These changes nullify Gianluca's question regarding defaulting a fhicl parameter since there is no longer a fhicl parameter for this. A remaining point/questionThe filling of true (g4) particles is itself inside of a check on For the reviewers@gputnam @cjbackhouse @PetrilloAtWork - I believe this is ready to be looked at again? Please let me know if things are left or are newly unsatisfactory or if other comments remain to be addressed (it's possible I'm missing or forgetting something!)? I did ask one question in the above as well. Thanks! |
|
Yeah, I think that's a NOvA comment. We had trouble with overlays. If you start with data and then overlay MC into it, art thinks you have a data event. But you probably do want to be able to query the truth of the stuff you added. So we wound up with some kind of check whether there were any truth products in the record, rather than relying on art's answer. |
PetrilloAtWork
left a comment
There was a problem hiding this comment.
It looks ok.
The only thing I am a bit fought about is that now fIsRealData does not really need to be a class data member: it could be a variable local to produce(), with no other consequence.
It bothers me a bit because it suggests that we know which kind the data is, which is actually true only after the first event is read.
After some deliberation, I recommend that this variable be removed from the class, and a local one be used. But I will accept a refusal.
|
Sure - I'm fine either way, so I've pushed a change. Obviously I can't say if others feel strongly a certain way. I did not re-run any test as this seems a very minor change... |
|
trigger build |
|
✔️ CI build for LArSoft Succeeded on slf7 for c7:prof -- details available through the CI dashboard |
|
✔️ CI build for LArSoft Succeeded on slf7 for e20:prof -- details 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 |
|
🚨 For more details about the warning phase, check the ci_tests SBND phase logs parent CI build details are available through the CI dashboard |
|
🚨 For more details about the warning phase, check the ci_tests 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 |
|
trigger build SBNSoftware/icaruscode#303 |
|
✔️ CI build for LArSoft Succeeded on slf7 for e20:prof -- details available through the CI dashboard |
|
✔️ CI build for LArSoft Succeeded on slf7 for c7:prof -- details available through the CI dashboard |
|
❌ CI build for SBND Failed at phase ci_tests SBND on slf7 for c7:prof - ignored warnings for build -- details available through the CI dashboard 🚨 For more details about the failed phase, check the ci_tests SBND phase logs parent CI build details are available through the CI dashboard |
|
❌ CI build for SBND Failed at phase ci_tests SBND on slf7 for e20:prof - ignored warnings for build -- details available through the CI dashboard 🚨 For more details about the failed phase, check the ci_tests 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 |
|
🚨 For more details about the warning phase, check the ci_tests ICARUS phase logs parent CI build details are available through the CI dashboard |
|
trigger build SBNSoftware/icaruscode#303 |
|
✔️ CI build for LArSoft Succeeded on slf7 for c7:prof -- details available through the CI dashboard |
|
✔️ CI build for LArSoft Succeeded on slf7 for e20:prof -- details available through the CI dashboard |
|
🚨 For more details about the warning phase, check the ci_tests 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 |
|
🚨 For more details about the warning phase, check the ci_tests ICARUS phase logs parent CI build details are available through the CI dashboard |
|
🚨 For more details about the warning phase, check the ci_tests SBND phase logs parent CI build details are available through the CI dashboard |
…rackParticleInventory
…it instead based on a fhicl parameter. Move backtracker and particle inventory service to be initialized when needed - this does have the downside of meaning it can be initiated multiple times per event. Move some of the Fill function calls to be inside a check on IsRealData, e.g. where it calls something that needed the backtracker or particle inventory...
NOTE This was pretty hastily coded up given the time, so comments/looks are appreciated. Maybe there is a better way even. I am concurrently opening an issue and tagging some folks there.