Line data Source code
1 : #ifndef ALIEMCALTRIGGERSTURAWSTREAM_H
2 : #define ALIEMCALTRIGGERSTURAWSTREAM_H
3 : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 : * See cxx source for full Copyright notice */
5 :
6 : /*
7 : Author: H. Yokoyama (Univ. of TSUKUBA/ Univ. of Grenoble)
8 : */
9 :
10 : #ifndef ROOT_TObject
11 : # include "TObject.h"
12 : #endif
13 : //#include <map>
14 :
15 : class AliRawReader;
16 :
17 : class AliEMCALTriggerSTURawStream: public TObject
18 : {
19 : public:
20 : AliEMCALTriggerSTURawStream();
21 : AliEMCALTriggerSTURawStream(AliRawReader* rawReader);
22 : virtual ~AliEMCALTriggerSTURawStream();
23 :
24 :
25 0 : virtual void SetDetector(int det){fDetector = static_cast<fDetType>(det);}
26 0 : virtual Int_t GetDetector(){return static_cast<Int_t>(fDetector) ;}
27 :
28 : virtual void Reset();
29 : virtual Bool_t ReadPayLoad();
30 :
31 : virtual void DumpPayLoad(const Option_t *option = "ALL") const;
32 :
33 : virtual void GetADC( Int_t iTRU, UInt_t ADC[] );
34 : virtual void GetPHOSSubregion( UInt_t PHOSSubregion[] );
35 0 : virtual UInt_t GetL1JetThreshold( const int i) const {return fL1JetThreshold [i];}
36 0 : virtual UInt_t GetL1GammaThreshold(const int i) const {return fL1GammaThreshold[i];}
37 :
38 0 : virtual Int_t GetNL0GammaPatch() const {return fNL0GammaPatch ;}
39 0 : virtual Int_t GetNL1GammaPatch( const int i) const {return fNL1GammaPatch[i] ;}
40 0 : virtual Int_t GetNL1JetPatch( const int i) const {return fNL1JetPatch [i] ;}
41 :
42 : virtual Bool_t GetL0GammaPatch(const Int_t i, Int_t& x, Int_t& y ) const;
43 : virtual Bool_t GetL1GammaPatch(const Int_t i, const Int_t j, Int_t& x, Int_t& y, Int_t& z) const;
44 : virtual Bool_t GetL1JetPatch( const Int_t i, const Int_t j, Int_t& x, Int_t& y ) const;
45 :
46 0 : virtual UInt_t GetV0A() const {return fV0A ;}
47 0 : virtual UInt_t GetV0C() const {return fV0C ;}
48 0 : virtual UInt_t GetG(int i, int j) const {return fG[i][j] ;}//[ABC][high/low]
49 0 : virtual UInt_t GetJ(int i, int j) const {return fJ[i][j] ;}//[ABC][high/low]
50 0 : virtual UInt_t GetPHOSScale(int i) const {return fS[i] ;}
51 0 : virtual UInt_t GetRho() const {return fRho ;}
52 0 : virtual UInt_t GetRegionEnable() const {return fRegionEnable ;}
53 0 : virtual UInt_t GetFrameReceived() const {return fFrameReceived ;}
54 0 : virtual UInt_t GetFwVersion() const {return fFwVersion ;}
55 0 : virtual UInt_t GetPatchSize() const {return fPatchSize ;}
56 0 : virtual Int_t GetRawData() const {return fGetRawData ;}
57 0 : virtual Int_t GetnTRU() const {return (fDetector==kEMCAL)?nTRU_EMCAL:(fDetector==kDCAL)?nTRU_DCAL:0;}
58 :
59 : private:
60 :
61 : AliEMCALTriggerSTURawStream(const AliEMCALTriggerSTURawStream& rhs);
62 : AliEMCALTriggerSTURawStream& operator = (const AliEMCALTriggerSTURawStream& rhs);
63 :
64 : UShort_t GetThreshold(Short_t A, Short_t B, Short_t C, UShort_t V0A, UShort_t V0C) const;
65 :
66 : AliRawReader* fRawReader; // object for reading the raw data
67 :
68 : enum fDetType {
69 : kEMCAL = 0,
70 : kDCAL = 1
71 : };
72 :
73 : enum fPayloadType {
74 : V0 = 0 ,
75 : V0Raw = 1 ,
76 : V1 = 2 ,
77 : V1Raw = 3 ,
78 : V1_2 = 8 ,
79 : V1_2Raw = 9 ,
80 :
81 : V2EMCAL = 4 ,
82 : V2EMCALRaw = 5 ,
83 : V2DCAL = 6 ,
84 : V2DCALRaw = 7 ,
85 : def = 8
86 : };
87 :
88 : fDetType fDetector ;//Set by function
89 : Int_t fGetRawData ;//Set by word size
90 : fPayloadType fPayload ;//Set by word size
91 :
92 : static const Int_t kPayLoadSizeV0 = 236 ;
93 : static const Int_t kPayLoadSizeV0_Raw = 1536 ;
94 : static const Int_t kPayLoadSizeV1 = 245 ;
95 : static const Int_t kPayLoadSizeV1_Raw = 1536 ;
96 : //XXX
97 : static const Int_t kPayLoadSizeV1_2 = 390 ;
98 : static const Int_t kPayLoadSizeV1_2_Raw = 1536 ;
99 :
100 : static const Int_t kPayLoadSizeV2_EMCAL = 391 ;//17+11+11+96+128+128
101 : static const Int_t kPayLoadSizeV2_EMCAL_Raw = 1536 ;//96*32/2
102 : static const Int_t kPayLoadSizeV2_DCAL = 197 ;//21+11+11+42+ 56+ 56
103 : static const Int_t kPayLoadSizeV2_DCAL_Raw = 708 ;//96*14/2 +36
104 :
105 : static const Int_t max_payload_size = 1937 ;
106 :
107 : static const Int_t max_L0GammaPatchIndex = 3100 ; // (48-1)*(64-1) = 2961 (EMCAL)
108 : // (48-1)*(40-1) = 1833 (DCAL)
109 : static const Int_t max_L1Gamma = 2 ; // L1Gamma_low,high (EMCAL)
110 : static const Int_t max_L1GammaPatchIndex = 3100 ; // (48-1)*(64-1) = 2961 (EMCAL)
111 : // (48-1)*(40-1) = 1833 (DCAL)
112 : static const Int_t max_L1Jet = 2 ; // L1Jet_low,high (EMCAL,DCAL)
113 : static const Int_t max_L1JetPatchIndex = 200 ; // (12-1)*(16-1) = 165 (EMCAL)
114 : // (12-1)*(10-1) = 99 (DCAL)
115 :
116 : static const Int_t max_nTRU = 32 ; // 32 (EMCAL)
117 : // 14 (DCAL)
118 : static const Int_t max_nmoduleInTRU = 96 ; // 96 (EMCAL)
119 : // 96 (DCAL)
120 :
121 : static const Int_t nTRU_EMCAL = 32 ;
122 : static const Int_t nTRU_DCAL = 14 ;
123 :
124 : static const Int_t nMod_EMCAL = 96 ;
125 : static const Int_t nMod_DCAL = 96 ;
126 :
127 : static const Int_t nSubregion_eta_EMCAL = 12 ;
128 : static const Int_t nSubregion_phi_EMCAL = 16 ;
129 :
130 : static const Int_t nSubregion_eta_DCAL = 12 ;
131 : static const Int_t nSubregion_phi_DCAL = 10 ;
132 :
133 :
134 : Int_t fNL0GammaPatch ; // N L0 Gamma Patch
135 : UShort_t fL0GammaPatchIndex[max_L0GammaPatchIndex] ; // L0 Gamma Patch Index
136 :
137 : Int_t fNL1GammaPatch [max_L1Gamma]; // N L1 Gamma Patch
138 : UInt_t fG [3][max_L1Gamma]; // Gamma threshold parameter:A,B,C
139 : UInt_t fL1GammaThreshold [max_L1Gamma]; // L1 Gamma Threshold
140 : UShort_t fL1GammaPatchIndex[max_L1GammaPatchIndex][max_L1Gamma]; // L1 Gamma Patch Index
141 :
142 : Int_t fNL1JetPatch [max_L1Jet] ; // N L1 Jet Patch
143 : UInt_t fJ [3][max_L1Jet] ; // Jet threshold parameter:A,B,C
144 : UInt_t fL1JetThreshold [max_L1Jet] ; // L1 Jet Threshold
145 : UShort_t fL1JetPatchIndex[max_L1JetPatchIndex][max_L1Jet] ; // L1 Jet Patch Index
146 :
147 : UInt_t fADC[max_nTRU][max_nmoduleInTRU];
148 : UInt_t fPHOSSubregion[36];
149 :
150 : UInt_t fV0A ; // V0A
151 : UInt_t fV0C ; // V0C
152 : UInt_t fS[4] ; // PHOS Scale parameter
153 : UInt_t fRho ; // background Rho
154 : UInt_t fPatchSize ; // jet patch size
155 :
156 : UInt_t fRegionEnable ; // Region Enable
157 : UInt_t fFrameReceived ; // Frame Received
158 : UInt_t fFwVersion ; // Fw Version
159 :
160 0 : Int_t GetnMod()const{ return (fDetector == kEMCAL)? nMod_EMCAL :
161 0 : (fDetector == kDCAL )? nMod_DCAL :
162 : 0 ;
163 : }
164 :
165 :
166 :
167 : virtual void DecodeL1JetPatchIndexes( const int i, UInt_t *word32, const int offset);
168 : virtual void DecodeL1GammaPatchIndexes(const int i, UInt_t *word32, const int offset);
169 : virtual void DecodeL0GammaPatchIndexes( UInt_t *word32, const int offset);
170 : virtual void DecodeTRUADC( UInt_t *word32, const int offset);
171 : virtual void DecodePHOSSubregion( UInt_t *word32, const int offset);
172 :
173 :
174 42 : ClassDef(AliEMCALTriggerSTURawStream,2) // class for reading EMCAL STU DDL raw data
175 : };
176 :
177 : #endif
|