Digitizer goes directly from photons to amplified charge
authormbroz <Michal.Broz@cern.ch>
Thu, 29 Jan 2015 14:08:47 +0000 (15:08 +0100)
committermbroz <Michal.Broz@cern.ch>
Thu, 29 Jan 2015 14:08:47 +0000 (15:08 +0100)
AD/ADbase/AliADCalibData.cxx
AD/ADbase/AliADConst.h
AD/ADsim/AliADDigitizer.cxx
AD/macros/MakeADPMGainsEntry.C

index 7acf9ca..37f1304 100644 (file)
@@ -51,7 +51,7 @@ AliADCalibData::AliADCalibData():
   // default constructor
   
     for(int t=0; t<16; t++) {
-        fMeanHV[t]      = 1600.0;
+        fMeanHV[t]      = 1500.0;
         fWidthHV[t]     = 0.0; 
        fTimeOffset[t]  = 0.0;
         fTimeGain[t]    = 1.0;
@@ -314,7 +314,8 @@ Float_t AliADCalibData::GetGain(Int_t channel)
   Float_t hv = fMeanHV[channel];
   Float_t gain = 0;
   if (hv>0)
-    gain = TMath::Exp(fPMGainsA[channel]+fPMGainsB[channel]*TMath::Log(hv));
+    //gain = TMath::Exp(fPMGainsA[channel]+fPMGainsB[channel]*TMath::Log(hv));
+    gain = TMath::Power(hv/fPMGainsA[channel],fPMGainsB[channel])*kChargePerADC/kNPhotonsPerMIP;
   return gain;
 }
 
index 65d7b5f..96bb176 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef ALIVZEROCONST_H
-#define ALIVZEROCONST_H
+#ifndef ALIADCONST_H
+#define ALIADCONST_H
 
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. */
 
@@ -7,6 +7,7 @@ const Float_t kIntTimeRes = 0.39; // intrinsic time resolution of the scintillat
 const Float_t kADOffset = -1338.6; // general V0 offset between the TDCs and the trigger
 const Int_t   kNClocks = 21; // Number of ADC clocks that are read out
 const Float_t kChargePerADC = 0.6e-12; // Charge per ADC
+const Int_t   kNPhotonsPerMIP = 30000;// Number of photons per MIP
 const Int_t   kMinTDCWidth = 13; // minimum signal width measured by TDC
 const Int_t   kMaxTDCWidth = 128; // maximum signal width measured by TDC
 const Float_t kPMRespTime = 6.0; // PM response time (corresponds to 1.9 ns rise time)
index 1007fea..0fbde40 100644 (file)
@@ -308,29 +308,17 @@ void AliADDigitizer::DigitizeHits()
           Float_t t = dt_scintillator + hit->GetTof();
           //t += fHptdcOffset[pmt];
           
-          
-          Int_t nPhE;
-          Float_t prob = fCalibData->GetLightYields(pmt)*kPhotoCathodeEfficiency; // Optical losses included!
-          if (nPhot > 100)
-            nPhE = (Int_t)gRandom->Gaus(prob*Float_t(nPhot)+0.5,
-                                        sqrt(Float_t(nPhot)*prob*(1.-prob)));
-          else
-            nPhE = gRandom->Binomial(nPhot,prob);
-          Float_t charge = TMath::Qe()*fPmGain[pmt]*fBinSize[pmt]/integral;
-          
-          for (Int_t iPhE = 0; iPhE < nPhE; ++iPhE) {       
-            Float_t tPhE = t + fSignalShape->GetRandom(0,fBinSize[pmt]*Float_t(fNBins[pmt]));
+          Float_t charge = nPhot*fPmGain[pmt]*fBinSize[pmt]/integral;
             
-            Float_t gainVar = fSinglePhESpectrum->GetRandom(0,20)/meansPhE;
+            Float_t tPhE = t + fSignalShape->GetRandom(0,fBinSize[pmt]*Float_t(fNBins[pmt]));
             
             Int_t firstBin = TMath::Max(0,(Int_t)((tPhE-kPMRespTime)/fBinSize[pmt]));
             Int_t lastBin = TMath::Min(fNBins[pmt]-1,(Int_t)((tPhE+2.*kPMRespTime)/fBinSize[pmt]));
             
             for(Int_t iBin = firstBin; iBin <= lastBin; ++iBin) {
               Float_t tempT = fBinSize[pmt]*(0.5+iBin)-tPhE;
-              fTime[pmt][iBin] += gainVar*charge*fPMResponse->Eval(tempT);
+              fTime[pmt][iBin] += charge*fPMResponse->Eval(tempT);
             }
-          }         // ph.e. loop
          }           // hit loop
      }               // track loop
      loader->UnloadHits();
index 42f114e..a228e66 100644 (file)
@@ -7,8 +7,8 @@ void MakeADPMGainsEntry()
   // Creation of the PM gains OCDB object
   Double_t a[16] = {1012, 1203, 1021, 1083, 835, 1067, 1163, 1050,
                    1033, 1026, 1121, 1135, 1050, 1312, 957, 1013};
-  Double_t b[16] = {7.32, 8.91, 6.05, 6.57, 5.34, 6.64, 8,25, 6.44,
-                   7.24, 6.77, 6.85, 7.67, 4.86, 7.38, 5.48 , 7.13};
+  Double_t b[16] = {7.32, 8.91, 6.05, 6.57, 5.34, 6.64, 8.25, 6.44,
+                   7.24, 6.77, 6.85, 7.67, 4.86, 7.38, 5.48 ,7.13};
 
   TH2F *gains = new TH2F("ADPMGains","AD PM gain factors",16,-0.5,15.5,2,-0.5,1.5);
   for(Int_t channel = 0; channel < 16; ++channel) {