Try:
can->GetListOfPrimitives()->ls()
can->GetListOfPrimitives()->Print()
and see if your “c1” canvas really contains a histogram (TH1) with the name “MCA”.
(Note: if it exists, make sure it’s a TH1D, and not a TH1F, for example.)
Try:
can->GetListOfPrimitives()->ls()
can->GetListOfPrimitives()->Print()
and see if your “c1” canvas really contains a histogram (TH1) with the name “MCA”.
(Note: if it exists, make sure it’s a TH1D, and not a TH1F, for example.)