]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
coverity
authorphille <phille@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 18 May 2011 10:04:17 +0000 (10:04 +0000)
committerphille <phille@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 18 May 2011 10:04:17 +0000 (10:04 +0000)
EMCAL/AliCaloConstants.h
EMCAL/AliCaloRawAnalyzerPeakFinder.cxx
HLT/EMCAL/AliHLTEMCALMapper.cxx

index ac3d07755cd4aec740a58d46d2a40044e2982471..00537f4871bc0f6631a83059e87b73e37cc15601 100644 (file)
@@ -66,6 +66,7 @@ namespace CaloConstants
   namespace EMCALConstants
   {
     const int MAXHWADDR = 3279;
+    const int MAXCHANNELS = 1408;
     const double ECENTRALHIT = 0.845678; //Percentage of total enegry contain in a single tower for a central hit  
     const int NZROWSMOD      =  24;   // Number of rows per module
     const int NXCOLUMNSMOD   =  48;   // Number of columns per module 
index 19675ea5ea77479345e15baf6d8d1a001a29150c..8d627019efc5175099ecc3748af58128123e644a 100644 (file)
@@ -40,6 +40,7 @@
 using namespace std;
 
 
+
 ClassImp( AliCaloRawAnalyzerPeakFinder )
 
 
index 00d2369f45fb96e28ebb4c047a5364eb9e9b296c..7b03a11272a95bc728282bab0aec96ba5ad35d0c 100644 (file)
@@ -26,6 +26,7 @@ using EMCAL::NMODULES;
 using EMCAL::NRCUSPERMODULE;
 using EMCAL::NRCUSPERSECTOR;
 using EMCAL::MAXHWADDR;
+using EMCAL::MAXCHANNELS; 
 
 AliHLTEMCALMapper::AliHLTEMCALMapper(const unsigned long specification ) : AliHLTCaloMapper(specification, "EMCAL")
 {
@@ -82,21 +83,29 @@ AliHLTEMCALMapper::InitAltroMapping(const unsigned long specification )
              fHw2geomapPtr[i].fZRow = 0;
              fHw2geomapPtr[i].fGain = 0;
            }
-         for(int i=0; i<nChannels; i ++)
+         // MAXCHANNELS
+         if( nChannels <= MAXCHANNELS )
            {
-             res = fscanf(fp, "%d %d %d %d\n", &tmpHwaddr, &tmpXCol, &tmpZRow,  &tmpGain);
-             
-             if(tmpGain < 2)
+             for(int i=0; i<nChannels; i ++)
                {
-                 if( tmpHwaddr <= MAXHWADDR  )
+                 res = fscanf(fp, "%d %d %d %d\n", &tmpHwaddr, &tmpXCol, &tmpZRow,  &tmpGain);
+                 
+                 if(tmpGain < 2)
                    {
-                     fHw2geomapPtr[tmpHwaddr].fXCol   = (char)tmpXCol;
-                     fHw2geomapPtr[tmpHwaddr].fZRow   = (char)tmpZRow;
-                     fHw2geomapPtr[tmpHwaddr].fGain  =  (char)tmpGain;
-                   }
-               } 
+                     if( tmpHwaddr <= MAXHWADDR  )
+                       {
+                         fHw2geomapPtr[tmpHwaddr].fXCol   = (char)tmpXCol;
+                         fHw2geomapPtr[tmpHwaddr].fZRow   = (char)tmpZRow;
+                         fHw2geomapPtr[tmpHwaddr].fGain  =  (char)tmpGain;
+                       }
+                   } 
+               }
+             fIsInitializedMapping = true;       
+           }
+         else
+           {
+             fIsInitializedMapping = false;       
            }
-         fIsInitializedMapping = true;   
          fclose(fp);
        }
       else