Noor1
March 22, 2018, 11:54am
1
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
couet
March 22, 2018, 1:04pm
2
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 ?
Noor1
March 22, 2018, 2:31pm
3
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
couet
March 22, 2018, 2:36pm
4
So you want to act on the histogram result (after TTree::Draw or TTree::Project ) ? A tree has no “bins” …
Noor1
March 22, 2018, 3:02pm
5
yes, thank you. I moved to histogram.
I thought it is possible under tree spectrum
Many thanks for clarifications
system
Closed
April 5, 2018, 3:02pm
6
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.