]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added several set methods and some minor corrections for testing fast
authorpavlinov <pavlinov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 6 Oct 2009 12:09:12 +0000 (12:09 +0000)
committerpavlinov <pavlinov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 6 Oct 2009 12:09:12 +0000 (12:09 +0000)
fitting procedure

EMCAL/AliEMCALRawUtils.cxx
EMCAL/AliEMCALRawUtils.h

index 23fb4dd45f9ca60fc43be8a3630ce417e1a1d15c..6411186797d7bcc4638a3dc81222204838c7d1ba 100644 (file)
@@ -30,6 +30,7 @@
   
 #include "TF1.h"
 #include "TGraph.h"
+#include <TRandom.h>
 class TSystem;
   
 class AliLog;
@@ -52,7 +53,8 @@ ClassImp(AliEMCALRawUtils)
   
 // Signal shape parameters
 Double_t AliEMCALRawUtils::fgTimeBinWidth  = 100E-9 ; // each sample is 100 ns
-Double_t AliEMCALRawUtils::fgTimeTrigger = 1.5E-6 ;   // 15 time bins ~ 1.5 musec
+Double_t AliEMCALRawUtils::fgTimeTrigger   = 1.5E-6 ; // 15 time bins ~ 1.5 musec
+Int_t    AliEMCALRawUtils::fgkTimeBins     = 50;      // number of sampling bins of the raw RO signal  
 
 // some digitization constants
 Int_t    AliEMCALRawUtils::fgThreshold = 1;
@@ -198,8 +200,10 @@ void AliEMCALRawUtils::Digits2Raw()
   for (Int_t i=0; i < nDDL; i++)
     buffers[i] = 0;
 
-  Int_t adcValuesLow[fgkTimeBins];
-  Int_t adcValuesHigh[fgkTimeBins];
+  //  Int_t adcValuesLow[fgkTimeBins];
+  //Int_t adcValuesHigh[fgkTimeBins];
+  Int_t* adcValuesLow = new Int_t[fgkTimeBins];
+  Int_t* adcValuesHigh = new Int_t [fgkTimeBins];
 
   // loop over digits (assume ordered digits)
   for (Int_t iDigit = 0; iDigit < digits->GetEntries(); iDigit++) {
@@ -268,6 +272,8 @@ void AliEMCALRawUtils::Digits2Raw()
        buffers[iDDL]->WriteChannel(ieta,iphi, 1, GetRawFormatTimeBins(), adcValuesHigh, fgThreshold);
     }
   }
+  delete [] adcValuesLow;
+  delete [] adcValuesHigh;
   
   // write headers and close files
   for (Int_t i=0; i < nDDL; i++) {
@@ -592,7 +598,8 @@ const Double_t dtime, const Double_t damp, Int_t * adcH, Int_t * adcL) const
 
     //According to Terry Awes, 13-Apr-2008
     //add gaussian noise in quadrature to each sample
-    //Double_t noise = gRandom->Gaus(0.,fgFEENoise);
+    Double_t noise = gRandom->Gaus(0.,fgFEENoise);
+    signal += noise; // March 17,09
     //signal = sqrt(signal*signal + noise*noise);
 
     adcH[iTime] =  static_cast<Int_t>(signal + 0.5) ;
index ac7c45bf98bee18fa5d58a7ac404903fd25cdb68..f4771884ad0c13d3ecf2b28ada109c78bbcdfd13 100644 (file)
@@ -43,17 +43,19 @@ class AliEMCALRawUtils : public TObject {
 
   // Signal shape parameters
   Double_t GetRawFormatHighLowGainFactor() const { return fHighLowGainFactor ;}
-  Int_t GetRawFormatOrder()                const { return fOrder ; }   
+  Int_t    GetRawFormatOrder()             const { return fOrder ; }   
   Double_t GetRawFormatTau()               const { return fTau ; }    
-  Int_t GetNoiseThreshold()                const { return fNoiseThreshold; }
-  Int_t GetNPedSamples()                   const { return fNPedSamples; }
+  Int_t    GetNoiseThreshold()             const { return fNoiseThreshold; }
+  Int_t    GetNPedSamples()                const { return fNPedSamples; }
 
   void SetRawFormatHighLowGainFactor(Double_t val) {fHighLowGainFactor=val;}
   void SetRawFormatOrder(Int_t val)                {fOrder=val; }   
   void SetRawFormatTau(Double_t val)               {fTau=val; }    
   void SetNoiseThreshold(Int_t val)                {fNoiseThreshold=val; }
   void SetNPedSamples(Int_t val)                   {fNPedSamples=val; }
-  
+  void SetFEENoise(Double_t val)                   {fgFEENoise = val;}
+  void SetRawFormatTimeBins(Int_t val)             {fgkTimeBins = val;}    
+
   static Int_t GetRawFormatTimeBins() { return fgkTimeBins ; }    
   static Double_t GetRawFormatTimeMax() { return fgkTimeBins*fgTimeBinWidth; }   
   static Double_t GetRawFormatTimeBinWidth() { return fgTimeBinWidth; }   
@@ -63,6 +65,9 @@ class AliEMCALRawUtils : public TObject {
   Int_t GetRawFormatThreshold() const { return fgThreshold ; }       
   Int_t GetRawFormatDDLPerSuperModule() const { return fgDDLPerSuperModule ; } 
 
+  Double_t GetPedestalValue() {return fgPedestalValue;}
+  Double_t GetFEENoise()      {return fgFEENoise;}
+
   virtual Option_t* GetOption() const { return fOption.Data(); }
   void SetOption(Option_t* opt) { fOption = opt; }
 
@@ -80,8 +85,8 @@ class AliEMCALRawUtils : public TObject {
   Int_t fNPedSamples;                   // number of samples to use in pedestal calculation
 
   static const Int_t fgkOverflowCut = 950;  // cut to discriminate overflowed channels
-  static const Int_t fgkTimeBins = 256 ; // number of sampling bins of the raw RO signal  
   static const Int_t fgkRawSignalOverflow = 0x3FF; // maximum signal (10 bits)
+  static Int_t fgkTimeBins;             // number of sampling bins of the raw RO signal  
 
   static Double_t fgTimeTrigger ;       // time of the trigger for the RO signal 
   static Double_t fgTimeBinWidth;       // maximum sampled time of the raw RO signal