3 #include "AliTPCtracker.h"
5 #include "TPolyMarker3D.h"
6 #include "AliSimDigits.h"
7 #include "AliRunLoader.h"
9 #include "AliTPCParamSR.h"
14 // input parameter is event number - threshol to the noise
15 // if sdigits=kTRUE it will display Sdigits - otherwise it display digits
16 // signal event is displayed with yellow color
18 Int_t AliTPCDisplayDigits3Dnew(Int_t eventn=0, Int_t noiseth=15, Bool_t sdigits=kFALSE) {
19 cerr<<"Displaying digits...\n";
21 // TFile *file=TFile::Open("galice.root");
22 // if (!file->IsOpen()) {cerr<<"Can't open galice.root !\n"; return 1;}
24 // TFile *cf=TFile::Open("galice.root");
25 // if (!cf->IsOpen()){cerr<<"Can't open AliTPCclusters.root !\n"; return 3;}
27 AliRunLoader* rl = AliRunLoader::Open();
30 AliLoader* tpcl = (AliLoader*)rl->GetLoader("TPCLoader");
33 cerr<<"Can not get TPC Loader"<<endl;
38 AliTPCParam *param=(AliTPCParam *)gDirectory->Get("75x40_100x60");
40 cerr<<"2 pad-length geom hits with 3 pad-lengths geom parameters\n";
42 param = new AliTPCParamSR();
46 param=(AliTPCParamSR *)gDirectory->Get("75x40_100x60_150x60");
49 if (!param) {cerr<<"TPC parameters have not been found !\n"; return 2;}
51 TCanvas *c1=new TCanvas("ddisplay", "Digits display",0,0,700,730);
52 TView *v=new TView(1);
53 v->SetRange(-430,-560,-430,430,560,1710);
59 AliTPCDigitsArray *digarr=new AliTPCDigitsArray;
78 Int_t markerColorSignal = 5;
79 Int_t markerColorBgr = 2;
80 Int_t MASK = 10000000;
86 digarr->ConnectTree(tree);
88 Int_t nrows=Int_t(digarr->GetTree()->GetEntries());
90 for (Int_t n=0; n<nrows; n++) {
91 AliSimDigits *s=(AliSimDigits*)digarr->LoadEntry(n);
93 param->AdjustSectorRow(s->GetID(),sec,row);
96 const Int_t kNIS=param->GetNInnerSector(), kNOS=param->GetNOuterSector();
98 npads = param->GetNPadsLow(row);
99 sign = (sec < kNIS/2) ? 1 : -1;
101 npads = param->GetNPadsUp(row);
102 sign = ((sec-kNIS) < kNOS/2) ? 1 : -1;
106 AliSimDigits *digrow = (AliSimDigits*)digarr->GetRow(sec,row);
108 if (digrow->First()){
109 while(digrow->Next()) ncl++;
112 TPolyMarker3D *pm=new TPolyMarker3D(ncl);
113 TPolyMarker3D *pmSignal=new TPolyMarker3D(ncl); // polymarker for signal
116 if (digrow->First()) do {
117 Short_t dig=digrow->CurrentDigit();
118 Double_t y = (digrow->CurrentColumn()- 0.5 - 0.5*npads)*param->GetPadPitchWidth(sec);
119 Double_t z = sign*(param->GetZLength()-param->GetZWidth()*digrow->CurrentRow());
120 Double_t x=param->GetPadRowRadii(sec,row);
122 if (dig<noiseth) continue;
123 // cout<<"\nAbove noise Threshold";
124 Int_t trackId = digrow->GetTrackID(digrow->CurrentRow(),digrow->CurrentColumn(),0);
126 param->AdjustCosSin(sec,cs,sn);
127 tmp = x*cs-y*sn; y= x*sn+y*cs; x=tmp;
128 if (trackId<0) continue; //if signal from croostalk - we don't have track ID information
129 // cout<<"Track ID > 0";
130 if (trackId < MASK-1) {
131 pmSignal->SetPoint(imarSignal,x,y,z);
134 pm->SetPoint(imarBgr,x,y,z);
137 } while (digrow->Next());
139 // change color for signal
140 digarr->ClearRow(sec,row);
141 pm->SetMarkerSize(1);
142 pm->SetMarkerColor(markerColorBgr);
143 pm->SetMarkerStyle(1);
146 pmSignal->SetMarkerSize(1);
147 pmSignal->SetMarkerColor(markerColorSignal);
148 pmSignal->SetMarkerStyle(1);
151 // cout<<"imarSignal ="<<imarSignal<<" imarBgr ="<<imarBgr<<" ncl ="<<ncl<<endl;
161 TGeometry *geom=(TGeometry*)gDirectory->Get("AliceGeom");
162 TNode * main = (TNode*)((geom->GetListOfNodes())->First());
163 TIter next(main->GetListOfNodes());
165 while((module = (TNode*)next())) {
167 sprintf(ch,"%s\n",module->GetTitle());
168 //printf("%s\n",module->GetTitle());
169 if (ch[0]=='T'&&ch[1]=='P' && ch[2]=='C') //if TPC draw
170 module->SetVisibility(3);
172 module->SetVisibility(-1);
178 c1->Modified(); c1->Update();