Cd() is not moving to the proper drawing pad

Instead of:
testCanvas->cd(...);
try:
gROOT->SetSelectedPad(testCanvas->cd(...));

2 Likes