Back to index

PdbPadBadCh.cc

 
//----------------------------------------------------------------------------- 
//  $header$ 
// 
//  The pdbcal package 
//  Copyright (C) PHENIX collaboration, 1999 
// 
//  Implementation of class PdbPadBadCh 
// 
//  Author: silvermy 
//----------------------------------------------------------------------------- 
#include "PdbPadBadCh.hh" 
 
#include <iostream.h> 
#include <iomanip.h> 
 
PdbPadBadCh::PdbPadBadCh() : nDim(3) 
{ 
  zero(); 
} 
 
void PdbPadBadCh::zero() 
{ 
   for (int i = 0; i < nDim; i++) { 
      BadChParameter[i] = 0; 
   } 
} 
 
PdbPadBadCh::~PdbPadBadCh() 
{ 
} 
 
int PdbPadBadCh::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 BadChParameter[i]; 
   else 
      return -1; 
} 
 
const char* PdbPadBadCh::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 "Packetid"; // 4001 to 4096 
   case 1: 
     return "Channel index"; // 0 to 2159 
   case 2: 
     return "Padtype"; // 1=inactive,2=hot,3 etc for future classifications. 0 not used (reserved for ok pads) 
   default: 
      return -1; 
   } 
} 
 
void PdbPadBadCh::setParameter(size_t i, int val) 
{ 
   if (i>=0 && i<nDim) 
      BadChParameter[i] = val; 
   else 
      cout << "PdbPadBadCh::SetParameter - Index = " << i  << " is out of range. [0.." << nDim-1 << "] is valid." << endl; 
} 
 
void PdbPadBadCh::print() const 
{ 
   cout << "Packetid  = " << BadChParameter[0] << endl; 
   cout << "Channel index  = " << BadChParameter[1] << endl; 
   cout << "Padtype  = " << BadChParameter[2] << endl; 
} 

Back to index