]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/alice-macros/tpc_raw.C
From Stefano.
[u/mrichter/AliRoot.git] / EVE / alice-macros / tpc_raw.C
CommitLineData
20dae051 1// $Id$
6226bf2b 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// Macro to visualise rootified raw-data from TPC.
11//
12// Use tpc_raw(Int_t mode) in order to run it
13// Needs that alieve_init() is already called
14// mode = 1 - show only 2D sectors
15// mode = 2 - show only 3D sectors
16// mode = 3 - show both 2D and 3D sectors
17
6226bf2b 18void tpc_raw(Int_t mode = 3)
19{
20 gStyle->SetPalette(1, 0);
21
6226bf2b 22 AliRawReader *reader = AliEveEventManager::AssertRawReader();
23 reader->Reset();
375fd576 24 AliTPCRawStreamV3 input(reader);
6226bf2b 25 reader->Select("TPC"); // ("TPC", firstRCU, lastRCU);
26
4d62585e 27 AliEveTPCData *x = new AliEveTPCData;
6226bf2b 28 // x->SetLoadPedestal(5);
29 x->SetLoadThreshold(5);
30 x->SetAutoPedestal(kTRUE);
31
6226bf2b 32 x->LoadRaw(input, kTRUE, kTRUE);
33
da94dab4 34 gEve->DisableRedraw();
35
de33999e 36 TEveElementList* sec2d = new TEveElementList("TPC 2D");
37 gEve->AddElement(sec2d);
38
39 TEveElementList* sec3d = new TEveElementList("TPC 3D");
40 gEve->AddElement(sec3d);
41
6226bf2b 42 for (Int_t i=0; i<=35; ++i) {
43 if (mode & 1) {
de33999e 44 s = new AliEveTPCSector2D(Form("2D sector %d",i));
6226bf2b 45 s->SetSectorID(i);
46 s->SetAutoTrans(kTRUE); // place on proper 3D coordinates
47 s->SetDataSource(x);
48 s->SetFrameColor(36);
de33999e 49 sec2d->AddElement(s);
6226bf2b 50 s->IncRTS();
51 }
52 if (mode & 2) {
de33999e 53 t = new AliEveTPCSector3D(Form("3D sector %d",i));
6226bf2b 54 t->SetSectorID(i);
55 t->SetAutoTrans(kTRUE);
56 t->SetDataSource(x);
de33999e 57 sec3d->AddElement(t);
6226bf2b 58 t->IncRTS();
59 }
60 }
61
62 gEve->EnableRedraw();
6226bf2b 63}