]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PMD/AliPMDDigitizer.cxx
cables and girders, modular geometry easy to turn off
[u/mrichter/AliRoot.git] / PMD / AliPMDDigitizer.cxx
index b0f6155a98976c64412b358957400b0fbc7f98ca..ff7143d2f3e9e349f1914758d07e6b316bc3cf59 100644 (file)
@@ -365,8 +365,7 @@ void AliPMDDigitizer::Hits2SDigits(Int_t ievt)
              edep       = fPMDHit->GetEnergy();
              Int_t vol1 = fPMDHit->GetVolume(1); // Column
              Int_t vol2 = fPMDHit->GetVolume(2); // Row
-             Int_t vol7 = fPMDHit->GetVolume(7); // UnitModule
-             Int_t vol8 = fPMDHit->GetVolume(8); // SuperModule
+             Int_t vol7 = fPMDHit->GetVolume(4); // Serial Module No
 
 
              // -----------------------------------------//
@@ -377,9 +376,15 @@ void AliPMDDigitizer::Hits2SDigits(Int_t ievt)
              //  nrow = 96, ncol = 48                    //
              // -----------------------------------------//
 
-
-             
-             smnumber = (vol8-1)*6 + vol7;
+             if (vol7 < 24)
+               {
+                 smnumber = vol7;
+               }
+             else
+               {
+                 smnumber = vol7 - 24;
+               }
+             Int_t vol8 = smnumber/6 + 1;   // fake supermodule
 
              if (vol8 == 1 || vol8 == 2)
                {
@@ -404,7 +409,8 @@ void AliPMDDigitizer::Hits2SDigits(Int_t ievt)
                  // PMD
                  fDetNo = 0;
                }
-             Int_t smn = smnumber - 1;
+             //Int_t smn = smnumber - 1;
+             Int_t smn = smnumber;
              Int_t ixx = xpad     - 1;
              Int_t iyy = ypad     - 1;
              if (fDetNo == 0)
@@ -590,9 +596,7 @@ void AliPMDDigitizer::Hits2Digits(Int_t ievt)
              edep       = fPMDHit->GetEnergy();
              Int_t vol1 = fPMDHit->GetVolume(1); // Column
              Int_t vol2 = fPMDHit->GetVolume(2); // Row
-             Int_t vol7 = fPMDHit->GetVolume(7); // UnitModule
-             Int_t vol8 = fPMDHit->GetVolume(8); // SuperModule
-
+             Int_t vol7 = fPMDHit->GetVolume(4); // Serial Module No
 
              // -----------------------------------------//
              // In new geometry after adding electronics //
@@ -602,7 +606,15 @@ void AliPMDDigitizer::Hits2Digits(Int_t ievt)
              //  nrow = 96, ncol = 48                    //
              // -----------------------------------------//
              
-             smnumber = (vol8-1)*6 + vol7;
+             if (vol7 < 24)
+               {
+                 smnumber = vol7;
+               }
+             else
+               {
+                 smnumber = vol7 - 24;
+               }
+             Int_t vol8 = smnumber/6 + 1;    // fake supermodule
 
              if (vol8 == 1 || vol8 == 2)
                {
@@ -629,7 +641,8 @@ void AliPMDDigitizer::Hits2Digits(Int_t ievt)
                  fDetNo = 0;
                }
 
-             Int_t smn = smnumber - 1;
+             //Int_t smn = smnumber - 1;
+             Int_t smn = smnumber;
              Int_t ixx = xpad     - 1;
              Int_t iyy = ypad     - 1;
              if (fDetNo == 0)
@@ -700,11 +713,10 @@ void AliPMDDigitizer::Hits2Digits(Int_t ievt)
                      // Pedestal Decalibration
                      Int_t   pedmeanrms = 
                          fCalibPed->GetPedMeanRms(idet,ism,jrow,kcol);
-                     Int_t   pedrms1    = (Int_t) pedmeanrms%1000;
+                     Int_t   pedrms1    = (Int_t) pedmeanrms%100;
                      Float_t pedrms     = (Float_t)pedrms1/10.;
                      Float_t pedmean    = 
                          (Float_t) (pedmeanrms - pedrms1)/1000.0;
-                     //printf("%f %f\n",pedmean, pedrms);
                      if (adc > 0.)
                      {
                          adc += (pedmean + 3.0*pedrms);
@@ -778,14 +790,13 @@ void AliPMDDigitizer::SDigits2Digits(Int_t ievt)
 
          MeV2ADC(edep,adc);
 
-         
          // To decalibrte the adc values
          //
          Float_t gain1 = Gain(det,smn,irow,icol);
          if (gain1 != 0.)
          {
-             Int_t adcDecalib = (Int_t)(adc/gain1);
-             adc = (Float_t) adcDecalib;
+           Int_t adcDecalib = (Int_t)(adc/gain1);
+           adc = (Float_t) adcDecalib;
          }
          else if(gain1 == 0.)
          {
@@ -793,10 +804,9 @@ void AliPMDDigitizer::SDigits2Digits(Int_t ievt)
          }
          // Pedestal Decalibration
          Int_t   pedmeanrms = fCalibPed->GetPedMeanRms(det,smn,irow,icol);
-         Int_t   pedrms1    = (Int_t) pedmeanrms%1000;
+         Int_t   pedrms1    = (Int_t) pedmeanrms%100;
          Float_t pedrms     = (Float_t)pedrms1/10.;
          Float_t pedmean    = (Float_t) (pedmeanrms - pedrms1)/1000.0;
-         //printf("%f %f\n",pedmean, pedrms);
          if(adc > 0.)
          {
              adc += (pedmean + 3.0*pedrms);
@@ -894,11 +904,10 @@ void AliPMDDigitizer::Exec(Option_t *option)
                      // Pedestal Decalibration
                      Int_t   pedmeanrms = 
                          fCalibPed->GetPedMeanRms(idet,ism,jrow,kcol);
-                     Int_t   pedrms1    = (Int_t) pedmeanrms%1000;
+                     Int_t   pedrms1    = (Int_t) pedmeanrms%100;
                      Float_t pedrms     = (Float_t)pedrms1/10.;
                      Float_t pedmean    = 
                          (Float_t) (pedmeanrms - pedrms1)/1000.0;
-                     //printf("%f %f\n",pedmean, pedrms);
                      if (adc > 0.)
                      {
                          adc += (pedmean + 3.0*pedrms);
@@ -1381,21 +1390,18 @@ void AliPMDDigitizer::MeV2ADC(Float_t mev, Float_t & adc) const
   //PS Test in September 2003 and 2006
   // KeV - ADC conversion for 12bit ADC
   // Modified by Ajay
-  //const Float_t kConstant   = 9.0809;
-  //const Float_t kErConstant = 1.6763;
-  //const Float_t kSlope      = 128.348;
-  //const Float_t kErSlope    = 0.4703;
-
-  const Float_t kConstant   = -4.5;
-  const Float_t kErConstant = 14.3;
-  const Float_t kSlope      = 68.2;
-  const Float_t kErSlope    = 5.21;
+  const Float_t kConstant   =  0.07;
+  const Float_t kErConstant =  0.1;
+  const Float_t kSlope      = 76.0;
+  const Float_t kErSlope    =  5.0;
   
   Float_t cons   = gRandom->Gaus(kConstant,kErConstant);
   Float_t slop   = gRandom->Gaus(kSlope,kErSlope);
   
   Float_t adc12bit = slop*mev*0.001 + cons;
   
+                          
   if(adc12bit < 1600.0)
     {
       adc = (Float_t) adc12bit;