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 #if !defined(__CINT__) || defined(__MAKECINT__)
9 #include <TGeoManager.h>
10 #include <TGeoPhysicalNode.h>
11 #include <TEveTrans.h>
12 #include <TEveManager.h>
13 #include <TEveElement.h>
14 #include <TEveGeoShape.h>
16 #include <AliEveEventManager.h>
17 #include <AliESDEvent.h>
18 #include <AliESDACORDE.h>
21 TString acorde_module_path(Int_t module);
23 Color_t g_acorde_esd_color_on = kRed;
24 Color_t g_acorde_esd_color_off = kBlue;
26 UChar_t g_acorde_esd_transp_on = 30;
27 UChar_t g_acorde_esd_transp_off = 60;
34 AliEveEventManager::AssertGeometry();
35 //AliESDEvent* fESD = new AliESDEvent();
36 AliESDACORDE *acordeESD = AliEveEventManager::AssertESD()->GetACORDEData();
39 if (acorde_module_path(0).IsNull())
41 Warning("acorde_esd", "Missing / wrong ACORDE module geometry.");
45 TEveElementList* acorde = new TEveElementList("ACORDE_Esd");
47 gEve->AddElement(acorde);
49 for (Int_t module=0; module < 60; module++)
51 TString path = acorde_module_path(module);
53 if ( ! gGeoManager->cd(path))
55 Warning("acorde_esd", "Module id=%d, path='%s' not found.", module, path.Data());
60 if (acordeESD->GetHitChannel(module)) val=kTRUE;
62 TEveGeoShape* eg_shape = new TEveGeoShape(TString::Format("Module %d", module),
63 TString::Format("Module %d, %s", module, val ? "Fired" : "Not fired"));
64 eg_shape->SetMainColor (val ? g_acorde_esd_color_on : g_acorde_esd_color_off);
65 eg_shape->SetMainTransparency(val ? g_acorde_esd_transp_on : g_acorde_esd_transp_off);
66 eg_shape->SetPickable(kTRUE);
67 eg_shape->RefMainTrans().SetFrom(*gGeoManager->GetCurrentMatrix());
68 eg_shape->SetShape((TGeoShape*) gGeoManager->GetCurrentVolume()->GetShape()->Clone());
70 acorde->AddElement(eg_shape);
76 //==============================================================================
77 //==============================================================================
79 TString acorde_module_path(Int_t module)
81 if (module < 0 || module > 59)
83 Error("acorde_module_path", "module %d out of range.", module);
87 TGeoPNEntry* pne = gGeoManager->GetAlignableEntry(Form("ACORDE/Array%d", module));
90 return Form("%s/ACORDESCINTILLATORMODULE_6", pne->GetTitle());