Hydra  4.0.1
A header-only templated C++ framework to perform data analysis on massively parallel platforms.
particle_mass.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/DeltaDMassBackground.h>
#include <hydra/functions/GeneralizedGamma.h>
#include <hydra/Placeholders.h>
#include <hydra/GaussKronrodQuadrature.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 particle_mass.inl:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PARTICLE_MASS_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 (true)
 

Variables

auto A1 = hydra::Parameter::Create("A1").Value( 0.55).Error(0.0001).Limits( 0.4, 0.6)
 
auto A2 = hydra::Parameter::Create("A2").Value(0.4).Error(0.0001).Limits( 0.3, 0.5)
 
auto alfa = hydra::Parameter::Create("alfa").Value(-1.1).Error(0.0001).Limits(-1.5, -0.5)
 
char ** argc
 
auto B1 = hydra::Parameter::Create("B1").Value( 0.067).Error(0.0001).Limits( 0.002, 0.1)
 
auto B2 = hydra::Parameter::Create("B2").Value(3.8).Error(0.0001).Limits( 1.0, 5.0)
 
auto beta = hydra::Parameter::Create("beta").Value(0.1).Error(0.0001).Limits(0.05, 0.5).Fixed()
 
auto C1 = hydra::Parameter::Create("C1").Value( 15.50).Error(0.0001).Limits( 10.0, 20.0)
 
auto C2 = hydra::Parameter::Create("C2").Value(0.85).Error(0.0001).Limits(0.5 , 1.0)
 
auto Combinatorial_Background_PDF
 
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(1);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(5000, 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(1.7).Error(0.0001).Limits(0.5, 2.6)
 
auto L2 = hydra::Parameter::Create("L2").Value(2.6).Error(0.0001).Limits(1.0, 3.5)
 
auto M0 = hydra::Parameter::Create("M0").Value(418.71).Error(0.0001).Limits(415.0, 421.0).Fixed()
 
double max = 550.0
 
double min = 418.71
 
auto model
 
auto mu = hydra::Parameter::Create("mu").Value(493.677).Error(0.0001).Limits(493.5, 493.7)
 
auto N1 = hydra::Parameter::Create("N1").Value(1.45).Error(0.0001).Limits(0.25, 2.7)
 
auto N2 = hydra::Parameter::Create("N2").Value(2.35).Error(0.0001).Limits(1.0, 3.5)
 
hydra::Parameter N_Combinatorial ("N_Combinatorial", 6000, 100, 100, nentries)
 
hydra::Parameter N_PartialRec ("N_PartialRec", 2000, 100, 100, nentries)
 
hydra::Parameter N_Signal ("N_Signal", 5000, 100, 100, nentries)
 
 nentries = EArg.getValue()
 
auto PartialRec_Background_PDF
 
auto range = hydra::sample(data, min, max, model.GetFunctor())
 
 return
 
auto sigma = hydra::Parameter::Create("sigma").Value(3.5).Error(0.0001).Limits(2.0,5.0)
 
auto Signal_PDF
 
 try
 

Macro Definition Documentation

◆ PARTICLE_MASS_INL_

#define PARTICLE_MASS_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 ( true  )

Variable Documentation

◆ A1

auto A1 = hydra::Parameter::Create("A1").Value( 0.55).Error(0.0001).Limits( 0.4, 0.6)

◆ A2

auto A2 = hydra::Parameter::Create("A2").Value(0.4).Error(0.0001).Limits( 0.3, 0.5)

◆ alfa

auto alfa = hydra::Parameter::Create("alfa").Value(-1.1).Error(0.0001).Limits(-1.5, -0.5)

◆ argc

char** argc
Initial value:
{
size_t nentries = 0
nentries
Definition: particle_mass.inl:102

◆ B1

auto B1 = hydra::Parameter::Create("B1").Value( 0.067).Error(0.0001).Limits( 0.002, 0.1)

◆ B2

auto B2 = hydra::Parameter::Create("B2").Value(3.8).Error(0.0001).Limits( 1.0, 5.0)

◆ beta

auto beta = hydra::Parameter::Create("beta").Value(0.1).Error(0.0001).Limits(0.05, 0.5).Fixed()

◆ C1

auto C1 = hydra::Parameter::Create("C1").Value( 15.50).Error(0.0001).Limits( 10.0, 20.0)

◆ C2

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

◆ Combinatorial_Background_PDF

auto Combinatorial_Background_PDF
Initial value:
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: particle_mass.inl:113
auto M0
Definition: particle_mass.inl:142
Definition: DeltaDMassBackground.h:64
auto C1
Definition: particle_mass.inl:147
double min
Definition: particle_mass.inl:112
auto A1
Definition: particle_mass.inl:145
Definition: AnalyticalIntegral.inl:39
auto B1
Definition: particle_mass.inl:146

◆ 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(1); 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(5000, 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(1.7).Error(0.0001).Limits(0.5, 2.6)

◆ L2

auto L2 = hydra::Parameter::Create("L2").Value(2.6).Error(0.0001).Limits(1.0, 3.5)

◆ M0

auto M0 = hydra::Parameter::Create("M0").Value(418.71).Error(0.0001).Limits(415.0, 421.0).Fixed()

◆ max

double max = 550.0

◆ min

double min = 418.71

◆ model

auto model
Initial value:
hydra::Parameter N_PartialRec("N_PartialRec", 2000, 100, 100, nentries)
auto Signal_PDF
Definition: particle_mass.inl:135
hydra::Parameter N_Combinatorial("N_Combinatorial", 6000, 100, 100, nentries)
auto Combinatorial_Background_PDF
Definition: particle_mass.inl:149
PDFSumExtendable< PDF1, PDF2, PDFs... > add_pdfs(std::array< Parameter, sizeof...(PDFs)+2 >const &var_list, PDF1 const &pdf1, PDF2 const &pdf2, PDFs const &...pdfs)
Function to build up extendable pdfs models.
Definition: PDFSumExtendable.h:351
hydra::Parameter N_Signal("N_Signal", 5000, 100, 100, nentries)
auto PartialRec_Background_PDF
Definition: particle_mass.inl:157

◆ mu

auto mu = hydra::Parameter::Create("mu").Value(493.677).Error(0.0001).Limits(493.5, 493.7)

◆ N1

auto N1 = hydra::Parameter::Create("N1").Value(1.45).Error(0.0001).Limits(0.25, 2.7)

◆ N2

auto N2 = hydra::Parameter::Create("N2").Value(2.35).Error(0.0001).Limits(1.0, 3.5)

◆ N_Combinatorial

hydra::Parameter N_Combinatorial("N_Combinatorial",6000, 100, 100, nentries)

◆ N_PartialRec

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

◆ N_Signal

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

◆ nentries

nentries = EArg.getValue()

◆ PartialRec_Background_PDF

auto PartialRec_Background_PDF
Initial value:
= hydra::make_pdf( hydra::GeneralizedGamma<_X>(M0, A2, B2, C2),
hydra::AnalyticalIntegral<hydra::GeneralizedGamma<_X>>(min, max))
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: particle_mass.inl:113
auto M0
Definition: particle_mass.inl:142
double min
Definition: particle_mass.inl:112
auto B2
Definition: particle_mass.inl:154
auto C2
Definition: particle_mass.inl:155
Definition: AnalyticalIntegral.inl:39
auto A2
Definition: particle_mass.inl:153

◆ range

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

◆ return

return

◆ sigma

auto sigma = hydra::Parameter::Create("sigma").Value(3.5).Error(0.0001).Limits(2.0,5.0)

◆ Signal_PDF

auto Signal_PDF
Initial value:
auto beta
Definition: particle_mass.inl:131
auto L1
Definition: particle_mass.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
double max
Definition: particle_mass.inl:113
double min
Definition: particle_mass.inl:112
auto sigma
Definition: particle_mass.inl:122
auto L2
Definition: particle_mass.inl:127
auto N1
Definition: particle_mass.inl:125
Definition: AnalyticalIntegral.inl:39
auto mu
Definition: particle_mass.inl:121
auto alfa
Definition: particle_mass.inl:130
auto N2
Definition: particle_mass.inl:128

◆ try

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