GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BufferGANIL.h
Go to the documentation of this file.
1 #ifndef GW_BUFFERGANIL_H
2 #define GW_BUFFERGANIL_H
3 
4 #define DATELENGTH 30
5 
6 #include <TString.h>
7 #include <map>
8 
22 {
23 public:
24 
25  static const Int_t BYTE;
26  static const Int_t KBYTE;
27  static const Int_t MBYTE;
28  static const Int_t GBYTE;
29  static const unsigned short fStartEventToken;
30  static const unsigned short fEndDataBlockToken;
31 
32 private:
33  int fRun; // run number associated with this buffer
34  int fBlock; // block number associated with this buffer
35  char fDate[DATELENGTH]; // date of the creation of the buffer
36 
37  short fNbEvents; // number of events written in this block
38  int fEventsSize; // size (in 2 byes unit) of events written in this block
39  short fNbEventsR; // number of events read from this block
40  int fEventsSizeR; // size (in 2 byes unit) of events read from this block
41 
42  int fEventSize; // size of the current event
43  int fSubEvtIndex; // curent sub event index
44  unsigned short fEvent[16384]; // buffer to hold the current event
45 
46 
47  Char_t *fBuffer; // buffer to be scanned
48 
49 public:
50  BufferGANIL(size_t s = 16*KBYTE);
51  ~BufferGANIL();
52 
53  bool IsType(const char *);
54 
55  int GetRun() const;
56  void SetRun(int run) { fRun = run;}
57  const char *GetDate() const;
58 
59  Char_t* GetBuffer();
60 
61  bool InitReading();
62  unsigned short * NextEvent(unsigned short &);
63 
64 public:
65 
66  static std::map<UShort_t, TString>* fgMap;
67 
68  static const Char_t* GetModuleName(UShort_t add);
69  static void InitTable(Char_t *);
70  static void InitTable(TString& data);
71 };
72 
73 // BufferGANIL inline members /////////////////////////////////////////////////
74 inline Char_t* BufferGANIL::GetBuffer() { return fBuffer; }
75 inline int BufferGANIL::GetRun() const { return fRun; }
76 inline const char *BufferGANIL::GetDate() const { return fDate; }
79 
80 
81 #endif
static const Int_t MBYTE
Definition: BufferGANIL.h:27
#define DATELENGTH
Definition: BufferGANIL.h:4
static const Int_t BYTE
Definition: BufferGANIL.h:25
static std::map< UShort_t, TString > * fgMap
Definition: BufferGANIL.h:66
static void InitTable(Char_t *)
Definition: BufferGANIL.C:49
BufferGANIL(size_t s=16 *KBYTE)
Definition: BufferGANIL.C:26
bool InitReading()
Definition: BufferGANIL.C:91
static const Int_t GBYTE
Definition: BufferGANIL.h:28
int GetRun() const
Definition: BufferGANIL.h:75
static const unsigned short fEndDataBlockToken
Definition: BufferGANIL.h:30
static const Int_t KBYTE
Definition: BufferGANIL.h:26
static const unsigned short fStartEventToken
Definition: BufferGANIL.h:29
unsigned short * NextEvent(unsigned short &)
Definition: BufferGANIL.C:137
bool IsType(const char *)
Definition: BufferGANIL.C:41
void SetRun(int run)
Definition: BufferGANIL.h:56
Char_t * GetBuffer()
Definition: BufferGANIL.h:74
Simple Class thats decode Ganil DAQ format for simple VME module as QDC, ADC, TDC, etc...
Definition: BufferGANIL.h:21
static const Char_t * GetModuleName(UShort_t add)
Definition: BufferGANIL.C:84
const char * GetDate() const
Definition: BufferGANIL.h:76