]>
Commit | Line | Data |
---|---|---|
48265b32 | 1 | #ifndef ALITPCMONITORALTRO_H |
2 | #define ALITPCMONITORALTRO_H | |
3 | ||
4 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
5 | * See cxx source for full Copyright notice */ | |
6 | ||
7 | /* $Id$ */ | |
8 | ||
9 | //////////////////////////////////////////////////////////////////////// | |
10 | // | |
11 | // AliTPCMonitorAltro class | |
12 | // | |
13 | // Class for decoding raw TPC data in the ALTRO format | |
14 | // | |
15 | // Authors: Roland Bramm, | |
16 | // Stefan Kniege, IKF, Frankfurt | |
17 | // | |
18 | ///////////////////////////////////////////////////////////////////////// | |
19 | ||
20 | ||
21 | ||
22 | #include <iostream> | |
23 | #include <iomanip> | |
24 | #include <fstream> | |
25 | #include "TNamed.h" | |
26 | #include "AliLog.h" | |
27 | ||
28 | using namespace std; | |
29 | ||
30 | class AliTPCMonitorAltro : public TNamed { | |
31 | public: | |
32 | AliTPCMonitorAltro(UInt_t* memory, Int_t size, Int_t fformat); | |
33 | ~AliTPCMonitorAltro(); | |
34 | ||
35 | void Allocate40BitArray(); | |
36 | void Allocate10BitArray(); | |
37 | ||
38 | void Decodeto40Bit(); | |
39 | void Decodeto10Bit(Int_t equipment = -1); | |
40 | ||
41 | Int_t DecodeTrailer(Int_t pos); | |
42 | ||
43 | Long64_t* Get40BitArray(); | |
44 | Short_t *Get10BitArray(); | |
45 | Int_t Get40BitArraySize(); | |
46 | Int_t Get10BitArraySize(); | |
47 | Char_t* GetActFileName() { return ffilename;} | |
48 | ||
49 | static Int_t GetHwMaskFEC() { return kHwMaskFEC;} | |
50 | static Int_t GetHwMaskBranch() { return kHwMaskBranch;} | |
51 | static Int_t GetHwMaskFECChannel() { return kHwMaskFECChannel;} | |
52 | static Int_t GetHwMaskAltroChannel() { return kHwMaskAltroChannel;} | |
53 | static Int_t GetHwMaskAltroChip() { return kHwMaskAltroChip;} | |
54 | ||
55 | static Int_t GetHwMaskRCU() { return kHwMaskRCU;} | |
56 | ||
57 | Int_t GetNextTrailerPos() { return fNextPos;} | |
58 | ||
59 | Int_t GetTrailerNWords() { return fTrailerNWords ;} | |
60 | Int_t GetTrailerHwAddress() { return fTrailerHwAddress;} | |
61 | Int_t GetTrailerDataPos() { return fTrailerDataPos ;} | |
62 | Int_t GetTrailerBlockPos() { return fTrailerBlockPos ;} | |
63 | Int_t GetTrailerPos() { return fTrailerPos ;} | |
64 | ||
65 | void SetDataOffset(Int_t val){ foffset =val ;} | |
66 | void SetWrite10Bit(Int_t wr) { fwrite10bit =wr ;} | |
67 | ||
68 | ||
69 | void SetActFilename(Char_t* name){ sprintf(ffilename,"%s",name); } | |
70 | void SetVerbose(Int_t val) { fverb=val;} | |
71 | ||
72 | private: | |
73 | ||
74 | Int_t fverb; // verbose flag | |
75 | UInt_t* fmemory; // memory pointer fo payload | |
76 | Int_t fsize; // size of fmemory | |
77 | Long64_t* f40BitArray; // array to store 40 bit words | |
78 | Short_t* f10BitArray; // array to store 10 bit words | |
79 | Int_t fdecoderPos; // start position for decoding 40 bit words | |
80 | ||
81 | Bool_t fallocate40BitArray; // flag for decoding to 40 bit words | |
82 | Bool_t fallocate10BitArray; // flag for decoding to 10 bit words | |
83 | Int_t foffset ; // data offset (CDH length) | |
84 | Int_t fwrite10bit; // flag for writing 10 bit words to file | |
85 | ||
86 | Int_t fTrailerNWords ; // from Trailer: number of 40 bit words for channel | |
87 | Int_t fTrailerHwAddress; // from Trailer: hardware address for current channel | |
88 | Int_t fTrailerDataPos; // from Trailer: position of first adc value | |
89 | Int_t fTrailerBlockPos; // from Trailer: number of 40 bit words for channel | |
90 | Int_t fTrailerPos; // trailer position | |
91 | ||
92 | Int_t fNextPos; // position of next trailer | |
93 | Char_t* ffilename; // name of processed file | |
94 | ||
95 | static const Int_t k24BitOn = 16777215; // bit masks for first 24 bits of 32 for decoding 32 bit words | |
96 | static const Int_t k16BitOn = 65535; // bit masks for first 24 bits of 24 | |
97 | static const Int_t k08BitOn = 255; // bit masks for first 24 bits of 8 | |
98 | ||
99 | ||
100 | static const Long64_t kmask10 = (Long64_t)0x00000000000003FFULL; // mask first 10 bit out of 4o0 bit word | |
101 | static const Long64_t kmask20 = (Long64_t)0x00000000000FFC00ULL; // mask second 10 bit out of 4o0 bit word | |
102 | static const Long64_t kmask30 = (Long64_t)0x000000003FF00000ULL; // mask third 10 bit out of 4o0 bit word | |
103 | static const Long64_t kmask40 = (Long64_t)0x000000FFC0000000ULL; // mask fourth 10 bit out of 4o0 bit word | |
104 | ||
105 | static const Long64_t kTrailerTail = (Long64_t)0x0000000000002AAAULL; // Tail of the Trailer set to 2AAA | |
106 | static const Long64_t kTrailerMaskTail = (Long64_t)0x000000fffC000000ULL; // mask for trailer | |
107 | static const Long64_t kTrailerMaskHardw = (Long64_t)0x0000000000000FFFULL; // mask for hardware address | |
108 | static const Long64_t kTrailerMaskNWords = (Long64_t)0x0000000003FF0000ULL; // mask for nwords (number of 40 bit data words) | |
109 | ||
110 | static const Int_t kHwMaskFEC = 0x0780; // mask for fec in hardware address | |
111 | static const Int_t kHwMaskBranch = 0x0800; // mask for branch in hardware address | |
112 | static const Int_t kHwMaskFECChannel = 0x007f; // mask for fec channel in hardware address | |
113 | static const Int_t kHwMaskAltroChannel = 0x000f; // mask for altro channel in hardware address | |
114 | static const Int_t kHwMaskAltroChip = 0x0070; // mask for altro chip in hardware address | |
115 | static const Int_t kHwMaskRCU = 0x7000; // not part of the trailer added afterwards | |
116 | ||
117 | ClassDef(AliTPCMonitorAltro,1); | |
118 | }; | |
119 | #endif |