1 void AliTPCTestClustering() {
2 const char *pname="75x40_100x60";
3 const char *tname="TreeD_75x40_100x60";
5 // Dynamically link some shared libs
7 if (gClassTable->GetID("AliRun") < 0) {
8 gROOT->LoadMacro("loadlibs.C");
15 // Connect the Root Galice file containing Geometry, Kine and Hits
16 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
17 if (!file) file = new TFile("galice.root");
18 //if (!file) file = TFile::Open("rfio:galice.root");
20 // Get AliRun object from file or create it if not on file
22 gAlice = (AliRun*)file->Get("gAlice");
23 if (gAlice) printf("AliRun object found on file\n");
24 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
29 AliTPC *TPC = (AliTPC*)gAlice->GetDetector("TPC");
30 int ver=TPC->IsVersion();
31 cerr<<"TPC version "<<ver<<" has been found !\n";
33 AliTPCParam *dig=(AliTPCParam *)file->Get(pname);
34 if (dig!=0) TPC->SetParam(dig);
35 else cerr<<"Warning: default TPC parameters will be used !\n";
39 cerr<<"Making clusters...\n";
43 cerr<<"Looking for clusters...\n";
44 TPC->Digits2Clusters();
47 cerr<<"Invalid TPC version !\n";
50 TClonesArray *c=TPC->Clusters();
51 int n=c->GetEntriesFast();
52 cerr<<"Number of clusters "<<n<<" \n";
55 TPolyMarker3D *pm=new TPolyMarker3D(n);
56 for (int i=0; i<n; i++) {
57 AliTPCcluster *cl=(AliTPCcluster *)c->UncheckedAt(i);
59 Double_t xx=x[0], yy=x[1], zz=x[2];
60 pm->SetPoint(i,xx,yy,zz);
63 c1=new TCanvas("c1", "Cluster display",0,0,700,730);
64 TView *v=new TView(1);
65 v->SetRange(-430,-560,-430,430,560,1710);
73 pm->SetMarkerColor(2);
74 pm->SetMarkerStyle(1);
77 gAlice->GetGeometry()->Draw("same");