]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Calibration data for raw digits
authorkharlov <kharlov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 Aug 2005 15:33:49 +0000 (15:33 +0000)
committerkharlov <kharlov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 Aug 2005 15:33:49 +0000 (15:33 +0000)
PHOS/AliPHOSDigitizer.cxx

index f9e8693858cc13b37e50f607e05fb4472e5a60a6..dd1e865123b8f5c179995f28a1df1707dbc89f49 100644 (file)
@@ -18,6 +18,9 @@
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.86  2005/07/12 20:07:35  hristov
+ * Changes needed to run simulation and reconstrruction in the same AliRoot session
+ *
  * Revision 1.85  2005/05/28 14:19:04  schutz
  * Compilation warnings fixed by T.P.
  *
@@ -388,8 +391,29 @@ Int_t AliPHOSDigitizer::DigitizeEnergy(Float_t energy, Int_t absId)
 {
   // Returns digitized value of the energy in a cell absId
 
+  AliPHOSGetter* gime = AliPHOSGetter::Instance();
+
+  //Determine rel.position of the cell absId
+  Int_t relId[4];
+  gime->PHOSGeometry()->AbsToRelNumbering(absId,relId);
+  Int_t module=relId[0];
+  Int_t raw=relId[2];
+  Int_t column=relId[3];
+  
   Int_t chanel ;
+  
   if(absId <= fEmcCrystals){ //digitize as EMC 
+
+    //reading calibration data for cell absId.
+    //If no calibration DB found, accept default values.
+
+    if(gime->CalibData()) {
+      fADCpedestalEmc = gime->CalibData()->GetADCpedestalEmc(module,column,raw);
+      fADCchanelEmc = gime->CalibData()->GetADCchannelEmc(module,column,raw);
+    }
+//         printf("\t\tabsId %d ==>>module=%d column=%d raw=%d ped=%.4f gain=%.4f\n",
+//                absId,module,column,raw,fADCpedestalEmc,fADCchanelEmc);
+
     chanel = (Int_t) TMath::Ceil((energy - fADCpedestalEmc)/fADCchanelEmc) ;       
     if(chanel > fNADCemc ) chanel =  fNADCemc ;
   }