ROOT logo
#ifndef HMDCRAW_H
#define HMDCRAW_H

using namespace std;

#include "TObject.h"
#include <cstdlib>
#include <iostream>

class HMdcRaw : public TObject {
protected:
    Int_t nHits;  // number of hits / Tdc mode
    Int_t time1;  // time of 1st hit [binnumber]
    Int_t time2;  // time of 2nd hit [binnumber]
    Int_t time3;  // time of 3rd hit [binnumber]
    Int_t time4;  // time of 4th hit [binnumber]
    Int_t time5;  // time of 5th hit [binnumber]
    Int_t time6;  // time of 6th hit [binnumber]
    Int_t sector; // sector number   [0-5]
    Int_t module; // module number   [0-3]
    Int_t mbo;    // motherboard number [0-15]
    Int_t tdc;    // tdc number * 8 + tdc channel number [0-95]
    Int_t nTrialsToFillHits; // number of trials to fill a time value to this cell / corresponding to nHist
public:
    HMdcRaw(void) { clear(); }
    ~HMdcRaw(void){;}

    /* enum and constants */
    static const Int_t kDefaultValueTime   ; //! default value of time
    static const Int_t kDefaultValueSector ; //! default value of sector
    static const Int_t kDefaultValueModule ; //! default value of module
    static const Int_t kDefaultValueMbo    ; //! default value of motherboard number
    static const Int_t kDefaultValueTdc    ; //! default value of tdc number
    
    enum {kFlashWire = BIT(14),
          kDeltaElec = BIT(15)};        // Wires with calibrated t1<-10 and ToT>30

    void clear(void)
      {
	// reset data member to default values
	nHits=0;
	sector=kDefaultValueSector;
	module=kDefaultValueModule;
	mbo   =kDefaultValueMbo;
	tdc   =kDefaultValueTdc;
	time1=time2=time3=time4=time5=time6=kDefaultValueTime;
        nTrialsToFillHits=0;
      }

    void setSector(const Int_t n) { sector=n; }
    void setModule(const Int_t n) { module=n; }
    void setMbo(const Int_t n)    { mbo=n; }
    void setTdc(const Int_t n)    { tdc=n; }
    void setAddress(const Int_t s,const Int_t m,const Int_t mb,const Int_t t)
      {
	sector=s;
	module=m;
	mbo=mb;
	tdc=t;
      }
    void setFlashWire(void)      { SetBit(kFlashWire); }
    void unsetFlashWire(void)    { ResetBit(kFlashWire); }
    void setDeltaElectWire(void) { SetBit(kDeltaElec); }
    void unsetDeltaElect(void)   { ResetBit(kDeltaElec); }

    Bool_t setTime(const Int_t,const Int_t mode=0, const Bool_t noComment = kFALSE);
    Bool_t setTimeNew(const Int_t time, const Int_t nrtime);

    Int_t getSector(void) const { return sector; }
    Int_t getModule(void) const { return module; }
    Int_t getMbo(void) const    { return mbo; }
    Int_t getTdc(void) const    { return tdc; }
    void getAddress(Int_t& s,Int_t& m,Int_t& mb,Int_t& t)
      {
	s=sector;
	m=module;
	mb=mbo;
	t=tdc;
      }
    Int_t getNHits(void) const  { return nHits; }
    Int_t getNTrialsToFillHits(void) const { return nTrialsToFillHits; }
    Int_t getTime(const Int_t n) const;
    Bool_t isFlashWire(void)   { return TestBit(kFlashWire); }
    Bool_t isDeltaElWire(void) { return TestBit(kDeltaElec); }

    ClassDef(HMdcRaw,1) // Raw hit on a MDC
};

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