Skip to content

Conversation

henryiii
Copy link
Member

@henryiii henryiii commented Nov 1, 2017

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.

@codecov
Copy link

codecov bot commented Nov 1, 2017

Codecov Report

❗ No coverage uploaded for pull request base (py_dev_hsp@b049282). Click here to learn what that means.
The diff coverage is 80.18%.

Impacted file tree graph

@@              Coverage Diff              @@
##             py_dev_hsp     #123   +/-   ##
=============================================
  Coverage              ?   69.18%           
=============================================
  Files                 ?       34           
  Lines                 ?     1233           
  Branches              ?      164           
=============================================
  Hits                  ?      853           
  Misses                ?      380           
  Partials              ?        0
Impacted Files Coverage Δ
include/goofit/PdfBase.h 50% <ø> (ø)
include/goofit/PDFs/GooPdf.h 50% <ø> (ø)
include/goofit/PDFs/basic/ExpPdf.h 100% <ø> (ø)
include/goofit/PDFs/basic/GaussianPdf.h 100% <ø> (ø)
include/goofit/UnbinnedDataSet.h 100% <ø> (ø)
include/goofit/BinnedDataSet.h 100% <ø> (ø)
src/goofit/PdfBase.cc 43.9% <100%> (ø)
src/PDFs/combine/ProdPdf.cu 78% <100%> (ø)
src/PDFs/PdfBase.cu 86.4% <100%> (ø)
include/goofit/Variable.h 95.45% <100%> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b049282...57799fb. Read the comment docs.

@henryiii henryiii added this to the V 2.1 milestone Nov 1, 2017
@galapaegos
Copy link
Contributor

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.

@henryiii
Copy link
Member Author

henryiii commented Nov 2, 2017

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.

@henryiii henryiii merged commit 423e18e into py_dev_hsp Nov 2, 2017
@henryiii henryiii deleted the obs branch November 2, 2017 01:52
@kingofmen
Copy link

It's not a hack, it's an inspired kludge. 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants