]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added function GetCell.
authornilsen <nilsen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 22 Jan 2003 01:07:29 +0000 (01:07 +0000)
committernilsen <nilsen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 22 Jan 2003 01:07:29 +0000 (01:07 +0000)
ITS/AliITSpList.h

index 214acb43c44b29fa6e721c5520c3ca13e16c6d6d..0c217ce89e5b798659a33f710a6f86f8cfc3d8f9 100644 (file)
@@ -217,6 +217,19 @@ class AliITSpList: public AliITSMap {
     void SetHit(Int_t i,Int_t j,Int_t k){;}
     // Flags a hit. Not of relavence in this case.
     void FlagHit(Int_t i,Int_t j){;}
+    // returns the i,j index numbers from the liniarized index computed
+    // from GetIndex above.
+    void GetCell(Int_t index,Int_t &i,Int_t &j){
+       if(index<0 || index>=fNi*fNj){
+           Warning("GetCell","Index out of range 0<=index=%d<%d",
+                   index,fNi*fNj);
+           i=-1;j=-1;
+           return;
+       } // end if
+       i = index/fNj;
+       j = index - fNj*i;
+       return;
+    }
 
  private:
     Int_t     fNi,fNj;   // The max index in i,j.