#ifndef ALIMUONRAWWRITER_H
#define ALIMUONRAWWRITER_H
#include <TObject.h>
#include "AliFstream.h"
class AliMUONBlockHeader;
class AliMUONBusStruct;
class AliMUONDarcHeader;
class AliMUONVDigit;
class AliMUONDspHeader;
class AliMUONGlobalTrigger;
class AliMUONLocalStruct;
class AliMUONRegHeader;
class AliMUONVDigitStore;
class AliMUONVTriggerStore;
class AliMpDDLStore;
class AliMpExMap;
class AliRawDataHeaderSim;
class AliMUONRawWriter : public TObject
{
public:
AliMUONRawWriter();
virtual ~AliMUONRawWriter();
Int_t Digits2Raw(const AliMUONVDigitStore* digitStore, const AliMUONVTriggerStore* triggerStore);
void SetScalersNumbers();
void SetHeader(AliRawDataHeaderSim& header) {fHeader = &header;}
private:
void Digits2BusPatchMap(const AliMUONVDigitStore& digitStore, AliMpExMap& busPatchMap);
void WriteTrackerDDL(AliMpExMap& busPatchMap, Int_t iDDL);
Int_t WriteTriggerDDL(const AliMUONVTriggerStore& triggerStore, AliFstream* file[2]);
Int_t GetBusPatch(const AliMUONVDigit& digit) const;
private:
AliMUONRawWriter (const AliMUONRawWriter& rhs);
AliMUONRawWriter& operator=(const AliMUONRawWriter& rhs);
static void LocalWordPacking(UInt_t &word, UInt_t locId, UInt_t locDec,
UInt_t trigY, UInt_t posY, UInt_t posX,
UInt_t sdevX, UInt_t devX);
AliMUONBlockHeader* fBlockHeader;
AliMUONDspHeader* fDspHeader;
AliMUONDarcHeader* fDarcHeader;
AliMUONRegHeader* fRegHeader;
AliMUONLocalStruct* fLocalStruct;
AliMpDDLStore* fDDLStore;
Bool_t fScalerEvent;
AliRawDataHeaderSim* fHeader;
Int_t fBufferSize;
Int_t* fBuffer;
ClassDef(AliMUONRawWriter,5)
};
#endif