Added capability to handle backlinked list properly.
[u/mrichter/AliRoot.git] / HLT / misc / AliL3AltroMemHandler.h
CommitLineData
acf814d1 1#ifndef ALIL3ALTROMEMHANDLER_H
2#define ALIL3ALTROMEMHANDLER_H
3
4#include "AliL3RootTypes.h"
5#include "AliL3Logging.h"
6
faebf2f5 7//Maximum size of Altro packet equals 1000 bit
8#define ALTRO_PACKET_SIZE 125
9
10//Maximum 10 bit data to be stored in one packet
acf814d1 11#define MAX_VALS 94
12
faebf2f5 13//Maximum size of array to store whole pad
14#define ALTRO_SIZE (100*ALTRO_PACKET_SIZE)
15
acf814d1 16class AliL3AltroMemHandler {
17
18 public:
faebf2f5 19
acf814d1 20 AliL3AltroMemHandler();
faebf2f5 21 void Write(UShort_t row, UChar_t pad, UShort_t charge, UShort_t time);
22 void WriteFinal();
23
24 Bool_t SetASCIIOutput(FILE *file);
acf814d1 25 Bool_t SetBinaryOutput(FILE *file);
26 //Bool_t SetBinaryInput(FILE *file);
acf814d1 27
28 private:
faebf2f5 29
acf814d1 30 UShort_t altromem[ALTRO_SIZE];
faebf2f5 31 UShort_t times_per_pad[1024];
32 UShort_t charges_per_pad[1024];
33
acf814d1 34 //FILE *fInBinary;
35 FILE *fOutBinary;
36 UShort_t lrow;
37 UChar_t lpad;
faebf2f5 38
39 UShort_t counter; //totalcounter
40 UShort_t tcounter; //timecounter
41 UShort_t pcounter; //packetcounter
acf814d1 42 Bool_t flag;
faebf2f5 43
acf814d1 44 void Clear();
faebf2f5 45 void Add(UShort_t charge, UShort_t time);
46 void MakeAltroPackets();
47 void AddTrailer();
48 void Write();
49
9c50e540 50 ClassDef(AliL3AltroMemHandler,1)
acf814d1 51};
52
53#endif
54
55
56
57
58
59