OCDB calib data: removal of gain values. Will be put in a separate OCDB entry as...
[u/mrichter/AliRoot.git] / VZERO / AliVZEROCalibData.cxx
index d124682..9527dc4 100644 (file)
@@ -50,7 +50,6 @@ AliVZEROCalibData::AliVZEROCalibData()
         fSigma[t]       = 0.0;        
         fADCmean[t]     = 0.0;      
         fADCsigma[t]    = 0.0;
-        fGain[t]        = 1.0;
     }
     for(int i=0; i<kNCIUBoards ;i++) {
        fTimeResolution[i]  = 25./256.;     // Default time resolution
@@ -90,7 +89,6 @@ AliVZEROCalibData::AliVZEROCalibData(const char* name)
        fSigma[t]       = 0.0;        
        fADCmean[t]     = 0.0;      
        fADCsigma[t]    = 0.0;
-       fGain[t]        = 1.0;
    }
    for(int i=0; i<kNCIUBoards ;i++) {
        fTimeResolution[i]  = 25./256.;    // Default time resolution in ns / channel
@@ -116,8 +114,7 @@ AliVZEROCalibData::AliVZEROCalibData(const AliVZEROCalibData& calibda) :
       fPedestal[t] = calibda.GetPedestal(t);
       fSigma[t]    = calibda.GetSigma(t);
       fADCmean[t]  = calibda.GetADCmean(t);
-      fADCsigma[t] = calibda.GetADCsigma(t);
-      fGain[t]     = calibda.GetGain(t); }
+      fADCsigma[t] = calibda.GetADCsigma(t); }
       
   for(int t=0; t<64; t++) { 
       fMeanHV[t]       = calibda.GetMeanHV(t);
@@ -151,8 +148,7 @@ AliVZEROCalibData &AliVZEROCalibData::operator =(const AliVZEROCalibData& calibd
       fPedestal[t] = calibda.GetPedestal(t);
       fSigma[t]    = calibda.GetSigma(t);
       fADCmean[t]  = calibda.GetADCmean(t);
-      fADCsigma[t] = calibda.GetADCsigma(t);
-      fGain[t]     = calibda.GetGain(t); }
+      fADCsigma[t] = calibda.GetADCsigma(t); }
       
   for(int t=0; t<64; t++) {
       fMeanHV[t]       = calibda.GetMeanHV(t);
@@ -278,13 +274,6 @@ void AliVZEROCalibData::SetDeadMap(const Bool_t* deadMap)
   else for(int t=0; t<64; t++) fDeadChannel[t] = kFALSE;
 }
 
-//________________________________________________________________
-void AliVZEROCalibData::SetGain(const Float_t* Gain) 
-{
-  if(Gain) for(int t=0; t<128; t++) fGain[t] = Gain[t];
-  else for(int t=0; t<128; t++) fGain[t] = 0.0;
-}
-
 //________________________________________________________________
 void AliVZEROCalibData::SetTimeOffset(Float_t val, Int_t channel)
 {
@@ -343,6 +332,37 @@ Float_t AliVZEROCalibData::GetMIPperADC(Int_t channel) const {
        return mip; 
        
 }
+
+//________________________________________________________________
+Float_t AliVZEROCalibData::GetGain(Int_t channel) const
+{
+  // Computes the PM gain factors
+  // Argument passed is the PM number (aliroot numbering)
+  Float_t a[64] = {-39.68,-35.83,-36.92,-36.42,-37.02,-37.50,-43.05,-39.39,
+                  -36.62,-36.93,-37.30,-36.46,-39.51,-40.32,-39.92,-39.20,
+                  -35.39,-37.95,-38.85,-42.76,-40.68,-40.32,-39.00,-37.36,
+                  -39.64,-38.86,-37.59,-39.59,-37.97,-36.32,-38.88,-41.35,
+                  -36.01,-36.82,-39.48,-36.86,-38.22,-32.55,-39.44,-35.08,
+                  -29.91,-37.88,-33.25,-36.49,-37.25,-35.89,-40.31,-39.15,
+                  -41.71,-37.07,-38.94,-36.04,-36.62,-32.96,-36.99,-30.71,
+                  -36.66,-37.23,-35.98,-36.56,-35.64,-36.97,-35.88,-38.78};
+  Float_t b[64] = {  7.40,  6.83,  7.02,  6.94,  7.03,  7.04,  7.79,  7.27,
+                    6.92,  6.96,  7.01,  6.90,  7.28,  7.38,  7.33,  7.23,
+                    6.71,  7.05,  7.17,  7.69,  7.41,  7.38,  7.21,  7.11,
+                    7.26,  7.12,  6.98,  7.35,  6.99,  6.79,  7.13,  7.58,
+                    6.95,  7.01,  7.33,  7.01,  7.21,  6.01,  7.34,  6.44,
+                    5.68,  7.12,  6.07,  6.92,  7.04,  6.82,  7.04,  7.24,
+                    7.53,  6.99,  7.10,  6.89,  7.07,  6.35,  6.88,  5.77,
+                    6.81,  7.01,  6.89,  6.84,  6.68,  6.95,  6.73,  7.14};
+
+  // High Voltage retrieval from Calibration Data Base:  
+  Float_t hv = fMeanHV[channel];
+  Float_t gain = 0;
+  if (hv>0)
+    gain = TMath::Exp(a[channel]+b[channel]*TMath::Log(hv));
+  return gain;
+}
+
 //________________________________________________________________
 void AliVZEROCalibData::SetTimeResolution(UShort_t *resols){
        // Set Time Resolution of the TDC