]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/Alieve/MUONDigitsInfo.cxx
Merge from EVE-dev.
[u/mrichter/AliRoot.git] / EVE / Alieve / MUONDigitsInfo.cxx
1 #include <TColor.h>
2
3 #include "MUONDigitsInfo.h"
4
5 #include <AliMUONDigit.h>
6 #include <AliMUONGlobalTrigger.h>
7 #include <AliMUONLocalTrigger.h>
8
9 using namespace Reve;
10 using namespace Alieve;
11 using namespace std;
12
13 ClassImp(MUONDigitsInfo)
14
15 /**************************************************************************/
16 MUONDigitsInfo:: ~MUONDigitsInfo() 
17 {
18
19 }
20
21 /**************************************************************************/
22 void MUONDigitsInfo::Init()
23 {
24
25   fDTree = 0;
26   fRTree = 0;
27   fTTree = 0;
28
29   //CreateColors();
30
31 }
32
33 /**************************************************************************/
34 void MUONDigitsInfo::SetDTree(TTree* tree)
35 {
36     
37   static const Exc_t eH("MUONDigitsInfo::SetDTree ");
38
39   fDTree = tree;
40
41 }
42
43 /**************************************************************************/
44 void MUONDigitsInfo::SetRTree(TTree* tree)
45 {
46     
47   static const Exc_t eH("MUONDigitsInfo::SetRTree ");
48
49   fRTree = tree;
50
51 }
52
53 /**************************************************************************/
54 void MUONDigitsInfo::SetTTree(TTree* tree)
55 {
56     
57   static const Exc_t eH("MUONDigitsInfo::SetTTree ");
58
59   fTTree = tree;
60
61 }
62
63 /**************************************************************************/
64 TClonesArray* MUONDigitsInfo::GetDigits(Int_t chamber)
65 {
66
67   Char_t branchname[30];
68
69   sprintf(branchname,"MUONDigits%d",chamber);
70   TClonesArray *digits = 0;
71   fDTree->SetBranchAddress(branchname,&digits);
72   fDTree->GetEntry(0);  // load event 0
73
74   return digits;
75
76 }
77
78 /**************************************************************************/
79 TClonesArray* MUONDigitsInfo::GetClusters(Int_t chamber)
80 {
81
82   if (chamber > 10) return 0;
83
84   Char_t branchname[30];
85
86   sprintf(branchname,"MUONRawClusters%d",chamber);
87   TClonesArray *clusters = 0;
88   fRTree->SetBranchAddress(branchname,&clusters);
89   fRTree->GetEntry(0);  // load event 0
90
91   return clusters;
92
93 }
94
95 /**************************************************************************/
96 TClonesArray* MUONDigitsInfo::GetTracks()
97 {
98
99   Char_t branchname[30];
100
101   sprintf(branchname,"MUONTrack");
102   TClonesArray *tracks = 0;
103   fTTree->SetBranchAddress(branchname,&tracks);
104   fTTree->GetEntry(0);  // load event 0
105
106   return tracks;
107
108 }
109
110 /*****************************************************************************/
111 void MUONDigitsInfo::CreateColors()
112 {
113 //    Create the colors palette used to display clusters
114
115     Int_t k,i;
116     Int_t color;
117     Float_t r,g,b;
118     
119     for (k=1;k<=5;k++) {
120
121         switch(k) {
122         case 1:
123             for (i=1;i<=5;i++) {
124                 r=1.;
125                 g=i*0.2;  
126                 b=0.;
127                 color=i;
128                 color=260+23-color;
129                 new TColor(color,r,g,b);
130             } 
131             break;
132         case 2:
133             for (i=1;i<=4;i++) {
134                 r=1.1-i*0.2;
135                 g=1.;  
136                 b=0.;
137                 color=i+5;
138                 color=260+23-color;
139                 new TColor(color,r,g,b);
140             } 
141             break;
142         case 3:
143             for (i=1;i<=4;i++) {
144                 r=0.;
145                 g=1.;  
146                 b=i*0.2+0.2;
147                 color=i+9;
148                 color=260+23-color;
149                 new TColor(color,r,g,b);
150             } 
151             break;
152         case 4:
153             for (i=1;i<=4;i++) {
154                 r=0.;
155                 g=1.1-i*0.2;  
156                 b=1.;
157                 color=i+13;
158                 color=260+23-color;
159                 new TColor(color,r,g,b);
160             } 
161             break;
162         case 5:
163             for (i=1;i<=5;i++) {
164                 r=i*0.2;
165                 g=0.;  
166                 b=1.;
167                 color=i+17;
168                 color=260+23-color;
169                 new TColor(color,r,g,b);
170             } 
171             break;
172         }
173
174     }
175
176 }