]>
Commit | Line | Data |
---|---|---|
1 | #if !defined(__CINT__) || defined(__MAKECINT__) | |
2 | #include <TH2F.h> | |
3 | #include <TCanvas.h> | |
4 | #include <TStopwatch.h> | |
5 | #include <TStyle.h> | |
6 | #include "AliRawReaderDate.h" | |
7 | #include "AliRawReaderRoot.h" | |
8 | #include "AliITSRawStreamSDD.h" | |
9 | #endif | |
10 | ||
11 | // Macro to display the SDD Raw Data for 1 DDL | |
12 | // Origin: F. Prino, prino@to.infn.it | |
13 | ||
14 | void PlotSDDRawData(Char_t datafil[100], Int_t nDDL, Int_t firstEv=0, Int_t lastEv=5){ | |
15 | ||
16 | const Int_t nHybrids=24; | |
17 | ||
18 | TH2F** histo = new TH2F*[nHybrids]; | |
19 | Char_t nome[20]; | |
20 | for(Int_t i=0;i<nHybrids;i++){ | |
21 | sprintf(nome,"histo%d",i); | |
22 | histo[i]=new TH2F(nome,"",256,-0.5,255.5,256,-0.5,255.5); | |
23 | histo[i]->SetStats(0); | |
24 | } | |
25 | ||
26 | Int_t iev=firstEv; | |
27 | AliRawReader *rd; | |
28 | if(strstr(datafil,".root")!=0){ | |
29 | rd=new AliRawReaderRoot(datafil,iev); | |
30 | }else{ | |
31 | rd=new AliRawReaderDate(datafil,iev); | |
32 | } | |
33 | TStopwatch *evtime=new TStopwatch(); | |
34 | TCanvas* c0 = new TCanvas("cd0","c0",900,900); | |
35 | gStyle->SetPalette(1); | |
36 | Int_t idev; | |
37 | do{ | |
38 | c0->Clear(); | |
39 | c0->Divide(4,6,0.001,0.001); | |
40 | ||
41 | evtime->Start(); | |
42 | printf("Event # %d\n",iev); | |
43 | rd->Reset(); | |
44 | for(Int_t i=0;i<nHybrids;i++) histo[i]->Reset(); | |
45 | AliITSRawStreamSDD s(rd); | |
46 | Int_t iCountNext=0; | |
47 | while(s.Next()){ | |
48 | iCountNext++; | |
49 | if(s.IsCompletedModule()==kFALSE){ | |
50 | Int_t i=s.GetCarlosId()*2+s.GetChannel(); | |
51 | if(rd->GetDDLID()==nDDL) histo[i]->Fill(s.GetCoord2(),s.GetCoord1(),s.GetSignal()); | |
52 | } | |
53 | } | |
54 | idev=s.GetEventId(); | |
55 | evtime->Stop(); | |
56 | printf("**** Event=%d ID=%d\n",iev,idev); | |
57 | evtime->Print("u"); | |
58 | evtime->Reset(); | |
59 | iev++; | |
60 | ||
61 | for(Int_t i=0;i<nHybrids;i++){ | |
62 | c0->cd(i+1); | |
63 | histo[i]->DrawCopy("colz"); | |
64 | } | |
65 | c0->Update(); | |
66 | }while(rd->NextEvent()&&iev<=lastEv); | |
67 | ||
68 | } | |
69 |