]> git.uio.no Git - u/mrichter/AliRoot.git/blob - VZERO/AliVZEROCalibData.cxx
Introducing event specie in QA (Yves)
[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 <TMath.h>
25
26 #include "AliVZEROCalibData.h"
27
28 ClassImp(AliVZEROCalibData)
29
30 //________________________________________________________________
31 AliVZEROCalibData::AliVZEROCalibData()
32 {
33   // 
34 }
35
36 //________________________________________________________________
37 void AliVZEROCalibData::Reset()
38 {
39   // reset 
40 }
41
42 //________________________________________________________________
43 AliVZEROCalibData::AliVZEROCalibData(const char* name)
44 {
45   TString namst = "Calib_";
46   namst += name;
47   SetName(namst.Data());
48   SetTitle(namst.Data());
49
50 }
51
52 //________________________________________________________________
53 AliVZEROCalibData::AliVZEROCalibData(const AliVZEROCalibData& calibda) :
54   TNamed(calibda)
55 {
56 // copy constructor
57
58   SetName(calibda.GetName());
59   SetTitle(calibda.GetName());
60   
61   for(int t=0; t<128; t++) { 
62       fPedestal[t] = calibda.GetPedestal(t);
63       fSigma[t]    = calibda.GetSigma(t);
64       fADCmean[t]  = calibda.GetADCmean(t);
65       fADCsigma[t] = calibda.GetADCsigma(t);
66       fGain[t]     = calibda.GetGain(t); }
67       
68   for(int t=0; t<64; t++) { 
69       fMeanHV[t]       = calibda.GetMeanHV(t);
70       fWidthHV[t]      = calibda.GetWidthHV(t);        
71       fTimeOffset[t]   = calibda.GetTimeOffset(t);
72       fTimeGain[t]     = calibda.GetTimeGain(t); }  
73   
74 }
75
76 //________________________________________________________________
77 AliVZEROCalibData &AliVZEROCalibData::operator =(const AliVZEROCalibData& calibda)
78 {
79 // assignment operator
80
81   SetName(calibda.GetName());
82   SetTitle(calibda.GetName());
83   
84   for(int t=0; t<128; t++) {
85       fPedestal[t] = calibda.GetPedestal(t);
86       fSigma[t]    = calibda.GetSigma(t);
87       fADCmean[t]  = calibda.GetADCmean(t);
88       fADCsigma[t] = calibda.GetADCsigma(t);
89       fGain[t]     = calibda.GetGain(t); }
90       
91   for(int t=0; t<64; t++) {
92       fMeanHV[t]       = calibda.GetMeanHV(t);
93       fWidthHV[t]      = calibda.GetWidthHV(t);        
94       fTimeOffset[t]   = calibda.GetTimeOffset(t);
95       fTimeGain[t]     = calibda.GetTimeGain(t); }   
96    
97   return *this;
98   
99 }
100
101 //________________________________________________________________
102 AliVZEROCalibData::~AliVZEROCalibData()
103 {
104   // destructor
105 }
106
107 //________________________________________________________________
108 void AliVZEROCalibData::SetPedestal(Float_t* Pedestal)
109 {
110   if(Pedestal) for(int t=0; t<128; t++) fPedestal[t] = Pedestal[t];
111   else for(int t=0; t<128; t++) fPedestal[t] = 0.0;
112 }
113
114 //________________________________________________________________
115 void AliVZEROCalibData::SetSigma(Float_t* Sigma)
116 {
117   if(Sigma) for(int t=0; t<128; t++) fSigma[t] = Sigma[t];
118   else for(int t=0; t<128; t++) fSigma[t] = 0.0;
119 }
120
121 //________________________________________________________________
122 void AliVZEROCalibData::SetADCmean(Float_t* ADCmean) 
123 {
124   if(ADCmean) for(int t=0; t<128; t++) fADCmean[t] = ADCmean[t];
125   else for(int t=0; t<128; t++) fADCmean[t] = 0.0;
126 }
127
128 //________________________________________________________________
129 void AliVZEROCalibData::SetADCsigma(Float_t* ADCsigma) 
130 {
131   if(ADCsigma) for(int t=0; t<128; t++) fADCsigma[t] = ADCsigma[t];
132   else for(int t=0; t<128; t++) fADCsigma[t] = 0.0;
133 }
134
135 //________________________________________________________________
136 void AliVZEROCalibData::SetMeanHV(Float_t* MeanHV) 
137 {
138   if(MeanHV) for(int t=0; t<64; t++) fMeanHV[t] = MeanHV[t];
139   else for(int t=0; t<64; t++) fMeanHV[t] = 0.0;
140 }
141
142 //________________________________________________________________
143 void AliVZEROCalibData::SetWidthHV(Float_t* WidthHV) 
144 {
145   if(WidthHV) for(int t=0; t<64; t++) fWidthHV[t] = WidthHV[t];
146   else for(int t=0; t<64; t++) fWidthHV[t] = 0.0;
147 }
148
149 //________________________________________________________________
150 void AliVZEROCalibData::SetGain(Float_t* Gain) 
151 {
152   if(Gain) for(int t=0; t<128; t++) fGain[t] = Gain[t];
153   else for(int t=0; t<128; t++) fGain[t] = 0.0;
154 }
155
156 //________________________________________________________________
157 void AliVZEROCalibData::SetTimeOffset(Float_t* TimeOffset) 
158 {
159   if(TimeOffset) for(int t=0; t<64; t++) fTimeOffset[t] = TimeOffset[t];
160   else for(int t=0; t<64; t++) fTimeOffset[t] = 0.0;
161 }
162
163 //________________________________________________________________
164 void AliVZEROCalibData::SetTimeGain(Float_t* TimeGain) 
165 {
166   if(TimeGain) for(int t=0; t<64; t++) fTimeGain[t] = TimeGain[t];
167   else for(int t=0; t<64; t++) fTimeGain[t] = 0.0;
168 }
169
170 //_____________________________________________________________________________
171 Float_t AliVZEROCalibData::GetMIPperADC(Int_t channel) const {
172         
173         // Computes the MIP conversion factor - MIP per ADC channel - 
174         // Argument passed is the PM number (aliroot numbering)
175         
176         Float_t P0[64] = {
177                 7.094891, 7.124938, 7.089708, 7.098169, 7.094482, 7.147250, 7.170978, 7.183392, 
178                 7.145760, 7.148096, 7.153840, 7.143544, 7.186069, 7.194580, 7.203516, 7.195176, 
179                 7.188333, 7.198607, 7.209412, 7.226565, 7.221695, 7.205132, 7.191238, 7.227724, 
180                 7.232810, 7.252655, 7.230309, 7.273518, 7.273518, 7.242969, 7.252859, 7.252655, 
181                 7.026802, 7.079913, 7.134147, 7.092387, 7.079561, 7.072848, 7.123192, 7.003141, 
182                 7.024667, 7.124784, 7.123442, 7.129744, 7.110671, 7.143031, 7.139439, 7.178109, 
183                 7.247803, 7.139396, 7.293809, 7.094454, 6.992198, 7.206448, 7.244765, 7.056197, 
184                 7.263595, 7.138569, 7.089582, 7.215683, 7.266183, 7.165123, 7.243276, 7.235135 };
185         Float_t P1[64] = {
186                 0.135569, 0.146405, 0.142425, 0.144278, 0.142307, 0.141648, 0.128477, 0.138239, 
187                 0.144173, 0.143419, 0.143572, 0.144482, 0.138024, 0.136542, 0.135955, 0.138537, 
188                 0.148521, 0.141999, 0.139627, 0.130014, 0.134970, 0.135635, 0.139094, 0.140634, 
189                 0.137971, 0.142080, 0.142793, 0.142778, 0.142778, 0.146045, 0.139133, 0.142080, 
190                 0.144121, 0.142311, 0.136564, 0.142686, 0.138792, 0.166285, 0.136387, 0.155391, 
191                 0.176082, 0.140408, 0.164738, 0.144270, 0.142766, 0.147486, 0.141951, 0.138012, 
192                 0.132394, 0.142849, 0.140477, 0.144592, 0.141558, 0.157646, 0.143758, 0.173385, 
193                 0.146489, 0.143279, 0.145230, 0.147203, 0.147333, 0.144979, 0.148597, 0.138985 };
194         
195         // High Voltage retrieval from Calibration Data Base:  
196         Float_t  HV = fMeanHV[channel];  
197         Float_t MIP = 0.5/TMath::Exp((TMath::Log(HV) - P0[channel] )/P1[channel]);
198         return MIP; 
199         
200 }
201