-Int_t AliITSclustererV2::Hits2Clusters(TTree *hTree, TTree *cTree) {
- //------------------------------------------------------------
- // This function creates ITS clusters
- //------------------------------------------------------------
- if (!gAlice) {
- Error("Hits2Clusters","gAlice==0 !");
- return 1;
- }
-
- AliITS *its = (AliITS*)gAlice->GetModule("ITS");
- if (!its) {
- Error("Hits2Clusters","Can't find the ITS !");
- return 2;
- }
- AliITSgeom *geom=its->GetITSgeom();
- Int_t mmax=geom->GetIndexMax();
-
- its->InitModules(-1,mmax);
- its->FillModules(hTree,0);
-
- TClonesArray *clusters=new TClonesArray("AliITSclusterV2",1000);
- TBranch *branch=cTree->GetBranch("Clusters");
- if (!branch) cTree->Branch("Clusters",&clusters);
- else branch->SetAddress(&clusters);
-
- static TClonesArray *points=its->RecPoints();
- AliITSsimulationFastPoints sim;
- Int_t ncl=0;
- for (Int_t m=0; m<mmax; m++) {
- AliITSmodule *mod=its->GetModule(m);
- sim.CreateFastRecPoints(mod,m,gRandom);
-
- RecPoints2Clusters(points, m, clusters);
- its->ResetRecPoints();
-
- ncl+=clusters->GetEntriesFast();
- cTree->Fill();
- clusters->Clear();
- }
-
- Info("Hits2Clusters","Number of found fast clusters : %d",ncl);
-
- //cTree->Write();
-
- delete clusters;
-
- return 0;
-}
-