]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fixed the DA so it picks up the pedestals from the right sample
authorhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 14 Sep 2008 19:35:57 +0000 (19:35 +0000)
committerhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 14 Sep 2008 19:35:57 +0000 (19:35 +0000)
FMD/AliFMDPedestalDA.cxx

index 21aa5c814e13de1371b91edc46c8e01bdcf21bc9..bb84b771e5b1fcd4cf9779fa9c80ccd10196ce17 100644 (file)
@@ -75,6 +75,8 @@ AliFMDPedestalDA::~AliFMDPedestalDA()
 void AliFMDPedestalDA::Init() 
 { 
   SetRequiredEvents(1000);
+  
 }
 
 //_____________________________________________________________________
@@ -111,7 +113,7 @@ void AliFMDPedestalDA::FillChannels(AliFMDDigit* digit)
   Char_t   ring  = digit->Ring();
   UShort_t sec   = digit->Sector();
   UShort_t strip = digit->Strip();
-
+  
   AliFMDParameters* pars     = AliFMDParameters::Instance();
   UInt_t             samples  = pars->GetSampleRate(det, ring, sec, strip);
   for (UInt_t sample = 0; sample < samples; sample++) {
@@ -176,10 +178,20 @@ void AliFMDPedestalDA::Analyse(UShort_t det,
     }
     
     Float_t chi2ndf = 0;
+    
+    
     if(fitFunc.GetNDF())
       chi2ndf = fitFunc.GetChisquare() / fitFunc.GetNDF();
     
-    if(sample==samples-1) {
+    Int_t sampleToWrite = 2;
+    
+    if(pars->GetSampleRate(det,ring,sec,strip)==2)
+      sampleToWrite = 1;
+    
+    if(pars->GetSampleRate(det,ring,sec,strip)<2)
+      sampleToWrite = 0;
+    
+    if(sample==sampleToWrite) {
     
       fOutputFile << det                         << ','
                  << ring                        << ','