ROOT logo
#ifndef HMDCTDCTHRESHOLD_H
#define HMDCTDCTHRESHOLD_H

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

class HMdcRawStruct;

class HMdcTdcThresholdDbo : public TObject {
protected:
    Int_t threshold;   // threshold of the two tdc of one DBO
public:
    HMdcTdcThresholdDbo() : threshold(-1){;}
    ~HMdcTdcThresholdDbo() {;}
    Int_t getThreshold()             {return threshold;}
    void setThreshold(Int_t thresh)  {threshold = thresh;}
    void fill(HMdcTdcThresholdDbo&);
    void clear() {
      threshold = -1;
    }
    ClassDef(HMdcTdcThresholdDbo,1) // Tdc level of the MDC calibration parameters
};


class HMdcTdcThresholdMbo : public TNamed {
protected:
    TObjArray *array; // array of pointers of type HMdcTdcThresholdDbo
public:
    HMdcTdcThresholdMbo(Int_t dbo = 6,const Text_t* name="");
    ~HMdcTdcThresholdMbo();
    HMdcTdcThresholdDbo& operator[](Int_t i) {
      return *static_cast<HMdcTdcThresholdDbo*>((*array)[i]);
    }
    Int_t getSize() {return array->GetEntries();}
    ClassDef(HMdcTdcThresholdMbo,1) // Mbo level of the MDC calibration parameters
};

class HMdcTdcThresholdMod : public TObject {
protected:
    TObjArray *array;   // array of pointers of type HMdcTdcThresholdMbo
public:
    HMdcTdcThresholdMod(Int_t mbo = 16);
    ~HMdcTdcThresholdMod();
    HMdcTdcThresholdMbo& operator[](Int_t i) {
      return *static_cast<HMdcTdcThresholdMbo*>((*array)[i]);
    }
    Int_t getSize() {return array->GetEntries();}
    void createMbo(Int_t, Int_t, const Char_t*);
    ClassDef(HMdcTdcThresholdMod,1) // Module level of the MDC calibration parameters
};

class HMdcTdcThresholdSec : public TObject {
protected:
    TObjArray* array;   // array of pointers of type HMdcTdcThresholdMod

public:
    HMdcTdcThresholdSec(Int_t mod = 4);
    ~HMdcTdcThresholdSec();
    HMdcTdcThresholdMod& operator[](Int_t i) {
      return *static_cast<HMdcTdcThresholdMod*>((*array)[i]);
    }
    Int_t getSize() {return array->GetEntries();}
    ClassDef(HMdcTdcThresholdSec,1) // Sector level of the MDC calibration parameters
};

class HMdcTdcThreshold : public HParSet {
protected:
    TObjArray* array;          // array of pointers of type HMdcTdcThresholdSec
    Int_t oraVersion;          // parameter version in Oracle
    HMdcRawStruct* pRawStruct; //! pointer to parameter container MdcRawStruct
    Int_t status;              //! Status of parameters (usable for DAQ?)

public:
    HMdcTdcThreshold(const Char_t* name="MdcTdcThreshold",
                  const Char_t* title="threshold parameters for Mdc",
                  const Char_t* context="MdcTdcThresholdProduction",
                  Int_t n=6);
    ~HMdcTdcThreshold();
    HMdcTdcThresholdSec& operator[](Int_t i) {
        return *static_cast<HMdcTdcThresholdSec*>((*array)[i]);
    }
    void fill(Int_t sector, Int_t module, Int_t mbo, Int_t dbo,Int_t th){
        ((HMdcTdcThresholdSec *)((*array)[0]))[sector][module][mbo][dbo].setThreshold(th);
    }
    Int_t getSize() {return array->GetEntries();}
    Bool_t init(HParIo*, Int_t*);
    Int_t write(HParIo*);
    void readline(const Char_t*, Int_t*);
    void readlinefromfile(const Char_t*);
    void writelinetofile(Char_t* buf, Int_t sec, Int_t mod, Int_t mbo, Int_t dbo);
    void addvalue(Int_t);
    void putAsciiHeader(TString&);
    Bool_t writeline(Char_t*, Int_t, Int_t, Int_t, Int_t);
    void clear();
    void printParam();
    void setOraVersion(Int_t v) { oraVersion=v;}
    void setStatus(Int_t stat){status = stat;};
    Int_t getStatus(void){return status;};
    Int_t getOraVersion() { return oraVersion; }
    ClassDef(HMdcTdcThreshold,4) // Container for the MDC threshold parameters on raw level
};

#endif  /*!HMDCTDCTHRESHOLD_H*/

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