#ifndef ALIITSCLUSTERFINDER_H
#define ALIITSCLUSTERFINDER_H
#include <TObject.h>
#include <TClonesArray.h>
#include "AliLog.h"
class AliITSMap;
class AliITSresponse;
class AliITSsegmentation;
class AliITSdigit;
class AliITSRecPoint;
class AliITSDetTypeRec;
class AliRawReader;
class TArrayI;
using std::istream;
class AliITSClusterFinder :public TObject{
public:
AliITSClusterFinder();
AliITSClusterFinder(AliITSDetTypeRec* dettyp);
AliITSClusterFinder(AliITSDetTypeRec* dettyp,TClonesArray *digits);
virtual ~AliITSClusterFinder();
virtual void FindRawClusters(Int_t )=0;
virtual void RawdataToClusters(AliRawReader* ) {
AliError("Method not implemented in this class ");
}
virtual void SetDigits(TClonesArray *itsDigits) {
fDigits=itsDigits;fNdigits = fDigits->GetEntriesFast();}
virtual AliITSdigit* GetDigit(Int_t i){
return (AliITSdigit*) fDigits->UncheckedAt(i);}
virtual TClonesArray* Digits(){return fDigits;}
virtual Int_t NDigits() const {return fNdigits;}
virtual void SetClusters(TClonesArray *itsClusters){
fClusters = itsClusters;}
virtual TClonesArray* Clusters(){return fClusters;}
virtual Int_t NClusters()const {return fClusters->GetEntriesFast();}
virtual void SetModule(Int_t module){fModule = module;}
virtual Int_t GetModule()const {return fModule;}
void SetEvent(Int_t event) { fEvent=event; }
virtual void SetMap(AliITSMap *m) {fMap=m;}
AliITSMap* Map(){return fMap;}
virtual Int_t GetNPeaks() const {return fNPeaks;}
virtual Bool_t IsNeighbor(TObjArray *digs,Int_t i,Int_t j[]) const;
void Print(ostream *os) const;
void Read(istream *os);
virtual void Print(Option_t *option="") const {TObject::Print(option);}
virtual Int_t Read(const char *name) {return TObject::Read(name);}
virtual void SetDetTypeRec(AliITSDetTypeRec* dtr) {fDetTypeRec=dtr;}
AliITSDetTypeRec* GetDetTypeRec() const {return fDetTypeRec;}
void InitGeometry();
Int_t GetNClusters() const {return fNClusters;}
void SetRawID2ClusID(TArrayI *arr) {fRawID2ClusID = arr;}
TArrayI* GetRawID2ClusID() const {return fRawID2ClusID;}
protected:
class Ali1Dcluster {
public:
void SetY(Float_t y) {fY=y;}
void SetQ(Float_t q) {fQ=q;}
void SetNd(Int_t n) {fNd=n;}
void SetLabels(Int_t *lab) {fLab[0]=lab[0];fLab[1]=lab[1];fLab[2]=lab[2];}
Float_t GetY() const {return fY;}
Float_t GetQ() const {return fQ;}
Int_t GetNd()const {return fNd;}
Int_t GetLabel(Int_t lab) const { return fLab[lab]; }
protected:
Float_t fY;
Float_t fQ;
Int_t fNd;
Int_t fLab[3];
};
class AliBin {
public:
AliBin():fIndex(0),fMask(0xFFFFFFFE),fRawID(-1),fQ(0){}
void SetIndex(UInt_t idx) {fIndex=idx;}
void SetQ(UShort_t q) {fQ=q;}
void SetMask(UInt_t m) {fMask=m;}
void SetRawID(Int_t id) {fRawID=id;}
void Reset() {fIndex=0; fMask=0xFFFFFFFE; fQ=0; fRawID=-1;}
void Use() {fMask&=0xFFFFFFFE;}
Bool_t IsNotUsed() const {return (fMask&1);}
Bool_t IsUsed() const {return !(IsNotUsed());}
UInt_t GetIndex() const {return fIndex;}
UShort_t GetQ() const {return fQ;}
UInt_t GetMask() const {return fMask;}
Int_t GetRawID() const {return fRawID;}
protected:
UInt_t fIndex;
UInt_t fMask;
Int_t fRawID;
UShort_t fQ;
};
void MakeCluster(Int_t k,Int_t max,AliBin *bins,UInt_t m,AliITSRecPoint &c);
static Bool_t IsMaximum(Int_t k, Int_t max, const AliBin *bins);
static void FindPeaks(Int_t k,Int_t m,AliBin*b,Int_t*idx,UInt_t*msk,Int_t&n);
static void MarkPeak(Int_t k, Int_t max, AliBin *bins, UInt_t m);
static void FindCluster(Int_t k,Int_t maxz,AliBin *bins,Int_t &n,Int_t *idx);
static void CheckLabels2(Int_t lab[10]);
static void AddLabel(Int_t lab[10], Int_t label);
Int_t fModule;
TClonesArray *fDigits;
Int_t fNdigits;
AliITSDetTypeRec* fDetTypeRec;
TClonesArray *fClusters;
AliITSMap *fMap;
Int_t fNPeaks;
Int_t fNdet[2200];
Int_t fNlayer[2200];
Int_t fNModules;
Int_t fEvent;
Int_t fZmin;
Int_t fZmax;
Int_t fXmin;
Int_t fXmax;
UInt_t fNClusters;
TArrayI* fRawID2ClusID;
AliITSClusterFinder(const AliITSClusterFinder &source);
AliITSClusterFinder& operator=(const AliITSClusterFinder &source);
ClassDef(AliITSClusterFinder,11)
};
ostream &operator<<(ostream &os,AliITSClusterFinder &source);
istream &operator>>(istream &os,AliITSClusterFinder &source);
#endif
AliITSClusterFinder.h:100 AliITSClusterFinder.h:101 AliITSClusterFinder.h:102 AliITSClusterFinder.h:103 AliITSClusterFinder.h:104 AliITSClusterFinder.h:105 AliITSClusterFinder.h:106 AliITSClusterFinder.h:107 AliITSClusterFinder.h:108 AliITSClusterFinder.h:109 AliITSClusterFinder.h:110 AliITSClusterFinder.h:111 AliITSClusterFinder.h:112 AliITSClusterFinder.h:113 AliITSClusterFinder.h:114 AliITSClusterFinder.h:115 AliITSClusterFinder.h:116 AliITSClusterFinder.h:117 AliITSClusterFinder.h:118 AliITSClusterFinder.h:119 AliITSClusterFinder.h:120 AliITSClusterFinder.h:121 AliITSClusterFinder.h:122 AliITSClusterFinder.h:123 AliITSClusterFinder.h:124 AliITSClusterFinder.h:125 AliITSClusterFinder.h:126 AliITSClusterFinder.h:127 AliITSClusterFinder.h:128 AliITSClusterFinder.h:129 AliITSClusterFinder.h:130 AliITSClusterFinder.h:131 AliITSClusterFinder.h:132 AliITSClusterFinder.h:133 AliITSClusterFinder.h:134 AliITSClusterFinder.h:135 AliITSClusterFinder.h:136 AliITSClusterFinder.h:137 AliITSClusterFinder.h:138 AliITSClusterFinder.h:139 AliITSClusterFinder.h:140 AliITSClusterFinder.h:141 AliITSClusterFinder.h:142 AliITSClusterFinder.h:143 AliITSClusterFinder.h:144 AliITSClusterFinder.h:145 AliITSClusterFinder.h:146 AliITSClusterFinder.h:147 AliITSClusterFinder.h:148 AliITSClusterFinder.h:149 AliITSClusterFinder.h:150 AliITSClusterFinder.h:151 AliITSClusterFinder.h:152 AliITSClusterFinder.h:153 AliITSClusterFinder.h:154 AliITSClusterFinder.h:155 AliITSClusterFinder.h:156 AliITSClusterFinder.h:157 AliITSClusterFinder.h:158 AliITSClusterFinder.h:159 AliITSClusterFinder.h:160 AliITSClusterFinder.h:161 AliITSClusterFinder.h:162 AliITSClusterFinder.h:163 AliITSClusterFinder.h:164 AliITSClusterFinder.h:165 AliITSClusterFinder.h:166 AliITSClusterFinder.h:167 AliITSClusterFinder.h:168 AliITSClusterFinder.h:169 AliITSClusterFinder.h:170 AliITSClusterFinder.h:171 AliITSClusterFinder.h:172 AliITSClusterFinder.h:173