PdbPadROCCal.cc
//-----------------------------------------------------------------------------
// $header$
//
// The pdbcal package
// Copyright (C) PHENIX collaboration, 1999
//
// Implementation of class PdbPadROCCal
//
// Author: silvermy
//-----------------------------------------------------------------------------
#include "PdbPadROCCal.hh"
#include <iostream.h>
#include <iomanip.h>
PdbPadROCCal::PdbPadROCCal() : nDim(11)
{
zero();
}
void PdbPadROCCal::zero()
{
for (int i = 0; i < nDim; i++) {
ROCCalParameter[i] = 0;
}
}
PdbPadROCCal::~PdbPadROCCal()
{
}
int PdbPadROCCal::getParameter(size_t i) const
{
//
// Returns the parameter value at a given index location, -1 if the index is out of range.
//
if (i>=0 && i<nDim)
return ROCCalParameter[i];
else
return -1;
}
const char* PdbPadROCCal::getParName(size_t i) const
{
//
// Returns the parameter name at a given index location. Returns -1 if the index is out of range.
//
switch(i) {
case 0:
return "ROC number";
case 1:
return "Measurement index"; // 1=DS@BNL,2=HAG@LU,3-6=ES/TA/AO@LU etc
case 2:
return "TGL1 MUX(TP1)"; // Calibration value: MUX amplitude as a function of TestPulse (TP1,2,3=5,15,30 (effectively))
case 3:
return "TGL1 MUX(TP2)";
case 4:
return "TGL1 MUX(TP3)";
case 5:
return "TGL2 MUX(TP1)";
case 6:
return "TGL2 MUX(TP2)";
case 7:
return "TGL2 MUX(TP3)";
case 8:
return "TGL3 MUX(TP1)";
case 9:
return "TGL3 MUX(TP2)";
case 10:
return "TGL3 MUX(TP3)";
default:
return -1;
}
}
void PdbPadROCCal::setParameter(size_t i, int val)
{
if (i>=0 && i<nDim)
ROCCalParameter[i] = val;
else
cout << "PdbPadROCCal::SetParameter - Index = " << i << " is out of range. [0.." << nDim-1 << "] is valid." << endl;
}
void PdbPadROCCal::print() const
{
cout << "ROC number = " << ROCCalParameter[0] << endl;
cout << "Measurement index = " << ROCCalParameter[1] << endl;
cout << "TGL1 MUX(TP1) = " << ROCCalParameter[2] << endl;
cout << "TGL1 MUX(TP2) = " << ROCCalParameter[3] << endl;
cout << "TGL1 MUX(TP3) = " << ROCCalParameter[4] << endl;
cout << "TGL2 MUX(TP1) = " << ROCCalParameter[5] << endl;
cout << "TGL2 MUX(TP2) = " << ROCCalParameter[6] << endl;
cout << "TGL2 MUX(TP3) = " << ROCCalParameter[7] << endl;
cout << "TGL3 MUX(TP1) = " << ROCCalParameter[8] << endl;
cout << "TGL3 MUX(TP2) = " << ROCCalParameter[9] << endl;
cout << "TGL3 MUX(TP3) = " << ROCCalParameter[10] << endl;
}