This fixes issues I saw when developing something else with EventData.copy.
EventData.copy did not copy the kinematics object, it was shared
EventKinematics object got changed into a tuple by the copy
I added some tests of copying and pickling of EventData and MCEvent, to ensure that the implementation works
I discovered that dataclasses.astuple works recursively if the dataclass also holds other dataclasses. This caused the second issue.
EventKinematics is now a thin class with just an init over EventKinematicsBase. This was necessary to make copies. I need to be able to call the raw init of the data holder (EventKinematicsBase), but we also want to customize the init. Since Python does not have overloads, I use this solution.
Other changes:
EventData._fast_selection was replaced with EventData._select, to simplify the code
I added a test of EventData.__getitem__ which calls EventData._select
This fixes issues I saw when developing something else with EventData.copy.
I discovered that dataclasses.astuple works recursively if the dataclass also holds other dataclasses. This caused the second issue.
EventKinematics is now a thin class with just an init over EventKinematicsBase. This was necessary to make copies. I need to be able to call the raw init of the data holder (EventKinematicsBase), but we also want to customize the init. Since Python does not have overloads, I use this solution.
Other changes:
EventData.__getitem__
which calls EventData._select