Put all classes in Alieve/ sub-module out of the Alieve namespace and
[u/mrichter/AliRoot.git] / EVE / test-macros / tpc_gui_hack.C
CommitLineData
d810d0de 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 **************************************************************************/
ef2e5239 9
10// Function to spawn a gui for reading rootified raw-data from TPC sector test.
11
12#ifdef __CINT__
13
14class AliRawReaderRoot;
15
16namespace Alieve {
d810d0de 17class AliEveTPCData;
18class AliEveTPCSector2D;
19class AliEveTPCSector3D;
ef2e5239 20}
21
22#else
23
84aff7a4 24#include <TEve.h>
25#include <TEveManager.h>
d810d0de 26#include <Alieve/AliEveTPCData.h>
27#include <Alieve/AliEveTPCSector2D.h>
28#include <Alieve/AliEveTPCSector3D.h>
ef2e5239 29
30#include <RAW/AliRawReaderRoot.h>
31#include <TPC/AliTPCRawStream.h>
32
33#include <TSystem.h>
34#include <TStyle.h>
35
36#endif
37
38
d810d0de 39AliEveTPCSectorData* su = 0;
40AliEveTPCSectorData* sl = 0;
ef2e5239 41
d810d0de 42AliEveTPCLoader* loader = 0;
ef2e5239 43
44void tpc_gui_hack(const char *file=0, Int_t ievent=0)
45{
46 gStyle->SetPalette(1, 0);
47
d810d0de 48 AliEveTPCLoader* l = new AliEveTPCLoader; loader = l;
49 AliEveTPCData* d = new AliEveTPCData;
ef2e5239 50 // d->SetLoadPedestal(5);
51 d->SetLoadThreshold(5);
52 d->SetAutoPedestal(kTRUE);
53 l->SetData(d);
54 l->SetDoubleSR(kTRUE);
55 l->SetInitParams(50, 980, 15);
7ffb2ef3 56 // l->SetTPCEquipementMap("EquipmentIdMap.data");
ef2e5239 57
58 su = d->GetSectorData( 4, kTRUE);
59 sl = d->GetSectorData(13, kTRUE);
60
84aff7a4 61 gEve->AddElement(l);
62 gEve->NotifyBrowser(l);
63 gEve->DrawElement(l);
ef2e5239 64
65 if(file != 0) {
66 l->SetFile(file);
67 l->OpenFile();
68 l->GotoEvent(ievent);
69 }
70}
71
d810d0de 72void disable_pad(Int_t row, Int_t pad, AliEveTPCSectorData* sd,
ef2e5239 73 Int_t thrExt=10, Float_t thrFac=2)
74{
d810d0de 75 if(row < 0 || row >= AliEveTPCSectorData::GetNAllRows())
ef2e5239 76 { printf("row off, %d\n", row); return; }
77
d810d0de 78 Int_t npads = AliEveTPCSectorData::GetNPadsInRow(row);
ef2e5239 79 if(pad < 0) pad = npads + pad;
80 if(pad < 0 || pad >= npads) { printf("pad off\n"); return; }
81
82 sd->AddPadRowHack(row, pad, thrExt, thrFac);
83}
84
85void disable_std()
86{
87 // The noisy pads in lower inner seg, left edge
88 disable_pad(30, 1, sl, 200, 5);
89 disable_pad(30, 2, sl, 200, 5);
90 disable_pad(31, 1, sl, 200, 5);
91
92 // The noisy pads in lower inner seg, middle
93 disable_pad(31, 44, sl);
94 disable_pad(31, 43, sl);
95 disable_pad(30, 43, sl);
96
97 for(Int_t r=16; r<32; ++r) {
98 disable_pad(r, 0, su, 20, 3);
99 disable_pad(r, 1, su, 20, 3);
100 disable_pad(r, 2, su, 20, 3);
101 disable_pad(r, 3, su, 20, 3);
102 disable_pad(r, 4, su, 20, 3);
103 }
104
105 { // Top 12, 4 pads on the negative side.
d810d0de 106 AliEveTPCSectorData::SegmentInfo& o1si = AliEveTPCSectorData::GetOut1Seg();
ef2e5239 107 Int_t last = o1si.GetLastRow();
108 for(Int_t r=last - 11; r<=last; ++r) {
109 disable_pad(r, -1, su, 20, 4);
110 disable_pad(r, -2, su, 10, 3);
111 disable_pad(r, -3, su, 10, 3);
112 disable_pad(r, -4, su, 5, 2.5);
113 disable_pad(r, -5, su, 5, 2.5);
114 disable_pad(r, 0, su, 5, 2.5);
115 disable_pad(r, 1, su, 20, 4);
116 disable_pad(r, 2, su, 10, 3);
117 disable_pad(r, 3, su, 10, 3);
118 disable_pad(r, 4, su, 5, 2.5);
119
120 disable_pad(r, -1, sl, 20, 4);
121 disable_pad(r, -2, sl, 10, 3);
122 disable_pad(r, -3, sl, 10, 3);
123 disable_pad(r, -4, sl, 5, 2.5);
124 disable_pad(r, -5, sl, 5, 2.5);
125 }
126
127 disable_pad(last-8, -4, sl, 5, 2.5);
128
129 disable_pad(last-9, -2, sl, 5, 2);
130 disable_pad(last-9, -3, sl, 5, 2.5);
131 disable_pad(last-9, -4, sl, 5, 2.5);
132 disable_pad(last-9, -5, sl, 5, 2.5);
133 disable_pad(last-8, -5, sl, 5, 2.5);
134 }
135
136 {
d810d0de 137 AliEveTPCSectorData::SegmentInfo& o2si = AliEveTPCSectorData::GetOut2Seg();
ef2e5239 138 Int_t first = o2si.GetFirstRow();
139 Int_t last = o2si.GetLastRow();
140
141 for(Int_t r=first; r<=last; ++r) {
142 disable_pad(r, -1, su, 30, 3.5);
143 disable_pad(r, -2, su, 25, 3);
144 disable_pad(r, -3, su, 20, 3);
145 disable_pad(r, 0, su, 30, 3.5);
146 disable_pad(r, 1, su, 25, 3);
147
148 disable_pad(r, 0, sl, 30, 3.5);
149 disable_pad(r, 1, sl, 25, 3);
150 disable_pad(r, 2, sl, 20, 3);
151 disable_pad(r, 3, sl, 20, 3);
152 disable_pad(r, 4, sl, 20, 3);
153 disable_pad(r, 5, sl, 20, 3);
154 disable_pad(r, -1, sl, 30, 3.5);
155 disable_pad(r, -2, sl, 25, 3);
156 disable_pad(r, -3, sl, 25, 3);
157 disable_pad(r, -4, sl, 25, 3);
158 disable_pad(r, -5, sl, 25, 3);
159 }
160
161 for(Int_t pad=3; pad<30; ++pad) {
162 disable_pad(last, -pad-1, sl, 20, 3);
163 disable_pad(last, pad, su, 20, 3);
164 }
165 for(Int_t pad=3; pad<15; ++pad) {
166 disable_pad(last-1, -pad-1, sl, 20, 3);
167 disable_pad(last-2, -pad-1, sl, 20, 3);
168 }
169 disable_pad(last, 2, su, 20, 3);
170 }
171
172 loader->LoadEvent(); loader->UpdateSectors();
173}