]>
Commit | Line | Data |
---|---|---|
820b4d9e | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | //==================================================================================================================================================== | |
17 | // | |
18 | // Class for the description of the structure for the planes of the ALICE Muon Forward Tracker | |
19 | // | |
20 | // Contact author: antonio.uras@cern.ch | |
21 | // | |
22 | //==================================================================================================================================================== | |
23 | ||
24 | #include "TNamed.h" | |
25 | #include "THnSparse.h" | |
26 | #include "TClonesArray.h" | |
820b4d9e | 27 | #include "TAxis.h" |
28 | #include "TPave.h" | |
29 | #include "TCanvas.h" | |
30 | #include "TH2D.h" | |
31 | #include "TEllipse.h" | |
32 | #include "TMath.h" | |
33 | #include "AliLog.h" | |
d4643a10 | 34 | #include "AliMFTConstants.h" |
35 | #include "AliMFTPlane.h" | |
36 | ||
37 | const Double_t AliMFTPlane::fRadiusMin = AliMFTConstants::fRadiusMin; | |
38 | const Double_t AliMFTPlane::fActiveSuperposition = AliMFTConstants::fActiveSuperposition; | |
39 | const Double_t AliMFTPlane::fHeightActive = AliMFTConstants::fHeightActive; | |
40 | const Double_t AliMFTPlane::fHeightReadout = AliMFTConstants::fHeightReadout; | |
41 | const Double_t AliMFTPlane::fSupportExtMargin = AliMFTConstants::fSupportExtMargin; | |
820b4d9e | 42 | |
43 | ClassImp(AliMFTPlane) | |
44 | ||
45 | //==================================================================================================================================================== | |
46 | ||
47 | AliMFTPlane::AliMFTPlane(): | |
48 | TNamed(), | |
d4643a10 | 49 | fPlaneNumber(-1), |
820b4d9e | 50 | fZCenter(0), |
51 | fRMinSupport(0), | |
52 | fRMax(0), | |
53 | fRMaxSupport(0), | |
54 | fPixelSizeX(0), | |
55 | fPixelSizeY(0), | |
56 | fThicknessActive(0), | |
57 | fThicknessSupport(0), | |
58 | fThicknessReadout(0), | |
59 | fZCenterActiveFront(0), | |
60 | fZCenterActiveBack(0), | |
61 | fEquivalentSilicon(0), | |
62 | fEquivalentSiliconBeforeFront(0), | |
63 | fEquivalentSiliconBeforeBack(0), | |
64 | fActiveElements(0), | |
65 | fReadoutElements(0), | |
bcaf50eb | 66 | fSupportElements(0), |
67 | fHasPixelRectangularPatternAlongY(kFALSE) | |
820b4d9e | 68 | { |
69 | ||
820b4d9e | 70 | // default constructor |
71 | ||
72 | } | |
73 | ||
74 | //==================================================================================================================================================== | |
75 | ||
76 | AliMFTPlane::AliMFTPlane(const Char_t *name, const Char_t *title): | |
77 | TNamed(name, title), | |
d4643a10 | 78 | fPlaneNumber(-1), |
820b4d9e | 79 | fZCenter(0), |
80 | fRMinSupport(0), | |
81 | fRMax(0), | |
82 | fRMaxSupport(0), | |
83 | fPixelSizeX(0), | |
84 | fPixelSizeY(0), | |
85 | fThicknessActive(0), | |
86 | fThicknessSupport(0), | |
87 | fThicknessReadout(0), | |
88 | fZCenterActiveFront(0), | |
89 | fZCenterActiveBack(0), | |
90 | fEquivalentSilicon(0), | |
91 | fEquivalentSiliconBeforeFront(0), | |
92 | fEquivalentSiliconBeforeBack(0), | |
ffc53def | 93 | fActiveElements(0), |
94 | fReadoutElements(0), | |
95 | fSupportElements(0), | |
bcaf50eb | 96 | fHasPixelRectangularPatternAlongY(kFALSE) |
820b4d9e | 97 | { |
98 | ||
d4643a10 | 99 | // constructor |
ffc53def | 100 | fActiveElements = new TClonesArray("THnSparseC"); |
101 | fReadoutElements = new TClonesArray("THnSparseC"); | |
102 | fSupportElements = new TClonesArray("THnSparseC"); | |
103 | fActiveElements->SetOwner(kTRUE); | |
104 | fReadoutElements->SetOwner(kTRUE); | |
105 | fSupportElements->SetOwner(kTRUE); | |
106 | ||
820b4d9e | 107 | } |
108 | ||
109 | //==================================================================================================================================================== | |
110 | ||
111 | AliMFTPlane::AliMFTPlane(const AliMFTPlane& plane): | |
112 | TNamed(plane), | |
113 | fPlaneNumber(plane.fPlaneNumber), | |
114 | fZCenter(plane.fZCenter), | |
115 | fRMinSupport(plane.fRMinSupport), | |
116 | fRMax(plane.fRMax), | |
117 | fRMaxSupport(plane.fRMaxSupport), | |
118 | fPixelSizeX(plane.fPixelSizeX), | |
119 | fPixelSizeY(plane.fPixelSizeY), | |
120 | fThicknessActive(plane.fThicknessActive), | |
121 | fThicknessSupport(plane.fThicknessSupport), | |
122 | fThicknessReadout(plane.fThicknessReadout), | |
123 | fZCenterActiveFront(plane.fZCenterActiveFront), | |
124 | fZCenterActiveBack(plane.fZCenterActiveBack), | |
125 | fEquivalentSilicon(plane.fEquivalentSilicon), | |
126 | fEquivalentSiliconBeforeFront(plane.fEquivalentSiliconBeforeFront), | |
127 | fEquivalentSiliconBeforeBack(plane.fEquivalentSiliconBeforeBack), | |
ffc53def | 128 | fActiveElements(0), |
129 | fReadoutElements(0), | |
130 | fSupportElements(0), | |
131 | fHasPixelRectangularPatternAlongY(plane.fHasPixelRectangularPatternAlongY) | |
820b4d9e | 132 | { |
133 | ||
134 | // copy constructor | |
ffc53def | 135 | fActiveElements = new TClonesArray(*(plane.fActiveElements)); |
136 | fActiveElements -> SetOwner(kTRUE); | |
137 | fReadoutElements = new TClonesArray(*(plane.fReadoutElements)); | |
138 | fReadoutElements -> SetOwner(kTRUE); | |
139 | fSupportElements = new TClonesArray(*(plane.fSupportElements)); | |
140 | fSupportElements -> SetOwner(kTRUE); | |
141 | ||
142 | ||
143 | } | |
144 | ||
145 | //==================================================================================================================================================== | |
146 | ||
147 | AliMFTPlane::~AliMFTPlane() { | |
148 | ||
149 | AliInfo("Delete AliMFTPlane"); | |
150 | if(fActiveElements) fActiveElements->Delete(); | |
151 | delete fActiveElements; | |
152 | if(fReadoutElements) fReadoutElements->Delete(); | |
153 | delete fReadoutElements; | |
154 | if(fSupportElements) fSupportElements->Delete(); | |
155 | delete fSupportElements; | |
156 | ||
157 | } | |
158 | ||
159 | //==================================================================================================================================================== | |
160 | ||
161 | void AliMFTPlane::Clear(const Option_t* /*opt*/) { | |
162 | ||
163 | AliInfo("Clear AliMFTPlane"); | |
164 | if(fActiveElements) fActiveElements->Delete(); | |
165 | delete fActiveElements; fActiveElements=NULL; | |
166 | if(fReadoutElements) fReadoutElements->Delete(); | |
167 | delete fReadoutElements; fReadoutElements=NULL; | |
168 | if(fSupportElements) fSupportElements->Delete(); | |
169 | delete fSupportElements; fSupportElements=NULL; | |
d4643a10 | 170 | |
820b4d9e | 171 | } |
172 | ||
173 | //==================================================================================================================================================== | |
174 | ||
175 | AliMFTPlane& AliMFTPlane::operator=(const AliMFTPlane& plane) { | |
176 | ||
177 | // Assignment operator | |
ffc53def | 178 | |
820b4d9e | 179 | // check assignement to self |
d4643a10 | 180 | if (this != &plane) { |
ffc53def | 181 | |
d4643a10 | 182 | // base class assignement |
183 | TNamed::operator=(plane); | |
184 | ||
ffc53def | 185 | // clear memory |
186 | Clear(""); | |
187 | ||
bcaf50eb | 188 | fPlaneNumber = plane.fPlaneNumber; |
189 | fZCenter = plane.fZCenter; | |
190 | fRMinSupport = plane.fRMinSupport; | |
191 | fRMax = plane.fRMax; | |
192 | fRMaxSupport = plane.fRMaxSupport; | |
193 | fPixelSizeX = plane.fPixelSizeX; | |
194 | fPixelSizeY = plane.fPixelSizeY; | |
195 | fThicknessActive = plane.fThicknessActive; | |
196 | fThicknessSupport = plane.fThicknessSupport; | |
197 | fThicknessReadout = plane.fThicknessReadout; | |
198 | fZCenterActiveFront = plane.fZCenterActiveFront; | |
199 | fZCenterActiveBack = plane.fZCenterActiveBack; | |
200 | fEquivalentSilicon = plane.fEquivalentSilicon; | |
201 | fEquivalentSiliconBeforeFront = plane.fEquivalentSiliconBeforeFront; | |
202 | fEquivalentSiliconBeforeBack = plane.fEquivalentSiliconBeforeBack; | |
ffc53def | 203 | fActiveElements = new TClonesArray(*(plane.fActiveElements)); |
204 | fActiveElements -> SetOwner(kTRUE); | |
205 | fReadoutElements = new TClonesArray(*(plane.fReadoutElements)); | |
206 | fReadoutElements -> SetOwner(kTRUE); | |
207 | fSupportElements = new TClonesArray(*(plane.fSupportElements)); | |
208 | fSupportElements -> SetOwner(kTRUE); | |
bcaf50eb | 209 | fHasPixelRectangularPatternAlongY = plane.fHasPixelRectangularPatternAlongY; |
820b4d9e | 210 | |
ffc53def | 211 | } |
212 | ||
820b4d9e | 213 | return *this; |
d4643a10 | 214 | |
820b4d9e | 215 | } |
216 | ||
217 | //==================================================================================================================================================== | |
218 | ||
219 | Bool_t AliMFTPlane::Init(Int_t planeNumber, | |
220 | Double_t zCenter, | |
221 | Double_t rMin, | |
222 | Double_t rMax, | |
223 | Double_t pixelSizeX, | |
224 | Double_t pixelSizeY, | |
225 | Double_t thicknessActive, | |
226 | Double_t thicknessSupport, | |
bcaf50eb | 227 | Double_t thicknessReadout, |
228 | Bool_t hasPixelRectangularPatternAlongY) { | |
820b4d9e | 229 | |
230 | AliDebug(1, Form("Initializing Plane Structure for Plane %s", GetName())); | |
231 | ||
232 | fPlaneNumber = planeNumber; | |
233 | fZCenter = zCenter; | |
234 | fRMinSupport = rMin; | |
235 | fRMax = rMax; | |
236 | fPixelSizeX = pixelSizeX; | |
237 | fPixelSizeY = pixelSizeY; | |
238 | fThicknessActive = thicknessActive; | |
239 | fThicknessSupport = thicknessSupport; | |
240 | fThicknessReadout = thicknessReadout; | |
241 | ||
bcaf50eb | 242 | fHasPixelRectangularPatternAlongY = hasPixelRectangularPatternAlongY; |
243 | ||
820b4d9e | 244 | fZCenterActiveFront = fZCenter - 0.5*fThicknessSupport - 0.5*fThicknessActive; |
245 | fZCenterActiveBack = fZCenter + 0.5*fThicknessSupport + 0.5*fThicknessActive; | |
246 | ||
58b93f36 | 247 | // if (fRMinSupport <= fRadiusMin) fRMinSupport = fRadiusMin; |
248 | // else { | |
249 | // fRMinSupport = fRadiusMin + (fHeightActive-fActiveSuperposition) * Int_t((fRMinSupport-fRadiusMin)/(fHeightActive-fActiveSuperposition)); | |
250 | // } | |
820b4d9e | 251 | |
252 | if (fRMax < fRMinSupport+fHeightActive) fRMax = fRMinSupport + fHeightActive; | |
253 | ||
254 | fRMax = fRMinSupport + (fHeightActive-fActiveSuperposition) * | |
255 | (Int_t((fRMax-fRMinSupport-fHeightActive)/(fHeightActive-fActiveSuperposition))+1) + fHeightActive; | |
256 | ||
d4643a10 | 257 | fRMaxSupport = TMath::Sqrt(fHeightActive*(2.*rMax-fHeightActive) + fRMax*fRMax) + fSupportExtMargin; |
820b4d9e | 258 | |
259 | return kTRUE; | |
260 | ||
261 | } | |
262 | ||
263 | //==================================================================================================================================================== | |
264 | ||
265 | Bool_t AliMFTPlane::CreateStructure() { | |
266 | ||
267 | Int_t nBins[3]={0}; | |
268 | Double_t minPosition[3]={0}, maxPosition[3]={0}; | |
269 | ||
270 | // ------------------- support element ------------------------------------------------- | |
271 | ||
272 | nBins[0] = 1; | |
273 | nBins[1] = 1; | |
274 | nBins[2] = 1; | |
275 | ||
276 | minPosition[0] = -1.*fRMaxSupport; | |
277 | minPosition[1] = -1.*fRMaxSupport; | |
278 | minPosition[2] = fZCenter - 0.5*fThicknessSupport; | |
279 | ||
280 | maxPosition[0] = +1.*fRMaxSupport; | |
281 | maxPosition[1] = +1.*fRMaxSupport; | |
282 | maxPosition[2] = fZCenter + 0.5*fThicknessSupport; | |
283 | ||
284 | new ((*fSupportElements)[fSupportElements->GetEntries()]) THnSparseC(Form("MFTSupportElemHist_%02d%03d", fPlaneNumber, fSupportElements->GetEntries()), | |
285 | Form("MFTSupportElemHist_%02d%03d", fPlaneNumber, fSupportElements->GetEntries()), | |
286 | 3, nBins, minPosition, maxPosition); | |
287 | ||
288 | // ------------------- det elements: active + readout ---------------------------------- | |
289 | ||
290 | Double_t lowEdgeActive = -1.*fRMax; | |
291 | Double_t supEdgeActive = lowEdgeActive + fHeightActive; | |
292 | Double_t zMin = 0.; | |
293 | Bool_t isFront = kTRUE; | |
294 | ||
295 | while (supEdgeActive < fRMax+0.01) { | |
296 | ||
297 | if (isFront) zMin = fZCenter - 0.5*fThicknessSupport - fThicknessActive; | |
298 | else zMin = fZCenter + 0.5*fThicknessSupport; | |
299 | ||
300 | Double_t extLimitAtLowEdgeActive = TMath::Sqrt((fRMax-TMath::Abs(lowEdgeActive)) * TMath::Abs(2*fRMax - (fRMax-TMath::Abs(lowEdgeActive)))); | |
301 | Double_t extLimitAtSupEdgeActive = TMath::Sqrt((fRMax-TMath::Abs(supEdgeActive)) * TMath::Abs(2*fRMax - (fRMax-TMath::Abs(supEdgeActive)))); | |
302 | ||
303 | // creating new det element: active + readout | |
304 | ||
305 | Double_t extLimitDetElem = TMath::Max(extLimitAtLowEdgeActive, extLimitAtSupEdgeActive); | |
306 | ||
307 | if (supEdgeActive<-1.*fRMinSupport+0.01 || lowEdgeActive>1.*fRMinSupport-0.01) { // single element covering the row | |
308 | ||
309 | nBins[0] = TMath::Nint(2.*extLimitDetElem/fPixelSizeX); | |
310 | nBins[1] = TMath::Nint(fHeightActive/fPixelSizeY); | |
311 | nBins[2] = 1; | |
312 | ||
313 | minPosition[0] = -1.*extLimitDetElem; | |
314 | minPosition[1] = lowEdgeActive; | |
315 | minPosition[2] = zMin; | |
316 | ||
317 | maxPosition[0] = +1.*extLimitDetElem; | |
318 | maxPosition[1] = supEdgeActive; | |
319 | maxPosition[2] = zMin+fThicknessActive; | |
320 | ||
321 | new ((*fActiveElements)[fActiveElements->GetEntries()]) THnSparseC(Form("MFTActiveElemHist_%02d%03d", fPlaneNumber, fActiveElements->GetEntries()), | |
322 | Form("MFTActiveElemHist_%02d%03d", fPlaneNumber, fActiveElements->GetEntries()), | |
323 | 3, nBins, minPosition, maxPosition); | |
324 | ||
325 | if (supEdgeActive>0.) { | |
326 | minPosition[1] = supEdgeActive; | |
327 | maxPosition[1] = supEdgeActive+fHeightReadout; | |
328 | } | |
329 | else { | |
330 | minPosition[1] = lowEdgeActive-fHeightReadout; | |
331 | maxPosition[1] = lowEdgeActive; | |
332 | } | |
333 | ||
334 | new ((*fReadoutElements)[fReadoutElements->GetEntries()]) THnSparseC(Form("MFTReadoutElemHist_%02d%03d", fPlaneNumber, fReadoutElements->GetEntries()), | |
335 | Form("MFTReadoutElemHist_%02d%03d", fPlaneNumber, fReadoutElements->GetEntries()), | |
336 | 3, nBins, minPosition, maxPosition); | |
337 | ||
338 | } | |
339 | ||
340 | else { // two elements covering the row | |
341 | ||
342 | Double_t intLimitAtLowEdge = 0., intLimitAtSupEdge = 0.; | |
343 | if (fRMinSupport-TMath::Abs(lowEdgeActive)>0.) intLimitAtLowEdge = TMath::Sqrt((fRMinSupport-TMath::Abs(lowEdgeActive)) * TMath::Abs(2*fRMinSupport - (fRMinSupport-TMath::Abs(lowEdgeActive)))); | |
344 | if (fRMinSupport-TMath::Abs(supEdgeActive)>0.) intLimitAtSupEdge = TMath::Sqrt((fRMinSupport-TMath::Abs(supEdgeActive)) * TMath::Abs(2*fRMinSupport - (fRMinSupport-TMath::Abs(supEdgeActive)))); | |
345 | Double_t intLimitDetElem = TMath::Max(intLimitAtLowEdge, intLimitAtSupEdge); | |
346 | ||
347 | nBins[0] = TMath::Nint((extLimitDetElem-intLimitDetElem)/fPixelSizeX); | |
348 | nBins[1] = TMath::Nint(fHeightActive/fPixelSizeY); | |
349 | nBins[2] = 1; | |
350 | ||
351 | // left element | |
352 | ||
353 | minPosition[0] = -1.*extLimitDetElem; | |
354 | minPosition[1] = lowEdgeActive; | |
355 | minPosition[2] = zMin; | |
356 | ||
357 | maxPosition[0] = -1.*intLimitDetElem; | |
358 | maxPosition[1] = supEdgeActive; | |
359 | maxPosition[2] = zMin+fThicknessActive; | |
360 | ||
361 | new ((*fActiveElements)[fActiveElements->GetEntries()]) THnSparseC(Form("MFTActiveElemHist_%02d%03d", fPlaneNumber, fActiveElements->GetEntries()), | |
362 | Form("MFTActiveElemHist_%02d%03d", fPlaneNumber, fActiveElements->GetEntries()), | |
363 | 3, nBins, minPosition, maxPosition); | |
364 | ||
365 | if (supEdgeActive>0.) { | |
366 | minPosition[1] = supEdgeActive; | |
367 | maxPosition[1] = supEdgeActive+fHeightReadout; | |
368 | } | |
369 | else { | |
370 | minPosition[1] = lowEdgeActive-fHeightReadout; | |
371 | maxPosition[1] = lowEdgeActive; | |
372 | } | |
373 | ||
374 | new ((*fReadoutElements)[fReadoutElements->GetEntries()]) THnSparseC(Form("MFTReadoutElemHist_%02d%03d", fPlaneNumber, fReadoutElements->GetEntries()), | |
375 | Form("MFTReadoutElemHist_%02d%03d", fPlaneNumber, fReadoutElements->GetEntries()), | |
376 | 3, nBins, minPosition, maxPosition); | |
377 | ||
378 | // right element | |
379 | ||
380 | minPosition[0] = +1.*intLimitDetElem; | |
381 | minPosition[1] = lowEdgeActive; | |
382 | minPosition[2] = zMin; | |
383 | ||
384 | maxPosition[0] = +1.*extLimitDetElem; | |
385 | maxPosition[1] = supEdgeActive; | |
386 | maxPosition[2] = zMin+fThicknessActive; | |
387 | ||
388 | new ((*fActiveElements)[fActiveElements->GetEntries()]) THnSparseC(Form("MFTActiveElemHist_%02d%03d", fPlaneNumber, fActiveElements->GetEntries()), | |
389 | Form("MFTActiveElemHist_%02d%03d", fPlaneNumber, fActiveElements->GetEntries()), | |
390 | 3, nBins, minPosition, maxPosition); | |
391 | ||
392 | if (supEdgeActive>0.) { | |
393 | minPosition[1] = supEdgeActive; | |
394 | maxPosition[1] = supEdgeActive+fHeightReadout; | |
395 | } | |
396 | else { | |
397 | minPosition[1] = lowEdgeActive-fHeightReadout; | |
398 | maxPosition[1] = lowEdgeActive; | |
399 | } | |
400 | ||
401 | new ((*fReadoutElements)[fReadoutElements->GetEntries()]) THnSparseC(Form("MFTReadoutElemHist_%02d%03d", fPlaneNumber, fReadoutElements->GetEntries()), | |
402 | Form("MFTReadoutElemHist_%02d%03d", fPlaneNumber, fReadoutElements->GetEntries()), | |
403 | 3, nBins, minPosition, maxPosition); | |
404 | ||
405 | } | |
406 | ||
407 | lowEdgeActive += fHeightActive - fActiveSuperposition; | |
408 | supEdgeActive = lowEdgeActive + fHeightActive; | |
409 | isFront = !isFront; | |
410 | ||
411 | } | |
412 | ||
413 | AliDebug(1, Form("Structure completed for MFT plane %s", GetName())); | |
414 | ||
415 | return kTRUE; | |
416 | ||
417 | } | |
418 | ||
419 | //==================================================================================================================================================== | |
420 | ||
421 | THnSparseC* AliMFTPlane::GetActiveElement(Int_t id) { | |
422 | ||
423 | if (id<0 || id>=GetNActiveElements()) return NULL; | |
424 | else return (THnSparseC*) fActiveElements->At(id); | |
425 | ||
426 | } | |
427 | ||
428 | //==================================================================================================================================================== | |
429 | ||
430 | THnSparseC* AliMFTPlane::GetReadoutElement(Int_t id) { | |
431 | ||
432 | if (id<0 || id>=GetNReadoutElements()) return NULL; | |
433 | else return (THnSparseC*) fReadoutElements->At(id); | |
434 | ||
435 | } | |
436 | ||
437 | //==================================================================================================================================================== | |
438 | ||
439 | THnSparseC* AliMFTPlane::GetSupportElement(Int_t id) { | |
440 | ||
441 | if (id<0 || id>=GetNSupportElements()) return NULL; | |
442 | else return (THnSparseC*) fSupportElements->At(id); | |
443 | ||
444 | } | |
445 | ||
446 | //==================================================================================================================================================== | |
447 | ||
d4643a10 | 448 | void AliMFTPlane::DrawPlane(Option_t *opt) { |
820b4d9e | 449 | |
450 | // ------------------- "FRONT" option ------------------ | |
451 | ||
452 | if (!strcmp(opt, "front")) { | |
453 | ||
454 | TCanvas *cnv = new TCanvas("cnv", GetName(), 900, 900); | |
455 | cnv->Draw(); | |
456 | ||
820b4d9e | 457 | TH2D *h = new TH2D("tmp", GetName(), |
458 | 1, 1.1*GetSupportElement(0)->GetAxis(0)->GetXmin(), 1.1*GetSupportElement(0)->GetAxis(0)->GetXmax(), | |
459 | 1, 1.1*GetSupportElement(0)->GetAxis(1)->GetXmin(), 1.1*GetSupportElement(0)->GetAxis(1)->GetXmax()); | |
460 | h->SetXTitle("x [cm]"); | |
461 | h->SetYTitle("y [cm]"); | |
462 | h->Draw(); | |
463 | ||
d4643a10 | 464 | AliInfo("Created hist"); |
820b4d9e | 465 | |
466 | TEllipse *supportExt = new TEllipse(0.0, 0.0, fRMaxSupport, fRMaxSupport); | |
467 | TEllipse *supportInt = new TEllipse(0.0, 0.0, fRMinSupport, fRMinSupport); | |
468 | supportExt->SetFillColor(kCyan-10); | |
469 | supportExt -> Draw("same"); | |
470 | supportInt -> Draw("same"); | |
471 | ||
820b4d9e | 472 | for (Int_t iEl=0; iEl<GetNActiveElements(); iEl++) { |
820b4d9e | 473 | if (!IsFront(GetActiveElement(iEl))) continue; |
474 | TPave *pave = new TPave(GetActiveElement(iEl)->GetAxis(0)->GetXmin(), | |
475 | GetActiveElement(iEl)->GetAxis(1)->GetXmin(), | |
476 | GetActiveElement(iEl)->GetAxis(0)->GetXmax(), | |
477 | GetActiveElement(iEl)->GetAxis(1)->GetXmax(), 1); | |
478 | pave -> SetFillColor(kGreen); | |
479 | pave -> Draw("same"); | |
480 | } | |
481 | ||
482 | for (Int_t iEl=0; iEl<GetNReadoutElements(); iEl++) { | |
820b4d9e | 483 | if (!IsFront(GetReadoutElement(iEl))) continue; |
484 | TPave *pave = new TPave(GetReadoutElement(iEl)->GetAxis(0)->GetXmin(), | |
485 | GetReadoutElement(iEl)->GetAxis(1)->GetXmin(), | |
486 | GetReadoutElement(iEl)->GetAxis(0)->GetXmax(), | |
487 | GetReadoutElement(iEl)->GetAxis(1)->GetXmax(), 1); | |
488 | pave -> SetFillColor(kRed); | |
489 | pave -> Draw("same"); | |
490 | } | |
491 | ||
492 | } | |
493 | ||
494 | // ------------------- "BACK" option ------------------ | |
495 | ||
496 | else if (!strcmp(opt, "back")) { | |
497 | ||
498 | TCanvas *cnv = new TCanvas("cnv", GetName(), 900, 900); | |
499 | cnv->Draw(); | |
500 | ||
501 | TH2D *h = new TH2D("tmp", GetName(), | |
502 | 1, 1.1*GetSupportElement(0)->GetAxis(0)->GetXmin(), 1.1*GetSupportElement(0)->GetAxis(0)->GetXmax(), | |
503 | 1, 1.1*GetSupportElement(0)->GetAxis(1)->GetXmin(), 1.1*GetSupportElement(0)->GetAxis(1)->GetXmax()); | |
504 | h->SetXTitle("x [cm]"); | |
505 | h->SetYTitle("y [cm]"); | |
506 | h->Draw(); | |
507 | ||
508 | TEllipse *supportExt = new TEllipse(0.0, 0.0, fRMaxSupport, fRMaxSupport); | |
509 | TEllipse *supportInt = new TEllipse(0.0, 0.0, fRMinSupport, fRMinSupport); | |
510 | supportExt -> SetFillColor(kCyan-10); | |
511 | supportExt -> Draw("same"); | |
512 | supportInt -> Draw("same"); | |
513 | ||
514 | for (Int_t iEl=0; iEl<GetNActiveElements(); iEl++) { | |
515 | if (IsFront(GetActiveElement(iEl))) continue; | |
516 | TPave *pave = new TPave(GetActiveElement(iEl)->GetAxis(0)->GetXmin(), | |
517 | GetActiveElement(iEl)->GetAxis(1)->GetXmin(), | |
518 | GetActiveElement(iEl)->GetAxis(0)->GetXmax(), | |
519 | GetActiveElement(iEl)->GetAxis(1)->GetXmax(), 1); | |
520 | pave -> SetFillColor(kGreen); | |
521 | pave -> Draw("same"); | |
522 | } | |
523 | ||
524 | for (Int_t iEl=0; iEl<GetNReadoutElements(); iEl++) { | |
525 | if (IsFront(GetReadoutElement(iEl))) continue; | |
526 | TPave *pave = new TPave(GetReadoutElement(iEl)->GetAxis(0)->GetXmin(), | |
527 | GetReadoutElement(iEl)->GetAxis(1)->GetXmin(), | |
528 | GetReadoutElement(iEl)->GetAxis(0)->GetXmax(), | |
529 | GetReadoutElement(iEl)->GetAxis(1)->GetXmax(), 1); | |
530 | pave -> SetFillColor(kRed); | |
531 | pave -> Draw("same"); | |
532 | } | |
533 | ||
534 | } | |
535 | ||
536 | // ------------------- "BOTH" option ------------------ | |
537 | ||
538 | else if (!strcmp(opt, "both")) { | |
539 | ||
540 | TCanvas *cnv = new TCanvas("cnv", GetName(), 900, 900); | |
541 | cnv->Draw(); | |
542 | ||
543 | TH2D *h = new TH2D("tmp", GetName(), | |
544 | 1, 1.1*GetSupportElement(0)->GetAxis(0)->GetXmin(), 1.1*GetSupportElement(0)->GetAxis(0)->GetXmax(), | |
545 | 1, 1.1*GetSupportElement(0)->GetAxis(1)->GetXmin(), 1.1*GetSupportElement(0)->GetAxis(1)->GetXmax()); | |
546 | h->SetXTitle("x [cm]"); | |
547 | h->SetYTitle("y [cm]"); | |
548 | h->Draw(); | |
549 | ||
550 | TEllipse *supportExt = new TEllipse(0.0, 0.0, fRMaxSupport, fRMaxSupport); | |
551 | TEllipse *supportInt = new TEllipse(0.0, 0.0, fRMinSupport, fRMinSupport); | |
552 | supportExt -> SetFillColor(kCyan-10); | |
553 | supportExt -> Draw("same"); | |
554 | supportInt -> Draw("same"); | |
555 | ||
556 | for (Int_t iEl=0; iEl<GetNActiveElements(); iEl++) { | |
557 | if (IsFront(GetActiveElement(iEl)) && GetActiveElement(iEl)->GetAxis(0)->GetXmin()<0.) { | |
558 | TPave *pave = new TPave(GetActiveElement(iEl)->GetAxis(0)->GetXmin(), | |
559 | GetActiveElement(iEl)->GetAxis(1)->GetXmin(), | |
560 | TMath::Min(GetActiveElement(iEl)->GetAxis(0)->GetXmax(), 0.), | |
561 | GetActiveElement(iEl)->GetAxis(1)->GetXmax(), 1); | |
562 | pave -> SetFillColor(kGreen); | |
563 | pave -> Draw("same"); | |
564 | } | |
565 | else if (!IsFront(GetActiveElement(iEl)) && GetActiveElement(iEl)->GetAxis(0)->GetXmax()>0.) { | |
566 | TPave *pave = new TPave(TMath::Max(GetActiveElement(iEl)->GetAxis(0)->GetXmin(), 0.), | |
567 | GetActiveElement(iEl)->GetAxis(1)->GetXmin(), | |
568 | GetActiveElement(iEl)->GetAxis(0)->GetXmax(), | |
569 | GetActiveElement(iEl)->GetAxis(1)->GetXmax(), 1); | |
570 | pave -> SetFillColor(kGreen); | |
571 | pave -> Draw("same"); | |
572 | } | |
573 | } | |
574 | ||
575 | for (Int_t iEl=0; iEl<GetNReadoutElements(); iEl++) { | |
576 | if (IsFront(GetReadoutElement(iEl)) && GetReadoutElement(iEl)->GetAxis(0)->GetXmin()<0.) { | |
577 | TPave *pave = new TPave(GetReadoutElement(iEl)->GetAxis(0)->GetXmin(), | |
578 | GetReadoutElement(iEl)->GetAxis(1)->GetXmin(), | |
579 | TMath::Min(GetReadoutElement(iEl)->GetAxis(0)->GetXmax(), 0.), | |
580 | GetReadoutElement(iEl)->GetAxis(1)->GetXmax(), 1); | |
581 | pave -> SetFillColor(kRed); | |
582 | pave -> Draw("same"); | |
583 | } | |
584 | else if (!IsFront(GetReadoutElement(iEl)) && GetReadoutElement(iEl)->GetAxis(0)->GetXmax()>0.) { | |
585 | TPave *pave = new TPave(TMath::Max(GetReadoutElement(iEl)->GetAxis(0)->GetXmin(), 0.), | |
586 | GetReadoutElement(iEl)->GetAxis(1)->GetXmin(), | |
587 | GetReadoutElement(iEl)->GetAxis(0)->GetXmax(), | |
588 | GetReadoutElement(iEl)->GetAxis(1)->GetXmax(), 1); | |
589 | pave -> SetFillColor(kRed); | |
590 | pave -> Draw("same"); | |
591 | } | |
592 | } | |
593 | ||
594 | } | |
595 | ||
596 | // ------------------- "PROFILE" option ------------------ | |
597 | ||
598 | else if (!strcmp(opt, "profile")) { | |
599 | ||
600 | TCanvas *cnv = new TCanvas("cnv", GetName(), 300, 900); | |
601 | cnv->Draw(); | |
602 | ||
603 | TH2D *h = new TH2D("tmp", GetName(), | |
604 | 1, fZCenter-0.5, fZCenter+0.5, | |
605 | 1, 1.1*GetSupportElement(0)->GetAxis(1)->GetXmin(), 1.1*GetSupportElement(0)->GetAxis(1)->GetXmax()); | |
606 | h->SetXTitle("z [cm]"); | |
607 | h->SetYTitle("y [cm]"); | |
608 | h->Draw(); | |
609 | ||
610 | TPave *supportExt = new TPave(GetSupportElement(0)->GetAxis(2)->GetXmin(), -fRMaxSupport, | |
611 | GetSupportElement(0)->GetAxis(2)->GetXmax(), fRMaxSupport); | |
612 | TPave *supportInt = new TPave(GetSupportElement(0)->GetAxis(2)->GetXmin(), -fRMinSupport, | |
613 | GetSupportElement(0)->GetAxis(2)->GetXmax(), fRMinSupport); | |
614 | supportExt -> SetFillColor(kCyan-10); | |
615 | supportInt -> SetFillColor(kCyan-10); | |
616 | supportExt -> SetBorderSize(1); | |
617 | supportInt -> SetBorderSize(1); | |
618 | supportExt -> Draw("same"); | |
619 | supportInt -> Draw("same"); | |
620 | ||
621 | for (Int_t iEl=0; iEl<GetNActiveElements(); iEl++) { | |
622 | TPave * pave = 0; | |
623 | if (IsFront(GetActiveElement(iEl))) { | |
624 | pave = new TPave(GetActiveElement(iEl)->GetAxis(2)->GetXmax() - | |
625 | 5*(GetActiveElement(iEl)->GetAxis(2)->GetXmax()-GetActiveElement(iEl)->GetAxis(2)->GetXmin()), | |
626 | GetActiveElement(iEl)->GetAxis(1)->GetXmin(), | |
627 | GetActiveElement(iEl)->GetAxis(2)->GetXmax(), | |
628 | GetActiveElement(iEl)->GetAxis(1)->GetXmax(), 1); | |
629 | } | |
630 | else { | |
631 | pave = new TPave(GetActiveElement(iEl)->GetAxis(2)->GetXmin(), | |
632 | GetActiveElement(iEl)->GetAxis(1)->GetXmin(), | |
633 | GetActiveElement(iEl)->GetAxis(2)->GetXmin() + | |
634 | 5*(GetActiveElement(iEl)->GetAxis(2)->GetXmax()-GetActiveElement(iEl)->GetAxis(2)->GetXmin()), | |
635 | GetActiveElement(iEl)->GetAxis(1)->GetXmax(), 1); | |
636 | } | |
637 | pave -> SetFillColor(kGreen); | |
638 | pave -> Draw("same"); | |
639 | } | |
640 | ||
641 | for (Int_t iEl=0; iEl<GetNReadoutElements(); iEl++) { | |
642 | TPave *pave = 0; | |
643 | if (IsFront(GetReadoutElement(iEl))) { | |
644 | pave = new TPave(GetReadoutElement(iEl)->GetAxis(2)->GetXmax() - | |
645 | 5*(GetReadoutElement(iEl)->GetAxis(2)->GetXmax()-GetReadoutElement(iEl)->GetAxis(2)->GetXmin()), | |
646 | GetReadoutElement(iEl)->GetAxis(1)->GetXmin(), | |
647 | GetReadoutElement(iEl)->GetAxis(2)->GetXmax(), | |
648 | GetReadoutElement(iEl)->GetAxis(1)->GetXmax(), 1); | |
649 | } | |
650 | else { | |
651 | pave = new TPave(GetReadoutElement(iEl)->GetAxis(2)->GetXmin(), | |
652 | GetReadoutElement(iEl)->GetAxis(1)->GetXmin(), | |
653 | GetReadoutElement(iEl)->GetAxis(2)->GetXmin() + | |
654 | 5*(GetReadoutElement(iEl)->GetAxis(2)->GetXmax()-GetReadoutElement(iEl)->GetAxis(2)->GetXmin()), | |
655 | GetReadoutElement(iEl)->GetAxis(1)->GetXmax(), 1); | |
656 | } | |
657 | pave -> SetFillColor(kRed); | |
658 | pave -> Draw("same"); | |
659 | } | |
660 | ||
661 | } | |
662 | ||
663 | } | |
664 | ||
665 | //==================================================================================================================================================== | |
666 | ||
53b30119 | 667 | Int_t AliMFTPlane::GetNumberOfChips(Option_t *opt) { |
668 | ||
669 | Int_t nChips = 0; | |
670 | ||
671 | if (!strcmp(opt, "front")) { | |
672 | for (Int_t iEl=0; iEl<GetNActiveElements(); iEl++) { | |
673 | if (!IsFront(GetActiveElement(iEl))) continue; | |
674 | Double_t length = GetActiveElement(iEl)->GetAxis(0)->GetXmax() - GetActiveElement(iEl)->GetAxis(0)->GetXmin(); | |
675 | nChips += Int_t (length/AliMFTConstants::fWidthChip) + 1; | |
676 | } | |
677 | } | |
678 | ||
679 | else if (!strcmp(opt, "back")) { | |
680 | for (Int_t iEl=0; iEl<GetNActiveElements(); iEl++) { | |
681 | if (IsFront(GetActiveElement(iEl))) continue; | |
682 | Double_t length = GetActiveElement(iEl)->GetAxis(0)->GetXmax() - GetActiveElement(iEl)->GetAxis(0)->GetXmin(); | |
683 | nChips += Int_t (length/AliMFTConstants::fWidthChip) + 1; | |
684 | } | |
685 | } | |
686 | ||
687 | return nChips; | |
688 | ||
689 | } | |
690 | ||
691 | //==================================================================================================================================================== |