Increase the number of entries in a root file


I am trying to increase the number of entries by some factor in the root file instead of scaling up like in a histogram. But after increasing the number of entries when I plot the histograms, the number of entries is now as without increasing. So my doubt is can I do like in this way? I have less luminosity in the MC, I want to normalize as that of data by some factor. After that, I want to do a ML fit by roofit for the MC.

What I do to increase the entries:
for(int i=0;i<n_tot*13;i++){


ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided

Hi @Debashis_sahoo,
As shown in the docs , TTree::GetEntry() returns the number of bytes read from the input buffer, so you’re not getting the actual value of the entry in the tree. Furthermore, any getter function would only give you a value from the class instance you are trying to access, but that doesn’t mean you would be modifying the content of the object. For that goal you should use setter functions (e.g. SetBinContent in the TH1 family).

Now, I’m assuming you already have a TTree and you finally want to create an histogram from its content. I would also presume that you really do not want to use any of the methods shown here to normalize your histogram or just fill it with weighted values. Then in this case I suggest that you simply TTree::Fill() a new branch of the tree with the number of values you want. An example is shown in this tutorial.

If you need any more help, please attach the program/macro you are working with.

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