How to scale the content of the TProfile?

Dear Root Experts,

I have the following issue: I am filling TProfile and at the end of the day I want to multiply the content of each bin with the same constant. I tried with the Scale() method, but with no success.

This illustrates:

TProfile *temp = new TProfile(“temp”,“temp”,1,0,1);
temp->Fill(0.5,10);
temp->Fill(0.5,20);

cout<GetBinContent(1)<<endl;
temp->Scale(2);
cout<GetBinContent(1)<<endl;

I wanted to get as an output:

15
30

but what I get is

15
15

Can anybody suggest how to multiply the content of each bin of TProfile with the same constant without looping over bins?

Thanks for any help,
Ante

Hi,

thank you for reporting this issue. It looks to me a bug due to the latest changes we applied in the TProfile to take care of errors.
Now scale is just merging the contents (adding also the entries).
We will fix in time for 5.24

Best Regards

Lorenzo