1 /****************************************************************************
2 * Origin: I.Belikov, CERN, Jouri.Belikov@cern.ch *
3 ****************************************************************************/
11 #include <TPolyMarker3D.h>
13 #include <TGeometry.h>
15 #include "AliTPCParam.h"
16 #include "AliClusters.h"
17 #include "AliTPCcluster.h"
20 Int_t AliTPCDisplayClusters(Int_t eventn=0, Int_t noiseth=15) {
21 cerr<<"Displaying clusters...\n";
23 TFile *file=TFile::Open("galice.root");
24 if (!file->IsOpen()) {cerr<<"Can't open galice.root !\n"; return 1;}
26 TFile *cf=TFile::Open("AliTPCclusters.root");
27 if (!cf->IsOpen()){cerr<<"Can't open AliTPCclusters.root !\n"; return 3;}
29 AliTPCParam *dig=(AliTPCParam *)cf->Get("75x40_100x60_150x60");
30 if (!dig) {cerr<<"TPC parameters have not been found !\n"; return 2;}
32 TCanvas *c1=new TCanvas("cdisplay", "Cluster display",0,0,700,730);
33 TView *v=new TView(1);
34 v->SetRange(-430,-560,-430,430,560,1710);
41 sprintf(cname,"TreeC_TPC_%d",eventn);
42 TTree *cTree=(TTree *)cf->Get(cname);
44 cerr<<"Can't find tree : "<<cname<<endl;
48 AliClusters *clusters=new AliClusters();
49 clusters->SetClass("AliTPCcluster");
51 cTree->SetBranchAddress("Segment",&clusters);
53 Int_t nrows=Int_t(cTree->GetEntries());
54 for (Int_t n=0; n<nrows; n++) {
57 dig->AdjustSectorRow(clusters->GetID(),sec,row);
58 TClonesArray &clrow=*clusters->GetArray();
59 Int_t ncl=clrow.GetEntriesFast();
60 TPolyMarker3D *pm=new TPolyMarker3D(ncl);
62 AliTPCcluster *cl=(AliTPCcluster*)clrow[ncl];
63 Double_t x=dig->GetPadRowRadii(sec,row), y=cl->GetY(), z=cl->GetZ();
64 if (cl->GetQ()<noiseth) continue;
66 dig->AdjustCosSin(sec,cs,sn);
67 tmp = x*cs-y*sn; y= x*sn+y*cs; x=tmp;
68 pm->SetPoint(ncl,x,y,z);
71 pm->SetMarkerSize(1); pm->SetMarkerColor(2); pm->SetMarkerStyle(1);
78 TGeometry *geom=(TGeometry*)file->Get("AliceGeom");
79 TNode * main = (TNode*)((geom->GetListOfNodes())->First());
80 TIter next(main->GetListOfNodes());
82 while((module = (TNode*)next())) {
84 sprintf(ch,"%s\n",module->GetTitle());
85 //printf("%s\n",module->GetTitle());
86 if (ch[0]=='T'&&ch[1]=='P' && ch[2]=='C') //if TPC draw
87 module->SetVisibility(3);
89 module->SetVisibility(-1);
94 c1->Modified(); c1->Update();