#include <iostream>
#include <assert.h>
#include <time.h>
#include <chrono>
#include <random>
#include <algorithm>
#include <tclap/CmdLine.h>
#include <hydra/device/System.h>
#include <hydra/Function.h>
#include <hydra/Lambda.h>
#include <hydra/FunctorArithmetic.h>
#include <hydra/Random.h>
#include <hydra/LogLikelihoodFCN.h>
#include <hydra/Parameter.h>
#include <hydra/UserParameters.h>
#include <hydra/Pdf.h>
#include <hydra/AddPdf.h>
#include <hydra/Filter.h>
#include <hydra/DenseHistogram.h>
#include <hydra/functions/Gaussian.h>
#include <hydra/functions/ArgusShape.h>
#include <hydra/Placeholders.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 (_X, double) int main(int argv |
|
TCLAP::ValueArg< size_t > | EArg ("n", "number-of-events","Number of events", true, 10e6, "size_t") |
|
Hist_Data | Fill (range.begin(), range.end()) |
|
std::cout<< "Minimum: "<< minimum_d<< std::endl;std::cout<< "-----------------------------------------"<< std::endl;std::cout<< "| [Fit] GPU Time (ms) ="<< elapsed_d.count()<< std::endl;std::cout<< "-----------------------------------------"<< std::endl;hydra::DenseHistogram< double, 1, hydra::device::sys_t > | Hist_Data (100, min, max) |
|
cmd | parse (argv, argc) |
|
model | SetExtended (1) |
|
|
char ** | argc |
|
double | B0_mass = 5.27955 |
|
auto | Background_PDF |
|
std::cout<< std::endl<< "Generated data:"<< std::endl;for(size_t i=0;i< 10;i++) std::cout<< "["<< i<< "] :"<< range[i]<< std::endl;std::cout<< std::endl<< "data size :"<< range.size()<< std::endl;auto fcn=hydra::make_loglikehood_fcn(model, range);ROOT::Minuit2::MnPrint::SetGlobalLevel(3);MnStrategy strategy(2);MnMigrad migrad_d(fcn, fcn.GetParameters().GetMnState(), strategy);std::cout<< fcn.GetParameters().GetMnState()<< std::endl;auto start_d=std::chrono::high_resolution_clock::now();FunctionMinimum minimum_d=FunctionMinimum(migrad_d(50000, 50));auto end_d=std::chrono::high_resolution_clock::now();std::chrono::duration< double, std::milli > | elapsed_d = end_d - start_d |
|
double | Jpsi_mass = 3.0969 |
|
double | K_mass = 0.493677 |
|
auto | m0 = hydra::Parameter::Create().Name("M0").Value(5.291).Error(0.0001).Limits(5.28, 5.3) |
|
double | max = 5.30 |
|
hydra::Parameter | mean = hydra::Parameter::Create().Name("Mean").Value( 5.28).Error(0.0001).Limits(5.25,5.29) |
|
double | min = 5.20 |
|
auto | model = hydra::add_pdfs( {N_Signal, N_Background}, Signal_PDF, Background_PDF) |
|
hydra::Parameter | N_Background ("N_Background", 2000, 100, 100, nentries) |
|
hydra::Parameter | N_Signal ("N_Signal", 500, 100, 100, nentries) |
|
| nentries = EArg.getValue() |
|
double | pi_mass = 0.13957061 |
|
auto | power = hydra::Parameter::Create().Name("Power").Value(0.5).Fixed() |
|
auto | range = hydra::sample(data, min, max, model.GetFunctor()) |
|
| return |
|
hydra::Parameter | sigma = hydra::Parameter::Create().Name("Sigma").Value(0.0026).Error(0.0001).Limits(0.0024,0.0028) |
|
auto | Signal_PDF |
|
auto | slope = hydra::Parameter::Create().Name("Slope").Value(-20.0).Error(0.0001).Limits(-30.0, -10.0) |
|
| try |
|
◆ GAUSSIANPLUSARGUS_H_
#define GAUSSIANPLUSARGUS_H_ |
◆ add()
◆ catch()
catch |
( |
TCLAP::ArgException & |
e | ) |
|
◆ declarg()
◆ EArg()
TCLAP::ValueArg<size_t> EArg |
( |
"n" |
, |
|
|
"number-of-events" |
, |
|
|
"Number of events" |
, |
|
|
true |
, |
|
|
10e6 |
, |
|
|
"size_t" |
|
|
) |
| |
◆ Fill()
Hist_Data Fill |
( |
range. |
begin(), |
|
|
range. |
end() |
|
) |
| |
◆ Hist_Data()
std::cout<< "Minimum: " << minimum_d << std::endl; std::cout << "-----------------------------------------"<<std::endl; std::cout << "| [Fit] GPU Time (ms) ="<< elapsed_d.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 |
|
|
) |
| |
◆ SetExtended()
◆ argc
◆ B0_mass
◆ Background_PDF
Initial value:double min
Definition: gaussian_plus_argus.inl:119
Pdf< FUNCTOR, INTEGRATOR > make_pdf(FUNCTOR const &functor, INTEGRATOR integrator)
Build a hydra::Pdf given a shape described by a functor and a integrator (algorithm or functor)...
Definition: Pdf.h:299
double max
Definition: gaussian_plus_argus.inl:120
auto m0
Definition: gaussian_plus_argus.inl:137
auto power
Definition: gaussian_plus_argus.inl:139
Implementation describing the ARGUS background shape.
Definition: ArgusShape.h:63
auto slope
Definition: gaussian_plus_argus.inl:138
Definition: AnalyticalIntegral.inl:39
- Examples:
- gaussian_plus_argus.inl.
◆ elapsed_d
std::cout<< std::endl<< "Generated data:"<< std::endl; for(size_t i=0; i< 10; i++) std::cout << "[" << i << "] :" << range[i] << std::endl; std::cout<< std::endl<< "data size :"<< range.size() << std::endl; auto fcn = hydra::make_loglikehood_fcn( model, range ); ROOT::Minuit2::MnPrint::SetGlobalLevel(3); MnStrategy strategy(2); MnMigrad migrad_d(fcn, fcn.GetParameters().GetMnState() , strategy); std::cout<<fcn.GetParameters().GetMnState()<<std::endl; auto start_d = std::chrono::high_resolution_clock::now(); FunctionMinimum minimum_d = FunctionMinimum(migrad_d(50000, 50)); auto end_d = std::chrono::high_resolution_clock::now(); std::chrono::duration<double, std::milli> elapsed_d = end_d - start_d |
◆ Jpsi_mass
◆ K_mass
◆ m0
◆ max
◆ mean
◆ min
◆ model
◆ N_Background
◆ N_Signal
◆ nentries
nentries = EArg.getValue() |
◆ pi_mass
◆ power
◆ range
◆ return
◆ sigma
◆ Signal_PDF
Initial value:double min
Definition: gaussian_plus_argus.inl:119
Pdf< FUNCTOR, INTEGRATOR > make_pdf(FUNCTOR const &functor, INTEGRATOR integrator)
Build a hydra::Pdf given a shape described by a functor and a integrator (algorithm or functor)...
Definition: Pdf.h:299
hydra::Parameter sigma
Definition: gaussian_plus_argus.inl:128
double max
Definition: gaussian_plus_argus.inl:120
hydra::Parameter mean
Definition: gaussian_plus_argus.inl:127
Gaussian functions are often used to represent the probability density function of a normally dist...
Definition: Gaussian.h:62
Definition: AnalyticalIntegral.inl:39
- Examples:
- gaussian_plus_argus.inl.
◆ slope
◆ try
Initial value:{
TCLAP::CmdLine cmd("Command line arguments for ", '=')