]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/alice-macros/pmd_raw.C
From Pawel Debski: more modes for VizDB.
[u/mrichter/AliRoot.git] / EVE / alice-macros / pmd_raw.C
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          *
7  * full copyright notice.                                                 *
8  **************************************************************************/
9 // ---------------------------------------------------------------------- //
10 void pmd_raw(Int_t mode = 0)
11 {
12   gStyle->SetPalette(1, 0);
13
14
15   TObjArray *pmdddlcont = new TObjArray();
16
17   TString spl;
18
19   TString sddl;
20   TString bsddl="DDL";
21
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);
28
29   gEve->DisableRedraw();
30
31   TEveElementList* l = new TEveElementList("PMD");
32   //  l->SetTitle("PMD");
33   //  l->SetMainColor(3);
34   gEve->AddElement(l);
35
36   Int_t NSM       = 0;
37   Int_t istartDDL = 0;
38   Int_t iendDDL   = 0;
39   Int_t modnumber = 0;
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;
51
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;
63
64     default:
65       printf("--- Not set for any Plane ---\n");
66     }
67
68   for (Int_t ipl = istartPlane; ipl < iendPlane; ipl++)
69     {
70
71       if (ipl == 0)
72         {
73           spl       = "PRE";
74           istartDDL = 0;
75           iendDDL   = 4;
76           zpos      = 365.;
77         }
78       if (ipl == 1)
79         {
80           spl = "CPV";
81           istartDDL = 4;
82           iendDDL   = 6;
83           zpos      = 360.;
84         }
85
86       TEveElementList* lplane = new TEveElementList(spl.Data());
87       //  l->SetMainColor(3);
88       gEve->AddElement(lplane, l);
89
90       Int_t iddl = -1;
91
92       while ((iddl = stream.DdlData(&pmdddlcont)) >=0) {
93           if (iddl >= istartDDL && iddl < iendDDL){
94               sddl = bsddl;
95               sddl += iddl;
96               TEveElementList* lddl = new TEveElementList(sddl.Data());
97               //  l->SetMainColor(3);
98               gEve->AddElement(ddl, lplane);
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);
116                   gEve->AddElement(lmodule, lddl);
117                   modnumber++;
118                   if (iddl == 4 && modnumber == 30) modnumber = 42;
119               }
120               
121               pmdddlcont->Delete();
122           }
123       }
124       
125       gEve->EnableRedraw();
126     }
127   
128 }
129 // ---------------------------------------------------------------------- //
130