3 #include "AliTPCtracker.h"
5 #include "TPolyMarker3D.h"
6 #include "AliSimDigits.h"
7 #include "AliTPCParamSR.h"
12 // input parameter is event number - threshol to the noise
13 // if sdigits=kTRUE it will display Sdigits - otherwise it display digits
14 // signal event is displayed with yellow color
16 Int_t AliTPCDisplayDigits3D(Int_t eventn=0, Int_t noiseth=15, Bool_t sdigits=kFALSE) {
17 cerr<<"Displaying digits...\n";
19 TFile *file=TFile::Open("galice.root");
20 if (!file->IsOpen()) {cerr<<"Can't open galice.root !\n"; return 1;}
22 TFile *cf=TFile::Open("galice.root");
23 // if (!cf->IsOpen()){cerr<<"Can't open AliTPCclusters.root !\n"; return 3;}
25 AliTPCParamSR *param=(AliTPCParamSR *)cf->Get("75x40_100x60");
27 cerr<<"2 pad-length geom hits with 3 pad-lengths geom parameters\n";
29 param = new AliTPCParamSR();
33 param=(AliTPCParamSR *)gDirectory->Get("75x40_100x60_150x60");
36 if (!param) {cerr<<"TPC parameters have not been found !\n"; return 2;}
38 TCanvas *c1=new TCanvas("ddisplay", "Digits display",0,0,700,730);
39 TView *v=new TView(1);
40 v->SetRange(-430,-560,-430,430,560,1710);
46 AliTPCDigitsArray *digarr=new AliTPCDigitsArray;
51 sprintf(cname,"TreeD_75x40_100x60_150x60_%d",eventn);
53 sprintf(cname,"TreeS_75x40_100x60_150x60_%d",eventn);
56 Int_t markerColorSignal = 5;
57 Int_t markerColorBgr = 2;
58 Int_t MASK = 10000000;
60 digarr->ConnectTree(cname);
61 Int_t nrows=Int_t(digarr->GetTree()->GetEntries());
63 for (Int_t n=0; n<nrows; n++) {
64 AliSimDigits *s=(AliSimDigits*)digarr->LoadEntry(n);
66 param->AdjustSectorRow(s->GetID(),sec,row);
69 const Int_t kNIS=param->GetNInnerSector(), kNOS=param->GetNOuterSector();
71 npads = param->GetNPadsLow(row);
72 sign = (sec < kNIS/2) ? 1 : -1;
74 npads = param->GetNPadsUp(row);
75 sign = ((sec-kNIS) < kNOS/2) ? 1 : -1;
79 AliSimDigits *digrow = (AliSimDigits*)digarr->GetRow(sec,row);
82 while(digrow->Next()) ncl++;
85 TPolyMarker3D *pm=new TPolyMarker3D(ncl);
86 TPolyMarker3D *pmSignal=new TPolyMarker3D(ncl); // polymarker for signal
89 if (digrow->First()) do {
90 Short_t dig=digrow->CurrentDigit();
91 Double_t y = (digrow->CurrentColumn()- 0.5 - 0.5*npads)*param->GetPadPitchWidth(sec);
92 Double_t z = sign*(param->GetZLength()-param->GetZWidth()*digrow->CurrentRow());
93 Double_t x=param->GetPadRowRadii(sec,row);
94 if (dig<noiseth) continue;
95 Int_t trackId = digrow->GetTrackID(digrow->CurrentRow(),digrow->CurrentColumn(),0);
97 param->AdjustCosSin(sec,cs,sn);
98 tmp = x*cs-y*sn; y= x*sn+y*cs; x=tmp;
99 if (trackId<0) continue; //if signal from croostalk - we don't have track ID information
100 if (trackId < MASK-1) {
101 pmSignal->SetPoint(imarSignal,x,y,z);
104 pm->SetPoint(imarBgr,x,y,z);
107 } while (digrow->Next());
109 // change color for signal
110 digarr->ClearRow(sec,row);
111 pm->SetMarkerSize(1);
112 pm->SetMarkerColor(markerColorBgr);
113 pm->SetMarkerStyle(1);
116 pmSignal->SetMarkerSize(1);
117 pmSignal->SetMarkerColor(markerColorSignal);
118 pmSignal->SetMarkerStyle(1);
128 TGeometry *geom=(TGeometry*)file->Get("AliceGeom");
129 TNode * main = (TNode*)((geom->GetListOfNodes())->First());
130 TIter next(main->GetListOfNodes());
132 while((module = (TNode*)next())) {
134 sprintf(ch,"%s\n",module->GetTitle());
135 //printf("%s\n",module->GetTitle());
136 if (ch[0]=='T'&&ch[1]=='P' && ch[2]=='C') //if TPC draw
137 module->SetVisibility(3);
139 module->SetVisibility(-1);
145 c1->Modified(); c1->Update();