3 #include "AliTPCtracker.h"
5 #include "TPolyMarker3D.h"
8 Int_t AliTPCDisplayDigits3D(Int_t eventn=0, Int_t noiseth=15) {
9 cerr<<"Displaying digits...\n";
11 TFile *file=TFile::Open("galice.root");
12 if (!file->IsOpen()) {cerr<<"Can't open galice.root !\n"; return 1;}
14 TFile *cf=TFile::Open("galice.root");
15 // if (!cf->IsOpen()){cerr<<"Can't open AliTPCclusters.root !\n"; return 3;}
17 AliTPCParam *param=(AliTPCParam *)cf->Get("75x40_100x60");
18 if (!param) {cerr<<"TPC parameters have not been found !\n"; return 2;}
20 TCanvas *c1=new TCanvas("ddisplay", "Digits display",0,0,700,730);
21 TView *v=new TView(1);
22 v->SetRange(-430,-560,-430,430,560,1710);
28 AliTPCDigitsArray *digarr=new AliTPCDigitsArray;
31 sprintf(cname,"TreeD_75x40_100x60_%d",eventn);
33 digarr->ConnectTree(cname);
34 Int_t nrows=Int_t(digarr->GetTree()->GetEntries());
35 for (Int_t n=0; n<nrows; n++) {
36 AliSimDigits *s=(AliSimDigits*)digarr->LoadEntry(n);
38 param->AdjustSectorRow(s->GetID(),sec,row);
41 const Int_t kNIS=param->GetNInnerSector(), kNOS=param->GetNOuterSector();
43 npads = param->GetNPadsLow(row);
44 sign = (sec < kNIS/2) ? 1 : -1;
46 npads = param->GetNPadsUp(row);
47 sign = ((sec-kNIS) < kNOS/2) ? 1 : -1;
51 AliSimDigits *digrow = (AliSimDigits*)digarr->GetRow(sec,row);
54 while(digrow->Next()) ncl++;
57 TPolyMarker3D *pm=new TPolyMarker3D(ncl);
61 Short_t dig=digrow->CurrentDigit();
62 Double_t y = (digrow->CurrentColumn()- 0.5 - 0.5*npads)*param->GetPadPitchWidth(sec);
63 Double_t z = sign*(param->GetZLength()-param->GetZWidth()*digrow->CurrentRow());
64 Double_t x=param->GetPadRowRadii(sec,row);
65 if (dig<noiseth) continue;
67 param->AdjustCosSin(sec,cs,sn);
68 tmp = x*cs-y*sn; y= x*sn+y*cs; x=tmp;
69 pm->SetPoint(imar,x,y,z);
71 } while (digrow->Next());
72 digarr->ClearRow(sec,row);
73 pm->SetMarkerSize(1); pm->SetMarkerColor(2); pm->SetMarkerStyle(1);
79 TGeometry *geom=(TGeometry*)file->Get("AliceGeom");
80 TList *list = geom->GetListOfNodes();
81 TNode * main = (TNode*)((geom->GetListOfNodes())->First());
82 TIter next(main->GetListOfNodes());
84 while((module = (TNode*)next())) {
86 sprintf(ch,"%s\n",module->GetTitle());
87 //printf("%s\n",module->GetTitle());
88 if (ch[0]=='T'&&ch[1]=='P' && ch[2]=='C') //if TPC draw
89 module->SetVisibility(3);
91 module->SetVisibility(-1);
97 c1->Modified(); c1->Update();