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