|  | ATLAS Offline Software
    | 
| Classes | |
| class | TH1 | 
| class | TH2 | 
| Functions | |
| def | load_hist (*args) | 
| def | get_sampling_vars (h) | 
| def | get_random_bin (globalbins, cheights) | 
| def | get_random_x (h, globalbins, cheights, globalbin_to_axisbin) | 
| def | get_random_xy (h2, globalbins, cheights, globalbin_to_axisbin) | 
| Variables | |
| string | __author__ = "Andy Buckley <andy.buckley@cern.ch>" | 
| def python.histsampling.get_random_bin | ( | globalbins, | |
| cheights | |||
| ) | 
Choose a random bin from the cumulative distribution list of nbins+1 entries. TODO: Search more efficiently (lin and log guesses, then lin search or binary split depending on vector size).
Definition at line 59 of file histsampling.py.
| def python.histsampling.get_random_x | ( | h, | |
| globalbins, | |||
| cheights, | |||
| globalbin_to_axisbin | |||
| ) | 
Choose a random bin via get_random_bin, then pick a uniform random x point in that bin (without any attempt at estimating the in-bin distribution).
Definition at line 74 of file histsampling.py.
| def python.histsampling.get_random_xy | ( | h2, | |
| globalbins, | |||
| cheights, | |||
| globalbin_to_axisbin | |||
| ) | 
Choose a random bin via get_random_bin, then pick a uniform random x,y point in that bin (without any attempt at estimating the in-bin distribution).
Definition at line 86 of file histsampling.py.
| def python.histsampling.get_sampling_vars | ( | h | ) | 
Get the following from a histogram h, since the ROOT API sucks: * list of global bin IDs (not even contiguous for 2D, gee thanks ROOT) * dict mapping global bin IDs to a tuple of axis bin IDs * list of nbins+1 cumulative bin values, in the same order as globalbins
Definition at line 33 of file histsampling.py.
| def python.histsampling.load_hist | ( | * | args | ) | 
Load a histogram from a filename/TFile and histo name. If a single arg is provided, it has to be a histo object and will be cloned before return.
Definition at line 13 of file histsampling.py.
| 
 | private | 
Definition at line 8 of file histsampling.py.
 1.8.18
 1.8.18