/************************************************************************** * Copyright(c) 2009-2010, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ #include #include #include #include "AliStrLine.h" #include "AliITSSortTrkl.h" /* $Id$ */ //////////////////////////////////////////////////////////////////////// // Helper class for finding multiple primary vertices // // To be used by AliITSVertexer3D // // It is based on the association of pairs of tracklets // // obtained by matching reconstructed points onthe first // // 2 layers of SPD // // Origin M. Masera masera@to.infn.it // //////////////////////////////////////////////////////////////////////// ClassImp(AliITSSortTrkl) //______________________________________________________________________ AliITSSortTrkl::AliITSSortTrkl():TObject(), fkSize(0), fIndex(0), fPairs(NULL), fClustersTmp(NULL), fClusters(NULL), fNoClus(0), fSize(NULL), fMark(), fCut(0.), fCoarseMaxRCut(0.) { // Default constructor } //______________________________________________________________________ AliITSSortTrkl::AliITSSortTrkl(Int_t n, Double_t cut):TObject(), fkSize(n), fIndex(0), fPairs(), fClustersTmp(NULL), fClusters(NULL), fNoClus(0), fSize(NULL), fMark(n), fCut(cut), fCoarseMaxRCut(0.) { // Standard constructor fPairs = new AliITSTracklPairs* [fkSize]; fClustersTmp = new Int_t* [fkSize-1]; for(Int_t i=0; iClassName()); if(!(str.Contains("AliStrLine"))){ AliFatal(Form("Wrong type of class in input TClonesArray (%s )",str.Data())); return; } Int_t siz = numtrack*(numtrack-1)/2; if(fkSize < siz){ AliError(Form("fkSize is too small. It is %d and it should be %d",fkSize,siz)); } fPairs = new AliITSTracklPairs* [fkSize]; fClustersTmp = new Int_t* [fkSize-1]; for(Int_t i=0; iCross(two,point); Double_t dca = one->GetDCA(two); if(dca>fCut)continue; Double_t rad=TMath::Sqrt(point[0]*point[0]+point[1]*point[1]); if(rad>fCoarseMaxRCut)continue; AddPairs(i,j,dca,point); } } } //______________________________________________________________________ AliITSSortTrkl::~AliITSSortTrkl(){ // Destructor if(fPairs){ for(Int_t i=0;i0){ AliDebug(25,Form("Clusters starting from pair %d : %d",i,v[0])); Int_t dim; v[v[0]+1]=i; // arr will contain the labels of the tracks associated to // the cluster of pairs starting from pair i. Int_t *arr=FindLabels(v+1,2*(v[0]+1),dim); /* cout<<"AliITSSortTrkl::FindClusters: Pairs involved \n"; for(Int_t j=1;j<=v[0]+1;j++){ cout<0)cout<HasTrack(arr[k])){ fMark.SetBitNumber(j); // cout<<"Marked pair "<0)fNoClus++; siz[i]=v[0]; } if(fNoClus == 0){ delete []siz; delete [] index; return; } AliDebug(25,Form("fNoClus = %d",fNoClus)); TMath::Sort(fIndex-1,siz,index); fClusters = new Int_t* [fNoClus]; fSize = new Int_t [fNoClus]; for(Int_t i=0;iGetTrack1(); // cout<<"AliITSSortTrkl::FindLabels - i="<GetDistance(*p2); // AliInfo(Form(" ******* i %d , j %d . Distance %g ",i,j,dist)); if(dist<=fCut){ Int_t dimclu=v[0]; Bool_t already = kFALSE; for(Int_t k=1;k<=dimclu;k++){ if(v[k]==j)already=kTRUE; } if(!already){ ++dimclu; v[0]=dimclu; fMark.SetBitNumber(i); AliDebug(25,Form("Marked pair %d - and call Clustering for pair %d",i,j)); v[dimclu]=j; Clustering(j,v); fMark.SetBitNumber(j); AliDebug(25,Form("Marked pair %d",j)); } } } AliDebug(25,Form("Leaving Clustering for pair %d ",i)); }