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 */
6 ///////////////////////////////////////////////////////////////////////////////
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.
12 ///////////////////////////////////////////////////////////////////////////////
18 class AliVZERORawStream: public TObject {
20 AliVZERORawStream(AliRawReader* rawReader);
21 virtual ~AliVZERORawStream();
24 virtual Bool_t Next();
26 // Getters of various scalers and Minimum Bias flags :
28 ULong64_t GetBBScalers(Int_t channel) const
29 { return fBBScalers[channel]; }
30 ULong64_t GetBGScalers(Int_t channel) const
31 { return fBGScalers[channel]; }
32 UInt_t GetTriggerScalers(Int_t num_scaler) const
33 { return fScalers[num_scaler]; }
34 UInt_t GetBunchNumbersMB(Int_t num_bunch) const
35 { return fBunchNumbers[num_bunch]; }
36 UShort_t GetChargeMB(Int_t channel, Int_t num_bunch) const
37 { return fChargeMB[channel][num_bunch]; }
38 Bool_t GetIntMBFlag(Int_t channel, Int_t num_bunch) const
39 { return fIsIntMB[channel][num_bunch]; }
40 Bool_t GetBBMBFlag(Int_t channel, Int_t num_bunch) const
41 { return fIsBBMB[channel][num_bunch]; }
42 Bool_t GetBGMBFlag(Int_t channel, Int_t num_bunch) const
43 { return fIsBGMB[channel][num_bunch]; }
45 // Getters of ADC signals, ADC pedestals, time information and corresponding flags :
47 UShort_t GetADC(Int_t channel) const
48 { return fADC[channel][kNEvOfInt/2]; }
49 UShort_t GetPedestal(Int_t channel, Int_t event) const
50 { return fADC[channel][event]; }
51 Bool_t GetIntegratorFlag(Int_t channel, Int_t event) const
52 { return fIsInt[channel][event]; }
53 Bool_t GetBBFlag(Int_t channel, Int_t event) const
54 { return fIsBB[channel][event]; }
55 Bool_t GetBGFlag(Int_t channel, Int_t event) const
56 { return fIsBG[channel][event]; }
57 UInt_t GetTime(Int_t channel) const
58 { return fTime[channel]; }
59 UInt_t GetWidth(Int_t channel) const
60 { return fWidth[channel]; }
62 enum EVZERORawDataParams {
63 kNChannels = 64, // number of electronic channels in V0
64 kNEvOfInt = 21, // number of events of interest
65 kNScalers = 16, // number of scalers
66 kNBunches = 10 // number of bunches used in Minimum Bias information
69 enum EVZERORawStreamError {
75 AliVZERORawStream(const AliVZERORawStream& stream);
76 AliVZERORawStream& operator = (const AliVZERORawStream& stream);
79 UShort_t GetNextShort();
81 ULong64_t fBBScalers[kNChannels]; // 'Beam-Beam' scalers for all channels
82 ULong64_t fBGScalers[kNChannels]; // 'Beam-Gas' scalers for all channels
83 UInt_t fScalers[kNScalers]; // Trigger scalers
84 UInt_t fBunchNumbers[kNBunches]; // Bunch numbers for the previous 10 MB events
85 UShort_t fChargeMB[kNChannels][kNBunches]; // ADC counts for all channels for the previous 10 MB events
86 Bool_t fIsIntMB[kNChannels][kNBunches]; // 'Integrator' flag for all channels for the previous 10 MB events
87 Bool_t fIsBBMB[kNChannels][kNBunches]; // 'Beam-Beam' flag for all channels for the previous 10 MB events
88 Bool_t fIsBGMB[kNChannels][kNBunches]; // 'Beam-Gas' for all channels for the previous 10 MB events
90 UShort_t fADC[kNChannels][kNEvOfInt]; // ADC counts for all channels and all events of interest
91 Bool_t fIsInt[kNChannels][kNEvOfInt]; // 'Integrator' flag for all channels
92 Bool_t fIsBB[kNChannels][kNEvOfInt]; // 'Beam-Beam' flag for all channels
93 Bool_t fIsBG[kNChannels][kNEvOfInt]; // 'Beam-Gas' flag for all channels
94 Int_t fTime[kNChannels]; // leading time for all channels - from HPTDC
95 Int_t fWidth[kNChannels]; // pulse width for all channels - from HPTDC
97 UShort_t fTrigger; // VZERO trigger inputs
98 UShort_t fTriggerMask; // VZERO trigger inputs mask
100 Int_t fPosition; // current position in the raw-data payload
102 AliRawReader* fRawReader; // object for reading the raw data
104 UChar_t* fData; // pointer to raw data payload
106 ClassDef(AliVZERORawStream, 0) // class for reading VZERO DDL raw data