HYDRA_development_version
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
hmdcraw.h
Go to the documentation of this file.
1 #ifndef HMDCRAW_H
2 #define HMDCRAW_H
3 
4 using namespace std;
5 
6 #include "TObject.h"
7 #include <cstdlib>
8 #include <iostream>
9 
10 class HMdcRaw : public TObject {
11 protected:
12  Int_t nHits; // number of hits / Tdc mode
13  Int_t time1; // time of 1st hit [binnumber]
14  Int_t time2; // time of 2nd hit [binnumber]
15  Int_t time3; // time of 3rd hit [binnumber]
16  Int_t time4; // time of 4th hit [binnumber]
17  Int_t time5; // time of 5th hit [binnumber]
18  Int_t time6; // time of 6th hit [binnumber]
19  Int_t sector; // sector number [0-5]
20  Int_t module; // module number [0-3]
21  Int_t mbo; // motherboard number [0-15]
22  Int_t tdc; // tdc number * 8 + tdc channel number [0-95]
23  Int_t nTrialsToFillHits; // number of trials to fill a time value to this cell / corresponding to nHist
24 public:
25  HMdcRaw(void) { clear(); }
26  ~HMdcRaw(void){;}
27 
28  /* enum and constants */
29  static const Int_t kDefaultValueTime ; //! default value of time
30  static const Int_t kDefaultValueSector ; //! default value of sector
31  static const Int_t kDefaultValueModule ; //! default value of module
32  static const Int_t kDefaultValueMbo ; //! default value of motherboard number
33  static const Int_t kDefaultValueTdc ; //! default value of tdc number
34 
35  enum {kFlashWire = BIT(14),
36  kDeltaElec = BIT(15)}; // Wires with calibrated t1<-10 and ToT>30
37 
38  void clear(void)
39  {
40  // reset data member to default values
41  nHits=0;
42  sector=kDefaultValueSector;
43  module=kDefaultValueModule;
44  mbo =kDefaultValueMbo;
45  tdc =kDefaultValueTdc;
46  time1=time2=time3=time4=time5=time6=kDefaultValueTime;
47  nTrialsToFillHits=0;
48  }
49 
50  void setSector(const Int_t n) { sector=n; }
51  void setModule(const Int_t n) { module=n; }
52  void setMbo(const Int_t n) { mbo=n; }
53  void setTdc(const Int_t n) { tdc=n; }
54  void setAddress(const Int_t s,const Int_t m,const Int_t mb,const Int_t t)
55  {
56  sector=s;
57  module=m;
58  mbo=mb;
59  tdc=t;
60  }
61  void setFlashWire(void) { SetBit(kFlashWire); }
62  void unsetFlashWire(void) { ResetBit(kFlashWire); }
63  void setDeltaElectWire(void) { SetBit(kDeltaElec); }
64  void unsetDeltaElect(void) { ResetBit(kDeltaElec); }
65 
66  Bool_t setTime(const Int_t,const Int_t mode=0, const Bool_t noComment = kFALSE);
67  Bool_t setTimeNew(const Int_t time, const Int_t nrtime);
68 
69  Int_t getSector(void) const { return sector; }
70  Int_t getModule(void) const { return module; }
71  Int_t getMbo(void) const { return mbo; }
72  Int_t getTdc(void) const { return tdc; }
73  void getAddress(Int_t& s,Int_t& m,Int_t& mb,Int_t& t)
74  {
75  s=sector;
76  m=module;
77  mb=mbo;
78  t=tdc;
79  }
80  Int_t getNHits(void) const { return nHits; }
81  Int_t getNTrialsToFillHits(void) const { return nTrialsToFillHits; }
82  Int_t getTime(const Int_t n) const;
83  Bool_t isFlashWire(void) { return TestBit(kFlashWire); }
84  Bool_t isDeltaElWire(void) { return TestBit(kDeltaElec); }
85 
86  ClassDef(HMdcRaw,1) // Raw hit on a MDC
87 };
88 
89 #endif /* !HMDCRAW_H */
HMdcRaw(void)
Definition: hmdcraw.h:25
Int_t mbo
Definition: hmdcraw.h:21
Int_t getMbo(void) const
Definition: hmdcraw.h:71
static const Int_t kDefaultValueMbo
default value of module
Definition: hmdcraw.h:32
void setFlashWire(void)
Definition: hmdcraw.h:61
Int_t getSector(void) const
Definition: hmdcraw.h:69
void setAddress(const Int_t s, const Int_t m, const Int_t mb, const Int_t t)
Definition: hmdcraw.h:54
void setModule(const Int_t n)
Definition: hmdcraw.h:51
Int_t time2
Definition: hmdcraw.h:14
void setDeltaElectWire(void)
Definition: hmdcraw.h:63
Bool_t isDeltaElWire(void)
Definition: hmdcraw.h:84
Int_t time4
Definition: hmdcraw.h:16
Int_t n
Int_t getModule(void) const
Definition: hmdcraw.h:70
void setSector(const Int_t n)
Definition: hmdcraw.h:50
Int_t nHits
Definition: hmdcraw.h:12
Int_t tdc
Definition: hmdcraw.h:22
static const Int_t kDefaultValueTdc
default value of motherboard number
Definition: hmdcraw.h:33
~HMdcRaw(void)
Definition: hmdcraw.h:26
Int_t time5
Definition: hmdcraw.h:17
static const Int_t kDefaultValueSector
default value of time
Definition: hmdcraw.h:30
void setMbo(const Int_t n)
Definition: hmdcraw.h:52
static const Int_t kDefaultValueModule
default value of sector
Definition: hmdcraw.h:31
void setTdc(const Int_t n)
Definition: hmdcraw.h:53
Int_t getTdc(void) const
Definition: hmdcraw.h:72
void unsetFlashWire(void)
Definition: hmdcraw.h:62
void clear(void)
Definition: hmdcraw.h:38
Int_t mode
Int_t getNTrialsToFillHits(void) const
Definition: hmdcraw.h:81
static const Int_t kDefaultValueTime
Definition: hmdcraw.h:29
Int_t module
Definition: hmdcraw.h:20
Int_t nTrialsToFillHits
Definition: hmdcraw.h:23
Int_t time1
Definition: hmdcraw.h:13
Int_t getNHits(void) const
Definition: hmdcraw.h:80
void getAddress(Int_t &s, Int_t &m, Int_t &mb, Int_t &t)
Definition: hmdcraw.h:73
Int_t sector
Definition: hmdcraw.h:19
Int_t time3
Definition: hmdcraw.h:15
Int_t time6
Definition: hmdcraw.h:18
Bool_t isFlashWire(void)
Definition: hmdcraw.h:83
void unsetDeltaElect(void)
Definition: hmdcraw.h:64