From db95e382db8d80dcc373ae7bac1c0c51f0403408 Mon Sep 17 00:00:00 2001 From: ivana Date: Wed, 17 Oct 2007 13:02:10 +0000 Subject: [PATCH] Adding FindPCBIndexByMotifPositionID method (Laurent) --- MUON/mapping/AliMpSlat.cxx | 13 +++++++++++++ MUON/mapping/AliMpSlat.h | 17 ++++++++--------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/MUON/mapping/AliMpSlat.cxx b/MUON/mapping/AliMpSlat.cxx index bcc498525ed..10846dcf2c3 100644 --- a/MUON/mapping/AliMpSlat.cxx +++ b/MUON/mapping/AliMpSlat.cxx @@ -330,6 +330,19 @@ AliMpSlat::FindPCBIndex(Double_t x, Double_t y) const 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) diff --git a/MUON/mapping/AliMpSlat.h b/MUON/mapping/AliMpSlat.h index 073cf42741b..60ea0f3ee27 100644 --- a/MUON/mapping/AliMpSlat.h +++ b/MUON/mapping/AliMpSlat.h @@ -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 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). - 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; -- 2.39.1