First pass of changes required for visualization of event-embedding.
[u/mrichter/AliRoot.git] / EVE / alice-macros / tpc_raw.C
CommitLineData
6226bf2b 1// $Id: tpc_sector_raw_test.C 25672 2008-05-09 11:56:22Z cvetan $
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
22 gEve->DisableRedraw();
23
24 AliRawReader *reader = AliEveEventManager::AssertRawReader();
25 reader->Reset();
26 AliTPCRawStream input(reader);
27 reader->Select("TPC"); // ("TPC", firstRCU, lastRCU);
28
4d62585e 29 AliEveTPCData *x = new AliEveTPCData;
6226bf2b 30 // x->SetLoadPedestal(5);
31 x->SetLoadThreshold(5);
32 x->SetAutoPedestal(kTRUE);
33
6226bf2b 34 x->LoadRaw(input, kTRUE, kTRUE);
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);
57 t->SetMinTime(40);
58 t->SetMaxTime(980);
59 t->SetDriftVel(2.273);
de33999e 60 sec3d->AddElement(t);
6226bf2b 61 t->IncRTS();
62 }
63 }
64
65 gEve->EnableRedraw();
66 gEve->Redraw3D();
67}