AculCalib.cpp 2.21 KB
Newer Older
1 2
#include "AculCalib.h"

3
//----------------------------------------------------------------------------
4
AculCalib::AculCalib() {
5
//documentation example
6 7 8 9 10 11
	printf("AculCalib::Default constructor called.\n");

	Init();

}

12 13
//----------------------------------------------------------------------------
/*AculCalib::AculCalib(const char* parfile) {
14 15 16 17 18
	printf("AculCalib::Constructor called.\n");

	SetParFile(parfile);
	Init();

19
}*/
20

21
//----------------------------------------------------------------------------
22 23 24 25 26 27 28 29
AculCalib::~AculCalib() {

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

	delete fPars;

}

30
//----------------------------------------------------------------------------
31 32 33 34 35
void AculCalib::Init() {

	fPars = 0;
}

36
//----------------------------------------------------------------------------
37 38 39 40 41 42
void AculCalib::SetParFile(const char* parfile) {

	fParFileName = parfile;
	return;
}

43
//----------------------------------------------------------------------------
44 45 46 47 48 49 50 51 52
void AculCalib::PrintParameters(const char* option) {
	if (!fPars) {
		cerr << "\"AculCalib::PrintParameters\" parameters were not initialized." << endl;
		return;
	}

	fPars->PrintParameters(option);
}

53
//----------------------------------------------------------------------------
54 55 56 57 58 59 60
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;
	}
}

61
//----------------------------------------------------------------------------
62 63 64 65 66 67 68 69
Double_t AculCalib::GetA(Int_t i) {
	if (i >= (Int_t)fA.size()) //if i >= number of array element
	{
		return 0.;
	}
	return fA[i];
}

70
//----------------------------------------------------------------------------
71 72 73 74 75 76 77
Double_t AculCalib::GetB(Int_t i) {
	if (i >= (Int_t)fB.size()) //if i >= number of array element
	{
		return 0.;
	}
	return fB[i];
}
78

79
//----------------------------------------------------------------------------
80 81 82 83 84 85 86 87 88 89 90 91 92 93
void AculCalib::CanDivider(TCanvas *c, Int_t noPads, Int_t columns, Int_t rows) {

	c->Clear();

	if (noPads == 16) {
		c->Divide(4, 4);
		return;
	}

	if (rows != 0 && columns != 0) {
		c->Divide(columns, rows);
		return;
	}
}
94 95 96

//----------------------------------------------------------------------------
ClassImp(AculCalib);