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