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