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

// $Id$
// $MpId: $ 

/// \ingroup management
/// \class AliMpBusPatch
/// \brief The class defines the properties of BusPatch
///
/// \author Ivana Hrivnacova, IPN Orsay

#ifndef ALI_MP_BUS_PATCH_H
#define ALI_MP_BUS_PATCH_H

#include <TObject.h>
#include <TString.h>

#include "AliMpArrayI.h"

class AliMpBusPatch : public  TObject {

  public:
    AliMpBusPatch(Int_t id, Int_t deId, Int_t ddlId);
    AliMpBusPatch(TRootIOCtor* /*ioCtor*/);
    virtual ~AliMpBusPatch();

    // static methods
    static Int_t GetGlobalBusID(Int_t localID, Int_t ddlID);
    static Int_t GetLocalBusID(Int_t globalID, Int_t ddlID);

    // methods 
    Bool_t AddManu(Int_t manuId);
    Bool_t SetNofManusPerModule(Int_t manuNumber = 0);
    void   SetTranslatorLabel(TString label);
    void   SetCableLabel(TString label); 
    void   SetCableLength(Float_t length);
    void   SetFrtId(Int_t id);
    void   RevertReadout();
    void   ResetReadout();
  
    // get methods
    Int_t  GetId() const;
    Int_t  GetDEId() const;
    Int_t  GetDdlId() const;
    Int_t  GetFrtId() const;
    Int_t  GetNofManus() const;
    Int_t  GetManuId(Int_t index) const;
    Bool_t HasManu(Int_t manuId) const;
    
    Int_t  GetNofPatchModules() const;
    Int_t  GetNofManusPerModule(Int_t patchModule) const;
    
    Float_t  GetCableLength() const;
    TString  GetCableLabel() const;
    TString  GetTranslatorLabel() const;
  TString GetFRTPosition() const;
  
  virtual void Print(Option_t* opt="") const;
  
  private:
    /// Not implemented
    AliMpBusPatch();
    /// Not implemented
    AliMpBusPatch(const AliMpBusPatch& rhs);
    /// Not implemented
    AliMpBusPatch& operator=(const AliMpBusPatch& rhs);

    // static data members	
    static const Int_t  fgkOffset; ///< Offset for conversion global/local ID  

    // data members	
    Int_t        fId;     ///< Identifier (unique)
    Int_t        fDEId;   ///< Detection element to which this bus patch is connected
    Int_t        fDdlId;  ///< DDL to which this bus patch is connected
    AliMpArrayI  fManus;  ///< Manu Ids connected to this bus patch
    AliMpArrayI  fNofManusPerModule; ///< Nof Manus per patch modules (PCBs)
    Float_t      fCableLength;       ///< length of the buspatch cable
    TString      fCableLabel;        ///< label of the buspatch cable
    TString      fTranslatorLabel;   ///< label of the translator board
    Int_t        fFrtId;               ///< FRT Ids connected to this bus patch

  ClassDef(AliMpBusPatch,3)  // The class collectiong electronics properties of DDL
};

// inline functions

/// Return the unique Id
inline Int_t AliMpBusPatch::GetId() const
{  return fId; }

/// Return the Detection element Id
inline Int_t AliMpBusPatch::GetDEId() const
{  return fDEId; }

/// Return the Ddl Id
inline Int_t AliMpBusPatch::GetDdlId() const
{  return fDdlId; }

/// Return the FRT Id
inline Int_t AliMpBusPatch::GetFrtId() const
{  return fFrtId; }

/// Return length of buspatch
inline Float_t  AliMpBusPatch::GetCableLength() const
{ return fCableLength; }

/// Set FRT id for buspatch
inline void  AliMpBusPatch::SetFrtId(Int_t id)
{ fFrtId = id; }

/// Set length of buspatch
inline void  AliMpBusPatch::SetCableLength(Float_t length)
{ fCableLength = length; }

/// Return label of buspatch
inline TString  AliMpBusPatch::GetCableLabel() const
{ return fCableLabel; }

/// Set label of buspatch
inline void  AliMpBusPatch::SetCableLabel(TString label)
{ fCableLabel = label; }

/// Return label of translator
inline TString  AliMpBusPatch::GetTranslatorLabel() const
{ return fCableLabel; }

/// Set label of translator
inline void  AliMpBusPatch::SetTranslatorLabel(TString label)
{ fTranslatorLabel = label; }


#endif //ALI_BUS_PATCH_H














 AliMpBusPatch.h:1
 AliMpBusPatch.h:2
 AliMpBusPatch.h:3
 AliMpBusPatch.h:4
 AliMpBusPatch.h:5
 AliMpBusPatch.h:6
 AliMpBusPatch.h:7
 AliMpBusPatch.h:8
 AliMpBusPatch.h:9
 AliMpBusPatch.h:10
 AliMpBusPatch.h:11
 AliMpBusPatch.h:12
 AliMpBusPatch.h:13
 AliMpBusPatch.h:14
 AliMpBusPatch.h:15
 AliMpBusPatch.h:16
 AliMpBusPatch.h:17
 AliMpBusPatch.h:18
 AliMpBusPatch.h:19
 AliMpBusPatch.h:20
 AliMpBusPatch.h:21
 AliMpBusPatch.h:22
 AliMpBusPatch.h:23
 AliMpBusPatch.h:24
 AliMpBusPatch.h:25
 AliMpBusPatch.h:26
 AliMpBusPatch.h:27
 AliMpBusPatch.h:28
 AliMpBusPatch.h:29
 AliMpBusPatch.h:30
 AliMpBusPatch.h:31
 AliMpBusPatch.h:32
 AliMpBusPatch.h:33
 AliMpBusPatch.h:34
 AliMpBusPatch.h:35
 AliMpBusPatch.h:36
 AliMpBusPatch.h:37
 AliMpBusPatch.h:38
 AliMpBusPatch.h:39
 AliMpBusPatch.h:40
 AliMpBusPatch.h:41
 AliMpBusPatch.h:42
 AliMpBusPatch.h:43
 AliMpBusPatch.h:44
 AliMpBusPatch.h:45
 AliMpBusPatch.h:46
 AliMpBusPatch.h:47
 AliMpBusPatch.h:48
 AliMpBusPatch.h:49
 AliMpBusPatch.h:50
 AliMpBusPatch.h:51
 AliMpBusPatch.h:52
 AliMpBusPatch.h:53
 AliMpBusPatch.h:54
 AliMpBusPatch.h:55
 AliMpBusPatch.h:56
 AliMpBusPatch.h:57
 AliMpBusPatch.h:58
 AliMpBusPatch.h:59
 AliMpBusPatch.h:60
 AliMpBusPatch.h:61
 AliMpBusPatch.h:62
 AliMpBusPatch.h:63
 AliMpBusPatch.h:64
 AliMpBusPatch.h:65
 AliMpBusPatch.h:66
 AliMpBusPatch.h:67
 AliMpBusPatch.h:68
 AliMpBusPatch.h:69
 AliMpBusPatch.h:70
 AliMpBusPatch.h:71
 AliMpBusPatch.h:72
 AliMpBusPatch.h:73
 AliMpBusPatch.h:74
 AliMpBusPatch.h:75
 AliMpBusPatch.h:76
 AliMpBusPatch.h:77
 AliMpBusPatch.h:78
 AliMpBusPatch.h:79
 AliMpBusPatch.h:80
 AliMpBusPatch.h:81
 AliMpBusPatch.h:82
 AliMpBusPatch.h:83
 AliMpBusPatch.h:84
 AliMpBusPatch.h:85
 AliMpBusPatch.h:86
 AliMpBusPatch.h:87
 AliMpBusPatch.h:88
 AliMpBusPatch.h:89
 AliMpBusPatch.h:90
 AliMpBusPatch.h:91
 AliMpBusPatch.h:92
 AliMpBusPatch.h:93
 AliMpBusPatch.h:94
 AliMpBusPatch.h:95
 AliMpBusPatch.h:96
 AliMpBusPatch.h:97
 AliMpBusPatch.h:98
 AliMpBusPatch.h:99
 AliMpBusPatch.h:100
 AliMpBusPatch.h:101
 AliMpBusPatch.h:102
 AliMpBusPatch.h:103
 AliMpBusPatch.h:104
 AliMpBusPatch.h:105
 AliMpBusPatch.h:106
 AliMpBusPatch.h:107
 AliMpBusPatch.h:108
 AliMpBusPatch.h:109
 AliMpBusPatch.h:110
 AliMpBusPatch.h:111
 AliMpBusPatch.h:112
 AliMpBusPatch.h:113
 AliMpBusPatch.h:114
 AliMpBusPatch.h:115
 AliMpBusPatch.h:116
 AliMpBusPatch.h:117
 AliMpBusPatch.h:118
 AliMpBusPatch.h:119
 AliMpBusPatch.h:120
 AliMpBusPatch.h:121
 AliMpBusPatch.h:122
 AliMpBusPatch.h:123
 AliMpBusPatch.h:124
 AliMpBusPatch.h:125
 AliMpBusPatch.h:126
 AliMpBusPatch.h:127
 AliMpBusPatch.h:128
 AliMpBusPatch.h:129
 AliMpBusPatch.h:130
 AliMpBusPatch.h:131
 AliMpBusPatch.h:132
 AliMpBusPatch.h:133
 AliMpBusPatch.h:134
 AliMpBusPatch.h:135
 AliMpBusPatch.h:136
 AliMpBusPatch.h:137
 AliMpBusPatch.h:138
 AliMpBusPatch.h:139
 AliMpBusPatch.h:140
 AliMpBusPatch.h:141
 AliMpBusPatch.h:142
 AliMpBusPatch.h:143
 AliMpBusPatch.h:144
 AliMpBusPatch.h:145
 AliMpBusPatch.h:146
 AliMpBusPatch.h:147