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

Go to the source code of this file.

Macros

#define IPATIA_PLUS_ARGUS_INL_
 

Functions

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

Variables

auto alfa = hydra::Parameter::Create("alfa").Value(-6.5).Error(0.0001).Limits(-7.0, -6.0)
 
char ** argc
 
auto Background_PDF
 
auto beta = hydra::Parameter::Create("beta").Value(1.0).Error(0.0001).Limits(0.5, 1.5)
 
std::cout<< std::endl<< "Generated data (10 first elements):"<< std::endl;for(size_t i=0;i< 10;i++) std::cout<< "["<< i<< "] :"<< range[i]<< std::endl;std::cout<< std::endl<< "Total dataset 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(500000, 50));auto end_d=std::chrono::high_resolution_clock::now();std::chrono::duration< double, std::milli > elapsed_d = end_d - start_d
 
auto L1 = hydra::Parameter::Create("L1").Value(0.5).Error(0.0001).Limits(0.1, 1.0)
 
auto L2 = hydra::Parameter::Create("L2").Value(1.2).Error(0.0001).Limits(0.5, 1.5)
 
auto m0 = hydra::Parameter::Create("M0").Value(5.291).Error(0.0001).Limits(5.28, 5.3)
 
double max = 5.30
 
double min = 5.20
 
auto model = hydra::add_pdfs( {N_Signal, N_Background}, Signal_PDF, Background_PDF)
 
auto mu = hydra::Parameter::Create("mu").Value(5.28).Error(0.0001).Limits(5.27,5.29)
 
auto N1 = hydra::Parameter::Create("N1").Value(2.0).Error(0.0001).Limits(4.5, 6.5)
 
auto N2 = hydra::Parameter::Create("N2").Value(9.5).Error(0.0001).Limits(8.5, 10.5)
 
hydra::Parameter N_Background ("N_Background", 2000, 100, 100, nentries)
 
hydra::Parameter N_Signal ("N_Signal", 500, 100, 100, nentries)
 
 nentries = EArg.getValue()
 
auto power = hydra::Parameter::Create("Power").Value(0.5).Fixed()
 
auto range = hydra::sample(data, min, max, model.GetFunctor())
 
 return
 
auto sigma = hydra::Parameter::Create("sigma").Value(0.0026).Error(0.0001).Limits(0.0020,0.0028)
 
auto Signal_PDF
 
auto slope = hydra::Parameter::Create("Slope").Value(-20.0).Error(0.0001).Limits(-30.0, -10.0)
 
 try
 

Macro Definition Documentation

◆ IPATIA_PLUS_ARGUS_INL_

#define IPATIA_PLUS_ARGUS_INL_

Function Documentation

◆ add()

cmd add ( EArg  )

◆ catch()

catch ( TCLAP::ArgException &  e)

◆ declarg()

declarg ( _X  ,
double   
)

◆ EArg()

TCLAP::ValueArg<size_t> EArg ( "n"  ,
"number-of-events"  ,
"Number of events"  ,
true  ,
10e6  ,
"size_t"   
)

◆ Fill()

Hist_Data Fill ( range  )

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

model SetExtended ( )

Variable Documentation

◆ alfa

auto alfa = hydra::Parameter::Create("alfa").Value(-6.5).Error(0.0001).Limits(-7.0, -6.0)

◆ argc

char** argc
Initial value:
{
size_t nentries = 0
nentries
Definition: Ipatia_plus_argus.inl:99

◆ Background_PDF

auto Background_PDF
Initial value:
auto slope
Definition: Ipatia_plus_argus.inl:139
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 min
Definition: Ipatia_plus_argus.inl:109
auto power
Definition: Ipatia_plus_argus.inl:140
double max
Definition: Ipatia_plus_argus.inl:110
auto m0
Definition: Ipatia_plus_argus.inl:138
Implementation describing the ARGUS background shape.
Definition: ArgusShape.h:63
Definition: AnalyticalIntegral.inl:39

◆ beta

auto beta = hydra::Parameter::Create("beta").Value(1.0).Error(0.0001).Limits(0.5, 1.5)

◆ elapsed_d

std::cout<< std::endl<< "Generated data (10 first elements):"<< std::endl; for(size_t i=0; i< 10; i++) std::cout << "[" << i << "] :" << range[i] << std::endl; std::cout<< std::endl<< "Total dataset 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(500000, 50)); auto end_d = std::chrono::high_resolution_clock::now(); std::chrono::duration<double, std::milli> elapsed_d = end_d - start_d

◆ L1

auto L1 = hydra::Parameter::Create("L1").Value(0.5).Error(0.0001).Limits(0.1, 1.0)

◆ L2

auto L2 = hydra::Parameter::Create("L2").Value(1.2).Error(0.0001).Limits(0.5, 1.5)

◆ m0

auto m0 = hydra::Parameter::Create("M0").Value(5.291).Error(0.0001).Limits(5.28, 5.3)

◆ max

double max = 5.30

◆ min

double min = 5.20

◆ model

◆ mu

auto mu = hydra::Parameter::Create("mu").Value(5.28).Error(0.0001).Limits(5.27,5.29)

◆ N1

auto N1 = hydra::Parameter::Create("N1").Value(2.0).Error(0.0001).Limits(4.5, 6.5)

◆ N2

auto N2 = hydra::Parameter::Create("N2").Value(9.5).Error(0.0001).Limits(8.5, 10.5)

◆ N_Background

hydra::Parameter N_Background("N_Background", 2000, 100, 100, nentries)

◆ N_Signal

hydra::Parameter N_Signal("N_Signal",500, 100, 100, nentries)

◆ nentries

nentries = EArg.getValue()

◆ power

auto power = hydra::Parameter::Create("Power").Value(0.5).Fixed()

◆ range

auto range = hydra::sample(data, min, max, model.GetFunctor())

◆ return

return

◆ sigma

auto sigma = hydra::Parameter::Create("sigma").Value(0.0026).Error(0.0001).Limits(0.0020,0.0028)

◆ Signal_PDF

auto Signal_PDF
Initial value:
auto alfa
Definition: Ipatia_plus_argus.inl:127
auto L2
Definition: Ipatia_plus_argus.inl:124
version of the Ipatia distribution as described in the reference https://doi.org/10.1016/j.nima.2014.06.081.
Definition: Ipatia.h:72
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
auto L1
Definition: Ipatia_plus_argus.inl:121
auto N1
Definition: Ipatia_plus_argus.inl:122
double min
Definition: Ipatia_plus_argus.inl:109
auto beta
Definition: Ipatia_plus_argus.inl:128
auto N2
Definition: Ipatia_plus_argus.inl:125
auto sigma
Definition: Ipatia_plus_argus.inl:119
double max
Definition: Ipatia_plus_argus.inl:110
Definition: AnalyticalIntegral.inl:39
auto mu
Definition: Ipatia_plus_argus.inl:118

◆ slope

auto slope = hydra::Parameter::Create("Slope").Value(-20.0).Error(0.0001).Limits(-30.0, -10.0)

◆ try

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