Adding FindPCBIndexByMotifPositionID method (Laurent)
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 17 Oct 2007 13:02:10 +0000 (13:02 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 17 Oct 2007 13:02:10 +0000 (13:02 +0000)
MUON/mapping/AliMpSlat.cxx
MUON/mapping/AliMpSlat.h

index bcc498525ed0be949986777124d2b53720a021c1..10846dcf2c3ddda8b623dd4a088fda165c4f5df5 100644 (file)
@@ -330,6 +330,19 @@ AliMpSlat::FindPCBIndex(Double_t x, Double_t y) const
   return -1;
 }
 
   return -1;
 }
 
+//_____________________________________________________________________________
+Int_t 
+AliMpSlat::FindPCBIndexByMotifPositionID(Int_t manuId) const
+{
+  /// Find the index of the PCB containing a given manu
+  for ( Size_t i = 0; i< GetSize(); ++i )
+  {
+    AliMpPCB* pcb = GetPCB(i);
+    if ( pcb->HasMotifPositionID(manuId) ) return i;
+  }
+  return -1;
+}
+
 //_____________________________________________________________________________
 void
 AliMpSlat::ForcePosition(const TVector2& pos)
 //_____________________________________________________________________________
 void
 AliMpSlat::ForcePosition(const TVector2& pos)
index 073cf42741b946ea85fd9508561048c73547ced1..60ea0f3ee2756a99065bd9ef26c3791ef1920cf2 100644 (file)
@@ -80,18 +80,17 @@ class AliMpSlat : public TObject
   /// Find the PCB containing the pad at location (ix,any iy).
   AliMpPCB* FindPCB(Int_t ix) const;
 
   /// 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 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).
-       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;
 
   /// Returns the i-th PCB of this slat.
   AliMpPCB* GetPCB(Size_t i) const;