1 /* Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
4 ////////////////////////////////////////////////////////////////////////////
5 // Class used for generating the files containing raw data, //
6 // required for Data Challenge //
7 ////////////////////////////////////////////////////////////////////////////
9 #ifndef AliTOFDDLRAWDATA_H
10 #define AliTOFDDLRAWDATA_H
15 class AliTOFDDLRawData:public TObject{
17 AliTOFDDLRawData(); // default constructor
18 virtual ~AliTOFDDLRawData(){;} // destructor
19 AliTOFDDLRawData(const AliTOFDDLRawData &source); // copy constructor
20 AliTOFDDLRawData& operator=(const AliTOFDDLRawData &source); // ass. op.
21 Int_t RawDataTOF(TBranch* branch);
22 // This method generates the files with the TOF detector data
23 void SetVerbose(Int_t Verbose){fVerbose=Verbose;}
24 // To set the verbose level
26 void GetDigits(TClonesArray *TOFdigits, Int_t ddl,UInt_t *buf);
27 //This method formats and stores in buf all the digits of a TOF module
29 void PackWord(UInt_t &BaseWord, UInt_t Word, Int_t StartBit, Int_t StopBit);
30 //This method stores the value of the variable Word of StopBit-StartBit+1 bits
31 //in BaseWord, starting from the bit StartBit
33 void UnpackWord(UInt_t PackedWord, Int_t StartBit, Int_t StopBit, UInt_t &Word);
34 //This method extracts a group of adjacent bits, specified by StartBit and StopBit,
35 //from the word PackedWord. The resulting word is saved in the Word variable
38 void WriteChipHeader(Int_t ChipAddr,Int_t EventCnt,UInt_t &BaseWord);
39 void WriteChipTrailer(UInt_t *buf,Int_t ChipHitCount,UInt_t &BaseWord);
40 //The three previous methods are used to store the data according to the
41 //TOF detector data format
43 void ReadChipHeader(Int_t &ChipAddr,Int_t &EventCnt,UInt_t BaseWord);
44 void ReadChipTrailer(Int_t &ChipHitCount,UInt_t BaseWord);
45 //Methods used for reading and dubugging TOF data files
48 Int_t fVerbose; //Verbose level (0:no msg, 1:msg, 2:digits in txt files)
49 Int_t fIndex; //number of 32 words to be stored into the output file
50 enum {kDDLOffset = 0x500}; //offset for DDL number
51 ClassDef(AliTOFDDLRawData,1)