]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ZDC/AliZDCRawStream.h
Fixing the decoding of regional header bits.
[u/mrichter/AliRoot.git] / ZDC / AliZDCRawStream.h
1 #ifndef ALIZDCRAWSTREAM_H
2 #define ALIZDCRAWSTREAM_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 //////////////////////////////////////////////////
9 //                                              //
10 //  Class to provide access to ZDC raw data     //
11 //  Author: Chiara Oppedisano                   //
12 //                                              //
13 //////////////////////////////////////////////////
14
15 #include <TObject.h>
16
17 class AliRawReader;
18 class AliRawDataHeader;
19
20
21 class AliZDCRawStream: public TObject {
22   public :
23     AliZDCRawStream(AliRawReader* rawReader); 
24     virtual ~AliZDCRawStream();
25     virtual Bool_t   Next();
26
27     virtual void ReadCDHHeader();
28     virtual void DecodeScaler() {;}
29
30     UInt_t    GetRawBuffer()    const {return fBuffer;}
31     
32     Int_t GetDeadfaceOffset() const {return fDeadfaceOffset;}
33     Int_t GetDeadbeefOffset() const {return fDeadbeefOffset;}
34     Int_t GetDataOffset()     const {return fDataOffset;}
35
36     Int_t GetSector(Int_t i) const {return fSector[i];}
37     Int_t GetModType()       const {return fModType;}
38     Int_t GetADCModule()     const {return fADCModule;}
39     Int_t GetADCNChannels()  const {return fADCNChannels;}
40     Int_t GetADCChannel()    const {return fADCChannel;}
41     Int_t GetADCValue()      const {return fADCValue;}
42     Int_t GetADCGain()       const {return fADCGain;}
43
44     Int_t GetCabledSignal()  const {return fCabledSignal;}
45
46     Bool_t  IsDARCHeader()  const {return fIsDARCHeader;}
47     Bool_t  IsChMapping()   const {return fIsChMapping;}
48     Bool_t  IsADCDataWord() const {return fIsADCDataWord;}
49     Bool_t  IsADCHeader()   const {return fIsADCHeader;}
50     Bool_t  IsADCEOB()      const {return fIsADCEOB;}
51
52     void SetSector(Int_t i, Int_t val) {fSector[i] = val;}
53     void SetMapADCMod(Int_t iraw, Int_t imod) {fMapADC[iraw][0]=imod;}
54     void SetMapADCCh(Int_t iraw, Int_t ich) {fMapADC[iraw][1]=ich;}
55     void SetMapADCSig(Int_t iraw, Int_t isig) {fMapADC[iraw][2]=isig;}
56     
57     enum EZDCRawStreamError{
58        kCDHError = 1,
59        kDARCError = 2,
60        kZDCDataError = 3,
61        kInvalidADCModule = 4
62     };
63
64     enum ZDCSignal{kNotConnected=0, kVoid=1,
65          kZNAC=2, kZNA1=3, kZNA2=4, kZNA3=5, kZNA4=6,
66          kZPAC=7, kZPA1=8, kZPA2=9, kZPA3=10, kZPA4=11,
67          kZNCC=12, kZNC1=13, kZNC2=14, kZNC3=15, kZNC4=16,
68          kZPCC=17, kZPC1=18, kZPC2=19, kZPC3=20, kZPC4=21,
69          kZEM1=22, kZEM2=23,
70          kZDCAMon=24, kZDCCMon=25,
71          kZNACoot=26, kZNA1oot=27, kZNA2oot=28, kZNA3oot=29, kZNA4oot=30,
72          kZPACoot=31, kZPA1oot=32, kZPA2oot=33, kZPA3oot=34, kZPA4oot=35,
73          kZNCCoot=36, kZNC1oot=37, kZNC2oot=38, kZNC3oot=39, kZNC4oot=40,
74          kZPCCoot=41, kZPC1oot=42, kZPC2oot=43, kZPC3oot=44, kZPC4oot=45,
75          kZEM1oot=46, kZEM2oot=47,
76          kZDCAMonoot=48, kZDCCMonoot=49};
77     
78   private :
79     AliZDCRawStream(const AliZDCRawStream& stream);
80     AliZDCRawStream& operator = (const AliZDCRawStream& stream);
81
82     AliRawReader* fRawReader;    // object for reading the raw data
83
84     UInt_t fBuffer;           // DARC header + ADC buffer
85     UInt_t fEvType;           // Event type
86     Int_t  fPosition;         // bit position in buffer data word
87     
88     Bool_t fIsCalib;          // True when calibration run
89     Bool_t fIsDARCHeader;     // True when DARC header
90     Bool_t fIsChMapping;      // True when reading ch. mapping
91     Bool_t fIsADCDataWord;    // True when data word
92     Bool_t fIsADCHeader;      // True when ADC header
93     Bool_t fIsADCEOB;         // True when EOB
94     
95     // From CDH
96     UInt_t fDARCEvBlockLenght;  // DARC block length
97     UInt_t fDARCBlockAttributes;// DARC block attributes
98
99     Int_t  fDeadfaceOffset;   // deadface offset
100     Int_t  fDeadbeefOffset;   // deadbeef offset
101     Int_t  fDataOffset;       // data offset
102         
103     // ADC signal
104     Int_t  fSector[2];    // [detector, sector]
105     Int_t  fModType;      // Module type
106     Int_t  fADCModule;    // ADC module
107     Int_t  fADCNChannels; // number of ADC ch.
108     Int_t  fADCChannel;   // ADC channel
109     Int_t  fADCValue;     // ADC channel
110     Int_t  fADCGain;      // ADC gain (0=high range; 1=low range)
111     
112     // Channel mapping 
113     Int_t  fNConnCh;       // current mapped ch.
114     Int_t  fCabledSignal;  // physics signal (from enum)
115     Int_t  fMapADC[48][3]; // ADC map for the current run
116         
117     ClassDef(AliZDCRawStream, 4)    // class for reading ZDC raw digits
118 };
119
120 #endif