]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fixed a bug in the ReadFromFile function as well as a bug in the calculation of the...
authorhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 9 Jun 2008 21:42:55 +0000 (21:42 +0000)
committerhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 9 Jun 2008 21:42:55 +0000 (21:42 +0000)
FMD/AliFMDCalibSampleRate.cxx
FMD/AliFMDCalibStripRange.cxx

index 85a8631d1d45c9c5d7aa337525dafd6e3c9b1ad5..5ab5e77fa13d27933ccb1e8106a8c3e7766eea31 100644 (file)
@@ -31,6 +31,7 @@
 // #include <AliLog.h>
 #include "TString.h"
 #include "AliFMDDebug.h" // Better debug macros
+#include "iostream"
 
 //____________________________________________________________________
 ClassImp(AliFMDCalibSampleRate)
@@ -69,9 +70,10 @@ AliFMDCalibSampleRate::Set(UShort_t det, Char_t ring,
                           UShort_t sector, UShort_t, UShort_t rate)
 {
   // Set values.  Strip argument is ignored 
-  UInt_t nSec  = (ring == 'I' ? 20 : 40);
+  UInt_t nSec  = (ring == 'I' ? 10 : 20);
   UInt_t board = sector / nSec;
   fRates(det, ring, board, 0) = rate;
+  
 }
 
 //____________________________________________________________________
@@ -80,7 +82,7 @@ AliFMDCalibSampleRate::Rate(UShort_t det, Char_t ring,
                            UShort_t sec, UShort_t) const
 {
   // Get the sample rate 
-  UInt_t nSec  = (ring == 'I' ? 20 : 40);
+  UInt_t nSec  = (ring == 'I' ? 10 : 20);
   UInt_t board = sec / nSec;
   AliFMDDebug(10, ("Getting sample rate for FMD%d%c[%2d,0] (board %d)", 
                    det, ring, sec, board));
@@ -131,9 +133,9 @@ AliFMDCalibSampleRate::ReadFromFile(ifstream &inFile)
   Int_t thisline = inFile.tellg();
   Char_t c[3];
   
-  while(line.ReadLine(inFile) && readData ) {
+  while( readData ) {
     thisline = inFile.tellg();
-    thisline = thisline--;
+    line.ReadLine(inFile);
     if(line.Contains("# ",TString::kIgnoreCase)) {
       readData = kFALSE;
       continue;
@@ -145,8 +147,10 @@ AliFMDCalibSampleRate::ReadFromFile(ifstream &inFile)
               >> sec          >> c[2]
               >> sampleRate;
     
+   
     Set(det,ring,sec,0,sampleRate);
-
+    
+    
   }
   
   inFile.seekg(0);
index 18c05a4331463ac0f8183b705bf1269c35a1376b..bb56f167ced3e702592f04de0436f518198878d0 100644 (file)
@@ -26,6 +26,7 @@
 // strips, and dead areas can be handled off-line. 
 // This information comes from DCS or the like.
 //
+#include "iostream"
 #include "AliFMDCalibStripRange.h"     // ALIFMDCALIBGAIN_H
 #include "TString.h"
 // #include "AliFMDParameters.h"           // ALIFMDPARAMETERS_H
@@ -68,7 +69,7 @@ AliFMDCalibStripRange::Set(UShort_t det, Char_t ring,
                           UShort_t max)
 {
   // Set the min and max for a half-ring 
-  UInt_t nSec  = (ring == 'I' ? 20 : 40);
+  UInt_t nSec  = (ring == 'I' ? 10 : 20);
   UInt_t board = sector / nSec;
   fRanges(det, ring, board, 0) = ((max & 0x7f) << 8) + (min & 0x7f);
 }
@@ -79,8 +80,9 @@ AliFMDCalibStripRange::Min(UShort_t det, Char_t ring,
                           UShort_t sec, UShort_t) const
 {
   // Get the min for a half-ring 
-  UInt_t nSec  = (ring == 'I' ? 20 : 40);
+  UInt_t nSec  = (ring == 'I' ? 10 : 20);
   UInt_t board = sec / nSec;
   return (fRanges(det, ring, board, 0) & 0x7f);
 }
 
@@ -90,7 +92,7 @@ AliFMDCalibStripRange::Max(UShort_t det, Char_t ring,
                           UShort_t sec, UShort_t) const
 {
   // Get the max for a half-ring 
-  UInt_t nSec  = (ring == 'I' ? 20 : 40);
+  UInt_t nSec  = (ring == 'I' ? 10 : 20);
   UInt_t board = sec / nSec;
   return ((fRanges(det, ring, board, 0) >> 8) & 0x7f);
 }
@@ -140,13 +142,14 @@ AliFMDCalibStripRange::ReadFromFile(ifstream &inFile)
   Int_t thisline = inFile.tellg();
   Char_t c[4];
   
-  while(line.ReadLine(inFile) && readData ) {
+  while( readData ) {
     thisline = inFile.tellg();
-    thisline = thisline--;
-    if(line.Contains("# ",TString::kIgnoreCase)) {
-      readData = kFALSE;
-      continue;
-    }
+    line.ReadLine(inFile);
+   
+      if(line.Contains("# ",TString::kIgnoreCase)) {
+       readData = kFALSE;
+       continue;
+      }
     
     inFile.seekg(thisline);
     inFile     >> det          >> c[0]
@@ -156,7 +159,7 @@ AliFMDCalibStripRange::ReadFromFile(ifstream &inFile)
               >> max;
     
     Set(det,ring,sec,0,min,max);
-
+  
   }
   
   inFile.seekg(0);