Commit 819defa
[RF] Vectorize weight evaluation with
This PR improves the speed for evaluating weights in `RooHistPdf`
and `RooHistFunc` for one dimensional histograms with no interpolation.
In the future, `RooDataHist::weights()` can be extended to cover
cases with higher dimensions and interpolation.
The function `RooDataHist::weights()` was implemented to enable
vectorized evaluations of bin weights. In `RooHistPdf` it is implemented
using the new function `RooHistPdf::computeBatch()`, which calls
`RooDataHist::weights()` in the case of no interpolation and 1D
histograms, and `RooAbsReal::computeBatch()` otherwise. In
`RooHistFunc::computeBatch`, `RooDataHist::weights()` is called in the
case of no interpolation and 1D histograms and is unchanged in the other cases.
To calculate the weight, bin indices are stored as a vector
using `RooAbsBinning::binNumbers`, which was implemented in root-project#11151.RooDataHist::weights()
1 parent 77553d9 commit 819defa
File tree
5 files changed
+46
-1
lines changed- roofit/roofitcore
- inc
- src
5 files changed
+46
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
105 | 107 | | |
106 | 108 | | |
107 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1142 | 1142 | | |
1143 | 1143 | | |
1144 | 1144 | | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
1145 | 1172 | | |
1146 | 1173 | | |
1147 | 1174 | | |
| |||
1243 | 1270 | | |
1244 | 1271 | | |
1245 | 1272 | | |
1246 | | - | |
1247 | 1273 | | |
1248 | 1274 | | |
1249 | 1275 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
199 | 205 | | |
200 | 206 | | |
201 | 207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| 191 | + | |
191 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
192 | 202 | | |
193 | 203 | | |
194 | 204 | | |
| |||
0 commit comments