]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDCalibFaker.cxx
MakeImage is now a method of AliCheckerBase, was AliQADataMaker before. This will...
[u/mrichter/AliRoot.git] / FMD / AliFMDCalibFaker.cxx
index 3693be68b62d6a38ecb094b4e13f06ebc32c0298..6e54ce61fc738e9403480d24e7706251819ce7d7 100644 (file)
 // the bit mask passed to the constructor, or added by `AddCalib'.
 //
 // The default is to write all calibration parameters to a local
-// storage `local://$ALICE_ROOT' which is were the sources live (sigh!
+// storage `local://$ALICE_ROOT/OCDB' which is were the sources live (sigh!
 // - why oh why do we need to shit where we eat - it's just not
 // healty).
 //                                                       
-#include "AliLog.h"               // ALILOG_H
+#include "AliFMDDebug.h"               // ALIFMDDEBUG_H ALILOG_H
 #include "AliFMDCalibFaker.h"      // ALIFMDCALIBFAKER_H
 #include "AliFMDCalibGain.h"       // ALIFMDCALIBGAIN_H
 #include "AliFMDCalibPedestal.h"   // ALIFMDCALIBPEDESTAL_H
@@ -45,6 +45,7 @@
 // #include <TMath.h>
 #include <TROOT.h>
 #include <TRandom.h>
+#include <TF1.h>
 
 //====================================================================
 ClassImp(AliFMDCalibFaker)
@@ -62,7 +63,7 @@ AliFMDCalibFaker::AliFMDCalibFaker(Int_t mask, const char* loc)
     fPedestalMin(20),
     fPedestalMax(30), 
     fDeadChance(0),
-    fRate(1),
+    fRate(4),
     fZeroThreshold(0),
     fRunMin(0),
     fRunMax(10),
@@ -207,22 +208,52 @@ AliFMDCalibFaker::MakePulseGain() const
   return gain;
 }
 
+//__________________________________________________________________
+Float_t 
+AliFMDCalibFaker::MakeNoise(Char_t ring, UShort_t str) const
+{
+  const UShort_t innerN    = 512;
+  const UShort_t outerN    = 256;
+  const UShort_t innerCut  = 350;
+  const UShort_t outerCut  = 190;
+  const Float_t  innerBase =   1.2;
+  const Float_t  outerBase =   2.1;
+  const Float_t  innerInc  =   0.5;
+  const Float_t  outerInc  =   0.8;
+  Float_t cut, base, inc, n;
+  switch (ring) {
+  case 'I': 
+    cut = innerCut; base = innerBase; inc = innerInc; n = innerN; break;
+  case 'O': 
+    cut = outerCut; base = outerBase; inc = outerInc; n = outerN; break;
+  default:
+    return -1;
+  }
+  Float_t bare = base + (str < cut ? 
+                        str / cut * inc : 
+                        inc  - (str - cut) / (n - cut) * inc);
+  return bare + gRandom->Uniform(-.07, .07);
+}
+  
 //__________________________________________________________________
 AliFMDCalibPedestal*
 AliFMDCalibFaker::MakePedestal() const
 {
   // Make the actual data
   AliFMDCalibPedestal*  pedestal  = new AliFMDCalibPedestal;
+  
   for (UShort_t det = 1; det <= 3; det++) {
-    Char_t rings[] = { 'I', (det == 1 ? '\0' : 'O'), '\0' };
+    Char_t rings[] = { 'I', 'O', '\0' };
     for (Char_t* ring = rings; *ring != '\0'; ring++) {
+      if (*ring == 'O' && det == 1) continue;
       UShort_t nSec = ( *ring == 'I' ? 20  :  40 );
       UShort_t nStr = ( *ring == 'I' ? 512 : 256 );
       for (UShort_t sec = 0; sec < nSec; sec++) {
         for (UShort_t str = 0; str < nStr; str++) {
-          pedestal->Set(det, *ring, sec, str,
-                       gRandom->Uniform(fPedestalMin, fPedestalMax), 1.5);
-        }
+         Float_t noise = MakeNoise(*ring, str);
+         Float_t ped   = gRandom->Uniform(fPedestalMin, fPedestalMax);
+          pedestal->Set(det, *ring, sec, str, ped, noise);
+       }
       }
     }
   }