-
Notifications
You must be signed in to change notification settings - Fork 41
Observables #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Observables #123
Conversation
Codecov Report
@@ Coverage Diff @@
## py_dev_hsp #123 +/- ##
=============================================
Coverage ? 69.18%
=============================================
Files ? 34
Lines ? 1233
Branches ? 164
=============================================
Hits ? 853
Misses ? 380
Partials ? 0
Continue to review full report at Codecov.
|
This looks great, and I like the renaming to EventNumber. What is the GooFit index? I believe I completely bypassed this in the indexing commit. |
It's the index into the goofit event. 0-n, where n is the observable or the variable max number. It's kind of hacky and keeps growing in the unit tests. |
It's not a hack, it's an inspired kludge. 😁 |
NOTE: this is a PR into the Python branch.
This splits Variables into two categories; Variables and Observables. You used to select between them with a magic number of parameters; now they are separate classes. This facilitated a cleanup of what an Indexable is, and specialized each of the class appropriately. For example, only an Observable has a number of bins, only a Variable has a FitterIndex. The API throughout GooFit has been adapted to use Observable as needed; you can't mix the two up anymore. Internally, GooFit always has treated them separately.
One related change; the GooFit index now gets assigned the first time a Variable is used in a PDF, and statically increments. The old Variable map has been axed.
CountingVariable has been renamed to EventNumber, since that's what it is, and because it's an Observable, not a Variable.
This also fixes the copyable Variables bug introduced in the last few commits to the python branch. Variables are still compared via address instead of internal address; that will be fixed soon. The final stage of that change would be removing Variable pointers everywhere, and instead using copies directly. This would be a huge help to both PyGooFit and AmpGen2GooFit, and to average users.