]>
Commit | Line | Data |
---|---|---|
31a920d3 | 1 | #ifndef ALIALTROBUNCH_H |
2 | #define ALIALTROBUNCH_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | #include <TObject.h> | |
7 | ||
44443c72 | 8 | #define DECODERERROR -3 |
9 | ||
31a920d3 | 10 | class AliAltroBunch: public TObject { |
11 | public: | |
12 | ||
13 | AliAltroBunch(); | |
14 | ~ AliAltroBunch(); | |
44443c72 | 15 | inline const UInt_t* GetData() const { return fData; } |
16 | ||
17 | inline void SetData(UInt_t *data) | |
18 | { | |
19 | fData = data; | |
20 | } | |
21 | ||
22 | inline Int_t GetBunchSize() const { return fBunchSize; } | |
23 | inline void SetBunchSize(Int_t size) | |
24 | { | |
d3f2a99e | 25 | fPrevBunchSize = fBunchSize; fBunchSize = size; |
44443c72 | 26 | } |
27 | ||
28 | inline int CheckConsistency() | |
29 | { | |
d3f2a99e | 30 | if( fPrevEndTimeBin <= fEndTimeBin + fPrevBunchSize ) |
44443c72 | 31 | { |
32 | // printf("%s:%d, ERROR conistency check failed\n", __FILE__ , __LINE__ ); | |
33 | return DECODERERROR; | |
34 | } | |
35 | else | |
36 | { | |
37 | return kTRUE; | |
38 | } | |
39 | } | |
40 | ||
94bf739c | 41 | UInt_t GetEndTimeBin() const { return fEndTimeBin; } |
44443c72 | 42 | inline void SetEndTimeBin(UInt_t bin) {fPrevEndTimeBin = fEndTimeBin; fEndTimeBin = bin; } |
94bf739c | 43 | UInt_t GetStartTimeBin() const { return (fEndTimeBin - (fBunchSize -1)); } |
44 | void SetStartTimeBin(UInt_t bin) { fStartTimeBin = bin; } | |
31a920d3 | 45 | |
46 | private: | |
31a920d3 | 47 | AliAltroBunch& operator = (const AliAltroBunch& bunch); |
48 | AliAltroBunch(const AliAltroBunch& bunch); | |
ac672c4c | 49 | UInt_t *fData; // pointer to data of current bunch |
50 | Int_t fBunchSize; // total size of current bunch including timestamp and the size indicator (i.e a bunch with just one sample will have size 3) | |
51 | UInt_t fEndTimeBin; // Time stamp of the last sample in the bunch in entities of sample indexes | |
52 | UInt_t fStartTimeBin; // Time index of the first bin in the bunch | |
d3f2a99e | 53 | UInt_t fPrevBunchSize; // Previous bunch size |
54 | UInt_t fPrevEndTimeBin;// Previous end time bin | |
44443c72 | 55 | // bool fIsFirstBunch; |
31a920d3 | 56 | |
57 | ClassDef(AliAltroBunch,0) // container class for Altro bunches | |
58 | }; | |
59 | ||
60 | #endif | |
61 |