5 #include "AliPMDdigit.h"
6 #include "AliPMDddldata.h"
9 using namespace Alieve;
11 const Float_t PMDModule::fgkRad = 0.25;
12 const Float_t PMDModule::fgkSqRoot3 = 1.732050808;
13 const Float_t PMDModule::fgkZpos = 0.;
14 //______________________________________________________________________
21 PMDModule::PMDModule():
29 // -------------------------------------------------------------------- //
30 void PMDModule::DisplayInit(Int_t ism)
32 TString smodule = "Module";
35 Float_t xism =0, yism = 0;
36 Float_t dxism =0, dyism = 0;
38 GenerateBox(ism,xism,yism,dxism,dyism);
40 Reve::FrameBox *pmdModBox = new FrameBox();
41 pmdModBox->SetAAQuadXY(xism, yism, 0, dxism, dyism);
42 pmdModBox->SetFrameColor((Color_t) 31);
44 Reve::RGBAPalette *pmdModPalette = new RGBAPalette(20, 1000);
45 pmdModPalette->SetLimits(0, 1000);
47 // Reve::QuadSet* q = this;
48 SetName(smodule.Data());
50 Reset(Reve::QuadSet::QT_HexagonXY, kFALSE, 32);
53 SetPalette(pmdModPalette);
56 // -------------------------------------------------------------------- //
57 void PMDModule::DisplayDigitsData(Int_t ism, TTree *pmdt)
62 Int_t det, smn, irow, icol, adc;
63 Int_t xpad = 0, ypad = 0;
66 TClonesArray *digits = new TClonesArray("AliPMDdigit", 0);
68 TBranch *branch = pmdt->GetBranch("PMDDigit");
69 branch->SetAddress(&digits);
71 AliPMDdigit *pmddigit;
73 branch->GetEntry(ism);
74 Int_t nentries = digits->GetLast();
75 //printf("%d\n", nentries);
77 for (Int_t ient = 0; ient < nentries+1; ient++)
79 pmddigit = (AliPMDdigit*)digits->UncheckedAt(ient);
81 det = pmddigit->GetDetector();
82 smn = pmddigit->GetSMNumber();
83 irow = pmddigit->GetRow();
84 icol = pmddigit->GetColumn();
85 adc = (Int_t) pmddigit->GetADC();
92 else if(smn >=12 && smn < 24)
98 RectGeomCellPos(smn, xpad, ypad, xpos, ypos);
100 AddHexagon(xpos, ypos, fgkZpos, fgkRad);
104 QuadId(new AliPMDdigit(*pmddigit));
105 // new TNamed(Form("Quad with idx=%d", ient),
106 // "This title is not confusing."));
113 fHMTrans.SetPos(fX, fY, fZ);
117 // -------------------------------------------------------------------- //
119 void PMDModule::DisplayRawData(Int_t ism, TObjArray *ddlcont)
122 if (ism > 23) ism -= 24;
126 Int_t det, smn, irow, icol, adc;
127 Int_t xpad = 0, ypad = 0;
130 Int_t nentries = ddlcont->GetEntries();
131 //printf("%d\n", nentries);
133 for (Int_t ient = 0; ient < nentries; ient++)
135 AliPMDddldata *pmdddl = (AliPMDddldata*)ddlcont->UncheckedAt(ient);
137 det = pmdddl->GetDetector();
138 smn = pmdddl->GetSMN();
139 if (smn != ism) continue;
140 irow = pmdddl->GetRow();
141 icol = pmdddl->GetColumn();
142 adc = pmdddl->GetSignal();
149 else if(smn >=12 && smn < 24)
155 RectGeomCellPos(smn, xpad, ypad, xpos, ypos);
157 AddHexagon(xpos, ypos, fgkZpos, fgkRad);
161 QuadId(new AliPMDddldata(*pmdddl));
162 //new TNamed(Form("Quad with idx=%d", ient),
163 // "This title is not confusing."));
170 fHMTrans.SetPos(fX, fY, fZ);
173 // -------------------------------------------------------------------- //
175 void PMDModule::RectGeomCellPos(Int_t ism, Int_t xpad, Int_t ypad,
176 Float_t &xpos, Float_t &ypos)
178 // This routine finds the cell eta,phi for the new PMD rectangular
180 // Authors : Bedanga Mohanty and Dipak Mishra - 29.4.2003
181 // modified by B. K. Nandi for change of coordinate sys
183 // SMA ---> Supermodule Type A ( SM - 0)
184 // SMAR ---> Supermodule Type A ROTATED ( SM - 1)
185 // SMB ---> Supermodule Type B ( SM - 2)
186 // SMBR ---> Supermodule Type B ROTATED ( SM - 3)
188 // ism : Serial module number from 0 to 23 for each plane
191 // Corner positions (x,y) of the 24 unit moudles in ALICE PMD
193 const Double_t kXcorner[24] =
195 74.8833, 53.0045, 31.1255, //Type-A
196 74.8833, 53.0045, 31.1255, //Type-A
197 -74.8833, -53.0044, -31.1255, //Type-AR
198 -74.8833, -53.0044, -31.1255, //Type-AR
199 8.9165, -33.7471, //Type-B
200 8.9165, -33.7471, //Type-B
201 8.9165, -33.7471, //Type-B
202 -8.9165, 33.7471, //Type-BR
203 -8.9165, 33.7471, //Type-BR
204 -8.9165, 33.7471, //Type-BR
208 const Double_t kYcorner[24] =
210 86.225, 86.225, 86.225, //Type-A
211 37.075, 37.075, 37.075, //Type-A
212 -86.225, -86.225, -86.225, //Type-AR
213 -37.075, -37.075, -37.075, //Type-AR
214 86.225, 86.225, //Type-B
215 61.075, 61.075, //Type-B
216 35.925, 35.925, //Type-B
217 -86.225, -86.225, //Type-BR
218 -61.075, -61.075, //Type-BR
219 -35.925, -35.925 //Type-BR
223 // const Float_t kSqroot3 = 1.732050808; // sqrt(3.);
224 // const Float_t kCellRadius = 0.25;
227 //Every even row of cells is shifted and placed
228 //in geant so this condition
243 ypos = kYcorner[ism] - (Float_t) xpad*fgkRad*2.0 - shift;
244 xpos = kXcorner[ism] - (Float_t) ypad*fgkSqRoot3*fgkRad;
246 else if(ism >=6 && ism < 12)
248 ypos = kYcorner[ism] + (Float_t) xpad*fgkRad*2.0 + shift;
249 xpos = kXcorner[ism] + (Float_t) ypad*fgkSqRoot3*fgkRad;
251 else if(ism >= 12 && ism < 18)
253 ypos = kYcorner[ism] - (Float_t) xpad*fgkRad*2.0 - shift;
254 xpos = kXcorner[ism] - (Float_t) ypad*fgkSqRoot3*fgkRad;
256 else if(ism >= 18 && ism < 24)
258 ypos = kYcorner[ism] + (Float_t) xpad*fgkRad*2.0 + shift;
259 xpos = kXcorner[ism] + (Float_t) ypad*fgkSqRoot3*fgkRad;
263 // -------------------------------------------------------------------- //
264 void PMDModule::GenerateBox(Int_t ism, Float_t &xism, Float_t &yism,
265 Float_t &dxism, Float_t &dyism)
267 const Float_t kDia = 0.50;
269 const Double_t kXcorner[24] =
271 74.8833, 53.0045, 31.1255, //Type-A
272 74.8833, 53.0045, 31.1255, //Type-A
273 -74.8833, -53.0044, -31.1255, //Type-AR
274 -74.8833, -53.0044, -31.1255, //Type-AR
275 8.9165, -33.7471, //Type-B
276 8.9165, -33.7471, //Type-B
277 8.9165, -33.7471, //Type-B
278 -8.9165, 33.7471, //Type-BR
279 -8.9165, 33.7471, //Type-BR
280 -8.9165, 33.7471, //Type-BR
284 const Double_t kYcorner[24] =
286 86.225, 86.225, 86.225, //Type-A
287 37.075, 37.075, 37.075, //Type-A
288 -86.225, -86.225, -86.225, //Type-AR
289 -37.075, -37.075, -37.075, //Type-AR
290 86.225, 86.225, //Type-B
291 61.075, 61.075, //Type-B
292 35.925, 35.925, //Type-B
293 -86.225, -86.225, //Type-BR
294 -61.075, -61.075, //Type-BR
295 -35.925, -35.925 //Type-BR
299 if (ism > 23) ism -= 24;
304 xism = kXcorner[ism] + fgkRad;
305 yism = kYcorner[ism] + fgkRad;
306 dxism = -fgkRad*fgkSqRoot3*48.;
307 dyism = -kDia*96. - fgkRad;
309 if (ism >= 6 && ism < 12)
311 xism = kXcorner[ism] - fgkRad;
312 yism = kYcorner[ism] - fgkRad;
313 dxism = fgkRad*fgkSqRoot3*48.;
314 dyism = kDia*96. + fgkRad;
316 if (ism >= 12 && ism < 18)
318 xism = kXcorner[ism] + fgkRad;
319 yism = kYcorner[ism] + fgkRad;
320 dxism = -fgkRad*fgkSqRoot3*96.;
321 dyism = -kDia*48. - fgkRad;
323 if (ism >= 18 && ism < 24)
325 xism = kXcorner[ism] - fgkRad;
326 yism = kYcorner[ism] - fgkRad;
327 dxism = fgkRad*fgkSqRoot3*96.;
328 dyism = kDia*48. + fgkRad;
333 // -------------------------------------------------------------------- //
335 void PMDModule::SetPosition(Float_t x, Float_t y, Float_t z)
342 // -------------------------------------------------------------------- //