]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/mapping/AliMpSlat.h
bugfix: stopwatches for HLT benchmarks had been resumed at wrong point and measuremen...
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpSlat.h
index bccd6bf53583abf20a81ce16f81d3faf1bd563cd..1242b0683023d1fcbbf2ca907da9e3e768f05b27 100644 (file)
@@ -2,13 +2,13 @@
  * See cxx source for full Copyright notice                               */
 
 // $Id$
-// $MpId: AliMpSlat.h,v 1.2 2005/09/19 19:01:09 ivana Exp $
+// $MpId: AliMpSlat.h,v 1.8 2006/05/24 13:58:24 ivana Exp $
 
 /// \ingroup slat
 /// \class AliMpSlat
 /// \brief A slat (building block of stations 3, 4 and 5)
 /// 
-/// Author: Laurent Aphecetche
+//  Author: Laurent Aphecetche
 
 #ifndef ALI_MP_SLAT_H
 #define ALI_MP_SLAT_H
 #endif
 
 #include "AliMpContainers.h"
+#include "AliMpExMap.h"
 
 class TArrayI;
 
 #ifdef WITH_ROOT
-#  include "AliMpExMap.h"
 #  include "TObjArray.h"
 #else
 #  include <vector>
-#  include <map>
+//#  include <map>
 #endif
 
 class AliMpMotifPosition;
@@ -51,24 +51,20 @@ class AliMpSlat : public TObject
 {
  public:
 
-#ifdef WITH_ROOT
-  typedef Int_t Size_t;
-#else
-  typedef UInt_t Size_t;
-#endif  
-  
-  AliMpSlat();
-  AliMpSlat(const char* id, AliMpPlaneType bendingOrNonBending);
+  AliMpSlat(TRootIOCtor* ioCtor);
+  AliMpSlat(const char* id, AliMp::PlaneType bendingOrNonBending);
   virtual ~AliMpSlat();
 
   TVector2 Dimensions() const;
-  TVector2 Position() const;
+  
+  /// Return position
+  TVector2 Position() const { return fPosition; }
   
   const char* GetName() const;
   
   const char* GetID() const;
 
-  void Add(AliMpPCB* pcbType, const TArrayI& manuList);
+  void Add(const AliMpPCB& pcbType, const TArrayI& manuList);
 
   Double_t DX() const;
   Double_t DY() const;
@@ -76,25 +72,20 @@ class AliMpSlat : public TObject
   /// Find the PCB containing the pad at location (ix,any iy).
   AliMpPCB* FindPCB(Int_t ix) const;
 
-  /** Find the index of the PCB containing the pad at location ix.
-   Should not be needed except to comply with Sector(), Dpx(), Dpy()
-        interface of old AliMUONVGeometrySegmentation.
-        FIXME: Remove me when VGeometrySegmentation dies at last.
-        */
-       Int_t FindPCBIndex(Int_t ix) const;
-       
+  /// Find the index of the PCB containing the pad at location ix.
+  Int_t FindPCBIndex(Int_t ix) const;
+
+  /// Find the index of the PCB containing a given manu
+  Int_t FindPCBIndexByMotifPositionID(Int_t manuId) const;
+  
   /// Find the PCB containing location (x,y).
   AliMpPCB* FindPCB(Double_t x, Double_t y) const;
 
-       /** Find the index of the PCB containing the pad at location (x,y).
-   Should not be needed except to comply with Sector(), Dpx(), Dpy()
-        interface of old AliMUONVGeometrySegmentation.
-        FIXME: Remove me when VGeometrySegmentation dies at last.
-        */
-       Int_t FindPCBIndex(Double_t x, Double_t y) const;
+  /// Find the index of the PCB containing the pad at location (x,y).
+  Int_t FindPCBIndex(Double_t x, Double_t y) const;
 
   /// Returns the i-th PCB of this slat.
-  AliMpPCB* GetPCB(Size_t i) const;
+  AliMpPCB* GetPCB(Int_t i) const;
 
   /// Returns the MotifPosition containing location (x,y).
   AliMpMotifPosition* FindMotifPosition(Double_t x, Double_t y) const;
@@ -106,7 +97,7 @@ class AliMpSlat : public TObject
   AliMpMotifPosition* FindMotifPosition(Int_t ix, Int_t iy) const;
 
   /// Return the ids of the electronic cards (either manu or local board).
-  void GetAllElectronicCardNumbers(TArrayI& ecn) const;
+  void GetAllMotifPositionsIDs(TArrayI& ecn) const;
   
   /** Returns the max. number of pads in the x-direction contained in this slat.
     This is a max only as for e.g. non-bending slats, the y-dimension depends
@@ -126,7 +117,7 @@ class AliMpSlat : public TObject
   Int_t GetNofPadsX() const;
  
   /// Returns the number of PCBs of this slat.
-  Size_t GetSize() const;
+  Int_t GetSize() const;
     
   void Print(Option_t* option="") const;
 
@@ -135,23 +126,36 @@ class AliMpSlat : public TObject
     */
   void ForcePosition(const TVector2& pos);
   
+  /// Return the plane type
+  AliMp::PlaneType PlaneType() const { return fPlaneType; }
+  
+  /// Return the number of pads in this slat
+  Int_t NofPads() const { return fNofPads; }
  private:
-  TString fId;
-  AliMpPlaneType fPlaneType;
-  Double_t fDX;
-  Double_t fDY;
-  Int_t fNofPadsX;
-  Int_t fMaxNofPadsY;
+  /// Not implemented
+  AliMpSlat();
+  /// Not implemented
+  AliMpSlat(const AliMpSlat& rhs);
+  /// Not implemented
+  AliMpSlat& operator=(const AliMpSlat& rhs);
+
+  TString fId; ///< The name of this slat, e.g. 112233N
+  AliMp::PlaneType fPlaneType; ///< Whether it's bending or non-bending plane
+  Double_t fDX; ///< Half-size in X (cm)
+  Double_t fDY; ///< Half-size in Y (cm)
+  Int_t fNofPadsX; ///< Actual number of pads in x direction
+  Int_t fMaxNofPadsY; ///< Maximum number of pads in y direction
+  mutable AliMpExMap fManuMap; ///< map of int to AliMpMotifPosition*
 #ifdef WITH_ROOT
-  TObjArray fPCBs; // array of AliMpPCB*
-  mutable AliMpExMap fManuMap; // map of int to AliMpMotifPosition*
+  TObjArray fPCBs; ///< array of AliMpPCB*
 #else  
-  std::vector<AliMpPCB*> fPCBs;
-  std::map<int,AliMpMotifPosition*> fManuMap;
+  std::vector<AliMpPCB*> fPCBs; ///< array of AliMpPCB*
 #endif
-  TVector2 fPosition;
+  TVector2 fPosition; ///< Position of the slat center.
+  Int_t fNofPads; ///< number of pads in this slat
   
-  ClassDef(AliMpSlat,1) // A slat for stations 3,4,5
+  ClassDef(AliMpSlat,2) // A slat for stations 3,4,5
 };
 
 #endif