bdrum / cern-physics

My analysis workflow
1 stars 1 forks source link

Generalize computations #37

Closed bdrum closed 3 years ago

bdrum commented 3 years ago

Now, when I want to plot mass with total charge zero and non-zero, I can't do it because I don't have a functions or objects that could change the state. So I should repeat a code. This is bad solution.

I have to parametrize calculations and states.

bdrum commented 3 years ago

I decided to organize code with functional style:

All data (events and tracks(four_tracks, four_tracks_zq, four_tracks_nzq)) defines once via class FourTrackEvents and then if for example now you want to calculate mass of events with pt < 0.15 and nTPC = 2 you have to do following:

kinematics.mass_events( ft.GetTracksWithPtLt( ft.GetTracksWithNTPC( ft.four_tracks_zq,i) ) )