Added ROOT dictionary generation for the TLondon1D-classes.

This commit is contained in:
Bastian M. Wojek 2008-05-29 14:56:13 +00:00
parent 7458f000a8
commit e889421a30
7 changed files with 99 additions and 23 deletions

View File

@ -1,18 +1,31 @@
#---------------------------------------------------
# get compilation flags from root-config
ROOTCFLAGS = $(shell $(ROOTSYS)/bin/root-config --cflags)
#---------------------------------------------------
CXX = g++
CXXFLAGS = -g -Wall -Wno-trigraphs -fPIC
LOCALINCLUDE = ../include/
INCLUDES = -I$(LOCALINCLUDE)
LOCALINCLUDE = ../include
ROOTINCLUDE = $(ROOTSYS)/include
INCLUDES = -I$(LOCALINCLUDE) -I$(ROOTINCLUDE)
LD = g++
LDFLAGS = -g
SOFLAGS = -O -shared
# the output from the root-config script:
CXXFLAGS += $(ROOTCFLAGS)
LDFLAGS +=
# some definitions: headers (used to generate *Dict* stuff), sources, objects,...
OBJS =
OBJS += TTrimSPDataHandler.o
OBJS += TBofZCalc.o
OBJS += TPofBCalc.o
OBJS += TPofTCalc.o
OBJS += TLondon1D.o
OBJS += TLondon1D.o TLondon1DDict.o
SHLIB = libTFitPofB.so
@ -23,7 +36,7 @@ all: $(SHLIB)
$(SHLIB): $(OBJS)
@echo "---> Building shared library $(SHLIB) ..."
/bin/rm -f $(SHLIB)
$(LD) $(OBJS) $(EXTOBJS) $(SOFLAGS) -o $(SHLIB)
$(LD) $(OBJS) $(SOFLAGS) -o $(SHLIB)
@echo "done"
# clean up: remove all object file (and core files)
@ -37,3 +50,9 @@ clean:; @rm -f $(OBJS) *Dict* core*
$(OBJS): %.o: %.cpp
$(CXX) $(INCLUDES) $(CXXFLAGS) -c $<
# Generate the ROOT CINT dictionary
TLondon1DDict.cpp: ../include/TLondon1D.h ../include/TLondon1DLinkDef.h
@echo "Generating dictionary $@..."
rootcint -f $@ -c -p $^

View File

@ -69,7 +69,7 @@ double TBofZCalc::GetBofZ(double zz) const {
TLondon1D_1L::TLondon1D_1L(const vector<double> &param) {
unsigned int n(2000); // number of steps for the calculation
unsigned int n(5000); // number of steps for the calculation
double N(cosh(param[2]/2.0/param[3]));
@ -93,7 +93,7 @@ TLondon1D_1L::TLondon1D_1L(const vector<double> &param) {
TLondon1D_2L::TLondon1D_2L(const vector<double> &param) {
unsigned int n(4000); // number of steps for the calculation
unsigned int n(5000); // number of steps for the calculation
double N1(param[5]*cosh(param[3]/param[5])*sinh(param[2]/param[4]) + param[4]*cosh(param[2]/param[4])*sinh(param[3]/param[5]));
double N2(4.0*N1);
@ -122,7 +122,7 @@ TLondon1D_2L::TLondon1D_2L(const vector<double> &param) {
TLondon1D_3L::TLondon1D_3L(const vector<double> &param) {
unsigned int n(4000); // number of steps for the calculation
unsigned int n(5000); // number of steps for the calculation
double N1(8.0*(param[5]*param[6]*cosh(param[3]/param[6])*sinh((param[2]+param[4])/param[5]) + ((param[5]*param[5]*cosh(param[2]/param[5])*cosh(param[4]/param[5])) + (param[6]*param[6]*sinh(param[2]/param[5])*sinh(param[4]/param[5])))*sinh(param[3]/param[6])));

View File

@ -5,7 +5,7 @@
Author: Bastian M. Wojek
e-mail: bastian.wojek@psi.ch
2008/05/27
2008/05/29
***************************************************************************/
@ -13,6 +13,11 @@
#include <iostream>
using namespace std;
ClassImp(TLondon1D)
ClassImp(TLondon1D1L)
ClassImp(TLondon1D2L)
ClassImp(TLondon1D3LS)
//------------------
// Destructor of the TLondon1D class -- cleaning up
//------------------
@ -78,8 +83,8 @@ double TLondon1D1L::Eval(double t, const vector<double> &par) const {
if( fPar[i]-par[i] ) {
fPar[i] = par[i];
par_changed = true;
if(i == 1 || i == 2 || i == 3) {
cout << "You are varying dt, dB or E! These parameters have to be fixed! Quitting..." << endl;
if(i == 1 || i == 2) {
cout << "You are varying dt or dB! These parameters have to be fixed! Quitting..." << endl;
exit(-1);
} else if (i == 0) {
only_phase_changed = true;
@ -201,8 +206,8 @@ double TLondon1D2L::Eval(double t, const vector<double> &par) const {
if( fPar[i]-par[i] ) {
fPar[i] = par[i];
par_changed = true;
if(i == 1 || i == 2 || i == 3) {
cout << "You are varying dt, dB or E! These parameters have to be fixed! Quitting..." << endl;
if(i == 1 || i == 2) {
cout << "You are varying dt or dB! These parameters have to be fixed! Quitting..." << endl;
exit(-1);
} else if (i == 0) {
only_phase_changed = true;
@ -339,8 +344,8 @@ double TLondon1D3LS::Eval(double t, const vector<double> &par) const {
if( fPar[i]-par[i] ) {
fPar[i] = par[i];
par_changed = true;
if(i == 1 || i == 2 || i == 3) {
cout << "You are varying dt, dB or E! These parameters have to be fixed! Quitting..." << endl;
if(i == 1 || i == 2) {
cout << "You are varying dt or dB! These parameters have to be fixed! Quitting..." << endl;
exit(-1);
} else if (i == 0) {
only_phase_changed = true;

View File

@ -15,10 +15,10 @@
#include <iostream>
#include <cstdio>
/* USED FOR DEBUGGING -----------------------*/
/* USED FOR DEBUGGING -----------------------
#include <ctime>
#include <fstream>
/*--------------------------------------------*/
--------------------------------------------*/
//------------------
// Constructor of the TPofTCalc class - it creates the FFT plan
@ -154,6 +154,7 @@ TPofTCalc::~TPofTCalc() {
fftw_destroy_plan(fFFTplan);
free(fFFTin);
fftw_free(fFFTout);
fftw_cleanup();
fT.clear();
fPT.clear();

View File

@ -5,16 +5,17 @@
Author: Bastian M. Wojek
e-mail: bastian.wojek@psi.ch
2008/05/27
2008/05/29
***************************************************************************/
#ifndef _TLondon1D_H_
#define _TLondon1D_H_
#include "TObject.h"
#include "TPofTCalc.h"
class TLondon1D {
class TLondon1D : public TObject {
public:
TLondon1D() : fCalcNeeded(true) {}
@ -27,21 +28,26 @@ protected:
TTrimSPData *fImpProfile;
TPofTCalc *fPofT;
mutable bool fCalcNeeded;
ClassDef(TLondon1D,1)
};
class TLondon1D1L : public TLondon1D {
public:
TLondon1D1L() {}
TLondon1D1L(const vector<unsigned int>& , const vector<double>&);
~TLondon1D1L() {}
double Eval(double, const vector<double>&) const;
ClassDef(TLondon1D1L,1)
};
class TLondon1D2L : public TLondon1D {
public:
TLondon1D2L() : fLastTwoChanged(true) {}
TLondon1D2L(const vector<unsigned int>& , const vector<double>&);
~TLondon1D2L() {}
@ -50,11 +56,13 @@ public:
private:
mutable bool fLastTwoChanged;
ClassDef(TLondon1D2L,1)
};
class TLondon1D3LS : public TLondon1D {
public:
TLondon1D3LS() : fLastThreeChanged(true) {}
TLondon1D3LS(const vector<unsigned int>& , const vector<double>&);
~TLondon1D3LS() {}
@ -63,6 +71,7 @@ public:
private:
mutable bool fLastThreeChanged;
ClassDef(TLondon1D3LS,1)
};
#endif //_TUserLondon1D_H_
#endif //_TLondon1D_H_

View File

@ -0,0 +1,26 @@
/***************************************************************************
TLondon1DLinkDef.h
Author: Bastian M. Wojek
e-mail: bastian.wojek@psi.ch
2008/05/29
***************************************************************************/
// root dictionary stuff --------------------------------------------------
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class TLondon1D+;
#pragma link C++ class TLondon1D1L+;
#pragma link C++ class TLondon1D2L+;
#pragma link C++ class TLondon1D3LS+;
#endif //__CINT__
// root dictionary stuff --------------------------------------------------

View File

@ -1,9 +1,25 @@
#---------------------------------------------------
# get compilation and library flags from root-config
ROOTCFLAGS = $(shell $(ROOTSYS)/bin/root-config --cflags)
ROOTLIBS = $(shell $(ROOTSYS)/bin/root-config --libs)
#---------------------------------------------------
CXX = g++
CXXFLAGS = -g -Wall
LOCALINCLUDE = ../include/
INCLUDES = -I$(LOCALINCLUDE)
LOCALINCLUDE = ../include
ROOTINCLUDE = $(ROOTSYS)/include
INCLUDES = -I$(LOCALINCLUDE) -I$(ROOTINCLUDE)
LD = g++
LDFLAGS = -g -L../classes/ -lTFitPofB -lfftw3 -lm
LDFLAGS = -g -L../classes -lTFitPofB -lfftw3 -lm
# the output from the root-config script:
CXXFLAGS += $(ROOTCFLAGS)
LDFLAGS +=
# the ROOT libraries
LIBS = $(ROOTLIBS)
EXEC = test
@ -17,7 +33,7 @@ all: $(EXEC)
$(EXEC): $(OBJS)
@echo "---> Building $(EXEC) ..."
$(LD) $(LDFLAGS) $(OBJS) -o $(EXEC)
$(LD) $(LDFLAGS) $(OBJS) -o $(EXEC) $(LIBS)
@echo "done"
# clean up: remove all object file (and core files)