1 /****************************************************************************
2 * Origin: I.Belikov, CERN, Jouri.Belikov@cern.ch *
3 ****************************************************************************/
10 #include "AliITSgeom.h"
11 #include "AliITSclustererV2.h"
14 #include "TStopwatch.h"
17 Int_t AliITSFindClustersV2(Char_t SlowOrFast='f',Int_t eventn=1,Char_t* path="./") {
19 cerr<<"Looking for clusters...\n";
22 sprintf(fname,"%s/galice.root",path);
23 TFile *in=TFile::Open(fname);
24 if (!in->IsOpen()) {cerr<<"Can't open galice.root !\n"; return 2;}
25 if (!(gAlice=(AliRun*)in->Get("gAlice"))) {
26 cerr<<"Can't find gAlice !\n";
29 AliITS *ITS = (AliITS*)gAlice->GetModule("ITS");
30 if (!ITS) { cerr<<"Can't find the ITS !\n"; return 3; }
32 AliITSgeom *geom=ITS->GetITSgeom();
34 Char_t fnameCluster[1024];
35 sprintf(fnameCluster,"%s/AliITSclustersV2.root",path);
36 TFile *out=TFile::Open(fnameCluster,"recreate");
38 cerr<<"Delete old AliITSclustersV2.root !\n"; return 1;}
42 AliITSclustererV2 clusterer(geom);
43 for (Int_t i=0; i<eventn; i++) {
44 cerr<<"Processing event number: "<<i<<endl;
46 //ITS->MakeTreeC(); //To make the V1 cluster finders happy
47 clusterer.SetEvent(i);
48 if (SlowOrFast=='s') clusterer.Digits2Clusters(in,out);
49 else clusterer.Hits2Clusters(in,out);
51 timer.Stop(); timer.Print();
53 delete gAlice; gAlice=0;