tree - Creating a histogram from a TTree -


I am trying to create a 1D histogram with a TTree that has only one variable.

  TTRE * tree = new TTI ("tree", ""); Tree-> ReadFile ("occupancy dataset.", "Size"); TH1F * Occupation = New TH1F ("occupancy", "surcharge per dataset", 100, 0, 0.063)  

You can see above that I created the tree and filled it with data The given .txt file I then created the histogram with the number of cans, x_low , and x_high required. When I try to

  occupancy-> Fill (tree);  

or

  occupation-> Fill (size);  

I get an error, any suggestions?

The fill method of TH1 (TH1F is the daughter class) Does not take in form.

You have two options:

  1. Fill them one by one in loops and histograms on tree entries

    For example < By adding code> tree-> Columns ("MYTREE") and then by adding MYTREE.C to loop () function P>>

      occupation-> Fill (VARIABLENAME);  

    Execute the resulting code in the loop.

  2. Use this:

      tree-> gt; ; Draw ("variableName>> HISTOGRAMNAME");  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -