]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/test-macros/tpc_raw_test.C
Move contents of EVE/Alieve to EVE/EveDet as most code will remain there.
[u/mrichter/AliRoot.git] / EVE / test-macros / tpc_raw_test.C
1 // $Id$
2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4 /**************************************************************************
5  * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6  * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
7  * full copyright notice.                                                 *
8  **************************************************************************/
9
10 class AliRawReaderFile;
11
12 class AliEveTPCData;
13
14 AliEveTPCData    *x      = 0;
15 AliRawReaderFile *reader = 0;
16
17 void tpc_raw_test()
18 {
19   gROOT->Macro("alieve_loadlibs.C");
20   gSystem->Load("libAlieve");
21
22   reader = new AliRawReaderFile("raw0");
23   reader->Reset();
24   reader->NextEvent();
25   AliTPCRawStream input(reader);
26
27   x = new AliEveTPCData;
28   //x->SetSectorBlockSize(8192);
29   //x->SetLoadThreshold(5);
30   x->CreateAllSectors();
31   x->LoadRaw(input, kFALSE);
32
33   gStyle->SetPalette(1, 0);
34
35   AliEveTPCSector2D* s = new AliEveTPCSector2D();
36   s->SetDataSource(x);
37   s->SetMainColor(36);
38   gEve->AddElement(s);
39   gEve->DrawElement(s);
40
41 }
42
43 void tpc_raw_pad_dump(Int_t s, Int_t r, Int_t p)
44 {
45   reader->Reset();
46   reader->NextEvent();
47
48   if(r >= AliEveTPCSectorData::GetInnSeg().fNRows) {
49     r -= AliEveTPCSectorData::GetInnSeg().fNRows;
50     s += 36;
51   }
52
53   AliTPCRawStream input(reader);
54   Int_t sector = input.GetSector();
55   Int_t row    = input.GetRow();
56
57   while (input.Next()) {
58     if (input.IsNewRow()) {
59       sector = input.GetSector();
60       row    = input.GetRow();
61     }
62     if(sector != s || row != r) continue;
63
64     Int_t signal = input.GetSignal();
65     Int_t pad    = input.GetPad();
66     Int_t time   = input.GetTime();
67
68     if(pad == p)
69       printf("%d %d\n", time, signal);
70   }
71 }