ROOT logo
#ifndef HMDCLOOKUPGEOM_H
#define HMDCLOOKUPGEOM_H

#include "TNamed.h"
#include "TObjArray.h"
#include "hparset.h"

class HParIo;

class HMdcLookupChan: public TObject {
protected:
  Int_t  nLayer;      // number of the layer
  Int_t  nCell;       // number of the cell
  Char_t readoutSide; // side, where the signal is read out
public:
  HMdcLookupChan(Int_t nl=-1,Int_t nc=-1, Char_t s='0') {
    nLayer=nl;
    nCell=nc;
    readoutSide=s;
  }
  ~HMdcLookupChan() {}
  void setNLayer(Int_t l) {nLayer=l;}
  void setNCell(Int_t c) {nCell=c;}
  void setReadoutSide(Char_t s) {
    readoutSide=(s=='L'||s=='R'||s=='U') ? s : '0';
  }
  void fill(Int_t l,Int_t c,Char_t s) {
    nLayer=l;
    nCell=c;
    setReadoutSide(s);
  }
  void fill(HMdcLookupChan& r) {
    nLayer=r.getNLayer();
    nCell=r.getNCell();
    readoutSide=r.getReadoutSide();
  }
  Int_t getNLayer() {return nLayer;}
  Int_t getNCell() {return nCell;}
  Char_t getReadoutSide() {return readoutSide;}
  void clear() {
    nLayer=-1;
    nCell=-1;
    readoutSide='0';
  }
  ClassDef(HMdcLookupChan,2) // Channel level of MDC lookup table (channel->wire)
};


class HMdcLookupMoth: public TNamed {
protected:
  TObjArray* array;
public:
  HMdcLookupMoth(Int_t n=0,const Text_t* name="");
  ~HMdcLookupMoth();
  HMdcLookupChan& operator[](Int_t i) {
    return *static_cast<HMdcLookupChan*>((*array)[i]);
  }
  Int_t getSize() {return array->GetEntries();}
  ClassDef(HMdcLookupMoth,1) // Motherboard level of MDC lookup table (channel->wire)
};


class HMdcLookupGMod: public TObject {
protected:
  TObjArray* array;
public:
  HMdcLookupGMod(Int_t n=16);
  ~HMdcLookupGMod();
  HMdcLookupMoth& operator[](Int_t i) {
    return *static_cast<HMdcLookupMoth*>((*array)[i]);
  }
  Int_t getSize() {return array->GetEntries();}
  void createMoth(Int_t, Int_t, const Char_t*);
  ClassDef(HMdcLookupGMod,1) // Module level of MDC lookup table (channel->wire)
};


class HMdcLookupGSec: public TObject {
protected:
  TObjArray* array;
  Int_t sector;
public:
  HMdcLookupGSec(Int_t n=4);
  ~HMdcLookupGSec();
  HMdcLookupGMod& operator[](Int_t i) {
    return *static_cast<HMdcLookupGMod*>((*array)[i]);
  }
  Int_t getSize() {return array->GetEntries();}
  ClassDef(HMdcLookupGSec,1) // Sector level of MDC lookup table (channel->wire)
};


class HMdcLookupGeom : public HParSet {
protected:
  TObjArray* array;     // array of pointers
public:
  HMdcLookupGeom(const Char_t* name="MdcLookupGeom",
                 const Char_t* title="Mdc lookup table from raw to cal1",
                 const Char_t* context="",
                 Int_t n=6);
  ~HMdcLookupGeom();
  HMdcLookupGSec& operator[](Int_t i) {
    return *static_cast<HMdcLookupGSec*>((*array)[i]);
  }
  Bool_t init(HParIo* input,Int_t* set);
  Int_t write(HParIo* output);
  void readline(const Char_t*, Int_t*);
  void putAsciiHeader(TString&);
  Bool_t writeline(Char_t *, Int_t, Int_t, Int_t, Int_t);
  Int_t getSize() {return array->GetEntries();}
  void clear();
  void printParam();
  ClassDef(HMdcLookupGeom,1) //  MDC lookup table (channel->wire)
};

#endif /* !HMDCLOOKUPGEOM_H */














 hmdclookupgeom.h:1
 hmdclookupgeom.h:2
 hmdclookupgeom.h:3
 hmdclookupgeom.h:4
 hmdclookupgeom.h:5
 hmdclookupgeom.h:6
 hmdclookupgeom.h:7
 hmdclookupgeom.h:8
 hmdclookupgeom.h:9
 hmdclookupgeom.h:10
 hmdclookupgeom.h:11
 hmdclookupgeom.h:12
 hmdclookupgeom.h:13
 hmdclookupgeom.h:14
 hmdclookupgeom.h:15
 hmdclookupgeom.h:16
 hmdclookupgeom.h:17
 hmdclookupgeom.h:18
 hmdclookupgeom.h:19
 hmdclookupgeom.h:20
 hmdclookupgeom.h:21
 hmdclookupgeom.h:22
 hmdclookupgeom.h:23
 hmdclookupgeom.h:24
 hmdclookupgeom.h:25
 hmdclookupgeom.h:26
 hmdclookupgeom.h:27
 hmdclookupgeom.h:28
 hmdclookupgeom.h:29
 hmdclookupgeom.h:30
 hmdclookupgeom.h:31
 hmdclookupgeom.h:32
 hmdclookupgeom.h:33
 hmdclookupgeom.h:34
 hmdclookupgeom.h:35
 hmdclookupgeom.h:36
 hmdclookupgeom.h:37
 hmdclookupgeom.h:38
 hmdclookupgeom.h:39
 hmdclookupgeom.h:40
 hmdclookupgeom.h:41
 hmdclookupgeom.h:42
 hmdclookupgeom.h:43
 hmdclookupgeom.h:44
 hmdclookupgeom.h:45
 hmdclookupgeom.h:46
 hmdclookupgeom.h:47
 hmdclookupgeom.h:48
 hmdclookupgeom.h:49
 hmdclookupgeom.h:50
 hmdclookupgeom.h:51
 hmdclookupgeom.h:52
 hmdclookupgeom.h:53
 hmdclookupgeom.h:54
 hmdclookupgeom.h:55
 hmdclookupgeom.h:56
 hmdclookupgeom.h:57
 hmdclookupgeom.h:58
 hmdclookupgeom.h:59
 hmdclookupgeom.h:60
 hmdclookupgeom.h:61
 hmdclookupgeom.h:62
 hmdclookupgeom.h:63
 hmdclookupgeom.h:64
 hmdclookupgeom.h:65
 hmdclookupgeom.h:66
 hmdclookupgeom.h:67
 hmdclookupgeom.h:68
 hmdclookupgeom.h:69
 hmdclookupgeom.h:70
 hmdclookupgeom.h:71
 hmdclookupgeom.h:72
 hmdclookupgeom.h:73
 hmdclookupgeom.h:74
 hmdclookupgeom.h:75
 hmdclookupgeom.h:76
 hmdclookupgeom.h:77
 hmdclookupgeom.h:78
 hmdclookupgeom.h:79
 hmdclookupgeom.h:80
 hmdclookupgeom.h:81
 hmdclookupgeom.h:82
 hmdclookupgeom.h:83
 hmdclookupgeom.h:84
 hmdclookupgeom.h:85
 hmdclookupgeom.h:86
 hmdclookupgeom.h:87
 hmdclookupgeom.h:88
 hmdclookupgeom.h:89
 hmdclookupgeom.h:90
 hmdclookupgeom.h:91
 hmdclookupgeom.h:92
 hmdclookupgeom.h:93
 hmdclookupgeom.h:94
 hmdclookupgeom.h:95
 hmdclookupgeom.h:96
 hmdclookupgeom.h:97
 hmdclookupgeom.h:98
 hmdclookupgeom.h:99
 hmdclookupgeom.h:100
 hmdclookupgeom.h:101
 hmdclookupgeom.h:102
 hmdclookupgeom.h:103
 hmdclookupgeom.h:104
 hmdclookupgeom.h:105
 hmdclookupgeom.h:106
 hmdclookupgeom.h:107
 hmdclookupgeom.h:108
 hmdclookupgeom.h:109
 hmdclookupgeom.h:110
 hmdclookupgeom.h:111
 hmdclookupgeom.h:112
 hmdclookupgeom.h:113
 hmdclookupgeom.h:114
 hmdclookupgeom.h:115
 hmdclookupgeom.h:116
 hmdclookupgeom.h:117
 hmdclookupgeom.h:118
 hmdclookupgeom.h:119
 hmdclookupgeom.h:120
 hmdclookupgeom.h:121
 hmdclookupgeom.h:122
 hmdclookupgeom.h:123
 hmdclookupgeom.h:124
 hmdclookupgeom.h:125
 hmdclookupgeom.h:126
 hmdclookupgeom.h:127
 hmdclookupgeom.h:128
 hmdclookupgeom.h:129
 hmdclookupgeom.h:130