]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDSignalIndex.h
Revert "Revert "#103626: Commit DCal geometry to master" since the files are broken."
[u/mrichter/AliRoot.git] / TRD / AliTRDSignalIndex.h
index 62456dc737657c8196d2dfbe548a8eeaedf251e0..b564b464bd6fa33833ae04401c452677605d4d77 100644 (file)
@@ -50,22 +50,16 @@ public:
   void     ResetArrays();
 
   // Store the index row-column as an interesting one
-  void     AddIndexRC(const Int_t row, const Int_t col){
-    Int_t num=row*fNcols+col;
-    if(fBoolIndex[num])return;
-    fBoolIndex[num]=kTRUE;
-    fSortedIndex[fCountRC].s.col=col;
-    fSortedIndex[fCountRC].s.row=row;
-    fCountRC++;
-  };
-
+  inline void AddIndexRC(const Int_t row, const Int_t col);
   // Get the next pad (row and column) and return kTRUE on success
-  Bool_t   NextRCIndex(Int_t &row, Int_t &col); 
+  inline Bool_t NextRCIndex(Int_t &row, Int_t &col); 
   // Get the next timebin of a pad (row and column) and return kTRUE on success
   Bool_t   NextRCTbinIndex(Int_t &row, Int_t &col, Int_t &tbin); 
   // Get the next active timebin and return kTRUE on success
   Bool_t   NextTbinIndex(Int_t &tbin); 
 
+  Bool_t CheckSorting(Int_t &row, Int_t &col);
+
   Int_t    GetCurrentRow() const  { return fCurrRow; }
   Int_t    GetCurrentCol() const  { return fCurrCol; }
   Int_t    GetCurrentTbin() const { return fCurrTbin; }
@@ -123,6 +117,40 @@ public:
   ClassDef(AliTRDSignalIndex,2)  //  Data container for one TRD detector segment
 
 };
+
+void AliTRDSignalIndex::AddIndexRC(const Int_t row, const Int_t col)
+{
+  //
+  // Adds RC combination to array
+  //
+
+  const Int_t num=row*fNcols+col;
+  if(fBoolIndex[num])return;
+  fBoolIndex[num]=kTRUE;
+  fSortedIndex[fCountRC].s.col=col;
+  fSortedIndex[fCountRC].s.row=row;
+  fCountRC++;
+}
+
+Bool_t AliTRDSignalIndex::NextRCIndex(Int_t &row, Int_t &col)
+{
+  //
+  // Returns next used RC combination
+  //
+
+  if (!IsAllocated())
+    return kFALSE;
+
+  if(fSortedIndex[fPositionRC].rc>-1){
+    row = fCurrRow = fSortedIndex[fPositionRC].s.row;
+    col = fCurrCol = fSortedIndex[fPositionRC].s.col;
+    fPositionRC++;
+    return kTRUE;
+  }
+  else
+    return CheckSorting(row, col);
+}
+
 #endif
 
 /*