]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PMD/AliPMDCalibGain.cxx
check at the primary level if the energy of the companion is lower than the calorimet...
[u/mrichter/AliRoot.git] / PMD / AliPMDCalibGain.cxx
index c381177779d7f96fb946119ca0fe9a8e682f96ed..b1af5003e6fa06d7d1d15845e0a60fd9abf0709b 100644 (file)
@@ -37,6 +37,7 @@
 #include "AliPMDddldata.h"
 #include "AliPMDCalibGain.h"
 
+using std::ifstream;
 ClassImp(AliPMDCalibGain)
 
 AliPMDCalibGain::AliPMDCalibGain():
@@ -205,7 +206,7 @@ Int_t AliPMDCalibGain::ExtractHotChannel(const Char_t *rootFile)
                {
                  for (Int_t icol = 0; icol < kMaxCol; icol++)
                    {
-                     fHotFlag[idet][kMaxSMN][kMaxRow][kMaxCol] = 0.;
+                     fHotFlag[idet][ismn][irow][icol] = 0.;
                    }
                }
            }
@@ -245,8 +246,9 @@ 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.;
@@ -256,7 +258,7 @@ void AliPMDCalibGain::ReadTempFile(const Char_t *tempFile)
     {
       for (Int_t ism = 0; ism < kMaxSMN; ism++)
        {
-         fscanf(fpw,"%d %d %f %f",&iddet,&issm,&smcount,&smiso);
+         intmpfile >> iddet >> issm >> smcount >> smiso;
          fSMCount[idet][ism] = smcount;
          fSMIso[idet][ism]   = smiso;
        }
@@ -270,8 +272,8 @@ void AliPMDCalibGain::ReadTempFile(const Char_t *tempFile)
            {
              for (Int_t icol = 0; icol < kMaxCol; icol++)
                {
-                 fscanf(fpw,"%d %d %d %d %f %f",&iddet,&issm,&irrow,&iccol,
-                        &cellcount,&celliso);
+                 intmpfile >> iddet >> issm >> irrow >> iccol
+                           >> cellcount >> celliso;
                  fCellCount[idet][ism][irow][icol] = cellcount;
                  fCellIso[idet][ism][irow][icol]   = celliso;
                }
@@ -279,7 +281,8 @@ void AliPMDCalibGain::ReadTempFile(const Char_t *tempFile)
        }
     }
   
-  fclose(fpw);
+
+  intmpfile.close();
 
 }
 // ------------------------------------------------------------------------ //