How can I get derivative from my spectrum

Hi my friends;
Please, I have a tree with many branches (Tem, time, mean, …), how can I get derivative values of one branch in spectrum(TH2F) like this plot:
to use these values as cut in other plots.


Were you able to solve this problem? If not, can you be clearer in what you are trying to achieve?