GET library
TestCore.C

Functions definition for the TestChannel.C example:

Header file:

//======================================================================
//
// Include file for compiled ROOT functions for test macros
//
//======================================================================
#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"
#include "GETSystem.hh"
#include "GETNoise.hh"
#include "GETFilterCut.hh"
#include "GETFilterGaus.hh"
#include "GETFilterAget.hh"
#include "GETFilterLowN.hh"
//======================================================================
// Signal functions
extern double FctGaus ( const double t[], const double p[] );
extern double FctGaus2 ( const double t[], const double p[] );
//======================================================================
#endif

Source file:

//======================================================================
//
// Various ROOT functions for test macros
//
//======================================================================
/*
These macros require to load the GET libraries
gROOT->Macro ( (getenv("GET_BASE")+string("/root/GETRootLibs.C")).c_str() );
To load the macro file
.L TestCore.C++
Functions:
double FctGaus2 ( const double t[], const double p[] )
*/
#include "TestCore.H"
//======================================================================
// Signal functions
// Gauss function.
// p[0] = amplitude
// p[1] = center
// p[2] = sigma
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]) );
}
// Signal function: double peak with same width
// p[0] = surf1 1st peak integral (fC)
// p[1] = surf2 2nd peak integral (fC)
// p[2] = ctr1 1st peak center (us)
// p[3] = ctr2 2nd peak center (us)
// p[4] = FWHM signal peak FWHM (us)
double FctGaus2 ( const double t[], const double p[] )
{
double result = 0.L;
double pgaus[3] = { p[0], p[2], p[4] * 0.424660900144009534340483469350147061050L };
// first peak
result += FctGaus ( t, pgaus );
// second peak
pgaus[0] = p[1];
pgaus[1] = p[3];
result += FctGaus ( t, pgaus );
return (result);
}
//======================================================================