]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/alice-macros/pmd_raw.C
From Stefano:
[u/mrichter/AliRoot.git] / EVE / alice-macros / pmd_raw.C
CommitLineData
d810d0de 1// $Id$
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 *
51346b82 7 * full copyright notice. *
d810d0de 8 **************************************************************************/
ee0e160c 9// ---------------------------------------------------------------------- //
dcdad5c4 10void pmd_raw(Int_t mode = 0)
ee0e160c 11{
12 gStyle->SetPalette(1, 0);
13
ee0e160c 14
15 TObjArray *pmdddlcont = new TObjArray();
16
17 TString spl;
18
19 TString sddl;
20 TString bsddl="DDL";
21
117015d9 22 // Use this to get data consistent with current event:
23 // AliRawReader *reader = AliEveEventManager::AssertRawReader();
24
25 Int_t ievt = 159;
26 AliRawReaderRoot reader("raw.root",ievt);
27 AliPMDRawStream stream(&reader);
ee0e160c 28
84aff7a4 29 gEve->DisableRedraw();
ee0e160c 30
84aff7a4 31 TEveElementList* l = new TEveElementList("PMD");
dcdad5c4 32 // l->SetTitle("PMD");
fbc350a3 33 // l->SetMainColor(3);
84aff7a4 34 gEve->AddElement(l);
51346b82 35
dcdad5c4 36 Int_t NSM = 0;
ee0e160c 37 Int_t istartDDL = 0;
84aff7a4 38 Int_t iendDDL = 0;
ee0e160c 39 Int_t modnumber = 0;
dcdad5c4 40 Int_t istartPlane = 0;
41 Int_t iendPlane = 0;
42 Float_t zpos = 0;
43
44 switch(mode)
45 {
46 case 0:
47 istartPlane = 0;
48 iendPlane = 1;
49 printf("--- Visualization is set for PREshower Plane ---\n");
50 break;
51346b82 51
dcdad5c4 52 case 1:
53 istartPlane = 1;
54 iendPlane = 2;
55 printf("--- Visualization is set for CPV Plane ---\n");
56 break;
57
58 case 2:
59 istartPlane = 0;
60 iendPlane = 2;
61 printf("--- Visualization is set for both the Plane ---\n");
62 break;
51346b82 63
dcdad5c4 64 default:
65 printf("--- Not set for any Plane ---\n");
66 }
ee0e160c 67
dcdad5c4 68 for (Int_t ipl = istartPlane; ipl < iendPlane; ipl++)
ee0e160c 69 {
70
71 if (ipl == 0)
72 {
dcdad5c4 73 spl = "PRE";
ee0e160c 74 istartDDL = 0;
75 iendDDL = 4;
dcdad5c4 76 zpos = 365.;
ee0e160c 77 }
78 if (ipl == 1)
79 {
80 spl = "CPV";
81 istartDDL = 4;
82 iendDDL = 6;
dcdad5c4 83 zpos = 360.;
ee0e160c 84 }
51346b82 85
84aff7a4 86 TEveElementList* lplane = new TEveElementList(spl.Data());
fbc350a3 87 // l->SetMainColor(3);
84aff7a4 88 gEve->AddElement(lplane, l);
51346b82 89
d22e4f00 90 Int_t iddl = -1;
91
117015d9 92 while ((iddl = stream.DdlData(&pmdddlcont)) >=0) {
d22e4f00 93 if (iddl >= istartDDL && iddl < iendDDL){
94 sddl = bsddl;
95 sddl += iddl;
96 TEveElementList* lddl = new TEveElementList(sddl.Data());
fbc350a3 97 // l->SetMainColor(3);
117015d9 98 gEve->AddElement(ddl, lplane);
d22e4f00 99
100 modnumber = iddl*6;
101
102 if (iddl < 4)
103 {
104 NSM = 6;
105 }
106 else if (iddl >=4 && iddl < 6)
107 {
108 NSM = 12;
109 }
110
111 for (Int_t ism = 0; ism < NSM; ism++)
112 {
113 AliEvePMDModule *lmodule = new AliEvePMDModule();
114 lmodule->SetPosition(0.,0.,zpos);
115 lmodule->DisplayRawData(modnumber,pmdddlcont);
117015d9 116 gEve->AddElement(lmodule, lddl);
d22e4f00 117 modnumber++;
118 if (iddl == 4 && modnumber == 30) modnumber = 42;
119 }
120
117015d9 121 pmdddlcont->Delete();
d22e4f00 122 }
123 }
117015d9 124
125 gEve->EnableRedraw();
ee0e160c 126 }
117015d9 127
ee0e160c 128}
ee0e160c 129// ---------------------------------------------------------------------- //
d22e4f00 130