1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 /////////////////////////////////////////////////////////////////////////////////
22 // This class is for the modes of the TRD calibration.
23 // The user has to choose with the functions SetNz and SetNrphi
24 // the precision of the calibration.
26 // R. Bailhache (R.Bailhache@gsi.de)
33 <TR><TD><center>Nz</center></TD><TD><center> 0 </center></TD><TD><center> 1 </center></TD><TD><center> 2 </center></TD><TD><center> 3 </center></TD><TD><center> 4 </center></TD></TR>
34 <TR><TD><CENTER>group of row pads per detector</CENTER></TD><TD><CENTER>1</CENTER></TD><TD><CENTER>2</CENTER></TD><TD><CENTER>4</CENTER></TD><TD><CENTER>6(chamb2)<br> 8(others chambers)</CENTER></TD><TD><CENTER>12 (chamb2)<br> 16 (chamb0)</CENTER></TD></TR>
35 <TR><TD><CENTER>row pads per group</CENTER></TD><TD><CENTER>12 (chamb2)<br> 16 (chamb0)</CENTER></TD><TD><CENTER>6 (chamb2)<br> 8 (chamb0)</CENTER></TD><TD><CENTER>3 (chamb2)<br> 4 (chamb0)</CENTER></TD><TD><CENTER>2</CENTER></TD><TD><CENTER>1</CENTER></TD></TR>
36 <TR><TD><CENTER>~distance [cm]</CENTER></TD><TD><CENTER>106 (chamb2)<br> 130 (chamb0)</CENTER></TD><TD><CENTER>53 (chamb2)<br> 65 (chamb0)</CENTER></TD><TD><CENTER>26.5 (chamb2)<br> 32.5 (chamb0)</CENTER></TD><TD><CENTER>17 (chamb2)<br> 17 (chamb0)</CENTER></TD><TD><CENTER>9 (chamb2)<br> 9 (chamb0)</CENTER></TD></TR>
37 <CAPTION>In the z direction</CAPTION>
43 <TR><TD><center>Nrphi</center></TD><TD><center> 0 </center></TD><TD><center> 1 </center></TD><TD><center> 2 </center></TD><TD><center> 3 </center></TD><TD><center> 4 </center></TD><TD><center> 5 </center></TD><TD><center> 6 </center></TD></TR>
44 <TR><TD><CENTER>group of col pads per detector</CENTER></TD><TD><CENTER>1</CENTER></TD><TD><CENTER>2</CENTER></TD><TD><CENTER>4</CENTER></TD><TD><CENTER>8</CENTER></TD><TD><CENTER>16</CENTER></TD><TD><center>36</center></TD><TD><center>144</center></TD></TR>
45 <TR><TD><CENTER>col pads per group</CENTER></TD><TD><CENTER>144</CENTER></TD><TD><CENTER>72</CENTER></TD><TD><CENTER>36</CENTER></TD><TD><CENTER>18</CENTER></TD><TD><CENTER>9</CENTER></TD><TD><center>4</center></TD><TD><center>1</center></TD></TR>
46 <TR><TD><CENTER>~distance [cm]</CENTER></TD><TD><CENTER>113.4</CENTER></TD><TD><CENTER>56.7</CENTER></TD><TD><CENTER>25.3</CENTER></TD><TD><CENTER>14.3</CENTER></TD><TD><CENTER>7.25</CENTER></TD><TD><center>3.2</center></TD><TD><center>0.8</center></TD></TR>
47 <CAPTION>In the rphi direction</CAPTION>
55 //////////////////////////////////////////////////////////////////////////////////////
59 #include "AliTRDCalibraMode.h"
60 #include "AliTRDgeometry.h"
62 ClassImp(AliTRDCalibraMode)
64 //______________________________________________________________________________________
65 AliTRDCalibraMode::AliTRDCalibraMode()
70 // Default constructor
73 for (Int_t i = 0; i < 3; i++) {
78 for (Int_t k = 0; k < 3; k++) {
83 for (Int_t i = 0; i < 3; i++) {
95 fGeo = new AliTRDgeometry();
99 //______________________________________________________________________________________
100 AliTRDCalibraMode::AliTRDCalibraMode(const AliTRDCalibraMode &c)
108 for(Int_t k = 0; k < 3; k++){
110 fNrphi[k] = c.fNrphi[k];
112 fNnRphi[k] = c.fNnRphi[k];
113 fNfragZ[k] = c.fNfragZ[k];
114 fNfragRphi[k] = c.fNfragRphi[k];
115 fRowMin[k] = c.fRowMin[k];
116 fRowMax[k] = c.fRowMax[k];
117 fColMin[k] = c.fColMin[k];
118 fColMax[k] = c.fColMax[k];
119 fXbins[k] = c.fXbins[k];
120 fDetChamb0[k] = c.fDetChamb0[k];
121 fDetChamb2[k] = c.fDetChamb2[k];
127 fGeo = new AliTRDgeometry();
131 //____________________________________________________________________________________
132 AliTRDCalibraMode::~AliTRDCalibraMode()
135 // AliTRDCalibraMode destructor
144 //_____________________________________________________________________________
145 void AliTRDCalibraMode::SetNz(Int_t i, Short_t Nz)
148 // Set the mode of calibration group in the z direction for the parameter i
156 AliInfo("You have to choose between 0 and 4");
161 //_____________________________________________________________________________
162 void AliTRDCalibraMode::SetNrphi(Int_t i, Short_t Nrphi)
165 // Set the mode of calibration group in the rphi direction for the parameter i
173 AliInfo("You have to choose between 0 and 6");
178 //_______________________________________________________________________________________
179 void AliTRDCalibraMode::ModePadCalibration(Int_t iChamb, Int_t i)
182 // Definition of the calibration mode
183 // from Nz and Nrphi, the number of row and col pads per calibration groups are setted
190 if ((fNz[i] == 0) && (iChamb == 2)) {
193 if ((fNz[i] == 0) && (iChamb != 2)) {
196 if ((fNz[i] == 1) && (iChamb == 2)) {
199 if ((fNz[i] == 1) && (iChamb != 2)) {
202 if ((fNz[i] == 2) && (iChamb == 2)) {
205 if ((fNz[i] == 2) && (iChamb != 2)) {
215 if (fNrphi[i] == 0) {
218 if (fNrphi[i] == 1) {
221 if (fNrphi[i] == 2) {
224 if (fNrphi[i] == 3) {
227 if (fNrphi[i] == 4) {
230 if (fNrphi[i] == 5) {
233 if (fNrphi[i] == 6) {
239 //_____________________________________________________________________________________________
240 Bool_t AliTRDCalibraMode::ModePadFragmentation(Int_t iPlane,Int_t iChamb, Int_t iSect, Int_t i)
243 // Definition of the calibration mode
244 // From the number of row and col pads per calibration groups the
245 // number of calibration groups are setted
251 // A little geometry:
252 Int_t rowMax = fGeo->GetRowMax(iPlane,iChamb,iSect);
253 Int_t colMax = fGeo->GetColMax(iPlane);
257 fNfragZ[i] = (Int_t) rowMax / fNnZ[i];
260 if (fNnRphi[i] != 0) {
261 fNfragRphi[i] = (Int_t) colMax / fNnRphi[i];
268 //_____________________________________________________________________________
269 void AliTRDCalibraMode::ReconstructionRowPadGroup(Int_t idect, Int_t i)
272 // For the calibration group idect in a detector calculate the
273 // first and last row pad and col pad.
274 // The pads in the interval will have the same calibrated coefficients
284 if (fNfragZ[i] != 0) {
285 posc = (Int_t) idect / fNfragZ[i];
287 if (fNfragRphi[i] != 0) {
288 posr = (Int_t) idect % fNfragZ[i];
290 fRowMin[i] = posr * fNnZ[i];
291 fRowMax[i] = (posr+1) * fNnZ[i];
292 fColMin[i] = posc * fNnRphi[i];
293 fColMax[i] = (posc+1) * fNnRphi[i];
297 //_____________________________________________________________________________
298 void AliTRDCalibraMode::CalculXBins(Int_t idect, Int_t i)
301 // For the detector idect calcul the first Xbins
305 AliDebug(2, Form("detector: %d", idect));
308 Int_t sector = GetSector(idect);
309 fXbins[i] += sector*(6*fDetChamb2[i]+6*4*fDetChamb0[i]);
312 Int_t chamber = GetChamber(idect);
314 while (kc < chamber) {
316 fXbins[i] += 6 * fDetChamb2[i];
319 fXbins[i] += 6 * fDetChamb0[i];
325 Int_t plane = GetPlane(idect);
327 fXbins[i] += plane*fDetChamb2[i];
330 fXbins[i] += plane*fDetChamb0[i];
335 //_____________________________________________________________________________
336 void AliTRDCalibraMode::ResetMinMax(Int_t i)
339 // Reset fRowMin fRowMax fColMin fColMax [i]
349 //_____________________________________________________________________________
350 void AliTRDCalibraMode::SetDetChamb0(Int_t i)
353 // Set the number of calibration group per detector != 2
356 fDetChamb0[i] = fNfragZ[i] * fNfragRphi[i];
360 //_____________________________________________________________________________
361 void AliTRDCalibraMode::SetDetChamb2(Int_t i)
364 // Set the number of calibration group per detector == 2
367 fDetChamb2[i] = fNfragZ[i] * fNfragRphi[i];
371 //_____________________________________________________________________________
372 Int_t AliTRDCalibraMode::GetPlane(Int_t d) const
375 // Reconstruct the plane number from the detector number
378 return ((Int_t) (d % 6));
382 //_____________________________________________________________________________
383 Int_t AliTRDCalibraMode::GetChamber(Int_t d) const
386 // Reconstruct the chamber number from the detector number
391 return ((Int_t) (d % 30) / fgkNplan);
395 //_____________________________________________________________________________
396 Int_t AliTRDCalibraMode::GetSector(Int_t d) const
399 // Reconstruct the sector number from the detector number
404 return ((Int_t) (d / fg));