]>
Commit | Line | Data |
---|---|---|
8c555625 | 1 | void AliTPCDigitsDisplay(int sec, int row, |
2 | int max_t_chan=500, float min_t=0., float max_t=500., | |
3 | int max_p_chan=200, float min_p=0., float max_p=200.) | |
4 | { | |
5 | // Dynamically link some shared libs | |
6 | if (gClassTable->GetID("AliRun") < 0) { | |
7 | gROOT->LoadMacro("loadlibs.C"); | |
8 | loadlibs(); | |
9 | } else { | |
10 | delete gAlice; | |
11 | gAlice=0; | |
12 | } | |
13 | ||
14 | // Connect the Root Galice file containing Geometry, Kine and Hits | |
15 | TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root"); | |
16 | if (f) f->Close(); | |
17 | f = new TFile("galice.root"); | |
18 | ||
19 | TClonesArray *fDigits=new TClonesArray("AliTPCdigit",10000); | |
20 | TTree *t=(TTree*)f->Get("TreeD0_Param1"); | |
21 | t->GetBranch("Digits")->SetAddress(&fDigits); | |
22 | Int_t sectors_by_rows=(Int_t)t->GetEntries(); | |
23 | for (Int_t n=0; n<sectors_by_rows; n++) { | |
24 | if (!t->GetEvent(n)) continue; | |
25 | AliTPCdigit *dig=(AliTPCdigit*)fDigits->UncheckedAt(0); | |
26 | ||
27 | if (sec < dig->fSector) break; | |
28 | if (sec != dig->fSector) continue; | |
29 | if (row != dig->fPadRow) continue; | |
30 | ||
31 | char s[80]; | |
32 | sprintf(s,"Sector %d Row %d\n",sec,row); | |
33 | TH2F *h = new TH2F("h",s,max_t_chan,min_t,max_t,max_p_chan,min_p,max_p); | |
34 | Int_t ndigits=fDigits->GetEntriesFast(); | |
35 | for (Int_t ndig=0; ndig<ndigits; ndig++) { | |
36 | dig=(AliTPCdigit*)fDigits->UncheckedAt(ndig); | |
37 | if (dig->fSignal < 0) continue; //cluster finder threshold | |
38 | h->Fill(dig->fTime,dig->fPad,dig->fSignal); | |
39 | } | |
40 | h->SetMaximum(200); | |
41 | gStyle->SetOptStat(0); | |
42 | TCanvas *c1=new TCanvas("c1","TPC digits display",0,0,1110,680); | |
43 | TPad *p1=new TPad("p1","",0,0,1,0.5); | |
44 | p1->Draw(); | |
45 | TPad *p2=new TPad("p2","",0,0.5,1,1); | |
46 | p2->Draw(); | |
47 | p2->cd(); | |
48 | h->Draw("lego"); | |
49 | p1->cd(); | |
50 | h->Draw("colz"); | |
51 | } | |
52 | } | |
53 |