Skip to content
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

Usage of getWeights().current in gundamCalcXsec.cxx for the plotting #531

Open
jedori0228 opened this issue Jun 4, 2024 · 2 comments
Open

Comments

@jedori0228
Copy link
Contributor

jedori0228 commented Jun 4, 2024

Hi, we are using 1.9.0, and noticed the gundamCalcXsec output in calcXsec/plots changed from what we saw from 1.7.2. Below, I tried to summarize what are being done for the plot generators:

1.8.3

  • Initialize weight.nominal = 0 before we throw toys
  • Once a toy is thrown, we do
    ev_.setNominalWeight( ev_.getNominalWeight() + binData );
    , where binData is the x-sec of this throw
  • In the end, weight.nominal becomes sum_{toys}(x-sec)
  • This weight is assigned to all events, so the histogram bin content becomes sum_{events}( sum_{toys}(x-sec))
    • In first order, BinContent = NEvent * NToys * x-sec
  • So we divide by 1/NToys/NEventInBin to get an averated x-sec histogram:
    ev_.setEventWeight(ev_.getNominalWeight() / nToys / double(nEventInBin[ev_.getSampleBinIndex()]) );
  • We used to have an averaged x-sec plot split by varDictionnaries.dictionary we defined in our PlotConfig yaml

1.9.0

  • nominal weights are removed, and current is used
  • Initialize weight.current = 0 before we throw toys
  • Once a toy is thrown, propagateParameters() will update weight.current to base weight * RW
  • We do weight.current += binData:
    ev_.getWeights().current += binData;
    • But weight.current was updated by propagation, so the previous += operation is overwritten
    • Say the updated weight.current is something like ~0.5; binData is a x-sec, so it's a order of 10^(-37), so besically this += does nothing to weight.current

So in the end, with 1.9.0, we got something like a histogram of given varToPlot, but divided by NToys and number of events of each bin, not the averaged x-sec plot that we used dto get from older release.

Related to this, we have a question on which release is recommend to be used now; it is recommended to use 1.8.x series rather than 1.9.X? We can see 1.8.X are keep being updated recently.

@ClarkMcGrew
Copy link
Contributor

ClarkMcGrew commented Jun 4, 2024

The current stable release series is 1.8. (For your own sanity, please use the latest released tag, not the 1.8.x which is the release candidate branch).

The 1.9 series are development pre-releases. That code base has some refactoring ideas that will probably be used in the long term, but the changes are rather significant and will require a full validation.

I meant to note that we are actively using 1.8 for T2K analysis, so it's getting all of the very close attention. Changes are being (or intend to be) forward ported to 1.9, but all of the careful bug checking is in 1.8.

@ClarkMcGrew
Copy link
Contributor

See the comment about GUNDAM versions is #560.

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

No branches or pull requests

2 participants