ROOT logo
#ifndef ALIMUONBUSSTRUCT_H
#define ALIMUONBUSSTRUCT_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

/*$Id$*/

/// \ingroup raw
/// \class AliMUONBusStruct
/// \brief MUON buspatch structure for tracker
///
//  Author Christian Finck

#include <TObject.h>

class AliMUONBusStruct : public TObject {

public:
   AliMUONBusStruct ();
   virtual ~AliMUONBusStruct ();
   AliMUONBusStruct(const AliMUONBusStruct& rhs);
   AliMUONBusStruct& operator=(const AliMUONBusStruct& rhs);

           /// Return header length in word
   static Int_t   GetHeaderLength()   {return fgkHeaderLength;}
           /// Return default data key word for Bus Patch Header
   static UInt_t  GetDefaultDataKey() {return fgkDefaultDataKey;}

   // header
           /// Return Data key word for bus patch header
   Int_t   GetDataKey()     const {return fDataKey;}
           /// Return total length of buspatch structure
   Int_t   GetTotalLength() const {return fTotalLength;}
           /// Return length of raw data
   Int_t   GetLength()      const {return fLength;}
           /// Return bus patch id
   Int_t   GetBusPatchId()  const {return fBusPatchId;}

           /// Return header
   Int_t*  GetHeader() {return &fDataKey;}

   // data
           /// Return initial size for data array
   Int_t   GetBufSize()     const {return fBufSize;}
           /// Return data
   UInt_t* GetData()        const {return fData;}
           /// Return block numer for monitoring
   Int_t   GetBlockId()     const {return fBlkId;}
           /// Return Dsp number for monitoring
   Int_t   GetDspId()       const {return fDspId;}

   Char_t   GetParity(Int_t n) const;
   UShort_t GetManuId(Int_t n) const;
   UChar_t   GetChannelId(Int_t n) const;
   UShort_t GetCharge(Int_t n) const; 
   UInt_t   GetData(Int_t n) const;

   // header setter
           /// Set Data key word for bus patch header 
   void    SetDataKey(Int_t d)     {fDataKey = d;}
           /// Set total length of buspatch structure 
   void    SetTotalLength(Int_t l) {fTotalLength = l;}
           /// Set length of raw data 
   void    SetLength(Int_t l)      {fLength = l;}
           /// Set bus patch id 
   void    SetBusPatchId(Int_t b)  {fBusPatchId = b;} 
 
   // data 
           /// Set data 
   void    SetData(UInt_t d, Int_t n)  {fData[n] = d;}
           /// Set block numer for monitoring 
   void    SetBlockId(Int_t b)     {fBlkId = b;}  
           /// Set Dsp number for monitoring 
   void    SetDspId(Int_t d)       {fDspId = d;}  

   void    AddData(UInt_t d);
   void    SetAlloc(Int_t size);

   // TClonesArray
           /// Return true as  Compare() is implemented
   Bool_t  IsSortable() const {return kTRUE;}
   Int_t   Compare(const TObject *obj) const;
   void    Clear(Option_t* opt);

 private:
   Int_t     fDataKey;       ///< Data key word for bus patch header 
   Int_t     fTotalLength;   ///< total length of buspatch structure
   Int_t     fLength;        ///< length of raw data
   Int_t     fBusPatchId;    ///< bus patch id

   static const Int_t  fgkHeaderLength;   ///< header length in word
   static const UInt_t fgkDefaultDataKey; ///< default data key word for Bus Patch Header 
   static const Int_t  fgkManuNofChannels;///< max number of channels per manu;

   Int_t     fBufSize;       ///< initial size for data array

   UInt_t*   fData;          ///< data 

   Int_t     fDspId;         ///< Dsp number for monitoring
   Int_t     fBlkId;         ///< block numer for monitoring

   void ResizeData(Int_t size = 0);

   void Print(Option_t* opt) const;


   ClassDef(AliMUONBusStruct,3)  // MUON DDL Tracker
};

#endif
 AliMUONBusStruct.h:1
 AliMUONBusStruct.h:2
 AliMUONBusStruct.h:3
 AliMUONBusStruct.h:4
 AliMUONBusStruct.h:5
 AliMUONBusStruct.h:6
 AliMUONBusStruct.h:7
 AliMUONBusStruct.h:8
 AliMUONBusStruct.h:9
 AliMUONBusStruct.h:10
 AliMUONBusStruct.h:11
 AliMUONBusStruct.h:12
 AliMUONBusStruct.h:13
 AliMUONBusStruct.h:14
 AliMUONBusStruct.h:15
 AliMUONBusStruct.h:16
 AliMUONBusStruct.h:17
 AliMUONBusStruct.h:18
 AliMUONBusStruct.h:19
 AliMUONBusStruct.h:20
 AliMUONBusStruct.h:21
 AliMUONBusStruct.h:22
 AliMUONBusStruct.h:23
 AliMUONBusStruct.h:24
 AliMUONBusStruct.h:25
 AliMUONBusStruct.h:26
 AliMUONBusStruct.h:27
 AliMUONBusStruct.h:28
 AliMUONBusStruct.h:29
 AliMUONBusStruct.h:30
 AliMUONBusStruct.h:31
 AliMUONBusStruct.h:32
 AliMUONBusStruct.h:33
 AliMUONBusStruct.h:34
 AliMUONBusStruct.h:35
 AliMUONBusStruct.h:36
 AliMUONBusStruct.h:37
 AliMUONBusStruct.h:38
 AliMUONBusStruct.h:39
 AliMUONBusStruct.h:40
 AliMUONBusStruct.h:41
 AliMUONBusStruct.h:42
 AliMUONBusStruct.h:43
 AliMUONBusStruct.h:44
 AliMUONBusStruct.h:45
 AliMUONBusStruct.h:46
 AliMUONBusStruct.h:47
 AliMUONBusStruct.h:48
 AliMUONBusStruct.h:49
 AliMUONBusStruct.h:50
 AliMUONBusStruct.h:51
 AliMUONBusStruct.h:52
 AliMUONBusStruct.h:53
 AliMUONBusStruct.h:54
 AliMUONBusStruct.h:55
 AliMUONBusStruct.h:56
 AliMUONBusStruct.h:57
 AliMUONBusStruct.h:58
 AliMUONBusStruct.h:59
 AliMUONBusStruct.h:60
 AliMUONBusStruct.h:61
 AliMUONBusStruct.h:62
 AliMUONBusStruct.h:63
 AliMUONBusStruct.h:64
 AliMUONBusStruct.h:65
 AliMUONBusStruct.h:66
 AliMUONBusStruct.h:67
 AliMUONBusStruct.h:68
 AliMUONBusStruct.h:69
 AliMUONBusStruct.h:70
 AliMUONBusStruct.h:71
 AliMUONBusStruct.h:72
 AliMUONBusStruct.h:73
 AliMUONBusStruct.h:74
 AliMUONBusStruct.h:75
 AliMUONBusStruct.h:76
 AliMUONBusStruct.h:77
 AliMUONBusStruct.h:78
 AliMUONBusStruct.h:79
 AliMUONBusStruct.h:80
 AliMUONBusStruct.h:81
 AliMUONBusStruct.h:82
 AliMUONBusStruct.h:83
 AliMUONBusStruct.h:84
 AliMUONBusStruct.h:85
 AliMUONBusStruct.h:86
 AliMUONBusStruct.h:87
 AliMUONBusStruct.h:88
 AliMUONBusStruct.h:89
 AliMUONBusStruct.h:90
 AliMUONBusStruct.h:91
 AliMUONBusStruct.h:92
 AliMUONBusStruct.h:93
 AliMUONBusStruct.h:94
 AliMUONBusStruct.h:95
 AliMUONBusStruct.h:96
 AliMUONBusStruct.h:97
 AliMUONBusStruct.h:98
 AliMUONBusStruct.h:99
 AliMUONBusStruct.h:100
 AliMUONBusStruct.h:101
 AliMUONBusStruct.h:102
 AliMUONBusStruct.h:103
 AliMUONBusStruct.h:104
 AliMUONBusStruct.h:105
 AliMUONBusStruct.h:106
 AliMUONBusStruct.h:107
 AliMUONBusStruct.h:108
 AliMUONBusStruct.h:109
 AliMUONBusStruct.h:110