From Cvetan: new macro to load ITS clusters.
[u/mrichter/AliRoot.git] / EVE / test-macros / tpc_raw_test.C
CommitLineData
915dabe1 1class AliRawReaderFile;
2
3namespace Alieve {
4class TPCData;
5}
6
7Alieve::TPCData* x = 0;
8AliRawReaderFile* reader = 0;
9
10void tpc_raw_test()
11{
12 gROOT->Macro("alieve_loadlibs.C");
13 gSystem->Load("libAlieve");
14
15 reader = new AliRawReaderFile("raw0");
16 reader->Reset();
17 reader->NextEvent();
18 AliTPCRawStream input(reader);
19
20 x = new Alieve::TPCData;
21 //x->SetSectorBlockSize(8192);
22 //x->SetLoadThreshold(5);
23 x->CreateAllSectors();
24 x->LoadRaw(input, kFALSE);
25
26 gStyle->SetPalette(1, 0);
27
28 Alieve::TPCSector2D* s = new Alieve::TPCSector2D();
29 s->SetDataSource(x);
30 s->SetMainColor(36);
31 gReve->AddRenderElement(s);
32 gReve->DrawRenderElement(s);
33
34}
35
36void tpc_raw_pad_dump(Int_t s, Int_t r, Int_t p)
37{
38 reader->Reset();
39 reader->NextEvent();
40
41 if(r >= Alieve::TPCSectorData::GetInnSeg().fNRows) {
42 r -= Alieve::TPCSectorData::GetInnSeg().fNRows;
43 s += 36;
44 }
45
46 AliTPCRawStream input(reader);
47 Int_t sector = input.GetSector();
48 Int_t row = input.GetRow();
49
50 while (input.Next()) {
51 if (input.IsNewRow()) {
52 sector = input.GetSector();
53 row = input.GetRow();
54 }
55 if(sector != s || row != r) continue;
56
57 Int_t signal = input.GetSignal();
58 Int_t pad = input.GetPad();
59 Int_t time = input.GetTime();
60
61 if(pad == p)
62 printf("%d %d\n", time, signal);
63 }
64}