]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/alice-macros/tpc_raw.C
Coverity
[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   AliRawReader *reader = AliEveEventManager::AssertRawReader();
23   reader->Reset();
24   AliTPCRawStreamV3 input(reader);
25   reader->Select("TPC"); // ("TPC", firstRCU, lastRCU);
26
27   AliEveTPCData *x = new AliEveTPCData;
28   // x->SetLoadPedestal(5);
29   x->SetLoadThreshold(5);
30   x->SetAutoPedestal(kTRUE);
31
32   x->LoadRaw(input, kTRUE, kTRUE);
33
34   gEve->DisableRedraw();
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       sec3d->AddElement(t);
58       t->IncRTS();
59     }
60   }
61
62   gEve->EnableRedraw();
63 }