]> git.uio.no Git - u/mrichter/AliRoot.git/blame - VZERO/VZERObase/AliVZERORawStream.h
VZERO DAs + Object target dependencies
[u/mrichter/AliRoot.git] / VZERO / VZERObase / AliVZERORawStream.h
CommitLineData
2eb38194 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///
1ecef4c5 12/// PLEASE NOTE that Int_t channel is here the FEE channel from 0 to 63 in the
13/// order defined by Yannick Zoccarato which is not the same order as the order
14/// defined in aliroot by the naming and numbering conventions.
15/// Therefore one has to go from FEE_Channel to AliRoot_Channel using
16/// GetOfflineChannel(Int_t channel) when going from Online to Offline !!!
17///
2eb38194 18///////////////////////////////////////////////////////////////////////////////
19
20#include <TObject.h>
db0db003 21#include <TMath.h>
2eb38194 22
23class AliRawReader;
cc12572f 24class AliVZEROTriggerData;
2eb38194 25
26class AliVZERORawStream: public TObject {
27 public :
28 AliVZERORawStream(AliRawReader* rawReader);
29 virtual ~AliVZERORawStream();
30
bfe07a27 31 virtual void Reset();
32 virtual Bool_t Next();
33
34// Getters of various scalers and Minimum Bias flags :
35
36 ULong64_t GetBBScalers(Int_t channel) const
37 { return fBBScalers[channel]; }
38 ULong64_t GetBGScalers(Int_t channel) const
39 { return fBGScalers[channel]; }
40 UInt_t GetTriggerScalers(Int_t num_scaler) const
41 { return fScalers[num_scaler]; }
42 UInt_t GetBunchNumbersMB(Int_t num_bunch) const
43 { return fBunchNumbers[num_bunch]; }
44 UShort_t GetChargeMB(Int_t channel, Int_t num_bunch) const
45 { return fChargeMB[channel][num_bunch]; }
46 Bool_t GetIntMBFlag(Int_t channel, Int_t num_bunch) const
47 { return fIsIntMB[channel][num_bunch]; }
48 Bool_t GetBBMBFlag(Int_t channel, Int_t num_bunch) const
49 { return fIsBBMB[channel][num_bunch]; }
50 Bool_t GetBGMBFlag(Int_t channel, Int_t num_bunch) const
51 { return fIsBGMB[channel][num_bunch]; }
52
53// Getters of ADC signals, ADC pedestals, time information and corresponding flags :
54
1d51e5e5 55 Short_t GetADC(Int_t channel) const
db0db003 56 { return TMath::MaxElement(kNEvOfInt, fADC[channel]); } // maximum value instead of central clock
57// { return fADC[channel][kNEvOfInt/2]; }
58
1d51e5e5 59 Short_t GetPedestal(Int_t channel, Int_t event) const
8094d3d3 60 { return fADC[channel][event]; }
bfe07a27 61 Bool_t GetIntegratorFlag(Int_t channel, Int_t event) const
62 { return fIsInt[channel][event]; }
63 Bool_t GetBBFlag(Int_t channel, Int_t event) const
64 { return fIsBB[channel][event]; }
65 Bool_t GetBGFlag(Int_t channel, Int_t event) const
66 { return fIsBG[channel][event]; }
1d51e5e5 67 Short_t GetTime(Int_t channel) const
726d762c 68 { return fTime[channel]; }
1d51e5e5 69 Short_t GetWidth(Int_t channel) const
a83ba31a 70 { return fWidth[channel]; }
726d762c 71
b090e6a3 72 UShort_t GetTriggerInputs() const
73 { return fTrigger; }
74 UShort_t GetTriggerInputsMask() const
75 { return fTriggerMask; }
76
cc12572f 77 void CalculateChargeForCentrTriggers(AliVZEROTriggerData *triggerData,
78 UShort_t &chargeA, UShort_t &chargeC) const;
9a7352cc 79 void CalculateBBandBGFlags(AliVZEROTriggerData *triggerData,
80 UChar_t &nBBA, UChar_t &nBBC,
81 UChar_t &nBGA, UChar_t &nBGC) const;
82 void FillTriggerBits(AliVZEROTriggerData *triggerData);
cc12572f 83
1ecef4c5 84// Getter of Offline Channel number as used in aliroot (defined by aliroot
85// numbering convention) from FEE channel (electronic channel number given
86// by the V0 electronics readout) - See comment above -
87
88 Int_t GetOfflineChannel(Int_t channel) const
89 { Int_t fOfflineChannel[64] = {39, 38, 37, 36, 35, 34, 33, 32,
90 47, 46, 45, 44, 43, 42, 41, 40,
91 55, 54, 53, 52, 51, 50, 49, 48,
92 63, 62, 61, 60, 59, 58, 57, 56,
93 7, 6, 5, 4, 3, 2, 1, 0,
94 15, 14, 13, 12, 11, 10, 9, 8,
95 23, 22, 21, 20, 19, 18, 17, 16,
96 31, 30, 29, 28, 27, 26, 25, 24};
97 return fOfflineChannel[channel]; }
98
726d762c 99 enum EVZERORawDataParams {
1ecef4c5 100 kNChannels = 64, // number of electronic channels in V0 (FEE numbering)
bfe07a27 101 kNEvOfInt = 21, // number of events of interest
102 kNScalers = 16, // number of scalers
103 kNBunches = 10 // number of bunches used in Minimum Bias information
726d762c 104 };
2eb38194 105
106 enum EVZERORawStreamError {
107 kRawDataSizeErr = 1
108 };
109
110 private:
111
112 AliVZERORawStream(const AliVZERORawStream& stream);
113 AliVZERORawStream& operator = (const AliVZERORawStream& stream);
114
726d762c 115 UInt_t GetNextWord();
116 UShort_t GetNextShort();
117
bfe07a27 118 ULong64_t fBBScalers[kNChannels]; // 'Beam-Beam' scalers for all channels
119 ULong64_t fBGScalers[kNChannels]; // 'Beam-Gas' scalers for all channels
120 UInt_t fScalers[kNScalers]; // Trigger scalers
121 UInt_t fBunchNumbers[kNBunches]; // Bunch numbers for the previous 10 MB events
122 UShort_t fChargeMB[kNChannels][kNBunches]; // ADC counts for all channels for the previous 10 MB events
123 Bool_t fIsIntMB[kNChannels][kNBunches]; // 'Integrator' flag for all channels for the previous 10 MB events
124 Bool_t fIsBBMB[kNChannels][kNBunches]; // 'Beam-Beam' flag for all channels for the previous 10 MB events
125 Bool_t fIsBGMB[kNChannels][kNBunches]; // 'Beam-Gas' for all channels for the previous 10 MB events
726d762c 126
1d51e5e5 127 Short_t fADC[kNChannels][kNEvOfInt]; // ADC counts for all channels and all events of interest
bfe07a27 128 Bool_t fIsInt[kNChannels][kNEvOfInt]; // 'Integrator' flag for all channels
129 Bool_t fIsBB[kNChannels][kNEvOfInt]; // 'Beam-Beam' flag for all channels
130 Bool_t fIsBG[kNChannels][kNEvOfInt]; // 'Beam-Gas' flag for all channels
1d51e5e5 131 Short_t fTime[kNChannels]; // leading time for all channels - from HPTDC - in HPTDC units
132 Short_t fWidth[kNChannels]; // pulse width for all channels - from HPTDC - in HPTDC units
2eb38194 133
bfe07a27 134 UShort_t fTrigger; // VZERO trigger inputs
135 UShort_t fTriggerMask; // VZERO trigger inputs mask
2eb38194 136
bfe07a27 137 Int_t fPosition; // current position in the raw-data payload
1ecef4c5 138
2eb38194 139
bfe07a27 140 AliRawReader* fRawReader; // object for reading the raw data
2eb38194 141
bfe07a27 142 UChar_t* fData; // pointer to raw data payload
2eb38194 143
144 ClassDef(AliVZERORawStream, 0) // class for reading VZERO DDL raw data
145};
146
147#endif