JeffersonLab / iguana

Preservation of common physics data analysis algorithms. Currently focused on HIPO data.
https://jeffersonlab.github.io/iguana/
GNU Lesser General Public License v3.0
2 stars 7 forks source link

provide a thread-safe way to reload configurations, for example, when the run number changes #95

Open c-dilks opened 7 months ago

c-dilks commented 7 months ago

When a run number changes, the configuration may also change. We need some way of handling this during event processing, which will require mutation of some algorithm class members, namely those from a configuration.

dglazier commented 3 months ago

I think it would be good to sort this issue sooner rather than later. As more algorithms come online it will mean more code re-working and more time spent to do it. It also will delay integration into analysis until this is sorted. I would class it more as urgent and essential rather than enhancement!

c-dilks commented 3 months ago

Fully agree, though I think we need something a bit more general than ChangeRun. We want to trigger a reload of the configuration parameters when some variable(s) change, such as run number.

I'm thinking perhaps a new function ReloadConfig; users of Run won't have to change anything, since Run can call ReloadConfig, whereas users of action functions will need to call ReloadConfig themselves (per event, not per every bank row). What do you think?

dglazier commented 3 months ago

I think run number will be the most useful and general switch. At the same time from the parameter point of view they will often be defined for run periods, so just need to define parameters for groups of runs. I think I would expect users of actions to call Reload themselves, but there is a risk of misuse there so need to make sure it is well advertised.