Script Compiler

mdobbs@uvic.ca
Thu, 15 Jul 1999 14:53:32 -0700 (PDT)


Hello,

I'm attempting to use the new Script Compiler feature of V2.22 on
HP-UX.B.10.20 and having some problems- hoping someone call help out:

Here's the result:
_________________________________________________________________________
*******************************************
* *
* W E L C O M E to R O O T *
* *
* Version 2.22/09 13 July 1999 *
* *
* You are welcome to visit our Web site *
* http://root.cern.ch *
* *
*******************************************
CINT/ROOT C/C++ Interpreter version 5.14.8, Jul 4 1999
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] .L GausLandConv.C++
Creating shared library
/gumbi/home/mdobbs/RootExamples_MAD/./GausLandConv.so
Note: operator new() masked 1c
Note: operator delete() masked 1c
CC: error: "baaa02213.C" not legal input for "-b" option (1923)
root [1]
_________________________________________________________________________
and here's the function GausLandConv.C
_________________________________________________________________________
#ifndef __CINT__
#include "TMath.h"
#endif
class TMath;

Double_t GausLandConv(Double_t *x, Double_t *par) {

// Crude convolution of a Gaussian (mean= 0.) and a Landau
// distribution at x[0].

Double_t LoBound = par[0]; // lo bound for integration
Double_t HiBound = par[1]; // hi bound for integration
Double_t NumIntBins = par[2]; // number of Riemann integration bins
Double_t YNorm = par[3]; // Normalization
Double_t GausSigma = par[4]; // sigma width of gaussian
Double_t XNorm = par[5]; // x axis normalization
Double_t LandMostProb = par[6]; // most probable of landau
Double_t StepSize = (HiBound - LoBound) / NumIntBins;

// Integrate over the region LoBound --> HiBound using
// NumIntBins Riemannian bins

Double_t gaus, result = 0;
for ( Double_t tau = LoBound + StepSize/2; tau < HiBound;
tau += StepSize ) {

// evaluate a gaussian curve at (x[0]-tau)
gaus = TMath::Exp( -1*(x[0]-tau)*(x[0]-tau)/(2*GausSigma*GausSigma) )
/ ( TMath::Sqrt(2.*3.141592653)*GausSigma );

// add the area of this Riemann bin to the total integral result
result += YNorm * TMath::Landau(tau,LandMostProb,XNorm) * gaus;
}
return result;
}

Thanks, Matt

_________________________________________________________________________
Matt D O B B S
Department of Physics and Astronomy CERN Address:
University of Victoria 40-1-C15, ATLAS Bldg.
P.O. Box 3055 Office Tel: 41.22.76.71272
Victoria, British Columbia
Canada V8W 3P6
Email: mdobbs@uvic.ca Matthew.Adam.Dobbs@Cern.CH
Office Tel.: (250) 721-7728 http://wwwhep.phys.uvic.ca/~mdobbs/
Home Tel.: (250) 995-1235