ROOT logo
//_HADES_CLASS_DESCRIPTION
////////////////////////////////////////////////////////////////////////////
//*-- AUTHOR : I. Koenig
////////////////////////////////////////////////////////////////////////////
// HEmcCellStatusPar
//
// Container class for EMC cell status parameters
// (Condition Style)
//
// cellStatus: Lookup table for the cell status
//             0: cell is OFF (delivers no signal on one or both sides)
//             1: cell is ON  (delivers signals on both sides)
//             By default all cells are ON.
//             Used in EMC hit finder
//
////////////////////////////////////////////////////////////////////////////

#include "hemccellstatuspar.h"
#include "hparamlist.h"

using namespace std;
#include <iostream>

ClassImp(HEmcCellStatusPar)

HEmcCellStatusPar::HEmcCellStatusPar(const Char_t* name,const Char_t* title,
                                     const Char_t* context)
                 : HParCond(name,title,context) {
  cellStatus.Set(163*6);
  clear();
}

void HEmcCellStatusPar::clear() {
  // Sets all cells ON
  cellStatus.Reset(1);
  status=kFALSE;
  resetInputVersions();
  changed=kFALSE;
}

void  HEmcCellStatusPar::setCellStatus(Int_t sec, Int_t cell, Int_t a) {
  // Sets the cell status
  if (sec<0||sec>5||cell<0||cell>163) {
    Error("setCellStatus","Address out of bounds");
  } else {
    cellStatus[163*sec+cell]=a;
  }
}

void HEmcCellStatusPar::putParams(HParamList* l) {
  // Puts all parameters to the list used by the io;
  if (!l) return;
  l->add("cellStatus", cellStatus);
}

Bool_t HEmcCellStatusPar::getParams(HParamList* l) {
  // Retrieves from the list all parameters needed
  if (!l) return kFALSE;
  if (!(l->fill("cellStatus", &cellStatus))) return kFALSE;
  return kTRUE;
}
 
void HEmcCellStatusPar::printCellParams() {
  // Shows the status of all cells
  cout<<"---- Format: sector  column  status of cells ----"<<endl;  
  for(Int_t sec=0;sec<6;sec++) {
    for(Int_t col=0;col<6;col++) {
      cout<<sec<<" "<<col<<"   ";
      for(Int_t cell=0;cell<163;cell++) {
        cout<<" "<<getCellStatus(sec,cell);
      }
      cout<<endl;
    }
  }
}
 hemccellstatuspar.cc:1
 hemccellstatuspar.cc:2
 hemccellstatuspar.cc:3
 hemccellstatuspar.cc:4
 hemccellstatuspar.cc:5
 hemccellstatuspar.cc:6
 hemccellstatuspar.cc:7
 hemccellstatuspar.cc:8
 hemccellstatuspar.cc:9
 hemccellstatuspar.cc:10
 hemccellstatuspar.cc:11
 hemccellstatuspar.cc:12
 hemccellstatuspar.cc:13
 hemccellstatuspar.cc:14
 hemccellstatuspar.cc:15
 hemccellstatuspar.cc:16
 hemccellstatuspar.cc:17
 hemccellstatuspar.cc:18
 hemccellstatuspar.cc:19
 hemccellstatuspar.cc:20
 hemccellstatuspar.cc:21
 hemccellstatuspar.cc:22
 hemccellstatuspar.cc:23
 hemccellstatuspar.cc:24
 hemccellstatuspar.cc:25
 hemccellstatuspar.cc:26
 hemccellstatuspar.cc:27
 hemccellstatuspar.cc:28
 hemccellstatuspar.cc:29
 hemccellstatuspar.cc:30
 hemccellstatuspar.cc:31
 hemccellstatuspar.cc:32
 hemccellstatuspar.cc:33
 hemccellstatuspar.cc:34
 hemccellstatuspar.cc:35
 hemccellstatuspar.cc:36
 hemccellstatuspar.cc:37
 hemccellstatuspar.cc:38
 hemccellstatuspar.cc:39
 hemccellstatuspar.cc:40
 hemccellstatuspar.cc:41
 hemccellstatuspar.cc:42
 hemccellstatuspar.cc:43
 hemccellstatuspar.cc:44
 hemccellstatuspar.cc:45
 hemccellstatuspar.cc:46
 hemccellstatuspar.cc:47
 hemccellstatuspar.cc:48
 hemccellstatuspar.cc:49
 hemccellstatuspar.cc:50
 hemccellstatuspar.cc:51
 hemccellstatuspar.cc:52
 hemccellstatuspar.cc:53
 hemccellstatuspar.cc:54
 hemccellstatuspar.cc:55
 hemccellstatuspar.cc:56
 hemccellstatuspar.cc:57
 hemccellstatuspar.cc:58
 hemccellstatuspar.cc:59
 hemccellstatuspar.cc:60
 hemccellstatuspar.cc:61
 hemccellstatuspar.cc:62
 hemccellstatuspar.cc:63
 hemccellstatuspar.cc:64
 hemccellstatuspar.cc:65
 hemccellstatuspar.cc:66
 hemccellstatuspar.cc:67
 hemccellstatuspar.cc:68
 hemccellstatuspar.cc:69
 hemccellstatuspar.cc:70
 hemccellstatuspar.cc:71
 hemccellstatuspar.cc:72
 hemccellstatuspar.cc:73
 hemccellstatuspar.cc:74
 hemccellstatuspar.cc:75