1 #ifndef ALIITSSORTTRKL_H
2 #define ALIITSSORTTRKL_H
4 /* Copyright(c) 2009-2010, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
9 ////////////////////////////////////////////////////////////////////////
10 // Helper class for finding multiple primary vertices //
11 // To be used by AliITSVertexer3D //
12 // Origin M. Masera masera@to.infn.it //
13 ////////////////////////////////////////////////////////////////////////
18 #include "AliITSTracklPairs.h"
22 class AliITSSortTrkl : public TObject {
27 AliITSSortTrkl(Int_t n, Double_t cut = 0.05);
28 AliITSSortTrkl(TClonesArray &tclo, Int_t n, Double_t cut, Double_t rcut);
29 virtual ~AliITSSortTrkl();
30 Int_t AddPairs(Int_t t1, Int_t t2, Double_t dca, Double_t *coo);
31 Int_t GetIndex() const {return fIndex;}
33 void SetCut(Double_t cut){fCut = cut;}
34 Double_t GetCut() const {return fCut; }
35 Int_t* GetClusters(Int_t index) const {if(index>=0 && index<fNoClus){return fClusters[index];} else {return NULL;}}
36 Int_t GetNumberOfClusters() const {return fNoClus;}
37 Int_t GetSizeOfCluster(Int_t index) const {if(index>=0 && index<fNoClus){return fSize[index];} else {return -1;}}
38 static void SortAndClean(Int_t numb, Int_t *arr, Int_t& numb2);
39 Int_t* GetTrackletsLab(Int_t index, Int_t& dim) const;
41 // FOR DEBUGGING PURPOSES
42 Int_t* GetClustersTmp(Int_t index){return fClustersTmp[index];}
43 AliITSTracklPairs* GetPairsAt(Int_t i) const {if(!(i>=0 && i<fIndex)){AliError(Form("Index %d out of bounds",i)); return NULL;} else{ return fPairs[i];} }
48 AliITSSortTrkl(const AliITSSortTrkl& pa);
49 AliITSSortTrkl& operator=(const AliITSSortTrkl& /* pa */);
51 void DeleteClustersTmp();
52 void PrepareClustersTmp();
53 void Clustering(Int_t i, Int_t *v);
54 Int_t* FindLabels(Int_t *v, Int_t dimmax, Int_t& dim) const;
56 const Int_t fkSize; // Maximum number of tracklet pairs
57 Int_t fIndex; // Total number of tracklet pairs (<=fkSize)
58 AliITSTracklPairs **fPairs; // array of tracklet pairs (pointers to)
59 Int_t **fClustersTmp; // Temporary list of clusters of tracklet pairs
60 Int_t **fClusters; // List of clusters of tracklet pairs after cleanup
61 Int_t fNoClus; // Number of clusters of tracklet pairs
62 Int_t *fSize; // Number of pairs for each cluster
63 TBits fMark; // Used to mask used pairs
64 Double_t fCut; // cut on distance of DCAs of pairs for association
65 Double_t fCoarseMaxRCut; // cut on distance from beam axis
67 ClassDef(AliITSSortTrkl,0);