]>
Commit | Line | Data |
---|---|---|
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 | ||
8 | #define DECODERERROR -3 | |
9 | ||
10 | class AliAltroBunch: public TObject { | |
11 | public: | |
12 | ||
13 | AliAltroBunch(); | |
14 | ~ AliAltroBunch(); | |
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 | { | |
25 | fPrevBunchSize = fBunchSize; fBunchSize = size; | |
26 | } | |
27 | ||
28 | inline int CheckConsistency() | |
29 | { | |
30 | if( fPrevEndTimeBin <= fEndTimeBin + fPrevBunchSize ) | |
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 | ||
41 | UInt_t GetEndTimeBin() const { return fEndTimeBin; } | |
42 | inline void SetEndTimeBin(UInt_t bin) {fPrevEndTimeBin = fEndTimeBin; fEndTimeBin = bin; } | |
43 | UInt_t GetStartTimeBin() const { return (fEndTimeBin - (fBunchSize -1)); } | |
44 | void SetStartTimeBin(UInt_t bin) { fStartTimeBin = bin; } | |
45 | ||
46 | private: | |
47 | AliAltroBunch& operator = (const AliAltroBunch& bunch); | |
48 | AliAltroBunch(const AliAltroBunch& bunch); | |
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 | |
53 | UInt_t fPrevBunchSize; // Previous bunch size | |
54 | UInt_t fPrevEndTimeBin;// Previous end time bin | |
55 | // bool fIsFirstBunch; | |
56 | ||
57 | ClassDef(AliAltroBunch,0) // container class for Altro bunches | |
58 | }; | |
59 | ||
60 | #endif | |
61 |