1 #ifndef ALIMUONBUSSTRUCT_H
2 #define ALIMUONBUSSTRUCT_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
9 /// \class AliMUONBusStruct
10 /// \brief MUON buspatch structure for tracker
12 // Author Christian Finck
16 class AliMUONBusStruct : public TObject {
20 virtual ~AliMUONBusStruct ();
21 AliMUONBusStruct(const AliMUONBusStruct& rhs);
22 AliMUONBusStruct& operator=(const AliMUONBusStruct& rhs);
24 /// Return header length in word
25 static Int_t GetHeaderLength() {return fgkHeaderLength;}
26 /// Return default data key word for Bus Patch Header
27 static UInt_t GetDefaultDataKey() {return fgkDefaultDataKey;}
30 /// Return Data key word for bus patch header
31 Int_t GetDataKey() const {return fDataKey;}
32 /// Return total length of buspatch structure
33 Int_t GetTotalLength() const {return fTotalLength;}
34 /// Return length of raw data
35 Int_t GetLength() const {return fLength;}
36 /// Return bus patch id
37 Int_t GetBusPatchId() const {return fBusPatchId;}
40 Int_t* GetHeader() {return &fDataKey;}
43 /// Return initial size for data array
44 Int_t GetBufSize() const {return fBufSize;}
46 UInt_t* GetData() const {return fData;}
47 /// Return block numer for monitoring
48 Int_t GetBlockId() const {return fBlkId;}
49 /// Return Dsp number for monitoring
50 Int_t GetDspId() const {return fDspId;}
52 Char_t GetParity(Int_t n) const;
53 UShort_t GetManuId(Int_t n) const;
54 UChar_t GetChannelId(Int_t n) const;
55 UShort_t GetCharge(Int_t n) const;
56 UInt_t GetData(Int_t n) const;
59 /// Set Data key word for bus patch header
60 void SetDataKey(Int_t d) {fDataKey = d;}
61 /// Set total length of buspatch structure
62 void SetTotalLength(Int_t l) {fTotalLength = l;}
63 /// Set length of raw data
64 void SetLength(Int_t l) {fLength = l;}
66 void SetBusPatchId(Int_t b) {fBusPatchId = b;}
70 void SetData(UInt_t d, Int_t n) {fData[n] = d;}
71 /// Set block numer for monitoring
72 void SetBlockId(Int_t b) {fBlkId = b;}
73 /// Set Dsp number for monitoring
74 void SetDspId(Int_t d) {fDspId = d;}
76 void AddData(UInt_t d);
77 void SetAlloc(Int_t size);
80 /// Return true as Compare() is implemented
81 Bool_t IsSortable() const {return kTRUE;}
82 Int_t Compare(const TObject *obj) const;
83 void Clear(Option_t* opt);
86 Int_t fDataKey; ///< Data key word for bus patch header
87 Int_t fTotalLength; ///< total length of buspatch structure
88 Int_t fLength; ///< length of raw data
89 Int_t fBusPatchId; ///< bus patch id
91 static const Int_t fgkHeaderLength; ///< header length in word
92 static const UInt_t fgkDefaultDataKey; ///< default data key word for Bus Patch Header
93 static const Int_t fgkManuNofChannels;///< max number of channels per manu;
95 Int_t fBufSize; ///< initial size for data array
97 UInt_t* fData; ///< data
99 Int_t fDspId; ///< Dsp number for monitoring
100 Int_t fBlkId; ///< block numer for monitoring
102 void ResizeData(Int_t size = 0);
104 void Print(Option_t* opt) const;
107 ClassDef(AliMUONBusStruct,3) // MUON DDL Tracker