]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/alice-macros/pmd_digits.C
doxy: code cleanup: comments and clarifications
[u/mrichter/AliRoot.git] / EVE / alice-macros / pmd_digits.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 #if !defined(__CINT__) || defined(__MAKECINT__)
10 #include <TTree.h>
11 #include <TStyle.h>
12 #include <TString.h>
13 #include <TEveElement.h>
14 #include <TEveFrameBox.h>
15 #include <TEveManager.h>
16 #include <TEvePointSet.h>
17 #include <TEveRGBAPalette.h>
18 #include <TEveTrans.h>
19
20 #include <AliHMPIDDigit.h>
21 #include <AliHMPIDv3.h>
22 #include <AliCluster3D.h>
23 #include <AliRunLoader.h>
24 #include <AliEveEventManager.h>
25 #include <AliEvePMDModule.h>
26 #endif
27
28 void pmd_digits(Int_t mode = 0)
29 {
30   Bool_t drawBackPolygons = kFALSE;
31
32   gStyle->SetPalette(1, 0);
33
34
35   TString spl;
36
37   TString sddl;
38   TString bsddl="DDL";
39
40
41   AliRunLoader* rl =  AliEveEventManager::AssertRunLoader();
42   rl->LoadDigits("PMD");
43   TTree* pmdt = rl->GetTreeD("PMD", false);
44
45   //  cout << pmdt->GetEntries() << endl;
46
47   gEve->DisableRedraw();
48
49   TEveElementList* l = new TEveElementList("PMD");
50   // l->SetTitle("tooltip");
51   // l->SetMainColor(3);
52   gEve->AddElement(l);
53
54   TEveRGBAPalette* pal = new TEveRGBAPalette(20, 1000);
55   pal->SetLimits(0, 1024);
56
57   Int_t NSM         = 0;
58   Int_t istartDDL   = 0;
59   Int_t iendDDL     = 0;
60   Int_t modnumber   = 0;
61   Int_t istartPlane = 0;
62   Int_t iendPlane   = 0;
63   Float_t zpos      = 0;
64
65   switch(mode)
66     {
67     case 0:
68       istartPlane = 0;
69       iendPlane   = 1;
70       printf("--- Visualization is set for PREshower Plane ---\n");
71       break;
72
73     case 1:
74       istartPlane = 1;
75       iendPlane   = 2;
76       printf("--- Visualization is set for CPV Plane ---\n");
77       break;
78
79     case 2:
80       istartPlane = 0;
81       iendPlane   = 2;
82       printf("--- Visualization is set for both Planes ---\n");
83       break;
84
85     default:
86       printf("--- Not set for any Plane ---\n");
87     }
88
89   for (Int_t ipl = istartPlane; ipl < iendPlane; ipl++)
90     {
91
92       if (ipl == 0)
93         {
94           spl       = "PRE";
95           istartDDL = 0;
96           iendDDL   = 4;
97           zpos      = 365.;
98         }
99       if (ipl == 1)
100         {
101           spl       = "CPV";
102           istartDDL = 4;
103           iendDDL   = 6;
104           zpos      = 360.;
105         }
106
107       TEveElementList* lplane = new TEveElementList(spl.Data());
108       //  l->SetMainColor(3);
109       gEve->AddElement(lplane, l);
110
111       for (Int_t iddl = istartDDL; iddl < iendDDL; iddl++)
112         {
113           sddl = bsddl;
114           sddl += iddl;
115           TEveElementList* lddl = new TEveElementList(sddl.Data());
116           //  l->SetMainColor(3);
117           gEve->AddElement(lddl, lplane);
118
119           modnumber = iddl*6;
120
121           if (iddl < 4)
122             {
123               NSM = 6;
124             }
125           else if (iddl >=4 && iddl < 6)
126             {
127               NSM = 12;
128             }
129
130           for (Int_t ism = 0; ism < NSM; ism++)
131             {
132
133               AliEvePMDModule *lmodule = new AliEvePMDModule();
134               lmodule->SetPosition(0.,0.,zpos);
135               lmodule->DisplayDigitsData(modnumber, pmdt);
136               lmodule->SetPalette(pal);
137               if (drawBackPolygons)
138               {
139                 TEveFrameBox* b = lmodule->GetFrame();
140                 b->SetFrameWidth(1.5);
141                 b->SetFrameColor(1);
142                 b->SetBackColor ((Color_t) (kTeal - 9));
143                 b->SetFrameFill (kFALSE);
144                 b->SetDrawBack  (kTRUE);
145               }
146               gEve->AddElement(lmodule, lddl);
147               modnumber++;
148               if (iddl == 4 && modnumber == 30) modnumber = 42;
149             }
150
151         }
152
153     }
154
155   gEve->EnableRedraw();
156 }
157
158 // ---------------------------------------------------------------------- //