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 // Moreover two other more general granularities:
56 // It can not work with AliTRDCalibraVector
57 // 10 corresponds to per supermodule
60 //////////////////////////////////////////////////////////////////////////////////////
64 #include "AliTRDCalibraMode.h"
65 #include "AliTRDgeometry.h"
67 ClassImp(AliTRDCalibraMode)
69 //______________________________________________________________________________________
70 AliTRDCalibraMode::AliTRDCalibraMode()
75 // Default constructor
78 for (Int_t i = 0; i < 3; i++) {
83 for (Int_t k = 0; k < 3; k++) {
88 for (Int_t i = 0; i < 3; i++) {
100 fGeo = new AliTRDgeometry();
104 //______________________________________________________________________________________
105 AliTRDCalibraMode::AliTRDCalibraMode(const AliTRDCalibraMode &c)
113 for(Int_t k = 0; k < 3; k++){
115 fNrphi[k] = c.fNrphi[k];
117 fNnRphi[k] = c.fNnRphi[k];
118 fNfragZ[k] = c.fNfragZ[k];
119 fNfragRphi[k] = c.fNfragRphi[k];
120 fRowMin[k] = c.fRowMin[k];
121 fRowMax[k] = c.fRowMax[k];
122 fColMin[k] = c.fColMin[k];
123 fColMax[k] = c.fColMax[k];
124 fXbins[k] = c.fXbins[k];
125 fDetChamb0[k] = c.fDetChamb0[k];
126 fDetChamb2[k] = c.fDetChamb2[k];
132 fGeo = new AliTRDgeometry();
136 //____________________________________________________________________________________
137 AliTRDCalibraMode::~AliTRDCalibraMode()
140 // AliTRDCalibraMode destructor
149 //_____________________________________________________________________________
150 void AliTRDCalibraMode::SetPerSuperModule(Int_t i)
153 // Set the mode of calibration group per supermodule
160 //_____________________________________________________________________________
161 void AliTRDCalibraMode::SetAllTogether(Int_t i)
164 // Set the mode of calibration group all together
171 //_____________________________________________________________________________
172 void AliTRDCalibraMode::SetNz(Int_t i, Short_t Nz)
175 // Set the mode of calibration group in the z direction for the parameter i
183 AliInfo("You have to choose between 0 and 4.");
188 //_____________________________________________________________________________
189 void AliTRDCalibraMode::SetNrphi(Int_t i, Short_t Nrphi)
192 // Set the mode of calibration group in the rphi direction for the parameter i
200 AliInfo("You have to choose between 0 and 6 or 10/100.");
205 //_______________________________________________________________________________________
206 void AliTRDCalibraMode::ModePadCalibration(Int_t iChamb, Int_t i)
209 // Definition of the calibration mode
210 // from Nz and Nrphi, the number of row and col pads per calibration groups are setted
217 if (((fNz[i] == 0) || (fNz[i] == 10) || (fNz[i] == 100)) && (iChamb == 2)) {
220 if (((fNz[i] == 0) || (fNz[i] == 10) || (fNz[i] == 100)) && (iChamb != 2)) {
223 if ((fNz[i] == 1) && (iChamb == 2)) {
226 if ((fNz[i] == 1) && (iChamb != 2)) {
229 if ((fNz[i] == 2) && (iChamb == 2)) {
232 if ((fNz[i] == 2) && (iChamb != 2)) {
242 if ((fNrphi[i] == 0) || (fNrphi[i] == 10) || (fNrphi[i] == 100)) {
245 if (fNrphi[i] == 1) {
248 if (fNrphi[i] == 2) {
251 if (fNrphi[i] == 3) {
254 if (fNrphi[i] == 4) {
257 if (fNrphi[i] == 5) {
260 if (fNrphi[i] == 6) {
266 //_____________________________________________________________________________________________
267 Bool_t AliTRDCalibraMode::ModePadFragmentation(Int_t iLayer,Int_t iStack, Int_t iSect, Int_t i)
270 // Definition of the calibration mode
271 // From the number of row and col pads per calibration groups the
272 // number of calibration groups are setted
278 // A little geometry:
279 Int_t rowMax = fGeo->GetRowMax(iLayer,iStack,iSect);
280 Int_t colMax = fGeo->GetColMax(iLayer);
284 fNfragZ[i] = (Int_t) rowMax / fNnZ[i];
287 if (fNnRphi[i] != 0) {
288 fNfragRphi[i] = (Int_t) colMax / fNnRphi[i];
295 //_____________________________________________________________________________
296 void AliTRDCalibraMode::ReconstructionRowPadGroup(Int_t idect, Int_t i)
299 // For the calibration group idect in a detector calculate the
300 // first and last row pad and col pad.
301 // The pads in the interval will have the same calibrated coefficients
311 if (fNfragZ[i] != 0) {
312 posc = (Int_t) idect / fNfragZ[i];
314 if (fNfragRphi[i] != 0) {
315 posr = (Int_t) idect % fNfragZ[i];
317 fRowMin[i] = posr * fNnZ[i];
318 fRowMax[i] = (posr+1) * fNnZ[i];
319 fColMin[i] = posc * fNnRphi[i];
320 fColMax[i] = (posc+1) * fNnRphi[i];
324 //_____________________________________________________________________________
325 void AliTRDCalibraMode::CalculXBins(Int_t idect, Int_t i)
328 // For the detector idect calcul the first Xbins
332 AliDebug(2, Form("detector: %d", idect));
335 if((fNz[i] == 100) && (fNrphi[i] == 100)) {
341 Int_t sector = GetSector(idect);
344 // First per supermodule
345 if((fNz[i] == 10) && (fNrphi[i] == 10)) {
350 fXbins[i] += sector*(6*fDetChamb2[i]+6*4*fDetChamb0[i]);
353 Int_t stack = GetStack(idect);
357 fXbins[i] += 6 * fDetChamb2[i];
360 fXbins[i] += 6 * fDetChamb0[i];
366 Int_t layer = GetLayer(idect);
368 fXbins[i] += layer*fDetChamb2[i];
371 fXbins[i] += layer*fDetChamb0[i];
376 //_____________________________________________________________________________
377 void AliTRDCalibraMode::ResetMinMax(Int_t i)
380 // Reset fRowMin fRowMax fColMin fColMax [i]
390 //_____________________________________________________________________________
391 void AliTRDCalibraMode::SetDetChamb0(Int_t i)
394 // Set the number of calibration group per detector != 2
397 fDetChamb0[i] = fNfragZ[i] * fNfragRphi[i];
401 //_____________________________________________________________________________
402 void AliTRDCalibraMode::SetDetChamb2(Int_t i)
405 // Set the number of calibration group per detector == 2
408 fDetChamb2[i] = fNfragZ[i] * fNfragRphi[i];
412 //_____________________________________________________________________________
413 Int_t AliTRDCalibraMode::GetLayer(Int_t d) const
416 // Reconstruct the plane number from the detector number
419 return ((Int_t) (d % 6));
423 //_____________________________________________________________________________
424 Int_t AliTRDCalibraMode::GetStack(Int_t d) const
427 // Reconstruct the stack number from the detector number
430 const Int_t kNlayer = 6;
432 return ((Int_t) (d % 30) / kNlayer);
436 //_____________________________________________________________________________
437 Int_t AliTRDCalibraMode::GetSector(Int_t d) const
440 // Reconstruct the sector number from the detector number
445 return ((Int_t) (d / fg));