5 #include "AliPMDdigit.h"
6 #include "AliPMDddldata.h"
8 #include <TClonesArray.h>
11 using namespace Alieve;
13 const Float_t PMDModule::fgkRad = 0.25;
14 const Float_t PMDModule::fgkSqRoot3 = 1.732050808;
15 const Float_t PMDModule::fgkZpos = 0.;
16 //______________________________________________________________________
23 PMDModule::PMDModule():
31 // -------------------------------------------------------------------- //
32 void PMDModule::DisplayInit(Int_t ism)
34 TString smodule = "Module";
37 Float_t xism =0, yism = 0;
38 Float_t dxism =0, dyism = 0;
40 GenerateBox(ism,xism,yism,dxism,dyism);
42 Reve::FrameBox *pmdModBox = new FrameBox();
43 pmdModBox->SetAAQuadXY(xism, yism, 0, dxism, dyism);
44 pmdModBox->SetFrameColor((Color_t) 31);
46 Reve::RGBAPalette *pmdModPalette = new RGBAPalette(20, 1000);
47 pmdModPalette->SetLimits(0, 1000);
49 // Reve::QuadSet* q = this;
50 SetName(smodule.Data());
52 Reset(Reve::QuadSet::QT_HexagonXY, kFALSE, 32);
55 SetPalette(pmdModPalette);
58 // -------------------------------------------------------------------- //
59 void PMDModule::DisplayDigitsData(Int_t ism, TTree *pmdt)
64 Int_t det, smn, irow, icol, adc;
65 Int_t xpad = 0, ypad = 0;
68 TClonesArray *digits = new TClonesArray("AliPMDdigit", 0);
70 TBranch *branch = pmdt->GetBranch("PMDDigit");
71 branch->SetAddress(&digits);
73 AliPMDdigit *pmddigit;
75 branch->GetEntry(ism);
76 Int_t nentries = digits->GetLast();
77 //printf("%d\n", nentries);
79 for (Int_t ient = 0; ient < nentries+1; ient++)
81 pmddigit = (AliPMDdigit*)digits->UncheckedAt(ient);
83 det = pmddigit->GetDetector();
84 smn = pmddigit->GetSMNumber();
85 irow = pmddigit->GetRow();
86 icol = pmddigit->GetColumn();
87 adc = (Int_t) pmddigit->GetADC();
94 else if(smn >=12 && smn < 24)
100 RectGeomCellPos(smn, xpad, ypad, xpos, ypos);
102 AddHexagon(xpos, ypos, fgkZpos, fgkRad);
106 QuadId(new AliPMDdigit(*pmddigit));
107 // new TNamed(Form("Quad with idx=%d", ient),
108 // "This title is not confusing."));
115 fHMTrans.SetPos(fX, fY, fZ);
119 // -------------------------------------------------------------------- //
121 void PMDModule::DisplayRawData(Int_t ism, TObjArray *ddlcont)
124 if (ism > 23) ism -= 24;
128 Int_t det, smn, irow, icol, adc;
129 Int_t xpad = 0, ypad = 0;
132 Int_t nentries = ddlcont->GetEntries();
133 //printf("%d\n", nentries);
135 for (Int_t ient = 0; ient < nentries; ient++)
137 AliPMDddldata *pmdddl = (AliPMDddldata*)ddlcont->UncheckedAt(ient);
139 det = pmdddl->GetDetector();
140 smn = pmdddl->GetSMN();
141 if (smn != ism) continue;
142 irow = pmdddl->GetRow();
143 icol = pmdddl->GetColumn();
144 adc = pmdddl->GetSignal();
151 else if(smn >=12 && smn < 24)
157 RectGeomCellPos(smn, xpad, ypad, xpos, ypos);
159 AddHexagon(xpos, ypos, fgkZpos, fgkRad);
163 QuadId(new AliPMDddldata(*pmdddl));
164 //new TNamed(Form("Quad with idx=%d", ient),
165 // "This title is not confusing."));
172 fHMTrans.SetPos(fX, fY, fZ);
175 // -------------------------------------------------------------------- //
177 void PMDModule::RectGeomCellPos(Int_t ism, Int_t xpad, Int_t ypad,
178 Float_t &xpos, Float_t &ypos)
180 // This routine finds the cell eta,phi for the new PMD rectangular
182 // Authors : Bedanga Mohanty and Dipak Mishra - 29.4.2003
183 // modified by B. K. Nandi for change of coordinate sys
185 // SMA ---> Supermodule Type A ( SM - 0)
186 // SMAR ---> Supermodule Type A ROTATED ( SM - 1)
187 // SMB ---> Supermodule Type B ( SM - 2)
188 // SMBR ---> Supermodule Type B ROTATED ( SM - 3)
190 // ism : Serial module number from 0 to 23 for each plane
193 // Corner positions (x,y) of the 24 unit moudles in ALICE PMD
195 const Double_t kXcorner[24] =
197 74.8833, 53.0045, 31.1255, //Type-A
198 74.8833, 53.0045, 31.1255, //Type-A
199 -74.8833, -53.0044, -31.1255, //Type-AR
200 -74.8833, -53.0044, -31.1255, //Type-AR
201 8.9165, -33.7471, //Type-B
202 8.9165, -33.7471, //Type-B
203 8.9165, -33.7471, //Type-B
204 -8.9165, 33.7471, //Type-BR
205 -8.9165, 33.7471, //Type-BR
206 -8.9165, 33.7471, //Type-BR
210 const Double_t kYcorner[24] =
212 86.225, 86.225, 86.225, //Type-A
213 37.075, 37.075, 37.075, //Type-A
214 -86.225, -86.225, -86.225, //Type-AR
215 -37.075, -37.075, -37.075, //Type-AR
216 86.225, 86.225, //Type-B
217 61.075, 61.075, //Type-B
218 35.925, 35.925, //Type-B
219 -86.225, -86.225, //Type-BR
220 -61.075, -61.075, //Type-BR
221 -35.925, -35.925 //Type-BR
225 // const Float_t kSqroot3 = 1.732050808; // sqrt(3.);
226 // const Float_t kCellRadius = 0.25;
229 //Every even row of cells is shifted and placed
230 //in geant so this condition
245 ypos = kYcorner[ism] - (Float_t) xpad*fgkRad*2.0 - shift;
246 xpos = kXcorner[ism] - (Float_t) ypad*fgkSqRoot3*fgkRad;
248 else if(ism >=6 && ism < 12)
250 ypos = kYcorner[ism] + (Float_t) xpad*fgkRad*2.0 + shift;
251 xpos = kXcorner[ism] + (Float_t) ypad*fgkSqRoot3*fgkRad;
253 else if(ism >= 12 && ism < 18)
255 ypos = kYcorner[ism] - (Float_t) xpad*fgkRad*2.0 - shift;
256 xpos = kXcorner[ism] - (Float_t) ypad*fgkSqRoot3*fgkRad;
258 else if(ism >= 18 && ism < 24)
260 ypos = kYcorner[ism] + (Float_t) xpad*fgkRad*2.0 + shift;
261 xpos = kXcorner[ism] + (Float_t) ypad*fgkSqRoot3*fgkRad;
265 // -------------------------------------------------------------------- //
266 void PMDModule::GenerateBox(Int_t ism, Float_t &xism, Float_t &yism,
267 Float_t &dxism, Float_t &dyism)
269 const Float_t kDia = 0.50;
271 const Double_t kXcorner[24] =
273 74.8833, 53.0045, 31.1255, //Type-A
274 74.8833, 53.0045, 31.1255, //Type-A
275 -74.8833, -53.0044, -31.1255, //Type-AR
276 -74.8833, -53.0044, -31.1255, //Type-AR
277 8.9165, -33.7471, //Type-B
278 8.9165, -33.7471, //Type-B
279 8.9165, -33.7471, //Type-B
280 -8.9165, 33.7471, //Type-BR
281 -8.9165, 33.7471, //Type-BR
282 -8.9165, 33.7471, //Type-BR
286 const Double_t kYcorner[24] =
288 86.225, 86.225, 86.225, //Type-A
289 37.075, 37.075, 37.075, //Type-A
290 -86.225, -86.225, -86.225, //Type-AR
291 -37.075, -37.075, -37.075, //Type-AR
292 86.225, 86.225, //Type-B
293 61.075, 61.075, //Type-B
294 35.925, 35.925, //Type-B
295 -86.225, -86.225, //Type-BR
296 -61.075, -61.075, //Type-BR
297 -35.925, -35.925 //Type-BR
301 if (ism > 23) ism -= 24;
306 xism = kXcorner[ism] + fgkRad;
307 yism = kYcorner[ism] + fgkRad;
308 dxism = -fgkRad*fgkSqRoot3*48.;
309 dyism = -kDia*96. - fgkRad;
311 if (ism >= 6 && ism < 12)
313 xism = kXcorner[ism] - fgkRad;
314 yism = kYcorner[ism] - fgkRad;
315 dxism = fgkRad*fgkSqRoot3*48.;
316 dyism = kDia*96. + fgkRad;
318 if (ism >= 12 && ism < 18)
320 xism = kXcorner[ism] + fgkRad;
321 yism = kYcorner[ism] + fgkRad;
322 dxism = -fgkRad*fgkSqRoot3*96.;
323 dyism = -kDia*48. - fgkRad;
325 if (ism >= 18 && ism < 24)
327 xism = kXcorner[ism] - fgkRad;
328 yism = kYcorner[ism] - fgkRad;
329 dxism = fgkRad*fgkSqRoot3*96.;
330 dyism = kDia*48. + fgkRad;
335 // -------------------------------------------------------------------- //
337 void PMDModule::SetPosition(Float_t x, Float_t y, Float_t z)
344 // -------------------------------------------------------------------- //