User Tools

Site Tools


root:ttreedraw

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
root:ttreedraw [2013/06/14 11:09] nchiaproot:ttreedraw [2013/06/14 11:10] – [Basic Usage] nchiap
Line 13: Line 13:
 Alternatively the name of the histogram to be created can be given or the data can be added to an existing histogram. Alternatively the name of the histogram to be created can be given or the data can be added to an existing histogram.
 <code c++> <code c++>
-tree->Draw("myvar>>myhist(10,0,100)");    // create a new histogram *myhist* with 10 bins between 0 and 100 +tree->Draw("myvar>>myhist(10,0,100)");     // create a new histogram *myhist* with 10 bins between 0 and 100 
-TH1F *hist = gPad->GetPrimitive("myhist") // create a pointer to the new histogram +TH1F *hist = gPad->GetPrimitive("myhist")// create a pointer to the new histogram 
-tree->Draw("myvar>>+myhist");             // add additional entries to *myhist*+tree->Draw("myvar>>+myhist");              // add additional entries to *myhist*
 </code> </code>
  
root/ttreedraw.txt · Last modified: 2013/06/14 11:41 by nchiap