]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSEmcCalibData.cxx
Loaders removed from the reconstruction code (C.Cheshkov)
[u/mrichter/AliRoot.git] / PHOS / AliPHOSEmcCalibData.cxx
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 PHOS EmCal calibration                                          //
19 //                                                                           //
20 ///////////////////////////////////////////////////////////////////////////////
21
22 #include "AliPHOSEmcCalibData.h"
23
24 ClassImp(AliPHOSEmcCalibData)
25
26 //________________________________________________________________
27   AliPHOSEmcCalibData::AliPHOSEmcCalibData(): TNamed()
28 {
29   // Default constructor
30   Reset();
31 }
32
33 //________________________________________________________________
34 AliPHOSEmcCalibData::AliPHOSEmcCalibData(const char* name)
35 {
36   // Constructor
37   TString namst = "Calib_";
38   namst += name;
39   SetName(namst.Data());
40   SetTitle(namst.Data());
41   Reset();
42 }
43
44 //________________________________________________________________
45 AliPHOSEmcCalibData::AliPHOSEmcCalibData(const AliPHOSEmcCalibData& calibda) :
46   TNamed(calibda)
47 {
48   // copy constructor
49   SetName(calibda.GetName());
50   SetTitle(calibda.GetName());
51
52   for(Int_t module=0; module<5; module++) {
53     for(Int_t column=0; column<56; column++) {
54       for(Int_t row=0; row<64; row++) {
55         fADCchannelEmc[module][column][row] = calibda.fADCchannelEmc[module][column][row];
56         fADCpedestalEmc[module][column][row] = calibda.fADCpedestalEmc[module][column][row];
57       }
58     }
59   }
60 }
61
62 //________________________________________________________________
63 AliPHOSEmcCalibData &AliPHOSEmcCalibData::operator =(const AliPHOSEmcCalibData& calibda)
64 {
65   // assignment operator
66
67   if(this != &calibda) { 
68
69     SetName(calibda.GetName());
70     SetTitle(calibda.GetName());
71
72     for(Int_t module=0; module<5; module++) {
73       for(Int_t column=0; column<56; column++) {
74         for(Int_t row=0; row<64; row++) {
75           fADCchannelEmc[module][column][row] = calibda.fADCchannelEmc[module][column][row];
76           fADCpedestalEmc[module][column][row] = calibda.fADCpedestalEmc[module][column][row];
77         }
78       }
79     }
80   }
81
82   return *this;
83 }
84
85 //________________________________________________________________
86 AliPHOSEmcCalibData::~AliPHOSEmcCalibData()
87 {
88   // Destructor
89 }
90
91 //________________________________________________________________
92 void AliPHOSEmcCalibData::Reset()
93 {
94   // Set all pedestals and all ADC channels to its ideal values = 1.
95
96   for (Int_t module=0; module<5; module++){
97     for (Int_t column=0; column<56; column++){
98       for (Int_t row=0; row<64; row++){
99         fADCpedestalEmc[module][column][row] = 0.;
100         fADCchannelEmc[module][column][row]  = 1.;
101       }
102     }
103   }
104
105 }
106
107 //________________________________________________________________
108 void  AliPHOSEmcCalibData::Print(Option_t *option) const
109 {
110   // Print tables of pedestals and ADC channels
111
112   if (strstr(option,"ped")) {
113     printf("\n  ----    EMC Pedestal values     ----\n\n");
114     for (Int_t module=0; module<5; module++){
115       printf("============== Module %d\n",module+1);
116       for (Int_t column=0; column<56; column++){
117         for (Int_t row=0; row<64; row++){
118           printf("%4.1f",fADCpedestalEmc[module][column][row]);
119         }
120         printf("\n");
121       }
122     }
123   }
124
125   if (strstr(option,"gain")) {
126     printf("\n  ----    EMC ADC channel values  ----\n\n");
127     for (Int_t module=0; module<5; module++){
128       printf("============== Module %d\n",module+1);
129       for (Int_t column=0; column<56; column++){
130         for (Int_t row=0; row<64; row++){
131           printf("%4.1f",fADCchannelEmc[module][column][row]);
132         }
133         printf("\n");
134       }
135     }
136   }
137 }
138
139 //________________________________________________________________
140 Float_t AliPHOSEmcCalibData::GetADCchannelEmc(Int_t module, Int_t column, Int_t row) const
141 {
142   //Return EMC calibration coefficient
143   //module, column,raw should follow the internal PHOS convention:
144   //module 1:5, column 1:56, row 1:64
145
146   return fADCchannelEmc[module-1][column-1][row-1];
147 }
148
149 //________________________________________________________________
150 Float_t AliPHOSEmcCalibData::GetADCpedestalEmc(Int_t module, Int_t column, Int_t row) const
151 {
152   //Return EMC pedestal
153   //module, column,raw should follow the internal PHOS convention:
154   //module 1:5, column 1:56, row 1:64
155
156   return fADCpedestalEmc[module-1][column-1][row-1];
157 }
158
159 //________________________________________________________________
160 void AliPHOSEmcCalibData::SetADCchannelEmc(Int_t module, Int_t column, Int_t row, Float_t value)
161 {
162   //Set EMC calibration coefficient
163   //module, column,raw should follow the internal PHOS convention:
164   //module 1:5, column 1:56, row 1:64
165
166   fADCchannelEmc[module-1][column-1][row-1] = value;
167 }
168
169 //________________________________________________________________
170 void AliPHOSEmcCalibData::SetADCpedestalEmc(Int_t module, Int_t column, Int_t row, Float_t value)
171 {
172   //Set EMC pedestal
173   //module, column,raw should follow the internal PHOS convention:
174   //module 1:5, column 1:56, row 1:64
175   fADCpedestalEmc[module-1][column-1][row-1] = value;
176 }