81 lines
3.1 KiB
C++

/***************************************************************************
TPofBCalc.h
Author: Bastian M. Wojek
e-mail: bastian.wojek@psi.ch
2008/09/04
***************************************************************************/
/***************************************************************************
* Copyright (C) 2009 by Bastian M. Wojek *
* *
* *
* 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. *
***************************************************************************/
#ifndef _TPofBCalc_H_
#define _TPofBCalc_H_
#include "TBofZCalc.h"
#include "TTrimSPDataHandler.h"
#include "TBulkVortexFieldCalc.h"
#define gBar 0.0135538817
#define pi 3.14159265358979323846
class TPofBCalc {
public:
// standard constructor: allocates memory for B and PB, the arrays are filled later by one of the Calculate-methods
TPofBCalc(const vector<double>&);
// alternative constructor: PB is not actually calculated but copied from a vector
TPofBCalc(const vector<double>&, const vector<double>& , double dt = 0.01);
~TPofBCalc() {
delete[] fB; fB = 0;
delete[] fPB; fPB = 0;
}
void Calculate(const string&, const vector<double>&);
void Calculate(const TBofZCalc*, const TTrimSPData*, const vector<double>&, unsigned int);
void Calculate(const TBofZCalcInverse*, const TTrimSPData*, const vector<double>&);
void Calculate(const TBulkVortexFieldCalc*, const vector<double>&);
const double* DataB() const {return fB;}
double* DataPB() const {return fPB;}
double GetBmin() const {return fBmin;}
double GetBmax() const {return fBmax;}
unsigned int GetPBSize() const {return fPBSize;}
void ConvolveGss(double);
void AddBackground(double, double, double);
void UnsetPBExists();
private:
double *fB;
mutable double *fPB;
double fBmin;
double fBmax;
double fDT;
double fDB;
mutable bool fPBExists;
unsigned int fPBSize;
};
#endif // _TPofBCalc_H_