Obsolete part commented out
[u/mrichter/AliRoot.git] / EVE / alice-macros / esd_zdc.C
CommitLineData
ec12c03d 1TEveRGBAPalette *g_zdc_palette = 0;
71363b2a 2Float_t g_zdc_scale = 0.1;
3Float_t g_zdc_dist = 11695;
4Float_t g_zdc_cross = 20;
ec12c03d 5
a3e7341e 6TEveGeoShape* zdc_make_shape(const Text_t* name, const Text_t* title_base,
7 Double_t signal, const Text_t* path)
ec12c03d 8{
9 if ( ! gGeoManager->cd(path))
10 {
11 Warning("zdc_make_shape", "Module name=%s, path='%s' not found.\n", name, path);
12 return 0;
13 }
14
15 UChar_t rgb[3];
16 g_zdc_palette->ColorFromValue(TMath::Nint(signal), rgb, kFALSE);
17
a3e7341e 18 TGeoShape *gs = (TGeoShape*) gGeoManager->GetCurrentVolume()->GetShape()->Clone();
0e3c56f9 19
a3e7341e 20 TEveGeoShape *s = new TEveGeoShape(name, Form("%s %s, E=%.3f", title_base, name, signal));
ec12c03d 21 s->SetPickable(kTRUE);
22 s->SetMainColorRGB(rgb[0], rgb[1], rgb[2]);
0e3c56f9 23 s->SetShape(gs);
ec12c03d 24 s->RefMainTrans().SetFrom(*gGeoManager->GetCurrentMatrix());
25
26 // Scale z-dictance by 0.1
27 Double_t* t = s->RefMainTrans().ArrT();
71363b2a 28 t[2] *= g_zdc_scale;
ec12c03d 29
30 return s;
31}
32
71363b2a 33TEveStraightLineSet*
34zdc_make_cross(const Text_t* name, const Text_t* title_base,
35 Float_t x, Float_t y, Float_t z, Float_t dx, Float_t dy, Float_t dz)
36{
37 TEveStraightLineSet* ls = new TEveStraightLineSet(name, Form("%s, x=%.3f, y=%.3f", title_base, x, y));
38 ls->SetMainColor(kYellow);
39 ls->SetLineWidth(2);
40 ls->RefMainTrans().SetPos(x, y, z);
41 ls->AddLine(dx, 0, 0, -dx, 0, 0);
42 ls->AddLine(0, dy, 0, 0, -dy, 0);
43 ls->AddLine(0, 0, dz, 0, 0, -dz);
44
45 return ls;
46}
47
ec12c03d 48// ???? There are 5 towers in ESD, 4 in geom.
49// Not sure about assignment A/C <-> 1/2
50
51void esd_zdc()
52{
53 AliEveEventManager::AssertGeometry();
54
55 AliESDZDC *esd = AliEveEventManager::AssertESD()->GetESDZDC();
56
57 if (g_zdc_palette == 0)
58 {
59 // Map values from 0, 50 on a spectrum palette.
60 g_zdc_palette = new TEveRGBAPalette(0, 50, kTRUE, kFALSE);
61 g_zdc_palette->IncRefCount();
62 gStyle->SetPalette(1, 0);
63 g_zdc_palette->SetupColorArray();
64 }
65
66 TEveElementList* l = new TEveElementList("ZDC Data", "");
67 gEve->AddElement(l);
68
69 TEveElementList *c = 0;
70 TEveGeoShape *s = 0;
71 Double_t *te = 0;
a3e7341e 72 Text_t *tb = 0;
ec12c03d 73
74 // ZNC geometry ------------------------------------
a3e7341e 75 tb = "ZNC";
76 c = new TEveElementList(tb);
ec12c03d 77 l->AddElement(c);
78
79 te = esd->GetZN1TowerEnergy();
80
a3e7341e 81 c->AddElement(zdc_make_shape("Tower 1", tb, te[1],
ec12c03d 82 "ALIC_1/ZDCC_1/ZNEU_1/ZNTX_1/ZN1_1"));
83
a3e7341e 84 c->AddElement(zdc_make_shape("Tower 2", tb, te[2],
ec12c03d 85 "ALIC_1/ZDCC_1/ZNEU_1/ZNTX_1/ZN1_2"));
86
a3e7341e 87 c->AddElement(zdc_make_shape("Tower 3", tb, te[3],
ec12c03d 88 "ALIC_1/ZDCC_1/ZNEU_1/ZNTX_2/ZN1_1"));
89
a3e7341e 90 c->AddElement(zdc_make_shape("Tower 4", tb, te[4],
ec12c03d 91 "ALIC_1/ZDCC_1/ZNEU_1/ZNTX_2/ZN1_2"));
92
93 // ZNA geometry
a3e7341e 94 tb = "ZNA";
95 c = new TEveElementList(tb);
ec12c03d 96 l->AddElement(c);
97
98 te = esd->GetZN2TowerEnergy();
99
a3e7341e 100 c->AddElement(zdc_make_shape("Tower 1", tb, te[1],
ec12c03d 101 "ALIC_1/ZDCA_1/ZNEU_2/ZNTX_1/ZN1_1"));
102
a3e7341e 103 c->AddElement(zdc_make_shape("Tower 2", tb, te[2],
ec12c03d 104 "ALIC_1/ZDCA_1/ZNEU_2/ZNTX_1/ZN1_2"));
105
a3e7341e 106 c->AddElement(zdc_make_shape("Tower 3", tb, te[3],
ec12c03d 107 "ALIC_1/ZDCA_1/ZNEU_2/ZNTX_2/ZN1_1"));
108
a3e7341e 109 c->AddElement(zdc_make_shape("Tower 4", tb, te[4],
ec12c03d 110 "ALIC_1/ZDCA_1/ZNEU_2/ZNTX_2/ZN1_2"));
111
112
113 // ZPC geometry ------------------------------------
a3e7341e 114 tb = "ZPC";
115 c = new TEveElementList(tb);
ec12c03d 116 l->AddElement(c);
117
118 te = esd->GetZP1TowerEnergy();
119
a3e7341e 120 c->AddElement(zdc_make_shape("Tower 1", tb, te[1],
ec12c03d 121 "ALIC_1/ZDCC_1/ZPRO_1/ZPTX_1/ZP1_1"));
122
a3e7341e 123 c->AddElement(zdc_make_shape("Tower 2", tb, te[2],
ec12c03d 124 "ALIC_1/ZDCC_1/ZPRO_1/ZPTX_2/ZP1_1"));
125
a3e7341e 126 c->AddElement(zdc_make_shape("Tower 3", tb, te[3],
ec12c03d 127 "ALIC_1/ZDCC_1/ZPRO_1/ZPTX_3/ZP1_1"));
128
a3e7341e 129 c->AddElement(zdc_make_shape("Tower 4", tb, te[4],
ec12c03d 130 "ALIC_1/ZDCC_1/ZPRO_1/ZPTX_4/ZP1_1"));
131
132 // ZPA geometry
a3e7341e 133 tb = "ZPA";
134 c = new TEveElementList(tb);
ec12c03d 135 l->AddElement(c);
136
137 te = esd->GetZP2TowerEnergy();
138
a3e7341e 139 c->AddElement(zdc_make_shape("Tower 1", tb, te[1],
ec12c03d 140 "ALIC_1/ZDCA_1/ZPRO_2/ZPTX_1/ZP1_1"));
141
a3e7341e 142 c->AddElement(zdc_make_shape("Tower 2", tb, te[2],
ec12c03d 143 "ALIC_1/ZDCA_1/ZPRO_2/ZPTX_2/ZP1_1"));
144
a3e7341e 145 c->AddElement(zdc_make_shape("Tower 3", tb, te[3],
ec12c03d 146 "ALIC_1/ZDCA_1/ZPRO_2/ZPTX_3/ZP1_1"));
147
a3e7341e 148 c->AddElement(zdc_make_shape("Tower 4", tb, te[4],
ec12c03d 149 "ALIC_1/ZDCA_1/ZPRO_2/ZPTX_4/ZP1_1"));
150
71363b2a 151
152 // Centroids
14bf2d8d 153 /*
71363b2a 154 TEveStraightLineSet *ls = 0;
155
14bf2d8d 156 This part has to be fixed: the getters now depend on the beam type: pp or PbPb,
157 and in case of PbPb we also habe to provide the beam. Peter
158
71363b2a 159 Double32_t *cNA = esd->GetZNACentroid();
160 ls = zdc_make_cross("ZNA Centroid", "ZNA",
161 cNA[0], cNA[1], g_zdc_dist * g_zdc_scale,
162 g_zdc_cross, g_zdc_cross, g_zdc_cross);
163 l->AddElement(ls);
164
165 Double32_t *cNC = esd->GetZNCCentroid();
166 ls = zdc_make_cross("ZNA Centroid", "ZNA",
167 cNC[0], cNC[1], -g_zdc_dist * g_zdc_scale,
168 g_zdc_cross, g_zdc_cross, g_zdc_cross);
169 l->AddElement(ls);
14bf2d8d 170 */
71363b2a 171
ec12c03d 172 // End - refresh screen
173 gEve->Redraw3D();
174}