1 void TPCHits2Clusters() {
2 // Dynamically link some shared libs
3 if (gClassTable->GetID("AliRun") < 0) {
4 gSystem->Load("libGeant3Dummy.so"); // a dummy version of Geant3
5 gSystem->Load("PHOS/libPHOSdummy.so"); // the standard Alice classes
6 gSystem->Load("libgalice.so"); // the standard Alice classes
9 // Connect the Root Galice file containing Geometry, Kine and Hits
10 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
11 if (file) file->Close();
12 file = new TFile("galice.root");
14 // Get AliRun object from file or create it if not on file
16 gAlice = (AliRun*)file->Get("gAlice");
17 if (gAlice) printf("AliRun object found on file\n");
18 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
23 AliTPC *TPC = (AliTPC*)gAlice->GetDetector("TPC");
25 TClonesArray *c=TPC->Clusters();
26 int n=c->GetEntriesFast();
27 cout<<"Number of clusters "<<n<<endl;
29 TPolyMarker3D *pm=new TPolyMarker3D(n);
30 for (int i=0; i<n; i++) {
31 AliTPCcluster *cl=(AliTPCcluster *)c->UncheckedAt(i);
32 pm->SetPoint(i,cl->fX,cl->fY,cl->fZ);
35 c1=new TCanvas("c1", "Cluster display",0,0,575,750);
36 TView *v=new TView(1);
37 v->SetRange(-430,-560,-430,430,560,1710);
45 pm->SetMarkerColor(2);
46 pm->SetMarkerStyle(1);
49 gAlice->GetGeometry()->Draw("same");