#ifndef ALIITSUVERTEXER_H
#define ALIITSUVERTEXER_H
#include "AliVertexer.h"
class TClonesArray;
class AliESDVertex;
class AliITSUVertexer : public AliVertexer {
public:
AliITSUVertexer(Double_t phicut=0.005,Double_t zcut=0.002,Double_t paircut=0.04, Double_t clustercut=0.8, Int_t clcontrib=5);
virtual ~AliITSUVertexer();
virtual AliESDVertex* GetAllVertices(Int_t& nVert) const { nVert=fNoVertices; return fVertices; };
virtual AliESDVertex* FindVertexForCurrentEvent(TTree *);
virtual void PrintStatus() const;
UInt_t GetNoLines() const { return fNoLines; }
UShort_t GetNumOfVertices() const { return fNoVertices; }
void SetPhiCut(Double_t phicut) { fPhiCut=phicut; }
void SetZCut(Double_t zcut) { fZCut=zcut; }
#ifdef MC_CHECK
UInt_t* GetParticleId(UInt_t &num) const { num=fGoodLines; return fParticleId; }
UInt_t GetGoodLines() const { return fGoodLines; }
UInt_t GetGoodLinesPhi() const { return fGoodLinesPhi; }
UInt_t GetLinesPhi() const { return fLinesPhi; }
#endif
protected:
AliITSUVertexer(AliITSUVertexer&);
AliITSUVertexer& operator=(const AliITSUVertexer& other);
void AddToCluster(UInt_t line,Bool_t weight=kFALSE,Int_t cl=-1);
void CleanAndOrderClusters();
void Clusterize(UInt_t l1, UInt_t l2, Bool_t weight=kFALSE);
void ComputeClusterCentroid(UInt_t cl);
void FindTracklets();
void FindVerticesForCurrentEvent();
Int_t MatchPoints(UShort_t layer, Double_t anchor, Double_t *p0=0x0, Double_t *p1=0x0);
void MoveLabels(Short_t start, Short_t end);
void Reset();
void SortClusters();
Int_t fClusterContribCut;
Double_t fClusterCut;
Int_t *fClusterIndex[3];
Double_t *fClusterPhi[3];
TClonesArray *fClusters[3];
TClonesArray fLines;
TClonesArray fLinesClusters;
UInt_t fLinesPhi;
UInt_t fNoClusters;
UInt_t fNoLines;
UShort_t fNoVertices;
Double_t fPairCut;
Double_t fPhiCut;
Double_t fZCut;
Bool_t *fUsedClusters[3];
Short_t *fUsedLines;
AliESDVertex *fVertices;
#ifdef MC_CHECK
Bool_t CheckMC(UInt_t,UInt_t,UInt_t);
UInt_t fGoodLines;
UInt_t fGoodLinesPhi;
UInt_t *fParticleId;
#endif
ClassDef(AliITSUVertexer,1)
};
#endif