I would like to re scale the graph since the graph data is somewhat overlapped. What should I do for that?
TH1F* pion = new TH1F(…);
TH1F* kaon = new TH1F(…);
TH1F* proton = new TH1F(…);
and I created
TH1F* pion2 = new TH1F(…);
TH1F* kaon2 = new TH1F(…);
TH1F* proton2 = new TH1F(…);
pion2 = TH1F( pion * 1.0 );
kaon2 = TH1F( kaon * 0.1 );
proton2 = TH1F( proton * 0.01);
but it does not work.
Would you tell me how to do that?
Thank you for the message, and TH1::Scale(factor) works.
I have the other but similar question.
How about TF1 *pionfit = new TF1(…);
but no error message and it does not change anything.
I know it is a “function” pointer, not a “histogram” pointer.
In this case, what should I do for the scaling?
Change the definition of your function adding a scaling parameter.
and call pionfit->Scale(0.01) (no TH1:: prefix). And please read a book on C++, your problems are caused by extremely basic C++ mistakes. E.g. you need to understand pointers and calls of virtual functions.