Modified file access mode
[u/mrichter/AliRoot.git] / VZERO / AliVZEROCalibData.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: AliVZEROCalibData.cxx,                                            */
17
18 /////////////////////////////////////////////////////////////////////////////
19 //                                                                         //
20 // class for VZERO calibration                                             //
21 //                                                                         //
22 /////////////////////////////////////////////////////////////////////////////
23
24 #include "AliVZEROCalibData.h"
25
26 ClassImp(AliVZEROCalibData)
27
28 //________________________________________________________________
29 AliVZEROCalibData::AliVZEROCalibData()
30 {
31   // 
32 }
33
34 //________________________________________________________________
35 void AliVZEROCalibData::Reset()
36 {
37   // reset 
38 }
39
40 //________________________________________________________________
41 AliVZEROCalibData::AliVZEROCalibData(const char* name)
42 {
43   TString namst = "Calib_";
44   namst += name;
45   SetName(namst.Data());
46   SetTitle(namst.Data());
47
48 }
49
50 //________________________________________________________________
51 AliVZEROCalibData::AliVZEROCalibData(const AliVZEROCalibData& calibda) :
52   TNamed(calibda)
53 {
54 // copy constructor
55
56   SetName(calibda.GetName());
57   SetTitle(calibda.GetName());
58   
59   for(int t=0; t<128; t++) { 
60       fPedestal[t] = calibda.GetPedestal(t);
61       fSigma[t]    = calibda.GetSigma(t);
62       fGain[t]     = calibda.GetGain(t); }
63       
64   for(int t=0; t<64; t++) { 
65       fTimeOffset[t]   = calibda.GetTimeOffset(t);
66       fTimeGain[t]     = calibda.GetTimeGain(t); 
67       fMeanHV[t]       = calibda.GetMeanHV(t);
68       fWidthHV[t]      = calibda.GetWidthHV(t); }   
69   
70 }
71
72 //________________________________________________________________
73 AliVZEROCalibData &AliVZEROCalibData::operator =(const AliVZEROCalibData& calibda)
74 {
75 // assignment operator
76
77   SetName(calibda.GetName());
78   SetTitle(calibda.GetName());
79   
80   for(int t=0; t<128; t++) {
81       fPedestal[t] = calibda.GetPedestal(t);
82       fSigma[t]    = calibda.GetSigma(t);
83       fGain[t]     = calibda.GetGain(t); }
84       
85   for(int t=0; t<64; t++) { 
86       fTimeOffset[t]   = calibda.GetTimeOffset(t);
87       fTimeGain[t]     = calibda.GetTimeGain(t); 
88       fMeanHV[t]       = calibda.GetMeanHV(t);
89       fWidthHV[t]      = calibda.GetWidthHV(t); }     
90   
91   return *this;
92   
93 }
94
95 //________________________________________________________________
96 AliVZEROCalibData::~AliVZEROCalibData()
97 {
98   // destructor
99 }
100
101                                                                                    
102
103 //________________________________________________________________
104 void AliVZEROCalibData::SetPedestal(Float_t* Pedestal)
105 {
106   if(Pedestal) for(int t=0; t<128; t++) fPedestal[t] = Pedestal[t];
107   else for(int t=0; t<128; t++) fPedestal[t] = 0.0;
108 }
109
110 //________________________________________________________________
111 void AliVZEROCalibData::SetSigma(Float_t* Sigma)
112 {
113   if(Sigma) for(int t=0; t<128; t++) fSigma[t] = Sigma[t];
114   else for(int t=0; t<128; t++) fSigma[t] = 0.0;
115 }
116
117 //________________________________________________________________
118 void AliVZEROCalibData::SetGain(Float_t* Gain) 
119 {
120   if(Gain) for(int t=0; t<128; t++) fGain[t] = Gain[t];
121   else for(int t=0; t<128; t++) fGain[t] = 0.0;
122 }
123
124 //________________________________________________________________
125 void AliVZEROCalibData::SetTimeOffset(Float_t* TimeOffset) 
126 {
127   if(TimeOffset) for(int t=0; t<64; t++) fTimeOffset[t] = TimeOffset[t];
128   else for(int t=0; t<64; t++) fTimeOffset[t] = 0.0;
129 }
130
131 //________________________________________________________________
132 void AliVZEROCalibData::SetTimeGain(Float_t* TimeGain) 
133 {
134   if(TimeGain) for(int t=0; t<64; t++) fTimeGain[t] = TimeGain[t];
135   else for(int t=0; t<64; t++) fTimeGain[t] = 0.0;
136 }
137
138 //________________________________________________________________
139 void AliVZEROCalibData::SetMeanHV(Float_t* MeanHVs) 
140 {
141   if(MeanHVs) for(int t=0; t<64; t++) fMeanHV[t] = MeanHVs[t];
142   else for(int t=0; t<64; t++) fMeanHV[t] = 0.0;
143 }
144
145 //________________________________________________________________
146 void AliVZEROCalibData::SetWidthHV(Float_t* WidthHVs) 
147 {
148   if(WidthHVs) for(int t=0; t<64; t++) fWidthHV[t] = WidthHVs[t];
149   else for(int t=0; t<64; t++) fWidthHV[t] = 0.0;
150 }