1 TEveRGBAPalette *g_zdc_palette = 0;
2 Float_t g_zdc_scale = 0.1;
3 Float_t g_zdc_dist = 11695;
4 Float_t g_zdc_cross = 20;
6 TEveGeoShape* zdc_make_shape(const Text_t* name, const Text_t* title_base,
7 Double_t signal, const Text_t* path)
9 if ( ! gGeoManager->cd(path))
11 Warning("zdc_make_shape", "Module name=%s, path='%s' not found.\n", name, path);
16 g_zdc_palette->ColorFromValue(TMath::Nint(signal), rgb, kFALSE);
18 TGeoShape *gs = (TGeoShape*) gGeoManager->GetCurrentVolume()->GetShape()->Clone();
20 TEveGeoShape *s = new TEveGeoShape(name, Form("%s %s, E=%.3f", title_base, name, signal));
21 s->SetPickable(kTRUE);
22 s->SetMainColorRGB(rgb[0], rgb[1], rgb[2]);
24 s->RefMainTrans().SetFrom(*gGeoManager->GetCurrentMatrix());
26 // Scale z-dictance by 0.1
27 Double_t* t = s->RefMainTrans().ArrT();
34 zdc_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)
37 TEveStraightLineSet* ls = new TEveStraightLineSet(name, Form("%s, x=%.3f, y=%.3f", title_base, x, y));
38 ls->SetMainColor(kYellow);
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);
48 // ???? There are 5 towers in ESD, 4 in geom.
49 // Not sure about assignment A/C <-> 1/2
53 AliEveEventManager::AssertGeometry();
55 AliESDZDC *esd = AliEveEventManager::AssertESD()->GetESDZDC();
57 if (g_zdc_palette == 0)
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();
66 TEveElementList* l = new TEveElementList("ZDC Data", "");
69 TEveElementList *c = 0;
74 // ZNC geometry ------------------------------------
76 c = new TEveElementList(tb);
79 te = esd->GetZN1TowerEnergy();
81 c->AddElement(zdc_make_shape("Tower 1", tb, te[1],
82 "ALIC_1/ZDCC_1/ZNEU_1/ZNTX_1/ZN1_1"));
84 c->AddElement(zdc_make_shape("Tower 2", tb, te[2],
85 "ALIC_1/ZDCC_1/ZNEU_1/ZNTX_1/ZN1_2"));
87 c->AddElement(zdc_make_shape("Tower 3", tb, te[3],
88 "ALIC_1/ZDCC_1/ZNEU_1/ZNTX_2/ZN1_1"));
90 c->AddElement(zdc_make_shape("Tower 4", tb, te[4],
91 "ALIC_1/ZDCC_1/ZNEU_1/ZNTX_2/ZN1_2"));
95 c = new TEveElementList(tb);
98 te = esd->GetZN2TowerEnergy();
100 c->AddElement(zdc_make_shape("Tower 1", tb, te[1],
101 "ALIC_1/ZDCA_1/ZNEU_2/ZNTX_1/ZN1_1"));
103 c->AddElement(zdc_make_shape("Tower 2", tb, te[2],
104 "ALIC_1/ZDCA_1/ZNEU_2/ZNTX_1/ZN1_2"));
106 c->AddElement(zdc_make_shape("Tower 3", tb, te[3],
107 "ALIC_1/ZDCA_1/ZNEU_2/ZNTX_2/ZN1_1"));
109 c->AddElement(zdc_make_shape("Tower 4", tb, te[4],
110 "ALIC_1/ZDCA_1/ZNEU_2/ZNTX_2/ZN1_2"));
113 // ZPC geometry ------------------------------------
115 c = new TEveElementList(tb);
118 te = esd->GetZP1TowerEnergy();
120 c->AddElement(zdc_make_shape("Tower 1", tb, te[1],
121 "ALIC_1/ZDCC_1/ZPRO_1/ZPTX_1/ZP1_1"));
123 c->AddElement(zdc_make_shape("Tower 2", tb, te[2],
124 "ALIC_1/ZDCC_1/ZPRO_1/ZPTX_2/ZP1_1"));
126 c->AddElement(zdc_make_shape("Tower 3", tb, te[3],
127 "ALIC_1/ZDCC_1/ZPRO_1/ZPTX_3/ZP1_1"));
129 c->AddElement(zdc_make_shape("Tower 4", tb, te[4],
130 "ALIC_1/ZDCC_1/ZPRO_1/ZPTX_4/ZP1_1"));
134 c = new TEveElementList(tb);
137 te = esd->GetZP2TowerEnergy();
139 c->AddElement(zdc_make_shape("Tower 1", tb, te[1],
140 "ALIC_1/ZDCA_1/ZPRO_2/ZPTX_1/ZP1_1"));
142 c->AddElement(zdc_make_shape("Tower 2", tb, te[2],
143 "ALIC_1/ZDCA_1/ZPRO_2/ZPTX_2/ZP1_1"));
145 c->AddElement(zdc_make_shape("Tower 3", tb, te[3],
146 "ALIC_1/ZDCA_1/ZPRO_2/ZPTX_3/ZP1_1"));
148 c->AddElement(zdc_make_shape("Tower 4", tb, te[4],
149 "ALIC_1/ZDCA_1/ZPRO_2/ZPTX_4/ZP1_1"));
154 TEveStraightLineSet *ls = 0;
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
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);
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);
172 // End - refresh screen