]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONBusStruct.h
New SSD calibration objects (AliITSBadChannelsSSD, AliITSGainSSD, AliITSNoiseSSD...
[u/mrichter/AliRoot.git] / MUON / AliMUONBusStruct.h
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 ///
12 //  Author Christian Finck
13
14 #include <TObject.h>
15
16 class AliMUONBusStruct : public TObject {
17
18 public:
19    AliMUONBusStruct ();
20    virtual ~AliMUONBusStruct ();
21    AliMUONBusStruct(const AliMUONBusStruct& rhs);
22    AliMUONBusStruct& operator=(const AliMUONBusStruct& rhs);
23
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
29    // header
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;}
38
39            /// Return header
40    Int_t*  GetHeader() {return &fDataKey;}
41
42    // data
43            /// Return initial size for data array
44    Int_t   GetBufSize()     const {return fBufSize;}
45            /// Return data
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;}
51
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;
57
58    // header setter
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;}
65            /// Set bus patch id 
66    void    SetBusPatchId(Int_t b)  {fBusPatchId = b;} 
67  
68    // data 
69            /// Set data 
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;}  
75
76    void    AddData(UInt_t d);
77    void    SetAlloc(Int_t size);
78
79    // TClonesArray
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);
84
85  private:
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
90
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;
94
95    Int_t     fBufSize;       ///< initial size for data array
96
97    UInt_t*   fData;          ///< data 
98
99    Int_t     fDspId;         ///< Dsp number for monitoring
100    Int_t     fBlkId;         ///< block numer for monitoring
101
102    void ResizeData(Int_t size = 0);
103
104    void Print(Option_t* opt) const;
105
106
107    ClassDef(AliMUONBusStruct,3)  // MUON DDL Tracker
108 };
109
110 #endif