-
Notifications
You must be signed in to change notification settings - Fork 2
dune‐tms Primer
Most of the code is in src but the actual executable is in app/ConvertToTMSTree.cpp. It runs both the detector simulation and the reconstruction, though in the future this will be split into two distinct steps. There are also config files that can change how the code operates in config, but most of the time default values can be used. TMS_Readout_Default_Config.toml changes the detector simulation while TMS_Default_Config.toml changes the reconstruction.
Most users will likely want to add the branches to the tmsreco.root
output files. This is all done in TMS_TreeWriter.cpp and TMS_TreeWriter.h. Please try to keep branches backwards compatible as best as possible so old code doesn't break
The edep sim (geant4) input files are processed into directly by TMS_Event. This will convert true hits into reconstructed hits by placing the hits in the center of each scinillator bar. Then all hits in the same bar that are close in time are merged into a single reconstructed hit. Also the hits are subjected to detector reconstruction effects such as noise and time delay from the fiber lengths. The detector simulation is all contained within ApplyReconstructionEffects.
After this, app/ConvertToTMSTree.cpp will optionally run the time slicer (see this talk for time slicer info), save some truth info per slice, and finally run the track finder. Then it optionally draws each event and writes out the event.
See slide 30 onwards for a flow chart and nice slides on each step.
Per event the track finder first checks for duplicates (hits) and checks if the energy of the event is high enough to qualify for a reconstruction. Then the hits are sorted by their orientation origin. Meaning all hits from U (-3°) layers are separated from hits from V (+3°) layers.
Afterwards (as it is implemented right now) the actual track finding starts with a Hough transformation. This calculates Hough lines which represent the most likely path of the particle.
Afterwards a simple A* algorithm runs over the hits to find the shortest path from the start and end of the path found by the Hough transformation and fill in potential gaps from the initial path finding, as the particle tracks are most likely curved while the Hough transformation implementation assumes a straight track.
As the A* algorithm only checks within the first and last hit of the Hough line for a path, an extrapolation at the start and end of the reconstructed track is performed to look for hits that escaped the Hough transformation due to the curvature as well.
These steps (Hough transformation, A* algorithm, extrapolation etc.) are repeated for the different orientations (U (-3°) and V (+3°) layers) separately. This allows for the track matching afterwards that reconstructs also the y coordinate (along the scintillator bars) of the track within the uncertainties of the geometry.
The track matching checks if the start and end of the simple tracks (simple – one orientation) match in the z coordinate (along beam direction), the x coordinate (neighboring scintillator bars) and time. If this is the case all hits from both simple tracks are copied over to the TMS_Track class and the Start, End, track length and track energy are calculated and assigned as well. TrackMatching3D_logic.pdf
On all hits that haven't made it into the simple tracks a clustering algorithm looks for clusters as well.
(In lack of a better place for now) These are resolution plots for start and end point resolution of the reconstruction (without Kalman filter) compared to the truth. Created with performance_reco.py and run on the /pnfs/dune/persistent/users/kleykamp/nd_production_output/2023-10-24_test_geom_v_1.0.3/edep/FHC/00m/0l0/neutrino.0... file