From: hdalsgaa Date: Mon, 9 Jun 2008 21:42:55 +0000 (+0000) Subject: Fixed a bug in the ReadFromFile function as well as a bug in the calculation of the... X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=43a191910ba17f53fea3cec3773fed73189d729c;p=u%2Fmrichter%2FAliRoot.git Fixed a bug in the ReadFromFile function as well as a bug in the calculation of the board number (number of sectors per board 10/20 --- diff --git a/FMD/AliFMDCalibSampleRate.cxx b/FMD/AliFMDCalibSampleRate.cxx index 85a8631d1d4..5ab5e77fa13 100644 --- a/FMD/AliFMDCalibSampleRate.cxx +++ b/FMD/AliFMDCalibSampleRate.cxx @@ -31,6 +31,7 @@ // #include #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); diff --git a/FMD/AliFMDCalibStripRange.cxx b/FMD/AliFMDCalibStripRange.cxx index 18c05a43314..bb56f167ced 100644 --- a/FMD/AliFMDCalibStripRange.cxx +++ b/FMD/AliFMDCalibStripRange.cxx @@ -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);