]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/mapping/AliMpBusPatch.h
Added switch as new member for DA (Christian)
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpBusPatch.h
index 3f7723935377ca9cbd8b28da63b57221a8cd2fb1..10158a88a1d29a6a72ee2f8cb209229f8672ab9a 100644 (file)
  * See cxx source for full Copyright notice                               */
 
 // $Id$
-// $MpId: AliMpBusPatch.h,v 1.2 2006/03/17 11:35:58 ivana Exp $
+// $MpId: 
 
 /// \ingroup management
 /// \class AliMpBusPatch
-/// \brief Class that manages the maps buspatch<>DDL<>DE 
+/// \brief The class defines the properties of BusPatch
 ///
-/// Calculates also the maximum DSP and buspatch numbers for a given DE
-///
-/// Author: Ch. Finck; Subatech Nantes
+/// \author Ivana Hrivnacova, IPN Orsay
 
-#ifndef ALI_MP_BUSPATCH_H
-#define ALI_MP_BUSPATCH_H
+#ifndef ALI_MP_BUS_PATCH_H
+#define ALI_MP_BUS_PATCH_H
 
 #include <TObject.h>
 
-#include <TExMap.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   SetCableLength(Float_t length);
+
+    // get methods
+    Int_t  GetId() const;
+    Int_t  GetDEId() const;
+    Int_t  GetDdlId() 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;
+
+  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
+
+  ClassDef(AliMpBusPatch,2)  // 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 length of buspatch
+inline Float_t  AliMpBusPatch::GetCableLength() const
+{ return fCableLength; }
+
+/// Set length of buspatch
+inline void  AliMpBusPatch::SetCableLength(Float_t length)
+{ fCableLength = length; }
+
+#endif //ALI_BUS_PATCH_H
+
+
 
-class TArrayI;
 
-class AliMpBusPatch : public TObject
-{
 
- public:
 
-  AliMpBusPatch();
-  AliMpBusPatch(const AliMpBusPatch& src);
-  virtual ~AliMpBusPatch();
 
-  // operators  
-  AliMpBusPatch& operator = (const AliMpBusPatch& src) ;
-  
-  // methods
-  void ReadBusPatchFile();
-  void GetDspInfo(Int_t iCh, Int_t& iDspMax, Int_t* iBusPerDSP) const;
 
-  Int_t    GetDEfromBus(Int_t busPatchId);
-  TArrayI* GetBusfromDE(Int_t idDE);
-  Int_t    GetDDLfromBus(Int_t busPatchId);
 
- private:
 
-  TExMap fDetElemIdToBusPatch;       //! Map from idDE to BusPatch   
-  TExMap fBusPatchToDetElem;         //! Map from BusPatch to idDE
-  TExMap fBusPatchToDDL;             //! Map from BusPatch to iDDL
 
-  Int_t fMaxBusPerCh[10];            //! max buspatch number per chamber
 
-  ClassDef(AliMpBusPatch,1) //utility class for the motif type
-};
 
 
-#endif //ALI_MP_BUSPATCH_H