]>
Commit | Line | Data |
---|---|---|
31a920d3 | 1 | /************************************************************************** |
2 | * This file is property of and copyright by the ALICE HLT Project * | |
3 | * All rights reserved. * | |
4 | * * | |
5 | * Primary Author: Per Thomas Hille <perthi@fys.uio.no> * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | #include "AliAltroData.h" | |
17 | #include "AliAltroBunch.h" | |
18 | ||
19 | ClassImp(AliAltroData) | |
20 | ||
21 | AliAltroData::AliAltroData(): fData(0), | |
22 | fBunchData(0), | |
23 | fDataSize(0), | |
24 | fWc(0), | |
25 | fHadd(0), | |
26 | fBunchCounter(0), | |
27 | fIsComplete(0) | |
28 | { | |
29 | ||
30 | ||
31 | } | |
32 | ||
33 | ||
34 | ||
35 | AliAltroData::~AliAltroData() | |
36 | { | |
37 | ||
38 | ||
39 | } | |
40 | ||
41 | ||
42 | Bool_t AliAltroData::NextBunch(AliAltroBunch *altroBunch) | |
43 | { | |
44 | if(fIsComplete == kTRUE) | |
45 | { | |
46 | ||
47 | if(fBunchCounter == 0) | |
48 | { | |
49 | fBunchData = &fData[fDataSize - 1]; | |
50 | } | |
51 | ||
52 | if(fWc < fDataSize) | |
53 | { | |
54 | if(*fBunchData == 0){ fWc += 1;}; | |
55 | fWc += *fBunchData; | |
1f8ca0bc | 56 | altroBunch->SetData(fData + fDataSize - fWc); |
57 | altroBunch->SetBunchSize(*fBunchData -2); | |
31a920d3 | 58 | fBunchData --; |
59 | altroBunch->SetEndTimeBin( *fBunchData ); | |
1f8ca0bc | 60 | // altroBunch->SetStartTimeBin(*fBunchData - fBunchSize); |
31a920d3 | 61 | fBunchData -= (altroBunch->GetBunchSize() +1); |
31a920d3 | 62 | fBunchCounter ++; |
63 | return kTRUE; | |
64 | } | |
65 | else | |
66 | { | |
67 | fBunchCounter = 0; | |
68 | fWc = 0; | |
69 | return kFALSE; | |
70 | } | |
71 | } | |
72 | else | |
73 | { | |
74 | printf("\nAliAltroData::NextBunch: WARNING, dataset is not complet. 2AAA endmarker is missing "); | |
75 | printf("\nfor branch %d, card %d, chip %d, channel %d\n", GetBranch(), GetCard(), GetChip(), GetChannel()); | |
76 | return kFALSE; | |
77 | } | |
78 | ||
79 | } | |
80 | ||
81 | void AliAltroData::Reset() | |
82 | { | |
83 | fWc = 0; | |
84 | fBunchCounter = 0; | |
85 | } | |
86 | ||
87 | ||
88 | Int_t AliAltroData::GetChannel() const | |
89 | { | |
90 | return fHadd & 0xf; | |
91 | } | |
92 | ||
93 | Int_t AliAltroData::GetChip() const | |
94 | { | |
95 | return (fHadd & 0x70) >> 4 ; | |
96 | } | |
97 | ||
98 | Int_t AliAltroData::GetCard() const | |
99 | { | |
100 | return (fHadd & 0x780) >> 7; | |
101 | } | |
102 | ||
103 | ||
104 | Int_t AliAltroData::GetBranch() const | |
105 | { | |
106 | return (fHadd & 0x800 ) >> 11; | |
107 | } |