2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
10 TString acorde_module_path(Int_t module);
12 Color_t g_acorde_raw_color_on = kRed;
13 Color_t g_acorde_raw_color_off = kBlue;
15 UChar_t g_acorde_raw_transp_on = 30;
16 UChar_t g_acorde_raw_transp_off = 60;
20 AliEveEventManager::AssertGeometry();
22 AliRawReader * reader = AliEveEventManager::AssertRawReader();
23 AliACORDERawStream * stream = new AliACORDERawStream(reader);
29 dy[0] = stream->GetWord(0);
30 dy[1] = stream->GetWord(1);
31 dy[2] = stream->GetWord(2);
32 dy[3] = stream->GetWord(3);
34 printf ("ACORDE event 0x%08x 0x%08x 0x%08x 0x%08x\n", dy[0], dy[1], dy[2], dy[3]);
36 if (acorde_module_path(0).IsNull())
38 Warning("acorde_raw", "Missing / wrong ACORDE module geometry.");
42 TEveElementList* acorde = new TEveElementList("ACORDE Raw");
44 gEve->AddElement(acorde);
46 for (Int_t module=0; module < 60; ++module)
48 TString path = acorde_module_path(module);
49 // printf("%2d - %s\n", i, path.Data());
51 if ( ! gGeoManager->cd(path))
53 Warning("acorde_raw", "Module id=%d, path='%s' not found.", module, path.Data());
58 // Here check state and assign color, I do it partially for now.
59 Int_t word_idx = module / 30;
60 Int_t bit_idx = module % 30;
61 Bool_t val = (dy[word_idx] & (1 << bit_idx)) != 0;
62 //printf("Module %2d: word_idx = %d, bit_idx = %2d => val = %d\n",
63 // module, word_idx, bit_idx, val);
65 TEveGeoShape* eg_shape = new TEveGeoShape(TString::Format("Module %d", module),
66 TString::Format("Module %d, %s", module, val ? "ON" : "OFF"));
67 eg_shape->SetMainColor (val ? g_acorde_raw_color_on : g_acorde_raw_color_off);
68 eg_shape->SetMainTransparency(val ? g_acorde_raw_transp_on : g_acorde_raw_transp_off);
69 eg_shape->SetPickable(kTRUE);
70 eg_shape->RefMainTrans().SetFrom(*gGeoManager->GetCurrentMatrix());
71 eg_shape->SetShape((TGeoShape*) gGeoManager->GetCurrentVolume()->GetShape()->Clone());
73 acorde->AddElement(eg_shape);
80 //==============================================================================
81 //==============================================================================
83 TString acorde_module_path(Int_t module)
85 if (module < 0 || module > 59)
87 Error("acorde_module_path", "module %d out of range.", module);
91 TGeoPNEntry* pne = gGeoManager->GetAlignableEntry(Form("ACORDE/Array%d", module + 1));
94 return Form("%s/ACORDE2_5", pne->GetTitle());