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 **************************************************************************/
17 ///////////////////////////////////////////////////////////////////////////////
19 // class for CPV calibration. //
20 // Author: Boris Polichtchouk (Boris.Polichtchouk@cern.ch). //
22 ///////////////////////////////////////////////////////////////////////////////
24 #include "AliPHOSCpvCalibData.h"
26 ClassImp(AliPHOSCpvCalibData)
28 //________________________________________________________________
29 AliPHOSCpvCalibData::AliPHOSCpvCalibData() : TNamed()
31 // Default constructor
35 //________________________________________________________________
36 AliPHOSCpvCalibData::AliPHOSCpvCalibData(const char* name)
39 TString namst = "CalibCPV_";
41 SetName(namst.Data());
42 SetTitle(namst.Data());
46 //________________________________________________________________
47 AliPHOSCpvCalibData::AliPHOSCpvCalibData(const AliPHOSCpvCalibData& calibda) :
51 SetName(calibda.GetName());
52 SetTitle(calibda.GetName());
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<128; row++) {
57 fADCchannelCpv[module][column][row] = calibda.GetADCchannelCpv(module,column,row);
58 fADCpedestalCpv[module][column][row] = calibda.GetADCpedestalCpv(module,column,row);
64 //________________________________________________________________
65 AliPHOSCpvCalibData &AliPHOSCpvCalibData::operator =(const AliPHOSCpvCalibData& calibda)
67 // assignment operator
68 SetName(calibda.GetName());
69 SetTitle(calibda.GetName());
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<128; row++) {
74 fADCchannelCpv[module][column][row] = calibda.GetADCchannelCpv(module,column,row);
75 fADCpedestalCpv[module][column][row] = calibda.GetADCpedestalCpv(module,column,row);
82 //________________________________________________________________
83 AliPHOSCpvCalibData::~AliPHOSCpvCalibData()
88 //________________________________________________________________
89 void AliPHOSCpvCalibData::Reset()
91 // Set all pedestals and all ADC channels to its default (ideal) values.
93 for (Int_t module=0; module<5; module++){
94 for (Int_t column=0; column<56; column++){
95 for (Int_t row=0; row<128; row++){
96 fADCpedestalCpv[module][column][row] = 0.012;
97 fADCchannelCpv[module][column][row] = 0.0012;
104 //________________________________________________________________
105 void AliPHOSCpvCalibData::Print(Option_t *option) const
107 // Print tables of pedestals and ADC channels
109 if (strstr(option,"ped")) {
110 printf("\n ---- Pedestal values ----\n\n");
111 for (Int_t module=0; module<5; module++){
112 printf("============== Module %d\n",module+1);
113 for (Int_t column=0; column<56; column++){
114 for (Int_t row=0; row<128; row++){
115 printf("%4.1f",fADCpedestalCpv[module][column][row]);
122 if (strstr(option,"gain")) {
123 printf("\n ---- ADC channel values ----\n\n");
124 for (Int_t module=0; module<5; module++){
125 printf("============== Module %d\n",module+1);
126 for (Int_t column=0; column<56; column++){
127 for (Int_t row=0; row<128; row++){
128 printf("%4.1f",fADCchannelCpv[module][column][row]);
136 //________________________________________________________________
137 Float_t AliPHOSCpvCalibData::GetADCchannelCpv(Int_t module, Int_t column, Int_t row) const
139 //Return CPV calibration coefficient
140 //module, column,raw should follow the internal PHOS convention:
141 //module 1:5, column 1:56, row 1:128.
143 return fADCchannelCpv[module-1][column-1][row-1];
146 //________________________________________________________________
147 Float_t AliPHOSCpvCalibData::GetADCpedestalCpv(Int_t module, Int_t column, Int_t row) const
149 //Return CPV pedestal
150 //module, column,raw should follow the internal PHOS convention:
151 //module 1:5, column 1:56, row 1:128.
152 return fADCpedestalCpv[module-1][column-1][row-1];
155 //________________________________________________________________
156 void AliPHOSCpvCalibData::SetADCchannelCpv(Int_t module, Int_t column, Int_t row, Float_t value)
158 //Set CPV calibration coefficient
159 //module, column,raw should follow the internal PHOS convention:
160 //module 1:5, column 1:56, row 1:128.
161 fADCchannelCpv[module-1][column-1][row-1] = value;
164 //________________________________________________________________
165 void AliPHOSCpvCalibData::SetADCpedestalCpv(Int_t module, Int_t column, Int_t row, Float_t value)
168 //module, column,raw should follow the internal PHOS convention:
169 //module 1:5, column 1:56, row 1:128.
170 fADCpedestalCpv[module-1][column-1][row-1] = value;