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 the precision of the calibration.
29 <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>
30 <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>
31 <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>
32 <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>
33 <CAPTION>In the z direction</CAPTION>
39 <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>
40 <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>
41 <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>
42 <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>
43 <CAPTION>In the rphi direction</CAPTION>
52 // R. Bailhache (R.Bailhache@gsi.de)
54 //////////////////////////////////////////////////////////////////////////////////////
58 #include "AliTRDCalibraMode.h"
59 #include "AliTRDgeometry.h"
61 ClassImp(AliTRDCalibraMode)
63 //______________________________________________________________________________________
64 AliTRDCalibraMode::AliTRDCalibraMode()
69 // Default constructor
72 for (Int_t i = 0; i < 3; i++) {
77 for (Int_t k = 0; k < 3; k++) {
82 for (Int_t i = 0; i < 3; i++) {
94 fGeo = new AliTRDgeometry();
98 //______________________________________________________________________________________
99 AliTRDCalibraMode::AliTRDCalibraMode(const AliTRDCalibraMode &c)
107 for(Int_t k = 0; k < 3; k++){
109 fNrphi[k] = c.fNrphi[k];
111 fNnRphi[k] = c.fNnRphi[k];
112 fNfragZ[k] = c.fNfragZ[k];
113 fNfragRphi[k] = c.fNfragRphi[k];
114 fRowMin[k] = c.fRowMin[k];
115 fRowMax[k] = c.fRowMax[k];
116 fColMin[k] = c.fColMin[k];
117 fColMax[k] = c.fColMax[k];
118 fXbins[k] = c.fXbins[k];
119 fDetChamb0[k] = c.fDetChamb0[k];
120 fDetChamb2[k] = c.fDetChamb2[k];
126 fGeo = new AliTRDgeometry();
130 //____________________________________________________________________________________
131 AliTRDCalibraMode::~AliTRDCalibraMode()
134 // AliTRDCalibraMode destructor
143 //_____________________________________________________________________________
144 void AliTRDCalibraMode::SetNz(Int_t i, Short_t Nz)
147 // Set the mode of calibration group in the z direction for the parameter i
155 AliInfo("You have to choose between 0 and 4");
160 //_____________________________________________________________________________
161 void AliTRDCalibraMode::SetNrphi(Int_t i, Short_t Nrphi)
164 // Set the mode of calibration group in the rphi direction for the parameter i
172 AliInfo("You have to choose between 0 and 6");
177 //_______________________________________________________________________________________
178 void AliTRDCalibraMode::ModePadCalibration(Int_t iChamb, Int_t i)
181 // Definition of the calibration mode
182 // from Nz and Nrphi, the number of row and col pads per calibration groups are setted
189 if ((fNz[i] == 0) && (iChamb == 2)) {
192 if ((fNz[i] == 0) && (iChamb != 2)) {
195 if ((fNz[i] == 1) && (iChamb == 2)) {
198 if ((fNz[i] == 1) && (iChamb != 2)) {
201 if ((fNz[i] == 2) && (iChamb == 2)) {
204 if ((fNz[i] == 2) && (iChamb != 2)) {
214 if (fNrphi[i] == 0) {
217 if (fNrphi[i] == 1) {
220 if (fNrphi[i] == 2) {
223 if (fNrphi[i] == 3) {
226 if (fNrphi[i] == 4) {
229 if (fNrphi[i] == 5) {
232 if (fNrphi[i] == 6) {
238 //_____________________________________________________________________________________________
239 Bool_t AliTRDCalibraMode::ModePadFragmentation(Int_t iPlane,Int_t iChamb, Int_t iSect, Int_t i)
242 // Definition of the calibration mode
243 // From the number of row and col pads per calibration groups the
244 // number of calibration groups are setted
250 // A little geometry:
251 Int_t rowMax = fGeo->GetRowMax(iPlane,iChamb,iSect);
252 Int_t colMax = fGeo->GetColMax(iPlane);
256 fNfragZ[i] = (Int_t) rowMax / fNnZ[i];
259 if (fNnRphi[i] != 0) {
260 fNfragRphi[i] = (Int_t) colMax / fNnRphi[i];
267 //_____________________________________________________________________________
268 void AliTRDCalibraMode::ReconstructionRowPadGroup(Int_t idect, Int_t i)
271 // For the calibration group idect in a detector calculate the
272 // first and last row pad and col pad.
273 // The pads in the interval will have the same calibrated coefficients
283 if (fNfragZ[i] != 0) {
284 posc = (Int_t) idect / fNfragZ[i];
286 if (fNfragRphi[i] != 0) {
287 posr = (Int_t) idect % fNfragZ[i];
289 fRowMin[i] = posr * fNnZ[i];
290 fRowMax[i] = (posr+1) * fNnZ[i];
291 fColMin[i] = posc * fNnRphi[i];
292 fColMax[i] = (posc+1) * fNnRphi[i];
296 //_____________________________________________________________________________
297 void AliTRDCalibraMode::CalculXBins(Int_t idect, Int_t i)
300 // For the detector idect calcul the first Xbins
304 AliDebug(2, Form("detector: %d", idect));
307 Int_t sector = GetSector(idect);
308 fXbins[i] += sector*(6*fDetChamb2[i]+6*4*fDetChamb0[i]);
311 Int_t chamber = GetChamber(idect);
313 while (kc < chamber) {
315 fXbins[i] += 6 * fDetChamb2[i];
318 fXbins[i] += 6 * fDetChamb0[i];
324 Int_t plane = GetPlane(idect);
326 fXbins[i] += plane*fDetChamb2[i];
329 fXbins[i] += plane*fDetChamb0[i];
334 //_____________________________________________________________________________
335 void AliTRDCalibraMode::ResetMinMax(Int_t i)
338 // Reset fRowMin fRowMax fColMin fColMax [i]
348 //_____________________________________________________________________________
349 void AliTRDCalibraMode::SetDetChamb0(Int_t i)
352 // Set the number of calibration group per detector != 2
355 fDetChamb0[i] = fNfragZ[i] * fNfragRphi[i];
359 //_____________________________________________________________________________
360 void AliTRDCalibraMode::SetDetChamb2(Int_t i)
363 // Set the number of calibration group per detector == 2
366 fDetChamb2[i] = fNfragZ[i] * fNfragRphi[i];
370 //_____________________________________________________________________________
371 Int_t AliTRDCalibraMode::GetPlane(Int_t d) const
374 // Reconstruct the plane number from the detector number
377 return ((Int_t) (d % 6));
381 //_____________________________________________________________________________
382 Int_t AliTRDCalibraMode::GetChamber(Int_t d) const
385 // Reconstruct the chamber number from the detector number
390 return ((Int_t) (d % 30) / fgkNplan);
394 //_____________________________________________________________________________
395 Int_t AliTRDCalibraMode::GetSector(Int_t d) const
398 // Reconstruct the sector number from the detector number
403 return ((Int_t) (d / fg));