1 #ifndef ALITPCMONITORALTRO_H
2 #define ALITPCMONITORALTRO_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
9 ////////////////////////////////////////////////////////////////////////
11 //// AliTPCMonitorAltro class
13 //// Class for decoding raw TPC data in the ALTRO format
15 //// Authors: Roland Bramm,
16 //// Stefan Kniege, IKF, Frankfurt
18 /////////////////////////////////////////////////////////////////////////
22 class AliTPCMonitorAltro : public TNamed {
24 AliTPCMonitorAltro(UInt_t* memory, Int_t size, Int_t fformat);
25 AliTPCMonitorAltro(const AliTPCMonitorAltro &altro);
26 AliTPCMonitorAltro& operator= (const AliTPCMonitorAltro& altro);
27 ~AliTPCMonitorAltro();
29 void Allocate40BitArray();
30 void Allocate10BitArray();
33 void Decodeto10Bit(Int_t equipment = -1);
35 Int_t DecodeTrailer(Int_t pos);
37 Long64_t* Get40BitArray();
38 Short_t *Get10BitArray();
39 Int_t Get40BitArraySize() const { return fmemory[fsize-GetRCUTrailerSize()];} //hier ändern
40 Int_t Get10BitArraySize() const { return fmemory[fsize-GetRCUTrailerSize()]*4;} //number of 10 bit words from trailer
41 Char_t* GetActFileName() const { return ffilename;}
43 static Int_t GetHwMaskFEC() { return fgkHwMaskFEC;}
44 static Int_t GetHwMaskBranch() { return fgkHwMaskBranch;}
45 static Int_t GetHwMaskFECChannel() { return fgkHwMaskFECChannel;}
46 static Int_t GetHwMaskAltroChannel() { return fgkHwMaskAltroChannel;}
47 static Int_t GetHwMaskAltroChip() { return fgkHwMaskAltroChip;}
49 static Int_t GetHwMaskRCU() { return fgkHwMaskRCU;}
51 Int_t GetNextTrailerPos() const { return fNextPos;}
53 Int_t GetTrailerNWords() const { return fTrailerNWords ;}
54 Int_t GetTrailerHwAddress() const { return fTrailerHwAddress;}
55 Int_t GetTrailerDataPos() const { return fTrailerDataPos ;}
56 Int_t GetTrailerBlockPos() const { return fTrailerBlockPos ;}
57 Int_t GetTrailerPos() const { return fTrailerPos ;}
59 Int_t GetRCUTrailerSize() const { Int_t ts=(fmemory[fsize-1]>>16==0xaaaa)*(fmemory[fsize-1]&0x3F); return (ts>0)?ts:1;}
61 void SetDataOffset(Int_t val){ foffset =val ;}
62 void SetWrite10Bit(Int_t wr) { fwrite10bit =wr ;}
65 void SetActFilename(Char_t* name){ sprintf(ffilename,"%s",name); }
66 void SetVerbose(Int_t val) { fverb=val;}
70 Int_t fverb; // verbose flag
71 UInt_t* fmemory; // memory pointer fo payload
72 Int_t fsize; // size of fmemory
73 Long64_t* f40BitArray; // array to store 40 bit words
74 Short_t* f10BitArray; // array to store 10 bit words
75 Int_t fdecoderPos; // start position for decoding 40 bit words
77 Bool_t fallocate40BitArray; // flag for decoding to 40 bit words
78 Bool_t fallocate10BitArray; // flag for decoding to 10 bit words
79 Int_t foffset ; // data offset (CDH length)
80 Int_t fwrite10bit; // flag for writing 10 bit words to file
82 Int_t fTrailerNWords ; // from Trailer: number of 40 bit words for channel
83 Int_t fTrailerHwAddress; // from Trailer: hardware address for current channel
84 Int_t fTrailerDataPos; // from Trailer: position of first adc value
85 Int_t fTrailerBlockPos; // from Trailer: number of 40 bit words for channel
86 Int_t fTrailerPos; // trailer position
88 Int_t fNextPos; // position of next trailer
89 Char_t* ffilename; // name of processed file
91 static const Int_t fgk24BitOn = 16777215; // bit masks for first 24 bits of 32 for decoding 32 bit words
92 static const Int_t fgk16BitOn = 65535; // bit masks for first 24 bits of 24
93 static const Int_t fgk08BitOn = 255; // bit masks for first 24 bits of 8
96 static const Long64_t fgkmask10 = (Long64_t)0x00000000000003FFULL; // mask first 10 bit out of 4o0 bit word
97 static const Long64_t fgkmask20 = (Long64_t)0x00000000000FFC00ULL; // mask second 10 bit out of 4o0 bit word
98 static const Long64_t fgkmask30 = (Long64_t)0x000000003FF00000ULL; // mask third 10 bit out of 4o0 bit word
99 static const Long64_t fgkmask40 = (Long64_t)0x000000FFC0000000ULL; // mask fourth 10 bit out of 4o0 bit word
101 static const Long64_t fgkTrailerTail = (Long64_t)0x0000000000002AAAULL; // Tail of the Trailer set to 2AAA
102 static const Long64_t fgkTrailerMaskTail = (Long64_t)0x000000fffC000000ULL; // mask for trailer
103 static const Long64_t fgkTrailerMaskHardw = (Long64_t)0x0000000000000FFFULL; // mask for hardware address
104 static const Long64_t fgkTrailerMaskNWords = (Long64_t)0x0000000003FF0000ULL; // mask for nwords (number of 40 bit data words)
106 static const Int_t fgkHwMaskFEC = 0x0780; // mask for fec in hardware address
107 static const Int_t fgkHwMaskBranch = 0x0800; // mask for branch in hardware address
108 static const Int_t fgkHwMaskFECChannel = 0x007f; // mask for fec channel in hardware address
109 static const Int_t fgkHwMaskAltroChannel = 0x000f; // mask for altro channel in hardware address
110 static const Int_t fgkHwMaskAltroChip = 0x0070; // mask for altro chip in hardware address
111 static const Int_t fgkHwMaskRCU = 0x7000; // not part of the trailer added afterwards
113 ClassDef(AliTPCMonitorAltro,1);