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]; }
60 enum EVZERORawDataParams {
61 kNChannels = 64, // number of electronic channels in V0
62 kNEvOfInt = 21, // number of events of interest
63 kNScalers = 16, // number of scalers
64 kNBunches = 10 // number of bunches used in Minimum Bias information
67 enum EVZERORawStreamError {
73 AliVZERORawStream(const AliVZERORawStream& stream);
74 AliVZERORawStream& operator = (const AliVZERORawStream& stream);
77 UShort_t GetNextShort();
79 ULong64_t fBBScalers[kNChannels]; // 'Beam-Beam' scalers for all channels
80 ULong64_t fBGScalers[kNChannels]; // 'Beam-Gas' scalers for all channels
81 UInt_t fScalers[kNScalers]; // Trigger scalers
82 UInt_t fBunchNumbers[kNBunches]; // Bunch numbers for the previous 10 MB events
83 UShort_t fChargeMB[kNChannels][kNBunches]; // ADC counts for all channels for the previous 10 MB events
84 Bool_t fIsIntMB[kNChannels][kNBunches]; // 'Integrator' flag for all channels for the previous 10 MB events
85 Bool_t fIsBBMB[kNChannels][kNBunches]; // 'Beam-Beam' flag for all channels for the previous 10 MB events
86 Bool_t fIsBGMB[kNChannels][kNBunches]; // 'Beam-Gas' for all channels for the previous 10 MB events
88 UShort_t fADC[kNChannels][kNEvOfInt]; // ADC counts for all channels and all events of interest
89 Bool_t fIsInt[kNChannels][kNEvOfInt]; // 'Integrator' flag for all channels
90 Bool_t fIsBB[kNChannels][kNEvOfInt]; // 'Beam-Beam' flag for all channels
91 Bool_t fIsBG[kNChannels][kNEvOfInt]; // 'Beam-Gas' flag for all channels
92 Int_t fTime[kNChannels]; // leading time for all channels - from HPTDC
93 Int_t fWidth[kNChannels]; // signal width for all channels - from HPTDC
95 UShort_t fTrigger; // VZERO trigger inputs
96 UShort_t fTriggerMask; // VZERO trigger inputs mask
98 Int_t fPosition; // current position in the raw-data payload
100 AliRawReader* fRawReader; // object for reading the raw data
102 UChar_t* fData; // pointer to raw data payload
104 ClassDef(AliVZERORawStream, 0) // class for reading VZERO DDL raw data