+ // Read the variables from the file
+
+ 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.;
+
+
+ for (Int_t idet = 0; idet < kDet; idet++)
+ {
+ for (Int_t ism = 0; ism < kMaxSMN; ism++)
+ {
+ intmpfile >> iddet >> issm >> smcount >> smiso;
+ fSMCount[idet][ism] = smcount;
+ fSMIso[idet][ism] = smiso;
+ }
+ }
+
+ for (Int_t idet = 0; idet < kDet; idet++)
+ {
+ for (Int_t ism = 0; ism < kMaxSMN; ism++)
+ {
+ for (Int_t irow = 0; irow < kMaxRow; irow++)
+ {
+ for (Int_t icol = 0; icol < kMaxCol; icol++)
+ {
+ intmpfile >> iddet >> issm >> irrow >> iccol
+ >> cellcount >> celliso;
+ fCellCount[idet][ism][irow][icol] = cellcount;
+ fCellIso[idet][ism][irow][icol] = celliso;
+ }
+ }
+ }
+ }
+
+
+ intmpfile.close();
+
+}
+// ------------------------------------------------------------------------ //
+void AliPMDCalibGain::WriteTempFile(const Char_t *tempFile)
+{
+ // Write the Temporary file if the required statics is not achieved
+
+
+ /*
+ Following variables to be written to a file
+ fDetIso[idet] ;
+ fSMIso[idet][ismn];
+ fCellIso[idet][ismn][irow][icol];
+
+ fDetCount[idet];
+ fSMCount[idet][ismn];
+ fCellCount[idet][ismn][irow][icol];
+ */
+
+
+ fpw = fopen(tempFile,"w+");
+
+ for (Int_t idet = 0; idet < kDet; idet++)
+ {
+ // fprintf(fpw,"%d %f %f\n",idet,fDetCount[idet],fDetIso[idet]);
+ }
+
+ for (Int_t idet = 0; idet < kDet; idet++)
+ {
+ for (Int_t ism = 0; ism < kMaxSMN; ism++)
+ {
+ fprintf(fpw,"%d %d %f %f\n",idet,ism, fSMCount[idet][ism],fSMIso[idet][ism]);
+ }
+ }
+
+ for (Int_t idet = 0; idet < kDet; idet++)
+ {
+ for (Int_t ism = 0; ism < kMaxSMN; ism++)
+ {
+ for (Int_t irow = 0; irow < kMaxRow; irow++)
+ {
+ for (Int_t icol = 0; icol < kMaxCol; icol++)
+ {
+ fprintf(fpw,"%d %d %d %d %f %f\n",idet,ism,irow,icol,
+ fCellCount[idet][ism][irow][icol],
+ fCellIso[idet][ism][irow][icol]);
+ }
+ }
+ }
+ }
+
+ fclose(fpw);
+
+}