]>
Commit | Line | Data |
---|---|---|
a1d53143 | 1 | Int_t AliTPCDisplayDigits(Int_t eventn, int sec, int row, int lab=-1, |
cc80f89e | 2 | int max_t_chan=500, float min_t=0., float max_t=500., |
3 | int max_p_chan=150, float min_p=0., float max_p=150.) | |
4 | { | |
73042f01 | 5 | cerr<<"Displaying digits...\n"; |
cc80f89e | 6 | |
7 | // Connect the Root Galice file containing Geometry, Kine and Hits | |
106ea0fc | 8 | TFile *f = TFile::Open("rfio:galice.root"); |
73042f01 | 9 | if (!f->IsOpen()) {cerr<<"Can't open galice.root !\n"; return 1;} |
cc80f89e | 10 | |
a1d53143 | 11 | |
12 | ||
73042f01 | 13 | AliTPCParam *par=(AliTPCParam *)f->Get("75x40_100x60"); |
cc80f89e | 14 | |
15 | char s[80]; | |
16 | sprintf(s,"Sector %d Row %d\n",sec,row); | |
17 | TH2F *h = new TH2F("h",s,max_t_chan,min_t,max_t,max_p_chan,min_p,max_p); | |
a1d53143 | 18 | |
19 | char name[100]; | |
20 | sprintf(name,"TreeD_75x40_100x60_%d",eventn); | |
cc80f89e | 21 | |
a1d53143 | 22 | TTree *t=(TTree*)f->Get(name); |
cc80f89e | 23 | AliSimDigits dummy, *digit=&dummy; |
24 | t->GetBranch("Segment")->SetAddress(&digit); | |
25 | for (int i=0; i<t->GetEntries(); i++) { | |
26 | t->GetEvent(i); | |
27 | int ss,rr; | |
28 | par->AdjustSectorRow(digit->GetID(),ss,rr); | |
29 | if (ss==sec && rr==row) goto ok; | |
30 | } | |
73042f01 | 31 | return 2; |
cc80f89e | 32 | |
33 | ok: | |
34 | int imax=0, jmax=0, qmax=0; | |
35 | digit->First(); | |
36 | do { | |
37 | Short_t dig=digit->CurrentDigit(); | |
38 | int i=digit->CurrentRow(), j=digit->CurrentColumn(); | |
39 | if (lab >= 0) { | |
40 | int lab0=digit->GetTrackID(i,j,0); | |
41 | int lab1=digit->GetTrackID(i,j,1); | |
42 | int lab2=digit->GetTrackID(i,j,2); | |
43 | if (lab0!=lab) if (lab1!=lab) if (lab2!=lab) continue; | |
44 | if (dig>qmax) {imax=i; jmax=j; qmax=dig;} | |
45 | cerr<<lab0<<' '<<lab1<<' '<<lab2<<endl; | |
46 | } | |
47 | h->Fill(i,j,dig); | |
48 | } while (digit->Next()); | |
73042f01 | 49 | if (qmax>0){cerr<<"Peak (time,pad,q) : "<<imax<<' '<<jmax<<' '<<qmax<<endl;} |
cc80f89e | 50 | |
51 | h->SetMaximum(100); | |
52 | gStyle->SetOptStat(0); | |
73042f01 | 53 | TCanvas *c1=new TCanvas("ddisplay","TPC digits display",0,0,1110,680); |
cc80f89e | 54 | TPad *p1=new TPad("p1","",0,0,1,0.5); |
55 | p1->Draw(); | |
56 | TPad *p2=new TPad("p2","",0,0.5,1,1); | |
57 | p2->Draw(); | |
58 | p2->cd(); | |
73042f01 | 59 | h->DrawCopy("lego"); |
cc80f89e | 60 | p1->cd(); |
73042f01 | 61 | h->DrawCopy("colz"); |
62 | ||
63 | c1->Modified(); c1->Update(); | |
64 | ||
65 | f->Close(); | |
66 | return 0; | |
cc80f89e | 67 | } |
68 |