dglazier / brufit Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v3.0
License: GNU General Public License v3.0
I modified the tutorial in FitHSMCModel.C such that the data that are used to create the template histogram pdf and the data that are fitted are identical (see FitHSMCModel2.py). Consequently, when fixing all fudge parameters to their nominal values, the fit result should match the data perfectly.
This works nicely, if I fit the signal pdf to the signal data:
or the background pdf to the background data:
To achieve the above I had to change a few things (see branch fitWithTrueTemplate):
However, when I fit the sum of signal and background pdfs to the corresponding true distribution, the fit result deviates from the data, although also in this case the pdf is in principle able to reproduce the data exactly:
The reason seems to be that the yields found by the fit are off by 45 counts, which corresponds to about 15% of the uncertainty.
Performing the same study for the data I use to measure the proton-track efficiency, the effect is even more pronounced:
It is unclear to me why this happens and I'm unsure whether this may hint at a deeper problem. Any thoughts on how to debug this would be welcome.
Produce sWeights for N MCMC samples. These can be used to propogate uncertainty in sPlot fit parameters.
When performing sPlot, do not continue if no valid ID branch
Building brufit
with a newer version of root
(6.24/02) causes several -Wdefaulted-function-deleted
. I think this is because of a cling
update, where -Wdefaulted-function-deleted
is now on by default. I've only tested this on the dev
branch.
Here are a couple sample warnings:
In file included from input_line_9:14:
/home/dilks/j/dispin/deps/brufit/core/Setup.h:61:14: warning: explicitly defaulted move assignment operator is implicitly deleted [-Wdefaulted-function-deleted]
Setup& operator=(Setup&& other) = default;
^
/home/dilks/j/dispin/deps/brufit/core/Setup.h:211:20: note: move assignment operator of 'Setup' is implicitly deleted because field 'fWS' has a deleted move assignment operator
RooWorkspace fWS;
^
/home/dilks/builds/root-6.24.02-install/include/RooWorkspace.h:278:39: note: copy assignment operator of 'RooWorkspace' is implicitly deleted because field '_factory' has a deleted copy assignment operator
std::unique_ptr<RooFactoryWSTool> _factory; //! Factory tool associated with workspace
^
/usr/include/c++/7/bits/unique_ptr.h:384:19: note: 'operator=' has been explicitly marked deleted here
unique_ptr& operator=(const unique_ptr&) = delete;
^
In file included from input_line_9:15:
/home/dilks/j/dispin/deps/brufit/core/Binner.h:27:7: warning: explicitly defaulted copy constructor is implicitly deleted [-Wdefaulted-function-deleted]
Binner(const Binner&)=default;
^
/home/dilks/j/dispin/deps/brufit/core/Binner.h:74:12: note: copy constructor of 'Binner' is implicitly deleted because field 'fBins' has multiple copy constructors
Bins fBins;
^
A common solution seems to be changing default
to delete
Problem:
Nuisance parameters are used in sPlot fits to account for small differences between MC and data. These are currently not applied to the accepted MC in the acceptance correction. This might result in problems when cutting on the inv. mass.
Possible strategy:
Apply nuisance parameters to accepted MC to emulate their effect in the fit.
It seems that
Line 56 in e342c98
tutorials/sPlotEventsPDF/FitPeakHistBinsBoot.C
: The script defines bins in the Eg
variable and Binner
creates the directories
Eg3.100000_
Eg3.300000_
Eg3.500000_
Eg3.700000_
Eg3.900000_
However, the Boot*.root
files for the Eg
bins are not created in these directories but in the parent directory.
As a consequence,
Line 60 in e342c98
Boot*.root
for the lower Eg
bins and only the ones for Eg3.900000_
remain.
Unfortunately fixing this is not straight-forward. Binner
would need an accessor to get the bin directory and this info would need to be passed down to FitManager::fData
in FitManager::LoadData()
and FitManager::ReloadData()
and maybe other places as well.
Problem:
Uncertainty from acceptance correction is currently not propagated.
Possible strategy:
Take results in MCMCTree and calculate acceptance for each step. This produces a distribution of acceptances. This is basically a sampled likelihood of the acceptance.
Remaining issues:
What to do if fit wasn't done with MCMC?
I'm having trouble building analysis code that depends on Brufit, unless I require the ROOT components RooStats and MathMore (see linked PR). Without these components, when building my analysis code I get errors such as
brufit/lib/libbrufit.so: undefined reference to `RooStats::ModelConfig::GetWS() const'
brufit/lib/libbrufit.so: undefined reference to `RooStats::SPlot::~SPlot()'
brufit/lib/libbrufit.so: undefined reference to `vtable for RooStats::MetropolisHastings'
brufit/lib/libbrufit.so: undefined reference to `RooStats::MarkovChain::MarkovChain()'
...
I'm running:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.