How to add the same bin content for class "TProfile3D"

ROOT Version: 6.22/08
Platform: Ubuntu20.04

Dear experts,

I would like to simply add the content for the same bin while using class “TProfile3D”,
I found the content is the weighted mean value while filling the same bin.
As shown in the attached code, I want to add the same bin content, that means “2+3=5” for bin [5,5,5] ( in fact, the value is “20.5+30.5=2.5”).
Could you please help me, thanks very much.

rc.C (406 Bytes)

Best regards,
Jiechen

Can you explain what you think is wrong with the example you posted ?

Hi, Couet,

Sorry for confusion, the example itself is alright as you mentioned.

Actually, I produced a 3D histogram by using class “TH3F” firstly;
then I get the center axis of each bin (this operation corresponds to real situation), e.g.: Point A[x,y,z, content];
next I rotate the coordinate and get a new axis of Point A, that is Point A[x’,y’,z’, content], at this step, I used TProfile3D to fill the new point.

The problem is that some points (with a close coordinate) are always divided into the same bin, e.g.: Point A[x’,y’,z’, content1], Point B[x’‘,y’‘,z’', content2], Point A and Point B are divided into the same bin.
Then, the new content for this bin is an average value “content1w1+content2w2”, this calculation hides the correspond sum of content, I only want to obtain a sum of the content “content1+content2”.
This is the reason why I attached the example before.
For this situation, how can I add contents for the same bin, could you please give me some advice?
Thank you very much.

Best regards,
Jiechen

Thanks for the clarification. May be @moneta will have a better understabding of what your problem is.