Functions definition for the TestChannel.C example:
Header file:
#ifndef ROOT_TEST_CORE_HH
#define ROOT_TEST_CORE_HH
#include "TStyle.h"
#include "TCanvas.h"
#include "TH1D.h"
#include "TLine.h"
#include "TLegend.h"
extern double FctGaus ( const double t[], const double p[] );
extern double FctGaus2 ( const double t[], const double p[] );
#endif
Source file:
#include "TestCore.H"
double FctGaus ( const double t[], const double p[] )
{
double x = (t[0] - p[1])/p[2];
return ( p[0]*exp(-0.5L*x*x)/(sqrt(3.1415926535897932384626433832795029L)*p[2]) );
}
double FctGaus2 ( const double t[], const double p[] )
{
double result = 0.L;
double pgaus[3] = { p[0], p[2], p[4] * 0.424660900144009534340483469350147061050L };
result += FctGaus ( t, pgaus );
pgaus[0] = p[1];
pgaus[1] = p[3];
result += FctGaus ( t, pgaus );
return (result);
}