Hydra  4.0.1
A header-only templated C++ framework to perform data analysis on massively parallel platforms.
basic_fit.inl File Reference
#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"
Include dependency graph for basic_fit.inl:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BASIC_FIT_INL_
 

Functions

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_tHist_Data (100, min, max)
 
cmd parse (argv, argc)
 

Variables

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)
 

Macro Definition Documentation

◆ BASIC_FIT_INL_

#define BASIC_FIT_INL_

Function Documentation

◆ add()

cmd add ( EArg  )
Examples:
dalitz_plot.C, and dalitz_plot.inl.

◆ catch()

catch ( TCLAP::ArgException &  e)

◆ declarg()

declarg ( xvar  ,
double   
)
Examples:
basic_fit.inl.

◆ EArg()

◆ Fill()

Hist_Data Fill ( dataset  )

◆ 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   
)

Variable Documentation

◆ argc

◆ 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

◆ max

◆ min

◆ nentries

◆ return

return

◆ try

try
Initial value:
{
TCLAP::CmdLine cmd("Command line arguments for ", '=')

◆ xgauss

auto xgauss = hydra::Gaussian<xvar>(xmean, xsigma)
Examples:
basic_fit.inl, and fit_gaussian.C.

◆ xmean

auto xmean = hydra::Parameter::Create("X-mean" ).Value(0.0).Error(0.0001).Limits(-1.0, 1.0)
Examples:
basic_fit.inl, and fit_gaussian.C.

◆ xmodel

◆ xsigma

auto xsigma = hydra::Parameter::Create("X-sigma").Value(1.0).Error(0.0001).Limits(0.01, 1.5)