]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSCalibData.cxx
Corrections for gcc 4.0
[u/mrichter/AliRoot.git] / PHOS / AliPHOSCalibData.cxx
CommitLineData
52783dbc 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
26ClassImp(AliPHOSCalibData)
27
28//________________________________________________________________
29AliPHOSCalibData::AliPHOSCalibData()
30{
31 // Default constructor
32 Reset();
33}
34
35//________________________________________________________________
36AliPHOSCalibData::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//________________________________________________________________
47AliPHOSCalibData::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<64; 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//________________________________________________________________
65AliPHOSCalibData &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<64; 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//________________________________________________________________
83AliPHOSCalibData::~AliPHOSCalibData()
84{
85 // Destructor
86}
87
88//________________________________________________________________
89void AliPHOSCalibData::Reset()
90{
91 // Set all pedestals to 0 and all ADC channels to 1
92 memset(fADCchannelEmc ,0,5*64*56*sizeof(Float_t));
93 memset(fADCpedestalEmc,1,5*64*56*sizeof(Float_t));
94}
95
96//________________________________________________________________
97void AliPHOSCalibData::Print(Option_t *option) const
98{
99 // Print tables of pedestals and ADC channels
100
13a9232b 101 if (strstr(option,"ped")) {
52783dbc 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<64; 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
13a9232b 114 if (strstr(option,"gain")) {
52783dbc 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<64; 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}