]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PMD/AliPMDCalibGain.cxx
Adding the option to zero shared entries below threshold
[u/mrichter/AliRoot.git] / PMD / AliPMDCalibGain.cxx
index e4436d5c83ecbcbe543127e34af2f697491a57b5..e800f59781c2c75e7452c16c28e88930fce8d155 100644 (file)
@@ -16,6 +16,7 @@
 //
 //////////////////////////////////////////////////////////////////////////////
 
+#include "Riostream.h"
 #include "TF1.h"
 #include "TFile.h"
 #include "TObjString.h"
@@ -198,13 +199,13 @@ Int_t AliPMDCalibGain::ExtractHotChannel(const Char_t *rootFile)
 
       for (Int_t idet = 0; idet < kDet; idet++)
        {
-         for (Int_t ismn = 0; ismn < kMaxSMN; idet++)
+         for (Int_t ismn = 0; ismn < kMaxSMN; ismn++)
            {
-             for (Int_t irow = 0; irow < kMaxRow; idet++)
+             for (Int_t irow = 0; irow < kMaxRow; irow++)
                {
-                 for (Int_t icol = 0; icol < kMaxCol; idet++)
+                 for (Int_t icol = 0; icol < kMaxCol; icol++)
                    {
-                     fHotFlag[idet][kMaxSMN][kMaxRow][kMaxCol] = 0.;
+                     fHotFlag[idet][ismn][irow][icol] = 0.;
                    }
                }
            }
@@ -244,8 +245,10 @@ void AliPMDCalibGain::ReadTempFile(const Char_t *tempFile)
 {
   // Read the variables from the file
   
-  fpw = fopen(tempFile,"r");
-  
+  ifstream intmpfile;
+  intmpfile.open(tempFile);
+
+  Int_t iddet = 0, issm = 0, irrow = 0, iccol = 0;
   Float_t smcount = 0., smiso = 0.;
   Float_t cellcount = 0., celliso = 0.;
 
@@ -254,8 +257,7 @@ void AliPMDCalibGain::ReadTempFile(const Char_t *tempFile)
     {
       for (Int_t ism = 0; ism < kMaxSMN; ism++)
        {
-         fscanf(fpw,"%d %d %f %f",&idet,&ism,&smcount,&smiso);
-         
+         intmpfile >> iddet >> issm >> smcount >> smiso;
          fSMCount[idet][ism] = smcount;
          fSMIso[idet][ism]   = smiso;
        }
@@ -269,9 +271,8 @@ void AliPMDCalibGain::ReadTempFile(const Char_t *tempFile)
            {
              for (Int_t icol = 0; icol < kMaxCol; icol++)
                {
-                 fscanf(fpw,"%d %d %d %d %f %f",&idet,&ism,&irow,&icol,
-                        &cellcount,&celliso);
-                 
+                 intmpfile >> iddet >> issm >> irrow >> iccol
+                           >> cellcount >> celliso;
                  fCellCount[idet][ism][irow][icol] = cellcount;
                  fCellIso[idet][ism][irow][icol]   = celliso;
                }
@@ -279,7 +280,8 @@ void AliPMDCalibGain::ReadTempFile(const Char_t *tempFile)
        }
     }
   
-  fclose(fpw);
+
+  intmpfile.close();
 
 }
 // ------------------------------------------------------------------------ //