some more work on userFcn
This commit is contained in:
@ -27,10 +27,12 @@ ROOTGLIBS = $(shell $(ROOTSYS)/bin/root-config --glibs)
|
||||
# linker, and the flags to use
|
||||
#
|
||||
|
||||
ifeq ($(OSTYPE),linux)
|
||||
OSTYPE = $(shell uname)
|
||||
|
||||
ifeq ($(OSTYPE),Linux)
|
||||
OS = LINUX
|
||||
endif
|
||||
ifeq ($(OSTYPE),linux-gnu)
|
||||
ifeq ($(OSTYPE),Linux-gnu)
|
||||
OS = LINUX
|
||||
endif
|
||||
ifeq ($(OSTYPE),darwin)
|
||||
|
@ -93,6 +93,7 @@ PTheory::PTheory(PMsrHandler *msrInfo, unsigned int runNo, const bool hasParent)
|
||||
fMul = 0;
|
||||
fStaticKTLFFunc = 0;
|
||||
fUserFcnClassName = TString("");
|
||||
fUserFcn = 0;
|
||||
|
||||
static unsigned int lineNo = 1; // lineNo
|
||||
static unsigned int depth = 0; // needed to handle '+' properly
|
||||
@ -258,8 +259,12 @@ PTheory::PTheory(PMsrHandler *msrInfo, unsigned int runNo, const bool hasParent)
|
||||
if (!fUserFcnClassName.IsWhitespace()) {
|
||||
cout << endl << ">> user function class name: " << fUserFcnClassName.Data() << endl;
|
||||
if (!TClass::GetDict(fUserFcnClassName.Data())) {
|
||||
cout << endl << "**ERROR**: PTheory: user function class '" << fUserFcnClassName.Data() << "' not found. See line no " << line->fLineNo;
|
||||
fValid = false;
|
||||
char libname[256];
|
||||
sprintf(libname, "lib%s.so", fUserFcnClassName.Data()); // add path needed??
|
||||
if (gSystem->Load(libname) < 0) {
|
||||
cout << endl << "**ERROR**: PTheory: user function class '" << fUserFcnClassName.Data() << "' not found. See line no " << line->fLineNo;
|
||||
fValid = false;
|
||||
}
|
||||
} else { // invoke user function object
|
||||
fUserFcn = 0;
|
||||
fUserFcn = (PUserFcnBase*)TClass::GetClass(fUserFcnClassName.Data())->New();
|
||||
|
56
src/classes/PUserFcnBase.cpp
Normal file
56
src/classes/PUserFcnBase.cpp
Normal file
@ -0,0 +1,56 @@
|
||||
/***************************************************************************
|
||||
|
||||
PUserFcnBase.cpp
|
||||
|
||||
Author: Andreas Suter
|
||||
e-mail: andreas.suter@psi.ch
|
||||
|
||||
$Id$
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007 by Andreas Suter *
|
||||
* andreas.suter@psi.c *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "PUserFcnBase.h"
|
||||
|
||||
ClassImp(PUserFcnBase)
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Constructor
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
*/
|
||||
PUserFcnBase::PUserFcnBase()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Destructor
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
*/
|
||||
PUserFcnBase::~PUserFcnBase()
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user