]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/alice-macros/tpc_raw.C
Using the new altro raw-data format. Removing some obsolete macros.
[u/mrichter/AliRoot.git] / EVE / alice-macros / tpc_raw.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 // 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
18 void 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   AliTPCRawStreamV3 input(reader);
27   reader->Select("TPC"); // ("TPC", firstRCU, lastRCU);
28
29   AliEveTPCData *x = new AliEveTPCData;
30   // x->SetLoadPedestal(5);
31   x->SetLoadThreshold(5);
32   x->SetAutoPedestal(kTRUE);
33
34   x->LoadRaw(input, kTRUE, kTRUE);
35
36   TEveElementList* sec2d = new TEveElementList("TPC 2D");
37   gEve->AddElement(sec2d);
38
39   TEveElementList* sec3d = new TEveElementList("TPC 3D");
40   gEve->AddElement(sec3d);
41
42   for (Int_t i=0; i<=35; ++i) {
43     if (mode & 1) {
44       s = new AliEveTPCSector2D(Form("2D sector %d",i));
45       s->SetSectorID(i);
46       s->SetAutoTrans(kTRUE); // place on proper 3D coordinates
47       s->SetDataSource(x);
48       s->SetFrameColor(36);
49       sec2d->AddElement(s);
50       s->IncRTS();
51     }
52     if (mode & 2) {
53       t = new AliEveTPCSector3D(Form("3D sector %d",i));
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);
60       sec3d->AddElement(t);
61       t->IncRTS();
62     }
63   }
64
65   gEve->EnableRedraw();
66   gEve->Redraw3D();
67 }