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