]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDCalibFaker.cxx
Fix for null fMCevent pointer
[u/mrichter/AliRoot.git] / FMD / AliFMDCalibFaker.cxx
index 604a10fcf712c0ebab2fc56fa7bdc838fb4cf2f8..80226dfaa50861092d39f3e56712f695c32c02d7 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
@@ -40,6 +40,7 @@
 #include "AliFMDCalibStripRange.h" // ALIFMDCALIBSTRIPRANGE_H
 #include <AliCDBManager.h>         // ALICDBMANAGER_H
 #include <AliCDBEntry.h>           // ALICDBMANAGER_H
+#include "AliFMDParameters.h"     // ALIFMDPARAMETERS_H
 //#include <Riostream.h>
 #include <TSystem.h>
 // #include <TMath.h>
@@ -63,7 +64,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),
@@ -265,7 +266,8 @@ AliFMDCalibDeadMap*
 AliFMDCalibFaker::MakeDeadMap() const
 {
   // Make the actual data
-  AliFMDCalibDeadMap*  deadmap  = new AliFMDCalibDeadMap;
+  AliFMDCalibDeadMap*  deadmap  = new AliFMDCalibDeadMap(0);
+  TRandom* random = new TRandom(0);
   for (UShort_t det = 1; det <= 3; det++) {
     Char_t rings[] = { 'I', (det == 1 ? '\0' : 'O'), '\0' };
     for (Char_t* ring = rings; *ring != '\0'; ring++) {
@@ -274,11 +276,12 @@ AliFMDCalibFaker::MakeDeadMap() const
       for (UShort_t sec = 0; sec < nSec; sec++) {
         for (UShort_t str = 0; str < nStr; str++) {
           deadmap->operator()(det, *ring, sec, str) = 
-           gRandom->Uniform(0, 1) < fDeadChance;
+           random->Uniform(0, 1) < fDeadChance;
         }
       }
     }
   }
+  if (AliDebugLevel() > 20) deadmap->Print();
   return deadmap;
 }
 
@@ -287,7 +290,7 @@ AliFMDCalibZeroSuppression*
 AliFMDCalibFaker::MakeZeroSuppression() const
 {
   // Make the actual data
-  AliFMDCalibZeroSuppression*  zs  = new AliFMDCalibZeroSuppression;
+  AliFMDCalibZeroSuppression*  zs  = new AliFMDCalibZeroSuppression(0);
   for (UShort_t det = 1; det <= 3; det++) {
     Char_t rings[] = { 'I', (det == 1 ? '\0' : 'O'), '\0' };
     for (Char_t* ring = rings; *ring != '\0'; ring++) {