// ***********************************************************************
#include "TArrayI.h"
#include "TClonesArray.h"
+#include "AliLog.h"
#include "AliITSMap.h"
#include "AliITSpListItem.h"
// returns "hit" AliITSpListItem as a TObject.
TObject * GetHit(Int_t i,Int_t j) const {return (TObject*)GetpListItem(i,j);}
// tests hit status.
- virtual FlagType TestHit(Int_t i,Int_t j){if(GetpListItem(i,j)==0) return kEmpty;
- else if(GetSignal(i,j)<=0) return kUnused; else return kUsed;}
+ virtual FlagTypeITS TestHit(Int_t i,Int_t j){if(GetpListItem(i,j)==0) return kEmptyITS;
+ else if(GetSignal(i,j)<=0) return kUnusedITS; else return kUsedITS;}
// returns the pList Item stored in the TClonesArray
AliITSpListItem* GetpListItem(Int_t index) { if((fa[index]).IsUsed())
return &(fa[index]);
// Flags a hit. Not of relavence in this case.
virtual void FlagHit(Int_t /* i */,Int_t /* j */){NotImplemented("FlagHit");}
virtual void GetCell(Int_t index,Int_t &i,Int_t &j) const;
+ // GetIndex returns the TClonesArray index for a given set of map indexes.
+ static Int_t GetIndex(Int_t i,Int_t j,Int_t maxj){
+ return maxj*i+j;}
private:
// private methods
- Int_t GetIndex(Int_t i,Int_t j) const;
+ Int_t GetIndex(Int_t i,Int_t j) const {
+ if(i<0||i>=fNi || j<0||j>=fNj){AliWarning(Form("Index out of range 0<i=%d<%d and 0<0j=%d<%d",i,fNi,j,fNj)); return -1;}
+ return GetIndex(i,j,fNj);}
void NotImplemented(const char *method) const {if(gDebug>0)
- Warning(method,"This method is not implemented for this class");}
+ Warning(method,"This method is not implemented for this class");}
// data members
Int_t fNi,fNj; // The max index in i,j.
AliITSpListItem *fa; // array of pList items