]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/alice-macros/acorde_raw.C
in debug mode output event number in file
[u/mrichter/AliRoot.git] / EVE / alice-macros / acorde_raw.C
CommitLineData
20dae051 1// $Id$
c2c4b7a2 2// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
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 **************************************************************************/
9
10TString acorde_module_path(Int_t module);
11
0a8fcf70 12Color_t g_acorde_raw_color_on = kRed;
13Color_t g_acorde_raw_color_off = kBlue;
14
15UChar_t g_acorde_raw_transp_on = 30;
16UChar_t g_acorde_raw_transp_off = 60;
c2c4b7a2 17
18void acorde_raw()
19{
6226bf2b 20 AliEveEventManager::AssertGeometry();
647814a2 21
c2c4b7a2 22 AliRawReader * reader = AliEveEventManager::AssertRawReader();
23 AliACORDERawStream * stream = new AliACORDERawStream(reader);
24
25 stream->Reset();
26 stream->Next();
27
28 UInt_t dy[4];
29 dy[0] = stream->GetWord(0);
30 dy[1] = stream->GetWord(1);
31 dy[2] = stream->GetWord(2);
32 dy[3] = stream->GetWord(3);
33
34 printf ("ACORDE event 0x%08x 0x%08x 0x%08x 0x%08x\n", dy[0], dy[1], dy[2], dy[3]);
35
28837087 36 if (acorde_module_path(0).IsNull())
37 {
38 Warning("acorde_raw", "Missing / wrong ACORDE module geometry.");
39 return;
40 }
41
c2c4b7a2 42 TEveElementList* acorde = new TEveElementList("ACORDE Raw");
43
44 gEve->AddElement(acorde);
45
4183784d 46 for (Int_t module=0; module < 60; module++)
c2c4b7a2 47 {
48 TString path = acorde_module_path(module);
49 // printf("%2d - %s\n", i, path.Data());
50
51 if ( ! gGeoManager->cd(path))
52 {
28837087 53 Warning("acorde_raw", "Module id=%d, path='%s' not found.", module, path.Data());
c2c4b7a2 54 continue;
55 }
56
c2c4b7a2 57 // From Matevz:
a3e7341e 58 // Here check state and assign color, I do it partially for now.
c2c4b7a2 59 Int_t word_idx = module / 30;
60 Int_t bit_idx = module % 30;
4183784d 61 //Bool_t val = (dy[word_idx] & (1 << bit_idx)) != 0;
62 Bool_t val = (dy[word_idx] & (1 << bit_idx)) != 0; // from Mario
63 // printf("Module %2d: word_idx = %d, bit_idx = %2d => val = %d\n",
64 // module, word_idx, bit_idx, val);
a3e7341e 65
66 TEveGeoShape* eg_shape = new TEveGeoShape(TString::Format("Module %d", module),
67 TString::Format("Module %d, %s", module, val ? "ON" : "OFF"));
0a8fcf70 68 eg_shape->SetMainColor (val ? g_acorde_raw_color_on : g_acorde_raw_color_off);
69 eg_shape->SetMainTransparency(val ? g_acorde_raw_transp_on : g_acorde_raw_transp_off);
a3e7341e 70 eg_shape->SetPickable(kTRUE);
a3e7341e 71 eg_shape->RefMainTrans().SetFrom(*gGeoManager->GetCurrentMatrix());
72 eg_shape->SetShape((TGeoShape*) gGeoManager->GetCurrentVolume()->GetShape()->Clone());
c2c4b7a2 73
74 acorde->AddElement(eg_shape);
75 }
76
a3e7341e 77 delete stream;
c2c4b7a2 78 gEve->Redraw3D();
79}
80
81//==============================================================================
82//==============================================================================
83
84TString acorde_module_path(Int_t module)
85{
c2c4b7a2 86 if (module < 0 || module > 59)
87 {
88 Error("acorde_module_path", "module %d out of range.", module);
89 return "";
90 }
91
f85ac9eb 92 TGeoPNEntry* pne = gGeoManager->GetAlignableEntry(Form("ACORDE/Array%d", module));
28837087 93 if (!pne) return "";
c2c4b7a2 94
4183784d 95 //return Form("%s/ACORDE2_5", pne->GetTitle());
96 return Form("%s/ACORDESCINTILLATORMODULE_6", pne->GetTitle());
97
c2c4b7a2 98}