]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PMD/AliPMDDigitizer.cxx
Calculation of new variables needed for Non-id HBT added. (Z. Chajecki)
[u/mrichter/AliRoot.git] / PMD / AliPMDDigitizer.cxx
index df8010ea54d34e6f328aa0abb180873cd3cfe68f..c5fd1439f7f1b840262e04e7f12f9ef7a6a0e752 100644 (file)
@@ -675,11 +675,11 @@ void AliPMDDigitizer::Hits2Digits(Int_t ievt)
                    }
                } // column loop
            } // row    loop
+         treeD->Fill();
+         ResetDigit();
        } // supermodule loop
-      treeD->Fill();
-      ResetDigit();
     } // detector loop
-
+  
   fPMDLoader->WriteDigits("OVERWRITE");
   ResetCellADC();
   
@@ -775,7 +775,7 @@ void AliPMDDigitizer::Exec(Option_t *option)
     {
       cerr<<"AliPMDDigitizer::Exec : Can not find PMD or PMDLoader\n";
     }
-  fPMDLoader->LoadDigits("recreate");
+  fPMDLoader->LoadDigits("update");
   TTree* treeD = fPMDLoader->TreeD();
   if (treeD == 0x0)
     {
@@ -822,9 +822,9 @@ void AliPMDDigitizer::Exec(Option_t *option)
          ResetDigit();
        } // supermodule loop
     } // detector loop
-  ResetCellADC();
-
   fPMDLoader->WriteDigits("OVERWRITE");  
+  fPMDLoader->UnloadDigits();
+  ResetCellADC();
 }
 //____________________________________________________________________________
 
@@ -1098,7 +1098,41 @@ void AliPMDDigitizer::MeV2ADC(Float_t mev, Float_t & adc) const
   // Test Beam Data
   // To be done
   //
-  adc = mev*1.;
+
+  //  adc = mev*1.;
+
+  
+  // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% //
+  // PS Test in September 2003
+  // MeV - ADC conversion for 10bit ADC
+
+  const Float_t kConstant   = 7.181;
+  const Float_t kErConstant = 0.6899;
+  const Float_t kSlope      = 35.93;
+  const Float_t kErSlope    = 0.306;
+
+  //gRandom->SetSeed();
+
+  Float_t cons   = gRandom->Gaus(kConstant,kErConstant);
+  Float_t slop   = gRandom->Gaus(kSlope,kErSlope);
+
+  Float_t adc10bit = slop*mev*0.001 + cons;
+
+  // 12 bit adc
+
+  Int_t adc12bit = (Int_t) (4.0*adc10bit);
+
+  if(adc12bit < 3000)
+    {
+      adc = (Float_t) adc12bit;
+    }
+  else if (adc12bit >= 3000)
+    {
+      adc = 3000.0;
+    }
+
+  // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% //
+
 }
 //____________________________________________________________________________
 void AliPMDDigitizer::AddSDigit(Int_t trnumber, Int_t det, Int_t smnumber,