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
using EMCAL::NRCUSPERMODULE;
using EMCAL::NRCUSPERSECTOR;
using EMCAL::MAXHWADDR;
+using EMCAL::MAXCHANNELS;
AliHLTEMCALMapper::AliHLTEMCALMapper(const unsigned long specification ) : AliHLTCaloMapper(specification, "EMCAL")
{
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