]>
Commit | Line | Data |
---|---|---|
73042f01 | 1 | Int_t AliTPCDisplayClusters() { |
2 | cerr<<"Displaying clusters...\n"; | |
3 | ||
4 | TFile *file=TFile::Open("galice.root"); | |
5 | if (!file->IsOpen()) {cerr<<"Can't open galice.root !\n"; return 1;} | |
6 | ||
7 | TFile *cf=TFile::Open("AliTPCclusters.root"); | |
8 | if (!cf->IsOpen()){cerr<<"Can't open AliTPCclusters.root !\n"; return 3;} | |
9 | ||
10 | AliTPCParam *dig=(AliTPCParam *)cf->Get("75x40_100x60"); | |
11 | if (!dig) {cerr<<"TPC parameters have not been found !\n"; return 2;} | |
12 | ||
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); | |
16 | c1->Clear(); | |
17 | c1->SetFillColor(1); | |
18 | c1->SetTheta(90.); | |
19 | c1->SetPhi(0.); | |
20 | ||
21 | AliTPCClustersArray *ca=new AliTPCClustersArray; | |
22 | ca->Setup(dig); | |
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); | |
28 | Int_t sec,row; | |
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); | |
33 | while (ncl--) { | |
34 | AliTPCcluster *cl=(AliTPCcluster*)clrow[ncl]; | |
35 | Double_t x=dig->GetPadRowRadii(sec,row), y=cl->GetY(), z=cl->GetZ(); | |
36 | Float_t cs, sn, tmp; | |
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); | |
40 | } | |
41 | ca->ClearRow(sec,row); | |
42 | pm->SetMarkerSize(1); pm->SetMarkerColor(2); pm->SetMarkerStyle(1); | |
43 | pm->Draw(); | |
44 | } | |
45 | delete ca; | |
46 | cf->Close(); | |
47 | ||
48 | TGeometry *geom=(TGeometry*)file->Get("AliceGeom"); | |
49 | geom->Draw("same"); | |
50 | c1->Modified(); c1->Update(); | |
51 | ||
52 | file->Close(); | |
53 | return 0; | |
54 | } |