]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/mapping/AliMpPCB.h
Replacement of AliMpIntPair object with algoritmic
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpPCB.h
index 3978dde077129535d2fe9153b40688b9248a589c..bb73e27f6f05de71e2bdc4a125f5649a43c17817 100644 (file)
@@ -2,17 +2,26 @@
  * See cxx source for full Copyright notice                               */
 
 // $Id$ 
-// $MpId: AliMpPCB.h,v 1.6 2006/03/17 16:42:28 ivana Exp $ 
+// $MpId: AliMpPCB.h,v 1.9 2006/05/24 13:58:24 ivana Exp $ 
 
 /// \ingroup slat
 /// \class AliMpPCB
 /// \brief A PCB for station 3,4 or 5
 /// 
-/// Author: Laurent Aphecetche
+//  Author: Laurent Aphecetche
 
 #ifndef ALIMPPCB_H
 #define ALIMPPCB_H
 
+#ifndef ALI_MP_VPAD_ITERATOR_H
+#  include "AliMpVPadIterator.h"
+#endif
+
+#ifndef ALI_MP_AREA_H
+#  include "AliMpArea.h"
+#endif
+
+
 #ifndef ROOT_TObject
 #  include "TObject.h"
 #endif
 #  include "TString.h"
 #endif
 
-#  ifndef ROOT_TArraI
-#    include "TArrayI.h"
-#  endif
-
-#include "AliMpContainers.h"
+#ifndef ROOT_TArraI
+#  include "TArrayI.h"
+#endif
 
-#ifdef WITH_ROOT
-#  ifndef ROOT_TObjArray
-#    include "TObjArray.h"
-#  endif
-#else
-#  include <vector>
+#ifndef ROOT_TObjArray
+#  include "TObjArray.h"
 #endif
 
+class AliMpSlatMotifMap;
 class AliMpMotifPosition;
 class AliMpMotifType;
 class AliMpMotifSpecial;
@@ -43,24 +47,13 @@ class AliMpPCB : public TObject
 {
  public:
 
-#ifdef WITH_ROOT
-  typedef Int_t  Size_t;
-#else  
-  typedef UInt_t Size_t;
-#endif
-  
   AliMpPCB();
   /** Ctor. The sizes are given in mm.
-      enveloppe is due to the fact that not all PCBs are "full" of pads,
-      e.g. the rounded or short ones miss some pads, but the enveloppe 
-      is a virtual size that should be constant across the slats, 
-      and is 400x400 mm.
-      It's a usefull notion to compute e.g. slat center in a uniform way, 
-      considering that a slat is N PCBs, of the same "virtual" size, that of 
-      the enveloppe.
+      See full doc for the meaning of enveloppe parameters.
   */
-  AliMpPCB(const char* id, Double_t padSizeX, Double_t padSizeY,
-          Double_t enveloppeSizeX, Double_t enveloppeSizeY);
+  AliMpPCB(AliMpSlatMotifMap* motifMap,
+           const char* id, Double_t padSizeX, Double_t padSizeY,
+           Double_t enveloppeSizeX, Double_t enveloppeSizeY);
   
   AliMpPCB(const char* id, AliMpMotifSpecial* ms);
   
@@ -89,8 +82,12 @@ class AliMpPCB : public TObject
     */
   void Add(AliMpMotifType* motifType, Int_t ix, Int_t iy);
 
+  AliMpArea Area() const;
+  
   void Print(Option_t* option = "") const;
 
+  Bool_t HasMotifPositionID(Int_t manuId) const;
+  
   Double_t ActiveDX() const;
   Double_t ActiveDY() const;
 
@@ -115,7 +112,7 @@ class AliMpPCB : public TObject
   /** Returns the i-th motifPosition of this PCB.
       i : [0..GetSize()-1]
   */
-  AliMpMotifPosition* GetMotifPosition(Size_t i) const;
+  AliMpMotifPosition* GetMotifPosition(Int_t i) const;
 
   /// Returns the motifPosition which contains the pad at (ix,iy).
   AliMpMotifPosition* FindMotifPosition(Int_t ix, Int_t iy) const;
@@ -124,7 +121,7 @@ class AliMpPCB : public TObject
   AliMpMotifPosition* FindMotifPosition(Double_t x, Double_t y) const;
 
   /// The number of motifs, aka manus.
-  Size_t GetSize() const;
+  Int_t GetSize() const;
 
   Int_t GetNofPadsX() const;
   Int_t GetNofPadsY() const;
@@ -137,29 +134,32 @@ class AliMpPCB : public TObject
   
   const char* GetID() const;
   
+  /// Return the number of pads in this PCB 
   Int_t NofPads() const { return fNofPads; }
   
+  /// Return the motif map
+  AliMpSlatMotifMap* MotifMap() const { return fMotifMap; }
+  
+  void Save() const;
+  
  private:
-  TString fId;
-  Double_t fPadSizeX;
-  Double_t fPadSizeY;
-  Double_t fEnveloppeSizeX;
-  Double_t fEnveloppeSizeY;
-  Double_t fXoffset;
-  Double_t fActiveXmin;
-  Double_t fActiveXmax;
-  Int_t fIxmin;
-  Int_t fIxmax;
-  Int_t fIymin;
-  Int_t fIymax;
-#ifdef WITH_ROOT
-  TObjArray fMotifs;
-#else  
-  std::vector<AliMpMotifPosition*> fMotifs;
-#endif
-  Int_t fNofPads;
+  TString fId; ///< PCB name
+  Double_t fPadSizeX; ///< x-size of this PCB's pads (cm)
+  Double_t fPadSizeY; ///< y-size of this PCB's pads (cm)
+  Double_t fEnveloppeSizeX; ///< max x-size of this PCB (cm)
+  Double_t fEnveloppeSizeY; ///< max y-size of this PCB (cm)
+  Double_t fXoffset; ///< x-offset = x of first pad of this PCB (cm)
+  Double_t fActiveXmin; ///< min x of an actual pad in this PCB (cm)
+  Double_t fActiveXmax; ///< max x of an actual pad in this PCB (cm)
+  Int_t fIxmin; ///< min pad index in x
+  Int_t fIxmax; ///< max pad index in x
+  Int_t fIymin; ///< min pad index in y
+  Int_t fIymax; ///< max pad index in y
+  TObjArray fMotifPositions; ///< array of motifs
+  Int_t fNofPads; ///< number of pads in this PCB
+  AliMpSlatMotifMap* fMotifMap; ///< to keep track of things to avoid duplications of motif and motiftypes, and get proper deletion
   
-  ClassDef(AliMpPCB,2) // A PCB for Stations 3,4,5
+  ClassDef(AliMpPCB,3) // A PCB for Stations 3,4,5
 };
 
 #endif