]>
Commit | Line | Data |
---|---|---|
f13fe1a4 | 1 | |
2 | /************************************************************************** | |
3 | * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. * | |
4 | * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * | |
5 | * full copyright notice. * | |
6 | **************************************************************************/ | |
7 | ||
8 | TString acorde_module_path(Int_t module); | |
9 | ||
10 | Color_t g_acorde_esd_color_on = kRed; | |
11 | Color_t g_acorde_esd_color_off = kBlue; | |
12 | ||
13 | UChar_t g_acorde_esd_transp_on = 30; | |
14 | UChar_t g_acorde_esd_transp_off = 60; | |
15 | ||
16 | void acorde_esd() | |
17 | { | |
18 | ||
19 | // From Mario RC: | |
20 | ||
21 | AliEveEventManager::AssertGeometry(); | |
22 | AliESDEvent* fESD = new AliESDEvent(); | |
23 | AliESDACORDE *acordeESD = AliEveEventManager::AssertESD()->GetACORDEData(); | |
24 | ||
25 | ||
26 | if (acorde_module_path(0).IsNull()) | |
27 | { | |
28 | Warning("acorde_esd", "Missing / wrong ACORDE module geometry."); | |
29 | return; | |
30 | } | |
31 | ||
32 | TEveElementList* acorde = new TEveElementList("ACORDE_Esd"); | |
33 | ||
34 | gEve->AddElement(acorde); | |
35 | ||
36 | for (Int_t module=0; module < 60; module++) | |
37 | { | |
38 | TString path = acorde_module_path(module); | |
39 | ||
40 | if ( ! gGeoManager->cd(path)) | |
41 | { | |
42 | Warning("acorde_esd", "Module id=%d, path='%s' not found.", module, path.Data()); | |
43 | continue; | |
44 | } | |
45 | ||
46 | Bool_t val = kFALSE; | |
47 | if (acordeESD->GetHitChannel(module)) val=kTRUE; | |
48 | // From Matevz: | |
49 | TEveGeoShape* eg_shape = new TEveGeoShape(TString::Format("Module %d", module), | |
50 | TString::Format("Module %d, %s", module, val ? "Fired" : "Not fired")); | |
51 | eg_shape->SetMainColor (val ? g_acorde_esd_color_on : g_acorde_esd_color_off); | |
52 | eg_shape->SetMainTransparency(val ? g_acorde_esd_transp_on : g_acorde_esd_transp_off); | |
53 | eg_shape->SetPickable(kTRUE); | |
54 | eg_shape->RefMainTrans().SetFrom(*gGeoManager->GetCurrentMatrix()); | |
55 | eg_shape->SetShape((TGeoShape*) gGeoManager->GetCurrentVolume()->GetShape()->Clone()); | |
56 | ||
57 | acorde->AddElement(eg_shape); | |
58 | } | |
59 | ||
60 | gEve->Redraw3D(); | |
61 | } | |
62 | ||
63 | //============================================================================== | |
64 | //============================================================================== | |
65 | ||
66 | TString acorde_module_path(Int_t module) | |
67 | { | |
68 | if (module < 0 || module > 59) | |
69 | { | |
70 | Error("acorde_module_path", "module %d out of range.", module); | |
71 | return ""; | |
72 | } | |
73 | ||
74 | TGeoPNEntry* pne = gGeoManager->GetAlignableEntry(Form("ACORDE/Array%d", module)); | |
75 | if (!pne) return ""; | |
76 | ||
77 | return Form("%s/ACORDESCINTILLATORMODULE_6", pne->GetTitle()); | |
78 | ||
79 | } |