]>
Commit | Line | Data |
---|---|---|
7f6ddf58 | 1 | /**************************************************************************** |
2 | * Very important, delicate and rather obscure macro. * | |
3 | * * | |
4 | * Creates list of "trackable" tracks, * | |
7f6ddf58 | 5 | * calculates efficiency, resolutions etc. * |
6 | * * | |
024a7fe9 | 7 | * Origin: I.Belikov, CERN, Jouri.Belikov@cern.ch * |
7f6ddf58 | 8 | * with several nice improvements by: M.Ivanov, GSI, m.ivanov@gsi.de * |
9 | ****************************************************************************/ | |
10 | ||
be9c5115 | 11 | #ifndef __CINT__ |
12 | #include "alles.h" | |
b9de75e1 | 13 | #include "AliTPCtracker.h" |
be9c5115 | 14 | #endif |
15 | ||
f38c8ae5 | 16 | struct GoodTrackTPC { |
cc80f89e | 17 | Int_t lab; |
18 | Int_t code; | |
19 | Float_t px,py,pz; | |
20 | Float_t x,y,z; | |
21 | }; | |
cc80f89e | 22 | |
7f6ddf58 | 23 | Int_t AliTPCComparison(Int_t event=0) { |
fbb58996 | 24 | |
25 | AliKalmanTrack::SetConvConst(1000/0.299792458/gAlice->Field()->SolenoidField()); | |
9b280d80 | 26 | cerr<<"Doing comparison...\n"; |
73042f01 | 27 | |
7f6ddf58 | 28 | const Int_t MAX=20000; |
29 | Int_t good_tracks_tpc(GoodTrackTPC *gt, const Int_t max, const Int_t event); | |
8c555625 | 30 | |
7f6ddf58 | 31 | gBenchmark->Start("AliTPCComparison"); |
afc42102 | 32 | |
7f6ddf58 | 33 | Int_t nentr=0,i=0; TObjArray tarray(MAX); |
34 | { /*Load tracks*/ | |
afc42102 | 35 | TFile *tf=TFile::Open("AliTPCtracks.root"); |
7f6ddf58 | 36 | if (!tf->IsOpen()) {cerr<<"Can't open AliTPCtracks.root !\n"; return 3;} |
37 | ||
38 | char tname[100]; sprintf(tname,"TreeT_TPC_%d",event); | |
39 | TTree *tracktree=(TTree*)tf->Get(tname); | |
40 | if (!tracktree) {cerr<<"Can't get a tree with TPC tracks !\n"; return 4;} | |
afc42102 | 41 | |
7f6ddf58 | 42 | TBranch *tbranch=tracktree->GetBranch("tracks"); |
43 | nentr=(Int_t)tracktree->GetEntries(); | |
44 | AliTPCtrack *iotrack=0; | |
45 | for (i=0; i<nentr; i++) { | |
be9c5115 | 46 | iotrack=new AliTPCtrack; |
73042f01 | 47 | tbranch->SetAddress(&iotrack); |
48 | tracktree->GetEvent(i); | |
73042f01 | 49 | tarray.AddLast(iotrack); |
7f6ddf58 | 50 | } |
51 | delete tracktree; //Thanks to Mariana Bondila | |
b9de75e1 | 52 | tf->Close(); |
7f6ddf58 | 53 | } |
8c555625 | 54 | |
7f6ddf58 | 55 | /* Generate a list of "good" tracks */ |
f38c8ae5 | 56 | GoodTrackTPC gt[MAX]; |
cc80f89e | 57 | Int_t ngood=0; |
be9c5115 | 58 | ifstream in("good_tracks_tpc"); |
cc80f89e | 59 | if (in) { |
60 | cerr<<"Reading good tracks...\n"; | |
7f6ddf58 | 61 | while (in>>gt[ngood].lab>>gt[ngood].code>> |
be9c5115 | 62 | gt[ngood].px>>gt[ngood].py>>gt[ngood].pz>> |
63 | gt[ngood].x >>gt[ngood].y >>gt[ngood].z) { | |
cc80f89e | 64 | ngood++; |
65 | cerr<<ngood<<'\r'; | |
f38c8ae5 | 66 | if (ngood==MAX) { |
cc80f89e | 67 | cerr<<"Too many good tracks !\n"; |
68 | break; | |
69 | } | |
70 | } | |
be9c5115 | 71 | if (!in.eof()) cerr<<"Read error (good_tracks_tpc) !\n"; |
cc80f89e | 72 | } else { |
73 | cerr<<"Marking good tracks (this will take a while)...\n"; | |
7f6ddf58 | 74 | ngood=good_tracks_tpc(gt,MAX, event); |
be9c5115 | 75 | ofstream out("good_tracks_tpc"); |
cc80f89e | 76 | if (out) { |
77 | for (Int_t ngd=0; ngd<ngood; ngd++) | |
7f6ddf58 | 78 | out<<gt[ngd].lab<<' '<<gt[ngd].code<<' '<< |
be9c5115 | 79 | gt[ngd].px<<' '<<gt[ngd].py<<' '<<gt[ngd].pz<<' '<< |
80 | gt[ngd].x <<' '<<gt[ngd].y <<' '<<gt[ngd].z <<endl; | |
81 | } else cerr<<"Can not open file (good_tracks_tpc) !\n"; | |
cc80f89e | 82 | out.close(); |
83 | } | |
7f6ddf58 | 84 | |
85 | ||
cc80f89e | 86 | |
cc80f89e | 87 | TH1F *hp=new TH1F("hp","PHI resolution",50,-20.,20.); hp->SetFillColor(4); |
88 | TH1F *hl=new TH1F("hl","LAMBDA resolution",50,-20,20);hl->SetFillColor(4); | |
8c555625 | 89 | TH1F *hpt=new TH1F("hpt","Relative Pt resolution",30,-10.,10.); |
90 | hpt->SetFillColor(2); | |
cc80f89e | 91 | TH1F *hmpt=new TH1F("hmpt","Relative Pt resolution (pt>4GeV/c)",30,-60,60); |
92 | hmpt->SetFillColor(6); | |
8c555625 | 93 | |
7f6ddf58 | 94 | TH1F *hgood=new TH1F("hgood","Good tracks",30,0.1,6.1); |
95 | TH1F *hfound=new TH1F("hfound","Found tracks",30,0.1,6.1); | |
96 | TH1F *hfake=new TH1F("hfake","Fake tracks",30,0.1,6.1); | |
97 | TH1F *hg=new TH1F("hg","",30,0.1,6.1); //efficiency for good tracks | |
8c555625 | 98 | hg->SetLineColor(4); hg->SetLineWidth(2); |
7f6ddf58 | 99 | TH1F *hf=new TH1F("hf","Efficiency for fake tracks",30,0.1,6.1); |
8c555625 | 100 | hf->SetFillColor(1); hf->SetFillStyle(3013); hf->SetLineWidth(2); |
101 | ||
cc80f89e | 102 | TH1F *he =new TH1F("he","dE/dX for pions with 0.4<p<0.5 GeV/c",50,0.,100.); |
7f6ddf58 | 103 | TH2F *hep=new TH2F("hep","dE/dX vs momentum",50,0.,2.,50,0.,400.); |
be9c5115 | 104 | hep->SetMarkerStyle(8); |
105 | hep->SetMarkerSize(0.4); | |
8c555625 | 106 | |
7f6ddf58 | 107 | //MI change |
108 | Int_t mingood=ngood; | |
109 | Int_t track_notfound[MAX], itrack_notfound=0; | |
110 | Int_t track_fake[MAX], itrack_fake=0; | |
111 | Int_t track_multifound[MAX], track_multifound_n[MAX], itrack_multifound=0; | |
cf98c13f | 112 | |
cc80f89e | 113 | while (ngood--) { |
cf98c13f | 114 | Int_t lab=gt[ngood].lab,tlab=-1; |
cc80f89e | 115 | Float_t ptg= |
116 | TMath::Sqrt(gt[ngood].px*gt[ngood].px + gt[ngood].py*gt[ngood].py); | |
8c555625 | 117 | |
7f6ddf58 | 118 | if (ptg<1e-33) continue; // for those not crossing 0 pad row |
b9de75e1 | 119 | |
8c555625 | 120 | hgood->Fill(ptg); |
cc80f89e | 121 | |
cf98c13f | 122 | AliTPCtrack *track=0; |
7f6ddf58 | 123 | for (i=0; i<nentr; i++) { |
cf98c13f | 124 | track=(AliTPCtrack*)tarray.UncheckedAt(i); |
73042f01 | 125 | tlab=track->GetLabel(); |
cc80f89e | 126 | if (lab==TMath::Abs(tlab)) break; |
8c555625 | 127 | } |
7f6ddf58 | 128 | if (i==nentr) { |
cf98c13f | 129 | track_notfound[itrack_notfound++]=lab; |
cc80f89e | 130 | continue; |
131 | } | |
cf98c13f | 132 | |
133 | //MI change - addition | |
134 | Int_t micount=0; | |
135 | Int_t mi; | |
136 | AliTPCtrack * mitrack; | |
7f6ddf58 | 137 | for (mi=0; mi<nentr; mi++) { |
cf98c13f | 138 | mitrack=(AliTPCtrack*)tarray.UncheckedAt(mi); |
139 | if (lab==TMath::Abs(mitrack->GetLabel())) micount++; | |
140 | } | |
141 | if (micount>1) { | |
cf98c13f | 142 | track_multifound[itrack_multifound]=lab; |
143 | track_multifound_n[itrack_multifound]=micount; | |
144 | itrack_multifound++; | |
145 | } | |
146 | ||
7f6ddf58 | 147 | Double_t xk=gt[ngood].x; |
cc80f89e | 148 | track->PropagateTo(xk); |
3c0f9266 | 149 | |
cc80f89e | 150 | if (lab==tlab) hfound->Fill(ptg); |
cf98c13f | 151 | else { |
152 | track_fake[itrack_fake++]=lab; | |
153 | hfake->Fill(ptg); | |
cf98c13f | 154 | } |
cc80f89e | 155 | |
be9c5115 | 156 | Double_t par[5]; track->GetExternalParameters(xk,par); |
157 | Float_t phi=TMath::ASin(par[2]) + track->GetAlpha(); | |
158 | if (phi<-TMath::Pi()) phi+=2*TMath::Pi(); | |
159 | if (phi>=TMath::Pi()) phi-=2*TMath::Pi(); | |
160 | Float_t lam=TMath::ATan(par[3]); | |
161 | Float_t pt_1=TMath::Abs(par[4]); | |
cc80f89e | 162 | |
163 | if (TMath::Abs(gt[ngood].code)==11 && ptg>4.) { | |
be9c5115 | 164 | hmpt->Fill((pt_1 - 1/ptg)/(1/ptg)*100.); |
cc80f89e | 165 | } else { |
166 | Float_t phig=TMath::ATan2(gt[ngood].py,gt[ngood].px); | |
cc80f89e | 167 | hp->Fill((phi - phig)*1000.); |
3c0f9266 | 168 | |
cc80f89e | 169 | Float_t lamg=TMath::ATan2(gt[ngood].pz,ptg); |
cc80f89e | 170 | hl->Fill((lam - lamg)*1000.); |
171 | ||
be9c5115 | 172 | hpt->Fill((pt_1 - 1/ptg)/(1/ptg)*100.); |
cc80f89e | 173 | } |
73042f01 | 174 | |
be9c5115 | 175 | Float_t mom=1./(pt_1*TMath::Cos(lam)); |
73042f01 | 176 | Float_t dedx=track->GetdEdx(); |
cc80f89e | 177 | hep->Fill(mom,dedx,1.); |
178 | if (TMath::Abs(gt[ngood].code)==211) | |
179 | if (mom>0.4 && mom<0.5) { | |
180 | he->Fill(dedx,1.); | |
181 | } | |
73042f01 | 182 | |
cc80f89e | 183 | } |
184 | ||
cf98c13f | 185 | cout<<"\nList of Not found tracks :\n"; |
cf98c13f | 186 | for ( i = 0; i< itrack_notfound; i++){ |
187 | cout<<track_notfound[i]<<"\t"; | |
188 | if ((i%5)==4) cout<<"\n"; | |
189 | } | |
190 | cout<<"\nList of fake tracks :\n"; | |
191 | for ( i = 0; i< itrack_fake; i++){ | |
192 | cout<<track_fake[i]<<"\t"; | |
193 | if ((i%5)==4) cout<<"\n"; | |
194 | } | |
195 | cout<<"\nList of multiple found tracks :\n"; | |
196 | for ( i=0; i<itrack_multifound; i++) { | |
7f6ddf58 | 197 | cout<<"id. "<<track_multifound[i] |
198 | <<" found - "<<track_multifound_n[i]<<"times\n"; | |
cf98c13f | 199 | } |
8c555625 | 200 | |
7f6ddf58 | 201 | Stat_t ng=hgood->GetEntries(), nf=hfound->GetEntries(); |
202 | if (ng!=0) cerr<<"\n\nIntegral efficiency is about "<<nf/ng*100.<<" %\n"; | |
203 | cout<<"Total number of found tracks ="<<nentr<<endl; | |
204 | cout<<"Total number of \"good\" tracks =" | |
205 | <<mingood<<" (selected for comparison: "<<ng<<')'<<endl<<endl; | |
206 | ||
207 | ||
8c555625 | 208 | gStyle->SetOptStat(111110); |
209 | gStyle->SetOptFit(1); | |
210 | ||
211 | TCanvas *c1=new TCanvas("c1","",0,0,700,850); | |
212 | ||
213 | TPad *p1=new TPad("p1","",0,0.3,.5,.6); p1->Draw(); | |
214 | p1->cd(); p1->SetFillColor(42); p1->SetFrameFillColor(10); | |
215 | hp->SetFillColor(4); hp->SetXTitle("(mrad)"); hp->Fit("gaus"); c1->cd(); | |
216 | ||
217 | TPad *p2=new TPad("p2","",0.5,.3,1,.6); p2->Draw(); | |
218 | p2->cd(); p2->SetFillColor(42); p2->SetFrameFillColor(10); | |
219 | hl->SetXTitle("(mrad)"); hl->Fit("gaus"); c1->cd(); | |
220 | ||
221 | TPad *p3=new TPad("p3","",0,0,0.5,0.3); p3->Draw(); | |
222 | p3->cd(); p3->SetFillColor(42); p3->SetFrameFillColor(10); | |
223 | hpt->SetXTitle("(%)"); hpt->Fit("gaus"); c1->cd(); | |
224 | ||
225 | TPad *p4=new TPad("p4","",0.5,0,1,0.3); p4->Draw(); | |
226 | p4->cd(); p4->SetFillColor(42); p4->SetFrameFillColor(10); | |
cc80f89e | 227 | hmpt->SetXTitle("(%)"); hmpt->Fit("gaus"); c1->cd(); |
8c555625 | 228 | |
229 | TPad *p5=new TPad("p5","",0,0.6,1,1); p5->Draw(); p5->cd(); | |
3c0f9266 | 230 | p5->SetFillColor(41); p5->SetFrameFillColor(10); |
8c555625 | 231 | hfound->Sumw2(); hgood->Sumw2(); hfake->Sumw2(); |
232 | hg->Divide(hfound,hgood,1,1.,"b"); | |
233 | hf->Divide(hfake,hgood,1,1.,"b"); | |
234 | hg->SetMaximum(1.4); | |
235 | hg->SetYTitle("Tracking efficiency"); | |
236 | hg->SetXTitle("Pt (GeV/c)"); | |
237 | hg->Draw(); | |
238 | ||
7f6ddf58 | 239 | TLine *line1 = new TLine(0.1,1.0,6.1,1.0); line1->SetLineStyle(4); |
8c555625 | 240 | line1->Draw("same"); |
7f6ddf58 | 241 | TLine *line2 = new TLine(0.1,0.9,6.1,0.9); line2->SetLineStyle(4); |
8c555625 | 242 | line2->Draw("same"); |
243 | ||
244 | hf->SetFillColor(1); | |
245 | hf->SetFillStyle(3013); | |
246 | hf->SetLineColor(2); | |
247 | hf->SetLineWidth(2); | |
248 | hf->Draw("histsame"); | |
249 | TText *text = new TText(0.461176,0.248448,"Fake tracks"); | |
250 | text->SetTextSize(0.05); | |
251 | text->Draw(); | |
252 | text = new TText(0.453919,1.11408,"Good tracks"); | |
253 | text->SetTextSize(0.05); | |
254 | text->Draw(); | |
3c0f9266 | 255 | |
256 | ||
257 | ||
258 | TCanvas *c2=new TCanvas("c2","",320,32,530,590); | |
259 | ||
260 | TPad *p6=new TPad("p6","",0.,0.,1.,.5); p6->Draw(); | |
261 | p6->cd(); p6->SetFillColor(42); p6->SetFrameFillColor(10); | |
262 | he->SetFillColor(2); he->SetFillStyle(3005); | |
263 | he->SetXTitle("Arbitrary Units"); | |
264 | he->Fit("gaus"); c2->cd(); | |
265 | ||
266 | TPad *p7=new TPad("p7","",0.,0.5,1.,1.); p7->Draw(); | |
267 | p7->cd(); p7->SetFillColor(42); p7->SetFrameFillColor(10); | |
268 | hep->SetXTitle("p (Gev/c)"); hep->SetYTitle("dE/dX (Arb. Units)"); | |
269 | hep->Draw(); c1->cd(); | |
270 | ||
cf98c13f | 271 | gBenchmark->Stop("AliTPCComparison"); |
272 | gBenchmark->Show("AliTPCComparison"); | |
273 | ||
274 | ||
73042f01 | 275 | return 0; |
cc80f89e | 276 | } |
3c0f9266 | 277 | |
cc80f89e | 278 | |
7f6ddf58 | 279 | Int_t good_tracks_tpc(GoodTrackTPC *gt, const Int_t max, const Int_t event) { |
280 | Int_t nt=0; | |
cc80f89e | 281 | |
f38c8ae5 | 282 | TFile *file=TFile::Open("galice.root"); |
73042f01 | 283 | if (!file->IsOpen()) {cerr<<"Can't open galice.root !\n"; exit(4);} |
284 | ||
285 | if (!(gAlice=(AliRun*)file->Get("gAlice"))) { | |
286 | cerr<<"gAlice have not been found on galice.root !\n"; | |
287 | exit(5); | |
288 | } | |
289 | ||
7f6ddf58 | 290 | Int_t np=gAlice->GetEvent(event); |
cc80f89e | 291 | |
73042f01 | 292 | AliTPC *TPC=(AliTPC*)gAlice->GetDetector("TPC"); |
293 | Int_t ver = TPC->IsVersion(); | |
294 | cerr<<"TPC version "<<ver<<" has been found !\n"; | |
295 | ||
c2b0eaa4 | 296 | AliTPCParamSR *digp=(AliTPCParamSR*)file->Get("75x40_100x60_150x60"); |
73042f01 | 297 | if (!digp) { cerr<<"TPC parameters have not been found !\n"; exit(6); } |
298 | TPC->SetParam(digp); | |
299 | ||
024a7fe9 | 300 | |
301 | ||
73042f01 | 302 | Int_t nrow_up=digp->GetNRowUp(); |
303 | Int_t nrows=digp->GetNRowLow()+nrow_up; | |
304 | Int_t zero=digp->GetZeroSup(); | |
7f6ddf58 | 305 | Int_t gap=Int_t(0.125*nrows), shift=Int_t(0.5*gap); |
cc80f89e | 306 | Int_t good_number=Int_t(0.4*nrows); |
307 | ||
7f6ddf58 | 308 | Int_t *good=new Int_t[np]; |
309 | Int_t i; | |
310 | for (i=0; i<np; i++) good[i]=0; | |
311 | ||
312 | ||
313 | switch (ver) { | |
314 | case 1: | |
315 | { | |
316 | char cname[100]; sprintf(cname,"TreeC_TPC_%d",event); | |
317 | TFile *cf=TFile::Open("AliTPCclusters.root"); | |
318 | if (!cf->IsOpen()){cerr<<"Can't open AliTPCclusters.root !\n";exit(5);} | |
319 | AliTPCClustersArray *pca=new AliTPCClustersArray, &ca=*pca; | |
320 | ca.Setup(digp); | |
321 | ca.SetClusterType("AliTPCcluster"); | |
322 | ca.ConnectTree(cname); | |
323 | Int_t nrows=Int_t(ca.GetTree()->GetEntries()); | |
324 | for (Int_t n=0; n<nrows; n++) { | |
325 | AliSegmentID *s=ca.LoadEntry(n); | |
326 | Int_t sec,row; | |
327 | digp->AdjustSectorRow(s->GetID(),sec,row); | |
328 | AliTPCClustersRow &clrow = *ca.GetRow(sec,row); | |
329 | Int_t ncl=clrow.GetArray()->GetEntriesFast(); | |
330 | while (ncl--) { | |
331 | AliTPCcluster *c=(AliTPCcluster*)clrow[ncl]; | |
332 | Int_t lab=c->GetLabel(0); | |
333 | if (lab<0) continue; //noise cluster | |
334 | lab=TMath::Abs(lab); | |
335 | ||
336 | if (sec>=digp->GetNInnerSector()) | |
337 | if (row==nrow_up-1) good[lab]|=0x4000; | |
338 | if (sec>=digp->GetNInnerSector()) | |
339 | if (row==nrow_up-1-gap) good[lab]|=0x1000; | |
340 | ||
341 | if (sec>=digp->GetNInnerSector()) | |
342 | if (row==nrow_up-1-shift) good[lab]|=0x2000; | |
343 | if (sec>=digp->GetNInnerSector()) | |
344 | if (row==nrow_up-1-gap-shift) good[lab]|=0x800; | |
345 | ||
346 | good[lab]++; | |
347 | } | |
348 | ca.ClearRow(sec,row); | |
349 | } | |
350 | delete pca; | |
351 | cf->Close(); | |
352 | } | |
afc42102 | 353 | break; |
7f6ddf58 | 354 | case 2: |
355 | { | |
7a09f434 | 356 | char dname[100]; sprintf(dname,"TreeD_75x40_100x60_150x60_%d",event); |
7f6ddf58 | 357 | TTree *TD=(TTree*)gDirectory->Get(dname); |
358 | AliSimDigits da, *digits=&da; | |
359 | TD->GetBranch("Segment")->SetAddress(&digits); | |
360 | ||
361 | Int_t *count = new Int_t[np]; | |
362 | Int_t i; | |
363 | for (i=0; i<np; i++) count[i]=0; | |
364 | ||
365 | Int_t sectors_by_rows=(Int_t)TD->GetEntries(); | |
366 | for (i=0; i<sectors_by_rows; i++) { | |
367 | if (!TD->GetEvent(i)) continue; | |
368 | Int_t sec,row; | |
369 | digp->AdjustSectorRow(digits->GetID(),sec,row); | |
370 | cerr<<sec<<' '<<row<<" \r"; | |
371 | digits->First(); | |
372 | do { //Many thanks to J.Chudoba who noticed this | |
373 | Int_t it=digits->CurrentRow(), ip=digits->CurrentColumn(); | |
374 | Short_t dig = digits->GetDigit(it,ip); | |
375 | Int_t idx0=digits->GetTrackID(it,ip,0); | |
376 | Int_t idx1=digits->GetTrackID(it,ip,1); | |
377 | Int_t idx2=digits->GetTrackID(it,ip,2); | |
8ded1b7a | 378 | if (idx0>=0 && dig>=zero && idx0<np) count[idx0]+=1; |
379 | if (idx1>=0 && dig>=zero && idx1<np) count[idx1]+=1; | |
380 | if (idx2>=0 && dig>=zero && idx2<np) count[idx2]+=1; | |
afc42102 | 381 | } while (digits->Next()); |
7f6ddf58 | 382 | for (Int_t j=0; j<np; j++) { |
383 | if (count[j]>1) { | |
384 | if (sec>=digp->GetNInnerSector()) | |
385 | if (row==nrow_up-1 ) good[j]|=0x4000; | |
386 | if (sec>=digp->GetNInnerSector()) | |
387 | if (row==nrow_up-1-gap) good[j]|=0x1000; | |
388 | ||
389 | if (sec>=digp->GetNInnerSector()) | |
390 | if (row==nrow_up-1-shift) good[j]|=0x2000; | |
391 | if (sec>=digp->GetNInnerSector()) | |
392 | if (row==nrow_up-1-gap-shift) good[j]|=0x800; | |
393 | good[j]++; | |
394 | } | |
395 | count[j]=0; | |
396 | } | |
397 | } | |
398 | delete[] count; | |
399 | delete TD; //Thanks to Mariana Bondila | |
afc42102 | 400 | } |
7f6ddf58 | 401 | break; |
402 | default: | |
403 | cerr<<"Invalid TPC version !\n"; | |
404 | file->Close(); | |
405 | exit(7); | |
cc80f89e | 406 | } |
7f6ddf58 | 407 | |
408 | ||
409 | /** select tracks which are "good" enough **/ | |
410 | for (i=0; i<np; i++) { | |
411 | if ((good[i]&0x5000) != 0x5000) | |
412 | if ((good[i]&0x2800) != 0x2800) continue; | |
413 | if ((good[i]&0x7FF ) < good_number) continue; | |
414 | ||
415 | TParticle *p = (TParticle*)gAlice->Particle(i); | |
416 | ||
417 | if (p->Pt()<0.100) continue; | |
418 | if (TMath::Abs(p->Pz()/p->Pt())>0.999) continue; | |
419 | ||
420 | Int_t j=p->GetFirstMother(); | |
421 | if (j>=0) { | |
024a7fe9 | 422 | TParticle *pp = (TParticle*)gAlice->Particle(j); |
423 | if (pp->GetFirstMother()>=0) continue;//only one decay is allowed | |
424 | /* for cascade hyperons only | |
425 | Int_t jj=pp->GetFirstMother(); | |
426 | if (jj>=0) { | |
427 | TParticle *ppp = (TParticle*)gAlice->Particle(jj); | |
428 | if (ppp->GetFirstMother()>=0) continue;//two decays are allowed | |
429 | } | |
430 | */ | |
7f6ddf58 | 431 | } |
432 | ||
433 | gt[nt].lab=i; | |
434 | gt[nt].code=p->GetPdgCode(); | |
435 | gt[nt].px=0.; gt[nt].py=0.; gt[nt].pz=0.; | |
527abbe9 | 436 | gt[nt].x=0.; gt[nt].y=0.; gt[nt].z=0.; |
7f6ddf58 | 437 | nt++; |
438 | if (nt==max) {cerr<<"Too many good tracks !\n"; break;} | |
439 | cerr<<np-i<<" \r"; | |
440 | } | |
441 | ||
442 | /** check if there is also information at the entrance of the TPC **/ | |
443 | TTree *TH=gAlice->TreeH(); np=(Int_t)TH->GetEntries(); | |
444 | for (i=0; i<np; i++) { | |
445 | TPC->ResetHits(); | |
446 | TH->GetEvent(i); | |
447 | AliTPChit *phit = (AliTPChit*)TPC->FirstHit(-1); | |
448 | for ( ; phit; phit=(AliTPChit*)TPC->NextHit() ) { | |
449 | if (phit->fQ !=0. ) continue; | |
450 | ||
451 | Double_t px=phit->X(), py=phit->Y(), pz=phit->Z(); | |
452 | ||
453 | if ((phit=(AliTPChit*)TPC->NextHit())==0) break; | |
454 | if (phit->fQ != 0.) continue; | |
455 | ||
456 | Double_t x=phit->X(), y=phit->Y(), z=phit->Z(); | |
457 | if (TMath::Sqrt(x*x+y*y)>90.) continue; | |
458 | ||
459 | Int_t j, lab=phit->Track(); | |
460 | for (j=0; j<nt; j++) {if (gt[j].lab==lab) break;} | |
461 | if (j==nt) continue; | |
462 | ||
463 | // (px,py,pz) - in global coordinate system, (x,y,z) - in local ! | |
464 | gt[j].px=px; gt[j].py=py; gt[j].pz=pz; | |
465 | Float_t cs,sn; digp->AdjustCosSin(phit->fSector,cs,sn); | |
466 | gt[j].x = x*cs + y*sn; | |
467 | gt[j].y =-x*sn + y*cs; | |
468 | gt[j].z = z; | |
469 | } | |
470 | cerr<<np-i<<" \r"; | |
471 | } | |
472 | ||
473 | delete[] good; | |
474 | ||
be9c5115 | 475 | delete gAlice; gAlice=0; |
7f6ddf58 | 476 | |
73042f01 | 477 | file->Close(); |
cf98c13f | 478 | gBenchmark->Stop("AliTPCComparison"); |
479 | gBenchmark->Show("AliTPCComparison"); | |
cc80f89e | 480 | return nt; |
8c555625 | 481 | } |
482 | ||
73042f01 | 483 | |
484 |