New macros to display SDD raw data and digits (F. Prino)
[u/mrichter/AliRoot.git] / ITS / PlotSDDRawData.C
CommitLineData
1e40ae31 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
14void PlotSDDRawData(Char_t datafil[100], Int_t nDDL, Int_t firstEv=0, Int_t lastEv=5){
15
16 Int_t eqOffset = 256;
17 Int_t DDLid_range= 24;
18 const Int_t nHybrids=24;
19
20 TH2F** histo = new TH2F*[nHybrids];
21 Char_t nome[20];
22 for(Int_t i=0;i<nHybrids;i++){
23 sprintf(nome,"histo%d",i);
24 histo[i]=new TH2F(nome,"",256,-0.5,255.5,256,-0.5,255.5);
25 histo[i]->SetStats(0);
26 }
27
28 Int_t iev=firstEv;
29 AliRawReader *rd;
30 if(strstr(datafil,".root")!=0){
31 rd=new AliRawReaderRoot(datafil,iev);
32 }else{
33 rd=new AliRawReaderDate(datafil,iev);
34 }
35 TStopwatch *evtime=new TStopwatch();
36 TCanvas* c0 = new TCanvas("cd0","c0",900,900);
37 gStyle->SetPalette(1);
38 Int_t idev;
39 do{
40 c0->Clear();
41 c0->Divide(4,6,0.001,0.001);
42
43 evtime->Start();
44 printf("Event # %d\n",iev);
45 rd->SelectEquipment(17,eqOffset,eqOffset+DDLid_range);
46 rd->Reset();
47 for(Int_t i=0;i<nHybrids;i++) histo[i]->Reset();
48 AliITSRawStreamSDD s(rd);
49 rd->SelectEquipment(17,eqOffset,eqOffset+DDLid_range);
50 Int_t iCountNext=0;
51 while(s.Next()){
52 iCountNext++;
53 if(s.IsCompletedModule()==kFALSE){
54 Int_t i=s.GetCarlosId()*2+s.GetChannel();
55 if(rd->GetDDLID()==nDDL) histo[i]->Fill(s.GetCoord2(),s.GetCoord1(),s.GetSignal());
56 }
57 }
58 idev=s.GetEventId();
59 evtime->Stop();
60 printf("**** Event=%d ID=%d\n",iev,idev);
61 evtime->Print("u");
62 evtime->Reset();
63 iev++;
64
65 for(Int_t i=0;i<nHybrids;i++){
66 c0->cd(i+1);
67 histo[i]->DrawCopy("colz");
68 }
69 c0->Update();
70 }while(rd->NextEvent()&&iev<=lastEv);
71
72}
73