Conversation
There is the time walk and the time alignment wrt DS. Needed also a new method to read vectors from the geometry, which can then be used for parameter structures of arbitary size.
Now every time-related method is provided with 1. a flag whether to apply time alignment or not 2. the distance to the SiPM so to correct for the light propagation time. Defaults of these are respectively false and 0, so to have backward compatibility.
It is defined in ShipUnits, if needed read from there.
|
First comment: love the long commit messages! Thanks for taking the time for adding the information! |
|
The Still thinking about a better name for Maybe it would be better to move the conditional into the calling function and then just have a helper function to apply the correction (i.e. the else case of |
|
In the current implementation, I use |
|
The table below summarizes the results if one calls the I'm attaching the code+ used to test these two cases, but the main difference is back-end of the MuFilterHit class and is not visible there. The values in the table are best out of 5 trials per case.
import ROOT
import SndlhcGeo
import os,time,psutil
def process_memory():
process = psutil.Process(os.getpid())
mem_info = process.memory_info()
return mem_info.rss
sndgeo = SndlhcGeo.GeoInterface('/eos/experiment/sndlhc/convertedData/physics/2023/geofile_sndlhc_TI18_V5_2023.root')
mufi = ROOT.gROOT.GetListOfGlobals().FindObject("MuFilter")
ch = ROOT.TChain("rawConv")
ch.Add("/eos/experiment/sndlhc/convertedData/physics/2022/run_004541/sndsw_raw-0020.root")
ch.GetEntry(0)
mufi.InitEvent(ch.EventHeader)
N = 1000000
start = time.perf_counter()
mem_before = process_memory()
for i, event in enumerate(ch):
if i==N-1: break
for hit in event.Digi_MuFilterHits:
if hit.GetSystem()!=3:
hit.GetAllTimes(True, False, 0)
mem_after = process_memory()
stop = time.perf_counter()
print("Seconds per call {}".format((stop - start)/N))
print("consumed total memory:",mem_before, mem_after, mem_after - mem_before) |
|
Is the difference in memory or time even significant? Unless you want to perform higher stats tests, I would propose that we go with the simpler solution. |
|
Tip: Markdown supports table like so:
|
|
The difference in time will become significant for analyses that use large number of events with numerous hits(shower events). The quoted times are 'time per event' and are averaged over 1M events. Then 9% faster per event for millions of events is a lot of time. |
I didn't expect that the image of the table would be so ugly pasted here... I had the table already done and wanted to save time. |
Completely agree that this can quickly add up. My question was whether the time-difference per event is significant. Execution time can fluctuate a lot depending on the load, data, cache and many other factors. 1M events 5 times might not be enough to establish which is faster (it would be good to know the spread between the 5 runs---at least to have a rough estimate of the uncertainty). |
No worries, for next time. And your table is elaborate enough, that it would be a pain to do in markdown. |
The sigma/mean ~ 3% for both realizations when asking for time alignment. I dont have the estimate for the case when no time corrections are asked for. So the 9% speed gain is legit. |
OK, in that case the difference when not applying corrections seems insignificant and the speedup in the case of applying corrections is small, but probably significant. Thanks! Then we proceed with A? |
|
Yes, approach A it is. |

Here we can discuss the implementation of the US and the Veto time alignment.
For this first implementation, when one needs the time calibration for a single channel, they have to use the detector method
GetCorrectedTimeas before.However, for multi-channel readout (Veto, US, DS horizontal), if an operation is to be performed using all SiPM timings per hit,
apply_t_corrflag andSipmDistanceparameters are added to all timing getters in the MuFilterHit class. This way the user can call one function per hit that could perform the time calibration for all channels before returning the time value - impact time, delta L/R time.It is not optimal that there are now 2 ways to return the calibration time - through the detector ( per signle channel at a time!) and through the hit (for multi-channel hits).