#include <iostream>
#include <assert.h>
#include <time.h>
#include <chrono>
#include <tclap/CmdLine.h>
#include <hydra/device/System.h>
#include <hydra/Function.h>
#include <hydra/LogLikelihoodFCN.h>
#include <hydra/Parameter.h>
#include <hydra/UserParameters.h>
#include <hydra/Pdf.h>
#include <hydra/functions/Gaussian.h>
#include <hydra/DenseHistogram.h>
#include <hydra/multivector.h>
#include <hydra/Zip.h>
#include "Minuit2/FunctionMinimum.h"
#include "Minuit2/MnUserParameterState.h"
#include "Minuit2/MnPrint.h"
#include "Minuit2/MnMigrad.h"
#include "Minuit2/MnMinimize.h"
Go to the source code of this file.
|
cmd | add (EArg) |
|
| catch (TCLAP::ArgException &e) |
|
| declarg (xvar, double) int main(int argv |
|
TCLAP::ValueArg< size_t > | EArg ("n", "number-of-events","Number of events", true, 10e6, "size_t") |
|
Hist_Data | Fill (dataset) |
|
std::cout<< " minimum: "<< xminimum<< std::endl;std::cout<< "-----------------------------------------"<< std::endl;std::cout<< "| Time (ms) ="<< elapsed.count()<< std::endl;std::cout<< "-----------------------------------------"<< std::endl;hydra::DenseHistogram< double, 1, hydra::device::sys_t > | Hist_Data (100, min, max) |
|
cmd | parse (argv, argc) |
|
|
char ** | argc |
|
std::cout<< std::endl<< "Generated data:"<< std::endl;for(size_t i=0;i< 10;i++) std::cout<< "["<< i<< "] :"<< dataset[i]<< std::endl;auto xfcn=hydra::make_loglikehood_fcn(xmodel, dataset);ROOT::Minuit2::MnPrint::SetGlobalLevel(3);hydra::Print::SetLevel(hydra::WARNING);MnStrategy strategy(2);MnMigrad xmigrad(xfcn, xfcn.GetParameters().GetMnState(), strategy);std::cout<< xfcn.GetParameters().GetMnState()<< std::endl;auto start=std::chrono::high_resolution_clock::now();FunctionMinimum xminimum=FunctionMinimum(xmigrad(std::numeric_limits< unsigned int >::max(), 5));auto stop=std::chrono::high_resolution_clock::now();std::chrono::duration< double, std::milli > | elapsed = stop - start |
|
double | max = 6.0 |
|
double | min = -6.0 |
|
| nentries = EArg.getValue() |
|
| return |
|
| try |
|
auto | xgauss = hydra::Gaussian<xvar>(xmean, xsigma) |
|
auto | xmean = hydra::Parameter::Create("X-mean" ).Value(0.0).Error(0.0001).Limits(-1.0, 1.0) |
|
auto | xmodel = hydra::make_pdf(xgauss, hydra::AnalyticalIntegral< hydra::Gaussian<xvar> >(min, max) ) |
|
auto | xsigma = hydra::Parameter::Create("X-sigma").Value(1.0).Error(0.0001).Limits(0.01, 1.5) |
|
◆ BASIC_FIT_INL_
◆ add()
◆ catch()
catch |
( |
TCLAP::ArgException & |
e | ) |
|
◆ declarg()
◆ EArg()
TCLAP::ValueArg<size_t> EArg |
( |
"n" |
, |
|
|
"number-of-events" |
, |
|
|
"Number of events" |
, |
|
|
true |
, |
|
|
10e6 |
, |
|
|
"size_t" |
|
|
) |
| |
- Examples:
- basic_fit.inl, booststrapping.inl, convolute_functions.inl, cufft.inl, dalitz_plot.inl, dense_histogram.inl, fft.inl, fill_basic_distributions.inl, fit_convoluted_pdfs.inl, multiarray_container.inl, multivector_container.inl, pseudo_experiment.inl, range_semantics.inl, sample_distribution.inl, simultaneous_fit.inl, and splot.inl.
◆ Fill()
◆ Hist_Data()
std::cout<< " minimum: " << xminimum << std::endl; std::cout << "-----------------------------------------"<<std::endl; std::cout << "| Time (ms) ="<< elapsed.count() <<std::endl; std::cout << "-----------------------------------------"<<std::endl; hydra::DenseHistogram<double, 1, hydra::device::sys_t> Hist_Data |
( |
100 |
, |
|
|
min |
, |
|
|
max |
|
|
) |
| |
◆ parse()
cmd parse |
( |
argv |
, |
|
|
argc |
|
|
) |
| |
◆ argc
Initial value:{
nentries
Definition: basic_fit.inl:102
- Examples:
- adaptive_gauss_kronrod.inl, basic_fit.inl, booststrapping.inl, convolute_functions.inl, cufft.inl, dalitz_plot.inl, dense_histogram.inl, fft.inl, fill_basic_distributions.inl, fit_convoluted_pdfs.inl, gauss_kronrod.inl, multiarray_container.inl, multivector_container.inl, phsp_averaging_functor.inl, phsp_basic.inl, phsp_chain.inl, phsp_reweighting.inl, phsp_unweighting_functor.inl, plain_mc.inl, pseudo_experiment.inl, range_semantics.inl, sample_distribution.inl, simultaneous_fit.inl, splot.inl, and vegas.inl.
◆ elapsed
std::cout<< std::endl<< "Generated data:"<< std::endl; for(size_t i=0; i<10; i++) std::cout << "[" << i << "] :" << dataset[i] << std::endl; auto xfcn = hydra::make_loglikehood_fcn(xmodel, dataset); ROOT::Minuit2::MnPrint::SetGlobalLevel(3); hydra::Print::SetLevel(hydra::WARNING); MnStrategy strategy(2); MnMigrad xmigrad(xfcn, xfcn.GetParameters().GetMnState() , strategy); std::cout << xfcn.GetParameters().GetMnState() << std::endl; auto start = std::chrono::high_resolution_clock::now(); FunctionMinimum xminimum = FunctionMinimum( xmigrad(std::numeric_limits<unsigned int>::max(), 5)); auto stop = std::chrono::high_resolution_clock::now(); std::chrono::duration<double, std::milli> elapsed = stop - start |
- Examples:
- adaptive_gauss_kronrod.inl, basic_fit.inl, dalitz_plot.C, dalitz_plot.inl, fit_gaussian.C, gauss_kronrod.inl, phsp_averaging_functor.inl, phsp_basic.inl, phsp_chain.inl, phsp_reweighting.inl, phsp_unweighting_functor.inl, plain_mc.inl, pseudo_experiment.inl, sample_distribution.inl, and simultaneous_fit.inl.
◆ max
- Examples:
- adaptive_gauss_kronrod.inl, basic_fit.inl, convolute_functions.inl, dense_histogram.inl, fit_convoluted_pdfs.inl, fit_gaussian.C, fit_johnson.C, gauss_kronrod.inl, plain_mc.inl, sample_distribution.inl, simultaneous_fit.inl, splot.inl, and vegas.inl.
◆ min
- Examples:
- adaptive_gauss_kronrod.inl, basic_fit.inl, convolute_functions.inl, dense_histogram.inl, fit_convoluted_pdfs.inl, fit_gaussian.C, fit_johnson.C, gauss_kronrod.inl, plain_mc.inl, sample_distribution.inl, simultaneous_fit.inl, splot.inl, and vegas.inl.
◆ nentries
nentries = EArg.getValue() |
- Examples:
- basic_fit.inl, booststrapping.inl, convolute_functions.inl, cufft.inl, dalitz_plot.C, dalitz_plot.inl, dense_histogram.inl, fft.inl, fill_basic_distributions.inl, fit_convoluted_pdfs.inl, fit_gaussian.C, fit_johnson.C, multiarray_container.inl, multivector_container.inl, phsp_averaging_functor.inl, phsp_basic.inl, phsp_chain.inl, phsp_reweighting.inl, phsp_unweighting_functor.inl, pseudo_experiment.inl, range_semantics.inl, sample_distribution.inl, simultaneous_fit.inl, and splot.inl.
◆ return
◆ try
Initial value:{
TCLAP::CmdLine cmd("Command line arguments for ", '=')
◆ xgauss
◆ xmean
◆ xmodel
◆ xsigma