]>
Commit | Line | Data |
---|---|---|
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 | **************************************************************************/ |
ba978640 | 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 | ||
6c49a8e1 | 20 | #include <AliHMPIDDigit.h> |
21 | #include <AliHMPIDv3.h> | |
22 | #include <AliCluster3D.h> | |
23 | #include <AliRunLoader.h> | |
24 | #include <AliEveEventManager.h> | |
25 | #include <AliEvePMDModule.h> | |
ba978640 | 26 | #endif |
16718cdc | 27 | |
dcdad5c4 | 28 | void pmd_digits(Int_t mode = 0) |
ee0e160c | 29 | { |
32e219c2 | 30 | Bool_t drawBackPolygons = kFALSE; |
31 | ||
ee0e160c | 32 | gStyle->SetPalette(1, 0); |
33 | ||
ee0e160c | 34 | |
35 | TString spl; | |
36 | ||
37 | TString sddl; | |
38 | TString bsddl="DDL"; | |
39 | ||
40 | ||
d810d0de | 41 | AliRunLoader* rl = AliEveEventManager::AssertRunLoader(); |
ee0e160c | 42 | rl->LoadDigits("PMD"); |
43 | TTree* pmdt = rl->GetTreeD("PMD", false); | |
44 | ||
45 | // cout << pmdt->GetEntries() << endl; | |
46 | ||
84aff7a4 | 47 | gEve->DisableRedraw(); |
dcdad5c4 | 48 | |
84aff7a4 | 49 | TEveElementList* l = new TEveElementList("PMD"); |
ee0e160c | 50 | // l->SetTitle("tooltip"); |
fbc350a3 | 51 | // l->SetMainColor(3); |
84aff7a4 | 52 | gEve->AddElement(l); |
32e219c2 | 53 | |
84aff7a4 | 54 | TEveRGBAPalette* pal = new TEveRGBAPalette(20, 1000); |
32e219c2 | 55 | pal->SetLimits(0, 1024); |
56 | ||
dcdad5c4 | 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 | } | |
ee0e160c | 88 | |
dcdad5c4 | 89 | for (Int_t ipl = istartPlane; ipl < iendPlane; ipl++) |
ee0e160c | 90 | { |
91 | ||
92 | if (ipl == 0) | |
93 | { | |
dcdad5c4 | 94 | spl = "PRE"; |
ee0e160c | 95 | istartDDL = 0; |
96 | iendDDL = 4; | |
dcdad5c4 | 97 | zpos = 365.; |
ee0e160c | 98 | } |
99 | if (ipl == 1) | |
100 | { | |
dcdad5c4 | 101 | spl = "CPV"; |
ee0e160c | 102 | istartDDL = 4; |
103 | iendDDL = 6; | |
dcdad5c4 | 104 | zpos = 360.; |
ee0e160c | 105 | } |
51346b82 | 106 | |
84aff7a4 | 107 | TEveElementList* lplane = new TEveElementList(spl.Data()); |
fbc350a3 | 108 | // l->SetMainColor(3); |
84aff7a4 | 109 | gEve->AddElement(lplane, l); |
51346b82 | 110 | |
ee0e160c | 111 | for (Int_t iddl = istartDDL; iddl < iendDDL; iddl++) |
112 | { | |
113 | sddl = bsddl; | |
114 | sddl += iddl; | |
84aff7a4 | 115 | TEveElementList* lddl = new TEveElementList(sddl.Data()); |
fbc350a3 | 116 | // l->SetMainColor(3); |
84aff7a4 | 117 | gEve->AddElement(lddl, lplane); |
ee0e160c | 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 | { | |
51346b82 | 132 | |
d810d0de | 133 | AliEvePMDModule *lmodule = new AliEvePMDModule(); |
dcdad5c4 | 134 | lmodule->SetPosition(0.,0.,zpos); |
ee0e160c | 135 | lmodule->DisplayDigitsData(modnumber, pmdt); |
32e219c2 | 136 | lmodule->SetPalette(pal); |
137 | if (drawBackPolygons) | |
138 | { | |
84aff7a4 | 139 | TEveFrameBox* b = lmodule->GetFrame(); |
32e219c2 | 140 | b->SetFrameWidth(1.5); |
fbc350a3 | 141 | b->SetFrameColor(1); |
7f57990a | 142 | b->SetBackColor ((Color_t) (kTeal - 9)); |
32e219c2 | 143 | b->SetFrameFill (kFALSE); |
144 | b->SetDrawBack (kTRUE); | |
145 | } | |
84aff7a4 | 146 | gEve->AddElement(lmodule, lddl); |
ee0e160c | 147 | modnumber++; |
148 | if (iddl == 4 && modnumber == 30) modnumber = 42; | |
149 | } | |
150 | ||
151 | } | |
152 | ||
153 | } | |
154 | ||
84aff7a4 | 155 | gEve->EnableRedraw(); |
ee0e160c | 156 | } |
157 | ||
158 | // ---------------------------------------------------------------------- // |