Dear ROOTers
I have problem with drawing histogram. Inside of my class i have assignment operator where i make clone of histogram:
fHisto = (TH1*)other.fHisto->Clone();
Later in macro I made something like
MyClass *A = new MyClassA();
MyClass B = *A;
delete A;
B->GetHistogram()->Draw();
However when I try to draw such histogram I get only white space with title. I call TCanvas::Update - but it doesn’t help. What is more strange - histogram contain data but those data cannot be drawn, also in fit panel new histograms are not available in list. Is it possible that this is some conflict of object names?
this is more subtle than that: this is a C++ matter.
In your code you are not invoking an assignment operator (operator=) but a copy constructor (MyClass(const MyClass&)). Did you implement one?
Yes, this is what I want to get, but I would like to use “Draw” instead of “DrawClone”. I also don’t know why my code (witch is almost like yours) don’t draw content of such histogram even with DrawClone (I only see white space with title and frames).