]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONBusStruct.h
Updated comments (Raffaele)
[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    // header
25    Int_t   GetDataKey()     const {return fDataKey;}
26    Int_t   GetTotalLength() const {return fTotalLength;}
27    Int_t   GetLength()      const {return fLength;}
28    Int_t   GetBusPatchId()  const {return fBusPatchId;}
29
30    Int_t   GetHeaderLength()   const {return fgkHeaderLength;}
31    UInt_t  GetDefaultDataKey() const {return fgkDefaultDataKey;}
32
33    Int_t*  GetHeader() {return &fDataKey;}
34
35    // data
36    Int_t   GetBufSize()     const {return fBufSize;}
37    UInt_t* GetData()        const {return fData;}
38    Int_t   GetBlockId()     const {return fBlkId;}
39    Int_t   GetDspId()       const {return fDspId;}
40
41    Char_t   GetParity(Int_t n) const;
42    UShort_t GetManuId(Int_t n) const;
43    Char_t   GetChannelId(Int_t n) const;
44    UShort_t GetCharge(Int_t n) const; 
45    UInt_t   GetData(Int_t n) const;
46
47    // header setter
48    void    SetDataKey(Int_t d)     {fDataKey = d;}
49    void    SetTotalLength(Int_t l) {fTotalLength = l;}
50    void    SetLength(Int_t l)      {fLength = l;}
51    void    SetBusPatchId(Int_t b)  {fBusPatchId = b;} 
52  
53    // data 
54    void    SetData(UInt_t d, Int_t n)  {fData[n] = d;}
55    void    SetBlockId(Int_t b)     {fBlkId = b;}  
56    void    SetDspId(Int_t d)       {fDspId = d;}  
57
58    void    AddData(UInt_t d);
59    void    SetAlloc(Int_t size);
60
61    // TClonesArray
62    Bool_t  IsSortable() const {return kTRUE;}
63    Int_t   Compare(const TObject *obj) const;
64    void    Clear(Option_t* opt);
65
66  private:
67    Int_t     fDataKey;       ///< Data key word for bus patch header 
68    Int_t     fTotalLength;   ///< total length of buspatch structure
69    Int_t     fLength;        ///< length of raw data
70    Int_t     fBusPatchId;    ///< bus patch id
71
72    static const Int_t  fgkHeaderLength;   ///< header length in word
73    static const UInt_t fgkDefaultDataKey; ///< default data key word for Bus Patch Header 
74
75    UInt_t*   fData;          ///< data 
76
77    Int_t     fBufSize;       ///< initial size for data array
78
79    Int_t     fDspId;         ///< Dsp number for monitoring
80    Int_t     fBlkId;         ///< block numer for monitoring
81
82    void ResizeData(Int_t size = 0);
83
84    ClassDef(AliMUONBusStruct,2)  // MUON DDL Tracker
85 };
86 #endif