Incorrect Calculation of Wire Pitch in lardata
The lardata utility function TrackPitchInView incorrectly specifies the wire plane index when acquiring the value of the wire pitch in the input plane. (as defined here: lardata:source:lardata/ArtDataHelper/TrackUtils.cxx)
To get the plane information, the TrackPitchInView takes as an argument the geo::View_t object corresponding to the specified plane (line 75). However, this function then uses the View_t object as the index of the plane, in line 96 (lardata:source:lardata/ArtDataHelper/TrackUtils.cxx#L96), when getting the wire pitch. This is ok for experiments where the View_t enum value and the plane index are identical (as is true for uBooNE and SBND). However, this results in incorrect behavior in (e.g.) ICARUS.
#1 Updated by Gianluca Petrillo over 1 year ago
- Description updated (diff)
The function that should be called is
geo::GeometryCore::WirePitch(geo::View_t) const, but
geo::GeometryCore::WirePitch(unsigned int, unsigned int,unsigned int) is called instead (
View_t is silently converted).
The former is not perfect either, since it uses the first TPC as a reference but it is not guaranteed that all TPC have the same view at the same plane.
#3 Updated by Gianluca Petrillo over 1 year ago
- Status changed from Assigned to Feedback
I have put together a potential solution, lardata:35b04366 in branch feature/gp_Issue23817 of lardata.
But I have no easy way to test it. Gray, could you try to run whatever you ran to find out the issue, and report back? Or you can put me in a shape to reproduce what you did.
#7 Updated by Bruce Howard about 1 year ago
I was able to test that the plane/view errors were not spit out for the events when running with this fix. I also checked a few of the variables in the TTree in the output file structure in the calorimetry tree and confirmed that it looked the same to what I had run before.
Thanks Gianluca for the help!