3 #ifndef ALIL3ALTROMEMHANDLER_H
4 #define ALIL3ALTROMEMHANDLER_H
6 #include "AliL3RootTypes.h"
8 //Maximum size of Altro packet equals 1000 bit
9 #define ALTRO_PACKET_SIZE 125
11 //Maximum 10 bit data to be stored in one packet
14 //Maximum size of array to store whole pad
15 #define ALTRO_SIZE (100*ALTRO_PACKET_SIZE)
17 class AliL3AltroMemHandler {
21 AliL3AltroMemHandler();
22 void Write(UShort_t row, UChar_t pad, UShort_t time, UShort_t charge);
23 Bool_t Read(UShort_t &row, UChar_t &pad, UShort_t &time, UShort_t &charge);
24 Bool_t ReadSequence(UShort_t &row, UChar_t &pad, UShort_t &time, UChar_t &n, UShort_t **charges);
27 Bool_t SetASCIIOutput(FILE *file);
28 Bool_t SetBinaryOutput(FILE *file);
29 Bool_t SetASCIIInput(FILE *file);
30 Bool_t SetBinaryInput(FILE *file);
34 UShort_t altromem[ALTRO_SIZE];
35 UShort_t times_per_pad[1024];
36 UShort_t charges_per_pad[1024];
42 UShort_t rrow; //read row
43 UChar_t rpad; //read pad
44 UShort_t rtime; //read time
45 UShort_t counter; //total counter
46 UShort_t tcounter; //time counter
47 UShort_t pcounter; //packet counter
48 UShort_t rcounter; //read counter
49 UShort_t scounter; //sequence counter
50 Bool_t flag; //Binary File?
54 void Add(UShort_t charge, UShort_t time);
55 void MakeAltroPackets();
59 ClassDef(AliL3AltroMemHandler,1)