X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=RAW%2FAliAltroBuffer.h;h=0b455311c6dadb9f518462ccff05bf4b07886952;hb=bdd72b4e93e130f4cb6dc6c76c80a7cac682be76;hp=2fc3910bfffe247ba55a426edf32a8ad44a920c7;hpb=3ea47630351efb0e4d630ae3f53767ba8cce45fc;p=u%2Fmrichter%2FAliRoot.git diff --git a/RAW/AliAltroBuffer.h b/RAW/AliAltroBuffer.h index 2fc3910bfff..0b455311c6d 100644 --- a/RAW/AliAltroBuffer.h +++ b/RAW/AliAltroBuffer.h @@ -18,53 +18,53 @@ #define AliALTROBUFFER_H #include -#ifdef __CINT__ -class fstream; -#else -#include "Riostream.h" -#endif +class AliFstream; + +class AliAltroMapping; class AliAltroBuffer: public TObject { public: - AliAltroBuffer(const char* fileName, Int_t flag); + AliAltroBuffer(const char* fileName, AliAltroMapping *mapping = NULL); virtual ~AliAltroBuffer(); - void FillBuffer(Int_t val); + virtual void FillBuffer(Int_t val); //this method stores a word into the buffer - Int_t GetFreeCellNumber()const {return fFreeCellBuffer;} - //this method returns the number of free cells of the internal buffer - Int_t GetNextBackWord(); - //this method returns the next word of 10 bit (reading the file backward) if it exists -1 otherwise - Int_t GetNext(); - //this method returns the next word of 10 bit (reading the file forward) if it exists -1 otherwise void WriteTrailer(Int_t wordsNumber, Int_t padNumber, Int_t rowNumber, Int_t secNumber); //this method is used to write the trailer - Bool_t ReadTrailer(Int_t& wordsNumber, Int_t& padNumber, - Int_t& rowNumber, Int_t &secNumber); - //this method is used to read the trailer when the file is read forward - Bool_t ReadTrailerBackward(Int_t& wordsNumber, Int_t& padNumber, - Int_t& rowNumber, Int_t& secNumber); - //this method is used to read the trailer when the file is read backward + virtual void WriteTrailer(Int_t wordsNumber, Short_t hwAddress); + //this method is used to write the trailer void WriteChannel(Int_t padNumber, Int_t rowNumber, Int_t secNumber, Int_t nTimeBins, const Int_t* adcValues, Int_t threshold = 0); //this method is used to write all ADC values and the trailer of a channel + void WriteChannel(Short_t hwAddress, + Int_t nTimeBins, const Int_t* adcValues, + Int_t threshold = 0); + //this method is used to write all ADC values and the trailer of a channel + Int_t WriteBunch(Int_t nTimeBins, const Int_t* adcValues, + Int_t threshold = 0); + //this method is used to write all ADC values void WriteDataHeader(Bool_t dummy, Bool_t compressed); //this method is used to write the data header + + virtual UChar_t WriteRCUTrailer(Int_t rcuId); + //this method is used to write the RCU trailer + void SetVerbose(Int_t val) {fVerbose = val;} //this method is used to set the verbose level //level 0 no output messages //level !=0 some messages are displayed during the run void Flush(); //this method is used to fill the buffer with 2AA hexadecimal value and save it into the output file - Int_t GetFillWordsNum() const {return fEndingFillWords;} - private: + void SetMapping(AliAltroMapping *mapping) { fMapping = mapping; } + + protected: AliAltroBuffer(const AliAltroBuffer& source); AliAltroBuffer& operator = (const AliAltroBuffer& source); @@ -78,14 +78,12 @@ class AliAltroBuffer: public TObject { //the shift operation are performed only on value Val. Int_t fCurrentCell; //This variable contains the cell number of the cell currently used Int_t fFreeCellBuffer;//number of free cells of the buffer - Int_t fFlag; //0 read 1 write Int_t fVerbose; //verbose level - fstream* fFile; //logical name of the I/O file - Int_t fMaskBackward; //bit mask for backward reading of a file - UInt_t fFilePosition;//'pointer' to the actual position in the file - UInt_t fFileEnd; //position of the last element of the file (File dimension) + AliFstream* fFile; //logical name of the I/O file UInt_t fDataHeaderPos;//Data header position - Int_t fEndingFillWords;//Few words at the end of the stream + + // Now the parameters for the mapping + AliAltroMapping* fMapping; // Pointer to the mapping handler ClassDef(AliAltroBuffer,0) // Interface to the Altro format };