AculCalib.cpp 1.11 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
#include "AculCalib.h"

ClassImp(AculCalib);

AculCalib::AculCalib() {

	printf("AculCalib::Default constructor called.\n");

	Init();

}

AculCalib::AculCalib(const char* parfile) {
	printf("AculCalib::Constructor called.\n");

	SetParFile(parfile);
	Init();

}

AculCalib::~AculCalib() {

	printf("AculCalib::Destructor called.\n");

	delete fPars;

}

void AculCalib::Init() {

	fPars = 0;
}

void AculCalib::SetParFile(const char* parfile) {

	fParFileName = parfile;
	return;
}

void AculCalib::PrintParameters(const char* option) {
	if (!fPars) {
		cerr << "\"AculCalib::PrintParameters\" parameters were not initialized." << endl;
		return;
	}

	fPars->PrintParameters(option);
}

void AculCalib::PrintCalibParameters() {
	cout << "i\ta\t\b" << endl;
	for (Int_t i = 0; i<=(Int_t)fA.size(); i++) {
		cout << i << "\t" << fA[i] << "\t" << fB[i] << endl;
	}
}

Double_t AculCalib::GetA(Int_t i) {
	if (i >= (Int_t)fA.size()) //if i >= number of array element
	{
		return 0.;
	}
	return fA[i];
}

Double_t AculCalib::GetB(Int_t i) {
	if (i >= (Int_t)fB.size()) //if i >= number of array element
	{
		return 0.;
	}
	return fB[i];
}