]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - VZERO/AliVZEROCalibData.cxx
Hopefully now Coverity will be happy
[u/mrichter/AliRoot.git] / VZERO / AliVZEROCalibData.cxx
index 4a9ca58cefd66a72f7c5c493ae9c19e0c3fe0323..ec315e228182e8e2328c0a8cbb2049e72a5282b0 100644 (file)
@@ -331,6 +331,20 @@ Float_t AliVZEROCalibData::GetMIPperADC(Int_t channel) {
        
 }
 
+//_____________________________________________________________________________
+Float_t AliVZEROCalibData::GetHV(Int_t channel, Float_t adcPerMip) {
+       
+  // Computes the HV value for certain ADC per MIP value
+  // Arguments passed is the PM number (aliroot numbering) and
+  // required value of ADC per MIP
+  if (!fPMGainsA) InitPMGains();
+
+  if (adcPerMip <= 0) return 0;
+  Float_t nPhPerMIP = (channel < 32) ? 6950 : 33690;
+  Float_t gain = adcPerMip/(nPhPerMIP*GetLightYields(channel)*0.18*TMath::Qe())*kChargePerADC;
+  return TMath::Exp((TMath::Log(gain)-fPMGainsA[channel])/fPMGainsB[channel]);
+}
+
 //________________________________________________________________
 Float_t AliVZEROCalibData::GetGain(Int_t channel)
 {
@@ -652,3 +666,30 @@ void  AliVZEROCalibData::InitPMGains()
     fPMGainsB[i] = gains->GetBinContent(i+1,2);
   }
 }
+
+Float_t AliVZEROCalibData::GetCalibDiscriThr(Int_t channel, Bool_t scaled)
+{
+  // The method returns actual TDC discri threshold
+  // extracted from the data.
+  //
+  // In case scaled flag is set the threshold is scaled
+  // so that to get 4.0 for a FEE threshold of 4.0.
+  // In this way we avoid a change in the slewing correction
+  // for the entire 2010 p-p data.
+  //
+  // The method is to be moved to OCDB object.
+
+  Float_t thr = GetDiscriThr(channel);
+
+  Float_t calThr = 0;
+  if (thr <= 1.) 
+    calThr = 3.1;
+  else if (thr >= 2.)
+    calThr = (3.1+1.15*thr-1.7);
+  else
+    calThr = (3.1-0.3*thr+0.3*thr*thr);
+
+  if (scaled) calThr *= 4./(3.1+1.15*4.-1.7);
+
+  return calThr;
+}