]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/alice-macros/tpc_raw.C
Modified macros to be compilable by ACLiC
[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 #if !defined(__CINT__) || defined(__MAKECINT__)
11 #include <TStyle.h>
12 #include <TTree.h>
13 #include <TEveManager.h>
14 #include <TEveElement.h>
15 #include <TEvePointSet.h>
16 #include <TEveTreeTools.h>
17
18 #include <RAW/AliRawReader.h>
19 #include <RAW/AliAltroRawStreamV3.h>
20 #include <TPC/AliTPCRawStreamV3.h>
21 #include <EVE/EveBase/AliEveEventManager.h>
22 #include <EVE/EveDet/AliEveTPCData.h>
23 #include <EVE/EveDet/AliEveTPCSector2D.h>
24 #include <EVE/EveDet/AliEveTPCSector3D.h>
25 #endif
26
27 // Macro to visualise rootified raw-data from TPC.
28 //
29 // Use tpc_raw(Int_t mode) in order to run it
30 // Needs that alieve_init() is already called
31 // mode = 1 - show only 2D sectors
32 // mode = 2 - show only 3D sectors
33 // mode = 3 - show both 2D and 3D sectors
34
35 void tpc_raw(Int_t mode = 3)
36 {
37   gStyle->SetPalette(1, 0);
38
39   AliRawReader *reader = AliEveEventManager::AssertRawReader();
40   reader->Reset();
41   AliTPCRawStreamV3 input(reader);
42   reader->Select("TPC"); // ("TPC", firstRCU, lastRCU);
43
44   AliEveTPCData *x = new AliEveTPCData;
45   // x->SetLoadPedestal(5);
46   x->SetLoadThreshold(5);
47   x->SetAutoPedestal(kTRUE);
48
49   x->LoadRaw(input, kTRUE, kTRUE);
50
51   gEve->DisableRedraw();
52
53   TEveElementList* sec2d = new TEveElementList("TPC 2D");
54   gEve->AddElement(sec2d);
55
56   TEveElementList* sec3d = new TEveElementList("TPC 3D");
57   gEve->AddElement(sec3d);
58
59   AliEveTPCSector2D *s;
60   AliEveTPCSector3D *t;
61   
62   for (Int_t i=0; i<=35; ++i) {
63     if (mode & 1) {
64       s = new AliEveTPCSector2D(Form("2D sector %d",i));
65       s->SetSectorID(i);
66       s->SetAutoTrans(kTRUE); // place on proper 3D coordinates
67       s->SetDataSource(x);
68       s->SetFrameColor(36);
69       sec2d->AddElement(s);
70       s->IncRTS();
71     }
72     if (mode & 2) {
73       t = new AliEveTPCSector3D(Form("3D sector %d",i));
74       t->SetSectorID(i);
75       t->SetAutoTrans(kTRUE);
76       t->SetDataSource(x);
77       sec3d->AddElement(t);
78       t->IncRTS();
79     }
80   }
81
82   gEve->EnableRedraw();
83 }