1 Int_t AliTPCDisplayClusters() {
2 cerr<<"Displaying clusters...\n";
4 TFile *file=TFile::Open("galice.root");
5 if (!file->IsOpen()) {cerr<<"Can't open galice.root !\n"; return 1;}
7 TFile *cf=TFile::Open("AliTPCclusters.root");
8 if (!cf->IsOpen()){cerr<<"Can't open AliTPCclusters.root !\n"; return 3;}
10 AliTPCParam *dig=(AliTPCParam *)cf->Get("75x40_100x60");
11 if (!dig) {cerr<<"TPC parameters have not been found !\n"; return 2;}
13 TCanvas *c1=new TCanvas("cdisplay", "Cluster display",0,0,700,730);
14 TView *v=new TView(1);
15 v->SetRange(-430,-560,-430,430,560,1710);
21 AliTPCClustersArray *ca=new AliTPCClustersArray;
23 ca->SetClusterType("AliTPCcluster");
24 ca->ConnectTree("Segment Tree");
25 Int_t nrows=Int_t(ca->GetTree()->GetEntries());
26 for (Int_t n=0; n<nrows; n++) {
27 AliSegmentID *s=ca->LoadEntry(n);
29 dig->AdjustSectorRow(s->GetID(),sec,row);
30 AliTPCClustersRow &clrow = *ca->GetRow(sec,row);
31 Int_t ncl=clrow.GetArray()->GetEntriesFast();
32 TPolyMarker3D *pm=new TPolyMarker3D(ncl);
34 AliTPCcluster *cl=(AliTPCcluster*)clrow[ncl];
35 Double_t x=dig->GetPadRowRadii(sec,row), y=cl->GetY(), z=cl->GetZ();
37 dig->AdjustCosSin(sec,cs,sn);
38 tmp = x*cs-y*sn; y= x*sn+y*cs; x=tmp;
39 pm->SetPoint(ncl,x,y,z);
41 ca->ClearRow(sec,row);
42 pm->SetMarkerSize(1); pm->SetMarkerColor(2); pm->SetMarkerStyle(1);
48 TGeometry *geom=(TGeometry*)file->Get("AliceGeom");
50 c1->Modified(); c1->Update();