1 //******* Run TPCTestClustering.C(1) for fast simulator data
2 //******* Run TPCTestClustering.C(2) for slow simulator data
3 void TPCTestClustering(int fast=1) {
4 // Dynamically link some shared libs
5 if (gClassTable->GetID("AliRun") < 0) {
6 gSystem->Load("libGeant3Dummy.so"); // a dummy version of Geant3
7 gSystem->Load("PHOS/libPHOSdummy.so"); // the standard Alice classes
8 gSystem->Load("libgalice.so"); // the standard Alice classes
14 // Connect the Root Galice file containing Geometry, Kine and Hits
15 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
16 if (!file) file = new TFile("galice.root");
18 // Get AliRun object from file or create it if not on file
20 gAlice = (AliRun*)file->Get("gAlice");
21 if (gAlice) printf("AliRun object found on file\n");
22 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
27 AliTPC *TPC = (AliTPC*)gAlice->GetDetector("TPC");
29 cerr<<"Making clusters...\n";
32 cerr<<"Looking for clusters...\n";
33 TPC->Digits2Clusters();
35 TClonesArray *c=TPC->Clusters();
36 int n=c->GetEntriesFast();
37 cerr<<"Number of clusters "<<n<<" \n";
39 TPolyMarker3D *pm=new TPolyMarker3D(n);
40 for (int i=0; i<n; i++) {
41 AliTPCcluster *cl=(AliTPCcluster *)c->UncheckedAt(i);
42 Double_t x, y, z; cl->GetXYZ(x,y,z);
43 pm->SetPoint(i,x,y,z);
46 c1=new TCanvas("c1", "Cluster display",0,0,575,750);
47 TView *v=new TView(1);
48 v->SetRange(-430,-560,-430,430,560,1710);
56 pm->SetMarkerColor(2);
57 pm->SetMarkerStyle(1);
60 gAlice->GetGeometry()->Draw("same");