Campuses:
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| computing:contrib:root:localdoc [2009/02/19 11:15] – strait | computing:contrib:root:localdoc [2009/06/01 15:47] (current) – more strait | ||
|---|---|---|---|
| Line 71: | Line 71: | ||
| void Loop(TTree * awesomedata) | void Loop(TTree * awesomedata) | ||
| { | { | ||
| + | yourdataobject * onedatum = 0; | ||
| + | awesomedata-> | ||
| for(int i = 0; i < awesomedata-> | for(int i = 0; i < awesomedata-> | ||
| awesomedata-> | awesomedata-> | ||
| Line 83: | Line 85: | ||
| Loop(awesomedata); | Loop(awesomedata); | ||
| } | } | ||
| + | |||
| + | The class " | ||
| === Use Good Names === | === Use Good Names === | ||
| Line 133: | Line 137: | ||
| | | ||
| // If you simply declared the object: | // If you simply declared the object: | ||
| - | // This copies the object: the sequence of random | + | // This copies the object: the sequence of random |
| - | // will not be advanced in the calling function | + | // numbers |
| void IWantRandomNumbers(TRandom3 laserfocus) | void IWantRandomNumbers(TRandom3 laserfocus) | ||
| - | // This uses the object itself: the sequence of random | + | |
| - | // *will* be advanced in the calling function | + | |
| + | // numbers | ||
| void IWantRandomNumbers(TRandom3 & laserfocus) | void IWantRandomNumbers(TRandom3 & laserfocus) | ||
| Line 196: | Line 201: | ||
| < | < | ||
| - | This has two big advantages. | + | This has two big advantages. |
| ====== Making Attractive Plots ====== | ====== Making Attractive Plots ====== | ||