Filling a histogram from an NTuple with '>>'

Add gROOT->cd(); right before nt->Draw("fspt>>AA");.

BTW. When you post “source code” or “output” here, do remember to enclose them into two lines which contain just three characters ``` (see how your post has been edited above).