slac-lcls / smalldata_tools

code to facilitate production of LCLS small data files and the analysis thereof
12 stars 11 forks source link

add a SumEvt function #188

Open silkenelson opened 7 months ago

silkenelson commented 7 months ago

when we only want the calculation for the ROI having a specific function avoids a potentially wasteful copy operation needed for chaining functions. This is a best we can easily do for https://jira.slac.stanford.edu/browse/ECS-4440

vespos commented 7 months ago

I think it would be better to sub-class the existing ROIFunc and only rewrite the process method. This way we dont duplicate the setFromDet and applyROI, and in case we need to change them (unlikely) we only have to do it in one spot. We could also make sure that no one tries to add functions by overwriting the addFunc method with smth like:

def addFunc(...)
    NotImplementedError('This function should not be used with any other DetObjectFunc')