]> git.uio.no Git - u/mrichter/AliRoot.git/blob - VZERO/AliVZERORawStream.h
- Fixing a problem in the tail effect, due to which
[u/mrichter/AliRoot.git] / VZERO / AliVZERORawStream.h
1 #ifndef ALIVZERORAWSTREAM_H
2 #define ALIVZERORAWSTREAM_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 ///////////////////////////////////////////////////////////////////////////////
7 ///
8 /// This is a class for reading the VZERO DDL raw data
9 /// The format of the raw data corresponds to the one
10 /// implemented in AliVZEROBuffer class.
11 ///
12 ///////////////////////////////////////////////////////////////////////////////
13
14 #include <TObject.h>
15
16 class AliRawReader;
17
18 class AliVZERORawStream: public TObject {
19   public :
20     AliVZERORawStream(AliRawReader* rawReader);
21     virtual ~AliVZERORawStream();
22
23     virtual void             Reset();
24     virtual Bool_t           Next();
25
26     UShort_t                 GetADC(Int_t channel) const
27       { return fADC[channel][kNEvOfInt/2]; }
28     UShort_t                 GetPedestal(Int_t channel, Int_t event) const
29       { return fADC[channel][event]; }
30     UInt_t                   GetTime(Int_t channel) const
31       { return fTime[channel]; }
32
33     enum EVZERORawDataParams {
34       kNChannels = 64,
35       kNEvOfInt  = 21, // Number of events of interest
36       kNScalers  = 16,
37       kNBunches  = 10
38     };
39
40     enum EVZERORawStreamError {
41       kRawDataSizeErr = 1
42     };
43
44   private:
45
46     AliVZERORawStream(const AliVZERORawStream& stream);
47     AliVZERORawStream& operator = (const AliVZERORawStream& stream);
48
49     UInt_t GetNextWord();
50     UShort_t GetNextShort();
51
52     ULong64_t       fBBScalers[kNChannels];       // 'Beam-Beam' scalers for all channels
53     ULong64_t       fBGScalers[kNChannels];       // 'Beam-Gas' scalers for all channels
54     UInt_t          fScalers[kNScalers];          // Trigger scalers
55     UInt_t          fBunchNumbers[kNBunches];     // Bunch numbers for the previous 10 MB events
56     UShort_t        fChargeMB[kNChannels][kNBunches]; // ADC counts for all channels for the previous 10 MB events
57     Bool_t          fIsIntMB[kNChannels][kNBunches];  // 'Integrator' flag for all channels for the previous 10 MB events
58     Bool_t          fIsBBMB[kNChannels][kNBunches];   // 'Beam-Beam' flag for all channels for the previous 10 MB events
59     Bool_t          fIsBGMB[kNChannels][kNBunches];   // 'Beam-Gas' for all channels for the previous 10 MB events
60
61     UShort_t        fADC[kNChannels][kNEvOfInt];   // ADC counts for all channels and all events of interest
62     Bool_t          fIsInt[kNChannels][kNEvOfInt]; // 'Integrator' flag for all channels
63     Bool_t          fIsBB[kNChannels][kNEvOfInt];  // 'Beam-Beam' flag for all channels
64     Bool_t          fIsBG[kNChannels][kNEvOfInt];  // 'Beam-Gas' flag for all channels
65     Int_t           fTime[kNChannels];             // leading time for all channels
66     Int_t           fWidth[kNChannels];            // signal width for all channels
67
68     UShort_t        fTrigger;      // VZERO trigger inputs
69     UShort_t        fTriggerMask;  // VZERO trigger inputs mask
70
71     Int_t           fPosition;     // current position in the raw-data payload
72
73     AliRawReader*   fRawReader;    // object for reading the raw data
74
75     UChar_t*        fData;         // pointer to raw data payload
76
77     ClassDef(AliVZERORawStream, 0) // class for reading VZERO DDL raw data
78 };
79
80 #endif