Scale one branch in created Tree

Dear all

I want to scale one branch from a created Tree file.

I created three Branches in Tree

    Tree->Branch("E_0",&sg0,"sg0/I");_
    Tree->Branch("E_1",&sg1,"sg1/I");_
    Tree->Branch("Sum",&sum,"s/I");_

then I created a loop and fill the events in the tree branches in one step

    Tree->Fill();

at the end of the loop I wrote the tree file and closed it

   TreeFile= Tree->GetCurrentFile();_
   TreeFile->Write();_
   TreeFile->Close();_

my question is how can I scale (divide it by 70) only the last branch in the tree (sum) directly after filling the tree?? and keep the first two branches

Thanks in advance

If you know you want to fill the tree not with sum but with sum/70 why don’t you do this scaling operation before filling ?

I am not sure that this is correct, this will change the value of the sum by sum/70
what I want is to change the total number under each bin by 70

thanks

So you want to act on the histogram result (after TTree::Draw or TTree::Project ) ? A tree has no “bins” …

yes, thank you. I moved to histogram.
I thought it is possible under tree spectrum

Many thanks for clarifications

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.