]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALCalibMapAPD.cxx
Added new class needed for refactoring of the
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALCalibMapAPD.cxx
index 82b888bea95f078f7b5897c80191d86e6cc17ca0..4e9af8fc119b92b1fd34939a34c0473e7c3939db 100644 (file)
@@ -39,6 +39,7 @@ AliEMCALCalibMapAPD::AliEMCALCalibMapAPD(const int nSM) :
     fSuperModuleData.Add(new AliEMCALSuperModuleCalibMapAPD(i));
   }
   fSuperModuleData.Compress(); // compress the TObjArray
+  fSuperModuleData.SetOwner(kTRUE); 
 }
 
 //____________________________________________________________________________
@@ -73,7 +74,7 @@ void AliEMCALCalibMapAPD::ReadTextCalibMapAPDInfo(Int_t nSM, const TString &txtF
   for (Int_t i = 0; i < fNSuperModule; i++) {
     AliEMCALSuperModuleCalibMapAPD * t = (AliEMCALSuperModuleCalibMapAPD*) fSuperModuleData[i];
     if (!inputFile) {
-      printf("AliEMCALCalibMapAPD::ReadCalibMapAPDInfo - Error while reading input file; likely EOF..");
+      printf("AliEMCALCalibMapAPD::ReadCalibMapAPDInfo - Error while reading input file; likely EOF..\n");
       return;
     }
     inputFile >> iSM;
@@ -86,6 +87,13 @@ void AliEMCALCalibMapAPD::ReadTextCalibMapAPDInfo(Int_t nSM, const TString &txtF
                >> parErr[0] >> parErr[1] >> parErr[2]
                >> iBreakDown >> darkCurrent;
 
+      // check that input values are not out bounds
+      if (iCol<0 || iCol>(AliEMCALGeoParams::fgkEMCALCols-1) ||
+         iRow<0 || iRow>(AliEMCALGeoParams::fgkEMCALRows-1) ) {
+       printf("AliEMCALCalibMapAPD::ReadCalibMapAPDInfo - Error while reading input file; j %d iCol %d iRow %d\n", j, iCol, iRow);
+      return;
+      }
+
       // assume that this info is already swapped and done for this basis?
       if (swapSides) {
        // C side, oriented differently than A side: swap is requested