HYDRA_development_version
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
hrichunpacker.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////
2 //
3 // $Id: $
4 //
5 //*-- Author : Martin Jurkovic <martin.jurkovic@ph.tum.de>
6 //*-- Revised : Martin Jurkovic <martin.jurkovic@ph.tum.de> 2010
7 //
8 //_HADES_CLASS_DESCRIPTION
9 //////////////////////////////////////////////////////////////////////////////
10 //
11 // HRichUnpacker
12 //
13 //
14 //////////////////////////////////////////////////////////////////////////////
15 
16 
17 #ifndef HRichUnpacker_H
18 #define HRichUnpacker_H
19 
20 #include "hldunpack.h"
21 
22 class HCategory;
23 class HRichMappingPar;
24 
25 
26 class HRichUnpacker : public HldUnpack {
27 
28 protected:
29 
30  static const UInt_t kHubDebugId; //! Identification of debug "subsubevent"
31  static const UInt_t kADCZero; //! ADC module ZERO offset
32 
33  UInt_t fRichId; //! current event #
34  UInt_t fEventNr; //! current event #
35  UInt_t fStartEvt; //! start unpacking with event #
36  UInt_t fSecMisMatchCntr; //!
37 
38  struct DataWord {
39  UInt_t sector;
40  UInt_t adc;
41  UInt_t apv;
42  UInt_t channel;
43  UInt_t charge;
44  } fDataWord; //! structure for channel address
45 
46  HCategory* fpCalCat; //!
48 
49 
50 private:
51 
52  void printDataWord(const DataWord& addr);
53  void printMapping(const DataWord& addr);
54 
55  inline Int_t getAddress(const DataWord& addr) const;
56 
57 public:
58  HRichUnpacker(Int_t richId,
59  Int_t strtEvt = 0);
61 
62  Bool_t init(void);
63  Int_t execute(void);
64  Bool_t finalize();
65 
66  inline Int_t getSubEvtId() ;
67 
68  ClassDef(HRichUnpacker, 0) // Unpack RICH data
69 };
70 
71 
72 inline Int_t
74 {
75  return static_cast<Int_t>((addr.adc << 11) + (addr.apv << 7) + addr.channel);
76 }
77 
78 inline Int_t
80 {
81  return fRichId;
82 }
83 
84 class DHeader {
85 
86 private:
87  Bool_t fEmpty;
88  UInt_t fSize;
89  UInt_t fSource;
90 
91 public:
92  DHeader();
93  ~DHeader() {}
94 
95  void reset();
96  void getEvent(UInt_t word);
97  void dump();
98 
99  Bool_t empty() const {
100  return fEmpty;
101  }
102  UInt_t getSize() const {
103  return fSize;
104  }
105  UInt_t getSource() const {
106  return fSource;
107  }
108 
109 };
110 
111 #endif /* !HRichUnpacker */
112 
HRichUnpacker(Int_t richId, Int_t strtEvt=0)
HCategory * fpCalCat
structure for channel address
Definition: hrichunpacker.h:46
UInt_t fSecMisMatchCntr
start unpacking with event #
Definition: hrichunpacker.h:36
static const UInt_t kHubDebugId
Definition: hrichunpacker.h:30
UInt_t getSize() const
HRichMappingPar * fpMapPar
Definition: hrichunpacker.h:47
UInt_t getSource() const
static const UInt_t kADCZero
Identification of debug "subsubevent".
Definition: hrichunpacker.h:31
Bool_t finalize()
Int_t execute(void)
void getEvent(UInt_t word)
void reset()
UInt_t fStartEvt
current event #
Definition: hrichunpacker.h:35
Int_t getAddress(const DataWord &addr) const
Definition: hrichunpacker.h:73
Bool_t empty() const
Definition: hrichunpacker.h:99
UInt_t fEventNr
current event #
Definition: hrichunpacker.h:34
Int_t getSubEvtId()
Definition: hrichunpacker.h:79
UInt_t fSource
Definition: hrichunpacker.h:89
void printMapping(const DataWord &addr)
void printDataWord(const DataWord &addr)
void dump()
struct HRichUnpacker::DataWord fDataWord
UInt_t fSize
Definition: hrichunpacker.h:88
Bool_t init(void)
Bool_t fEmpty
Definition: hrichunpacker.h:87
UInt_t fRichId
ADC module ZERO offset.
Definition: hrichunpacker.h:33