THStack not working

When you create a new post, this link is automatically added (you deleted it, since it’s not showing), where you can see that to write code here, you enclose it in ``` (three single left quotation marks).
As for your question, you need to add the “nostack” option when you Draw the THStack; do not include “nostack” when adding the histograms to the THStack, I think that is simply ignored as it is not a valid option for drawing histograms.
When Adding to a THStack, you can specify formatting options like showing markers, line, fill… for any/all of the histos if you want (for example if you want different options for each histogram; otherwise you can specify these options later when drawing the stack --in addition to nostack–, and all will look the same).