easier and more flexible code. It produces a root file with all the relevant histos. Plotting needs to be done afterwards