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