Fixes for #86059: Install data when ALICE_ROOT does not point to source (Christian)
[u/mrichter/AliRoot.git] / MUON / AliMUONBusStruct.h
CommitLineData
47c194a6 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 */
5
6/*$Id$*/
7
8/// \ingroup raw
9/// \class AliMUONBusStruct
10/// \brief MUON buspatch structure for tracker
11///
78649106 12// Author Christian Finck
47c194a6 13
14#include <TObject.h>
15
16class AliMUONBusStruct : public TObject {
17
18public:
19 AliMUONBusStruct ();
20 virtual ~AliMUONBusStruct ();
21 AliMUONBusStruct(const AliMUONBusStruct& rhs);
22 AliMUONBusStruct& operator=(const AliMUONBusStruct& rhs);
23
b56232f8 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;}
28
84ceeb06 29 // header
71a2d3aa 30 /// Return Data key word for bus patch header
84ceeb06 31 Int_t GetDataKey() const {return fDataKey;}
71a2d3aa 32 /// Return total length of buspatch structure
47c194a6 33 Int_t GetTotalLength() const {return fTotalLength;}
71a2d3aa 34 /// Return length of raw data
47c194a6 35 Int_t GetLength() const {return fLength;}
71a2d3aa 36 /// Return bus patch id
47c194a6 37 Int_t GetBusPatchId() const {return fBusPatchId;}
84ceeb06 38
71a2d3aa 39 /// Return header
84ceeb06 40 Int_t* GetHeader() {return &fDataKey;}
41
42 // data
71a2d3aa 43 /// Return initial size for data array
84ceeb06 44 Int_t GetBufSize() const {return fBufSize;}
71a2d3aa 45 /// Return data
47c194a6 46 UInt_t* GetData() const {return fData;}
71a2d3aa 47 /// Return block numer for monitoring
47c194a6 48 Int_t GetBlockId() const {return fBlkId;}
71a2d3aa 49 /// Return Dsp number for monitoring
47c194a6 50 Int_t GetDspId() const {return fDspId;}
51
47c194a6 52 Char_t GetParity(Int_t n) const;
53 UShort_t GetManuId(Int_t n) const;
000e9681 54 UChar_t GetChannelId(Int_t n) const;
47c194a6 55 UShort_t GetCharge(Int_t n) const;
56 UInt_t GetData(Int_t n) const;
57
84ceeb06 58 // header setter
71a2d3aa 59 /// Set Data key word for bus patch header
84ceeb06 60 void SetDataKey(Int_t d) {fDataKey = d;}
71a2d3aa 61 /// Set total length of buspatch structure
47c194a6 62 void SetTotalLength(Int_t l) {fTotalLength = l;}
71a2d3aa 63 /// Set length of raw data
47c194a6 64 void SetLength(Int_t l) {fLength = l;}
71a2d3aa 65 /// Set bus patch id
84ceeb06 66 void SetBusPatchId(Int_t b) {fBusPatchId = b;}
67
68 // data
71a2d3aa 69 /// Set data
47c194a6 70 void SetData(UInt_t d, Int_t n) {fData[n] = d;}
71a2d3aa 71 /// Set block numer for monitoring
47c194a6 72 void SetBlockId(Int_t b) {fBlkId = b;}
71a2d3aa 73 /// Set Dsp number for monitoring
47c194a6 74 void SetDspId(Int_t d) {fDspId = d;}
75
76 void AddData(UInt_t d);
77 void SetAlloc(Int_t size);
78
84ceeb06 79 // TClonesArray
71a2d3aa 80 /// Return true as Compare() is implemented
47c194a6 81 Bool_t IsSortable() const {return kTRUE;}
82 Int_t Compare(const TObject *obj) const;
83 void Clear(Option_t* opt);
84
47c194a6 85 private:
84ceeb06 86 Int_t fDataKey; ///< Data key word for bus patch header
829425a5 87 Int_t fTotalLength; ///< total length of buspatch structure
88 Int_t fLength; ///< length of raw data
89 Int_t fBusPatchId; ///< bus patch id
47c194a6 90
84ceeb06 91 static const Int_t fgkHeaderLength; ///< header length in word
92 static const UInt_t fgkDefaultDataKey; ///< default data key word for Bus Patch Header
b56232f8 93 static const Int_t fgkManuNofChannels;///< max number of channels per manu;
47c194a6 94
829425a5 95 Int_t fBufSize; ///< initial size for data array
47c194a6 96
878b883f 97 UInt_t* fData; ///< data
98
84ceeb06 99 Int_t fDspId; ///< Dsp number for monitoring
100 Int_t fBlkId; ///< block numer for monitoring
47c194a6 101
102 void ResizeData(Int_t size = 0);
103
1ed3c5c2 104 void Print(Option_t* opt) const;
105
106
878b883f 107 ClassDef(AliMUONBusStruct,3) // MUON DDL Tracker
47c194a6 108};
b56232f8 109
47c194a6 110#endif