ROOT logo
#ifndef HWALLLOOKUP_H
#define HWALLLOOKUP_H

#include "TObject.h"
#include "TObjArray.h"
#include "hparset.h"

class HWallLookupChan : public TObject {
protected:
  Int_t cell;     // cell number (0..383)
public:
  HWallLookupChan(void) { clear(); }
  ~HWallLookupChan(void) {;}
  Int_t getCell(void)  { return cell; }
  void fill(HWallLookupChan& r) { cell=r.getCell(); }
  void setCell(const Int_t n)  { cell=n; }
  void clear(void) { cell=-1; }
  ClassDef(HWallLookupChan,1) // Channel level of the lookup table for the Forward Wall unpacker 
};

class HWallLookupSlot: public TObject {
protected:
  TObjArray* array; // pointer array containing HWallLookupChan objects
  Char_t modType;   // type of digital converter (A=ADC, T=TDC, U=undefined)
  Int_t maxChannel; // actual maximum index of channel
  Int_t nChannels;  // maximum number of channels in a slot
public:
  HWallLookupSlot(Int_t numChannels=1);
  ~HWallLookupSlot(void);
  HWallLookupChan& operator[](Int_t i) {
      return *static_cast<HWallLookupChan*>((*array)[i]);
  }
  HWallLookupChan* getChannel(Int_t c) {
    if (c>=0 && c<=maxChannel) return &((*this)[c]);
    else return 0;
  }
  Int_t getSize(void)  { return maxChannel+1; }
  Int_t getMaxSize(void) { return nChannels; }
  Char_t getType(void) { return modType; }
  void fill(Char_t,Int_t,Int_t);
  void clear(void);
  ClassDef(HWallLookupSlot,1) // ADC/TDC level of  the lookup table for the Forward Wall unpacker
};

class HWallLookupCrate: public TObject {
protected:
  TObjArray* array; // pointer array containing HWallLookupSlot objects
  Int_t maxSlot;    // actual maximum index of slots
  Int_t nSlots;     // maximum number of slots in a crate
public:
  HWallLookupCrate(Int_t numSlots=1);
  ~HWallLookupCrate(void);
  HWallLookupSlot& operator[](Int_t i) {
      return *static_cast<HWallLookupSlot*>((*array)[i]);
  }
  HWallLookupSlot* getSlot(Int_t s) {
    if (s>=0 && s<=maxSlot) return &((*this)[s]);
    else return 0;
  }
  Int_t getSize(void) { return maxSlot+1; }
  Int_t getMaxSize(void) { return nSlots; }
  void fill(Int_t,Char_t,Int_t,Int_t);
  ClassDef(HWallLookupCrate,1) // Crate level of the lookup table for the Forward Wall unpacker
};

class HWallLookup : public HParSet {
protected:
  TObjArray* array;  // array of pointers of type HWallLookupCrate
  Int_t maxCrate;    // actual maximum index of crates
public:
  HWallLookup(const Char_t* name="WallLookup",
             const Char_t* title="Lookup table for Forward Wall unpacker",
             const Char_t* context="WallLookupProduction",
             Int_t nCrates=1, Int_t nSlots=1);
  ~HWallLookup(void);
  HWallLookupCrate& operator[](Int_t i) {
    return *static_cast<HWallLookupCrate*>((*array)[i]);
  }
  HWallLookupSlot* getSlot(Int_t c, Int_t s) {
    if (c>=0 && c<=maxCrate) return (*this)[c].getSlot(s);
    else return 0;
  }
  Int_t getSize(void) { return maxCrate+1; }
  Bool_t init(HParIo*,Int_t*);
  Int_t write(HParIo*);
  void clear(void);
  void printParam(void);
  void fill(Int_t,Int_t,Char_t,Int_t,Int_t);
  void readline(const Char_t*, Int_t*);
  void putAsciiHeader(TString&);
  Bool_t writeline(Char_t*, Int_t, Int_t, Int_t);
  ClassDef(HWallLookup,1) // Lookup table for the unpacker of the Forward Wall
};

#endif  /*!HWALLLOOKUP_H*/









 hwalllookup.h:1
 hwalllookup.h:2
 hwalllookup.h:3
 hwalllookup.h:4
 hwalllookup.h:5
 hwalllookup.h:6
 hwalllookup.h:7
 hwalllookup.h:8
 hwalllookup.h:9
 hwalllookup.h:10
 hwalllookup.h:11
 hwalllookup.h:12
 hwalllookup.h:13
 hwalllookup.h:14
 hwalllookup.h:15
 hwalllookup.h:16
 hwalllookup.h:17
 hwalllookup.h:18
 hwalllookup.h:19
 hwalllookup.h:20
 hwalllookup.h:21
 hwalllookup.h:22
 hwalllookup.h:23
 hwalllookup.h:24
 hwalllookup.h:25
 hwalllookup.h:26
 hwalllookup.h:27
 hwalllookup.h:28
 hwalllookup.h:29
 hwalllookup.h:30
 hwalllookup.h:31
 hwalllookup.h:32
 hwalllookup.h:33
 hwalllookup.h:34
 hwalllookup.h:35
 hwalllookup.h:36
 hwalllookup.h:37
 hwalllookup.h:38
 hwalllookup.h:39
 hwalllookup.h:40
 hwalllookup.h:41
 hwalllookup.h:42
 hwalllookup.h:43
 hwalllookup.h:44
 hwalllookup.h:45
 hwalllookup.h:46
 hwalllookup.h:47
 hwalllookup.h:48
 hwalllookup.h:49
 hwalllookup.h:50
 hwalllookup.h:51
 hwalllookup.h:52
 hwalllookup.h:53
 hwalllookup.h:54
 hwalllookup.h:55
 hwalllookup.h:56
 hwalllookup.h:57
 hwalllookup.h:58
 hwalllookup.h:59
 hwalllookup.h:60
 hwalllookup.h:61
 hwalllookup.h:62
 hwalllookup.h:63
 hwalllookup.h:64
 hwalllookup.h:65
 hwalllookup.h:66
 hwalllookup.h:67
 hwalllookup.h:68
 hwalllookup.h:69
 hwalllookup.h:70
 hwalllookup.h:71
 hwalllookup.h:72
 hwalllookup.h:73
 hwalllookup.h:74
 hwalllookup.h:75
 hwalllookup.h:76
 hwalllookup.h:77
 hwalllookup.h:78
 hwalllookup.h:79
 hwalllookup.h:80
 hwalllookup.h:81
 hwalllookup.h:82
 hwalllookup.h:83
 hwalllookup.h:84
 hwalllookup.h:85
 hwalllookup.h:86
 hwalllookup.h:87
 hwalllookup.h:88
 hwalllookup.h:89
 hwalllookup.h:90
 hwalllookup.h:91
 hwalllookup.h:92
 hwalllookup.h:93
 hwalllookup.h:94
 hwalllookup.h:95
 hwalllookup.h:96
 hwalllookup.h:97
 hwalllookup.h:98
 hwalllookup.h:99
 hwalllookup.h:100
 hwalllookup.h:101
 hwalllookup.h:102
 hwalllookup.h:103
 hwalllookup.h:104