]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
subtract RCU L1Phase from time measurement, and try to avoid data jumps in sample...
authordsilverm <dsilverm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 11 Apr 2010 18:37:24 +0000 (18:37 +0000)
committerdsilverm <dsilverm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 11 Apr 2010 18:37:24 +0000 (18:37 +0000)
EMCAL/AliCaloRawAnalyzer.cxx
EMCAL/AliEMCALRawUtils.cxx

index 38b317b7d25bc0565e403a306db41f8732e1efbe..6f5ea4e2f0e9c3a1749ff79b49abce0a5f27ce61 100644 (file)
@@ -98,31 +98,29 @@ AliCaloRawAnalyzer::SelectSubarray( const Double_t *fData, const int length, con
 {
   //Selection of subset of data from one bunch that will be used for fitting or
   //Peak finding.  Go to the left and right of index of the maximum time bin
-  //Untile the ADC value is less that fFitArrayCut
+  //Until the ADC value is less that fFitArrayCut, or derivative changes sign (data jump)
   int tmpfirst =  maxindex;
   int tmplast  =  maxindex;
+  Double_t valFirst =  fData[maxindex];
+  Double_t valLast  =  fData[maxindex];
   
-  while((  tmpfirst  ) > 0  &&  ( fData[tmpfirst] >  fFitArrayCut   ))  
+  while( (tmpfirst >= 0) && (fData[tmpfirst] >= fFitArrayCut) &&
+        (fData[tmpfirst]<valFirst || tmpfirst==maxindex) )  
     {
+      valFirst = fData[tmpfirst];
       tmpfirst -- ;
     }
   
-  while(( tmplast ) <  (length-1)   && ( fData [tmplast] >  fFitArrayCut ))
+  while( (tmplast < length) && (fData[tmplast] >= fFitArrayCut) &&
+        (fData[tmplast]<valLast || tmplast==maxindex) )  
     {
+      valLast = fData[tmplast];
       tmplast ++;
     }
 
-
   *first = tmpfirst +1;
   *last =  tmplast -1;
-
-  int nsamples = *last - *first + 1;
-  if (nsamples < fNsampleCut) {
-    // keep edge bins (below threshold) also, for low # of samples case    
-    *first = tmpfirst;
-    *last =  tmplast; 
-  }
-
+  return;
 }
 
 
index 4367eb79cc3696b91b46ed0cff6baf9557ef9886..b06aaab6b7ad0e77615256cb007e17413b45ac8a 100644 (file)
@@ -453,6 +453,8 @@ void AliEMCALRawUtils::Raw2Digits(AliRawReader* reader,TClonesArray *digitsArr,
 
        // go from time-bin units to physical time fgtimetrigger
        time = time * GetRawFormatTimeBinWidth(); // skip subtraction of fgTimeTrigger?
+       // subtract RCU L1 phase (L1Phase is in seconds) w.r.t. L0:
+       time -= in.GetL1Phase();
 
        AliDebug(2,Form("id %d lowGain %d amp %g", id, lowGain, amp));
        // printf("Added tower: SM %d, row %d, column %d, amp %3.2f\n",in.GetModule(), in.GetRow(), in.GetColumn(),amp);