]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Coverity
authorphille <phille@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 17 May 2011 05:18:44 +0000 (05:18 +0000)
committerphille <phille@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 17 May 2011 05:18:44 +0000 (05:18 +0000)
EMCAL/AliCaloConstants.h
EMCAL/AliCaloRawAnalyzer.cxx
EMCAL/AliCaloRawAnalyzer.h
EMCAL/AliCaloRawAnalyzerFactory.cxx
EMCAL/AliCaloRawAnalyzerPeakFinder.cxx
HLT/CALO/AliHLTCaloConstants.h
HLT/EMCAL/AliHLTEMCALMapper.cxx

index e35ae19f741f4061126f3efca361ba1075b20e5f..ac3d07755cd4aec740a58d46d2a40044e2982471 100644 (file)
@@ -49,7 +49,7 @@ namespace CaloConstants
     const int NALTROS        =   4;      // Number of ALTROs per frontend card
     const int NALTROCHANNELS =  16;      // Number of readout channels per ALTRO chip
     const int MINHARDWAREADDRESS = -2;   // Smallest possible HW address ( in offline )
-    const int MAXHARDWAREADDRESS = 4096; // Max harware address,  ( its to high ) 
+    //    const int MAXHARDWAREADDRESS = 4096; // Max harware address,  ( its to high ) 
     const int MAXBINVALUE = 1023;        // Max possible ALTRO ADC value ( 10 bit )
     const int NGAINS         =   2;      // Number of gains ( high + low )
     const int HIGHGAIN    =   1;         // Mnemonic for High Gain
@@ -61,23 +61,17 @@ namespace CaloConstants
   //FEE constants common to PHOS EMCAL
   const int CSPSPERFEE       =   32;    // Charge Sensitive Preamplifiers (CSPs) per FEE
   const int NBRANCHES        =    2;    // Branches per RCU   
-  const int MAXHWADDRESSES   = 4096;    // Highest possible harware address
+  //  const int MAXHWADDRESSES   = 4096;    // Highest possible harware address
   
   namespace EMCALConstants
   {
-    // const int NZROWSMOD      =  48;   // Number of rows per module
-    // const int NXCOLUMNSMOD   =  24;   // Number of columns per module 
+    const int MAXHWADDR = 3279;
     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 
-    
     const int NROWSMOD     = NZROWSMOD;   // Number of rows per module
     const int NCOLUMNSMOD  = NXCOLUMNSMOD;   // Number of columns per module 
     
-    //   const int NZROWSMOD      =  24;   // Number of rows per module
-    //   const int NXCOLUMNSMOD   =  48;   // Number of columns per module 
-    
     const int NRCUSPERSECTOR = 4;     // Number of RCUs per sector
     const int NMODULES    =    10;    // Number of modules of the EMCAL detector
     const int NRCUSPERMODULE =  2 ;   // Number of RCUs per Module
@@ -91,6 +85,8 @@ namespace CaloConstants
 
   namespace PHOSConstants
   {
+    const int MAXHWADDR = 4096; 
+    //    const int MAXHARDWAREADDRESS = 4096; // Max harware address,  ( its to high )  
     const int NZROWSMOD      =  56;   // Number of rows per module       
     const int NXCOLUMNSMOD   =  64;   // Number of columns per module
     const int NMODULES    =     5;    // Number of modules of the PHOS detector
@@ -98,12 +94,6 @@ namespace CaloConstants
     const int NFEECS         =  14;   // Number of Frontend cards per branch
   }
 
-
-  //namespace FitAlgorithm
-  // {
-  //  enum fitAlgorithm { kStandard = 0, kCrude = 1, kPeakFinder = 2, kNeuralNet = 3, kFastFit= 4,
-  //                   kLogFit = 5, kLMS = 6,  kLMSOffline = 7, kFakeAltro = 9, kNONE = 8}; // possible return values
-  // }
   
   namespace FitAlgorithm
   {
index 5fe155c0f23f88987c5a405758002807510a3a71..bdec18b523c47ffd4c60f83b5a787fb5d2892cd4 100644 (file)
@@ -291,7 +291,7 @@ AliCaloRawAnalyzer::IsInTimeRange( const int maxindex, const int maxtindx, const
 
 
 void 
-AliCaloRawAnalyzer::PrintBunches( const vector<AliCaloBunchInfo> &bvctr ) const
+AliCaloRawAnalyzer::PrintBunches( const vector<AliCaloBunchInfo> &bvctr ) 
 {
   //comment
   cout << __FILE__ << __LINE__<< "*************** Printing Bunches *******************" << endl;
@@ -307,7 +307,7 @@ AliCaloRawAnalyzer::PrintBunches( const vector<AliCaloBunchInfo> &bvctr ) const
 
 
 void 
-AliCaloRawAnalyzer::PrintBunch( const AliCaloBunchInfo &bunch ) const
+AliCaloRawAnalyzer::PrintBunch( const AliCaloBunchInfo &bunch )
 {
   //comment
   cout << __FILE__ << ":" << __LINE__ << endl;
index 0bc471a2b2b7a1b7580119fb318a46608e1ace61..261d5822020b41e355a15088285f95157794a0a5 100644 (file)
@@ -45,8 +45,8 @@ public:
   virtual AliCaloFitResults Evaluate( const std::vector<AliCaloBunchInfo> &/*bunchvector*/, 
                                      const UInt_t /*altrocfg1*/,  const UInt_t /*altrocfg2*/ )  = 0;
 
-  void PrintBunches( const std::vector<AliCaloBunchInfo> &bunchvector ) const;
-  void PrintBunch( const AliCaloBunchInfo &bunch ) const ;
+  static void PrintBunches( const std::vector<AliCaloBunchInfo> &bunchvector );
+  static void PrintBunch( const AliCaloBunchInfo &bunch );
   
   int PreFitEvaluateSamples( const std::vector<AliCaloBunchInfo>  &bunchvector, 
                                     const UInt_t altrocfg1,  const UInt_t altrocfg2, Int_t & index, 
index 5a846621328f43fc06ab2129b5abee1cbf3efed1..8124024e89d675a5f2bcb65b50ea6c5a6e63a720 100644 (file)
@@ -57,6 +57,7 @@ AliCaloRawAnalyzerFactory::CreateAnalyzer( const int algo )
       return new AliCaloRawAnalyzerNN();
       break;
     case kPeakFinder:
+      //    cout << __FILE__ << ":" << __LINE__ << ": Returning new peakFinder " << endl;
       return new AliCaloRawAnalyzerPeakFinder();
       break;
     case kCrude:
index c423b9623bc73c9194c1d6a8a2ffe39b2622ec65..19675ea5ea77479345e15baf6d8d1a001a29150c 100644 (file)
@@ -159,11 +159,8 @@ AliCaloRawAnalyzerPeakFinder::Evaluate( const vector<AliCaloBunchInfo> &bunchvec
              int n = last - first;  
              int pfindex = n - fNsampleCut; 
              pfindex = pfindex > PF::SAMPLERANGE ? PF::SAMPLERANGE : pfindex;
-
              int dt =  maxampindex - startbin -2; 
              int tmpindex = 0;
-
-
              Float_t tmptof = ScanCoarse( &fReversed[dt] , n );
              
              if( tmptof < -1 )
@@ -181,26 +178,24 @@ AliCaloRawAnalyzerPeakFinder::Evaluate( const vector<AliCaloBunchInfo> &bunchvec
                  }
 
              double tof = 0;
-           
              for(int k=0; k < PF::SAMPLERANGE; k++   )
                {
                  tof +=  fPFTofVectors[0][pfindex][k]*fReversed[ dt  +k + tmpindex -1 ];   
                }
-           
              for( int i=0; i < PF::SAMPLERANGE; i++ )
                {
                  {
+                   
                    fAmp += fPFAmpVectors[0][pfindex][i]*fReversed[ dt  +i  +tmpindex -1 ];
                  }
                }
+
              if( TMath::Abs(  (maxf - fAmp  )/maxf )  >   0.1 )
                {
                  fAmp = maxf;
                }
              
              tof = timebinOffset - 0.01*tof/fAmp - fL1Phase/TIMEBINWITH; // clock
-             
-             // use local-array time for chi2 estimate
              Float_t chi2 = CalculateChi2(fAmp, tof-timebinOffset+maxrev, first, last);
              Int_t ndf = last - first - 1; // nsamples - 2
              return AliCaloFitResults( maxamp, ped , Ret::kFitPar, fAmp, tof, 
index 14c374831f4c554031ebf0c250b72c595b9a35fa..8e3392f97f854ee08bff58de1515b7b908017efa 100644 (file)
 #include "AliCaloConstants.h"
 
 
-// namespace CaloHLTConst
-// {
-//   const int MAXHOSTS=20;
-//   //Constants related to the ALTRO chip (Common to EMCAL / PHOS )
-//   const int MAXBINVALUE = 1023;
-//   const int NGAINS         =   2;    
-//   const int HIGHGAIN    =   1;
-//   const int LOWGAIN     =   0;
-//   const int ALTROMAXSAMPLES = 1008;    /**<The maximum number of samples of the ALTRO*/
-//   const int ALTROMAXPRESAMPLES = 15;        
-//   const int NALTROS        =   4;      /**<Number of ALTROs per frontend card*/
-//   const int NALTROCHANNELS =  16;
-
-//   //FEE constants common to PHOS EMCAL
-//   const int CSPSPERFEE    = 32;
-//   const int NBRANCHES      =   2;   
-//   const int MAXHWADDRESSES = 4096;
-  
-//   namespace EmcalHLTConst
-//   {
-//     const int NZROWSMOD      =  48;   /**<Number of rows per module*/       
-//     const int NXCOLUMNSMOD   =  24;   /**<Number of columns per module*/ 
-//     const int NRCUSPERSECTOR = 4;     /**<Number of RCUs per sector*/
-//     const int NMODULES    =    10;    /**<Number of modules of the EMCAL detector*/
-//     const int NRCUSPERMODULE =  2 ;   /**<Number of RCUs per Module*/
-//     const int NFEECS         =  9;    /**<Number of Frontend cards per branch*/
-//   };
-  
-//   namespace PhosHLTConst
-//   {
-//     const int NZROWSMOD      =  56;   /**<Number of rows per module*/       
-//     const int NXCOLUMNSMOD   =  64;   /**<Number of columns per module*/ 
-//     const int NMODULES    =    5;     /**<Number of modules of the PHOS detector*/
-//     const int NRCUSPERMODULE =  4 ;   /**<Number of RCUs per Module*/
-//     const int NFEECS         =  14;   /**<Number of Frontend cards per branch*/
-//   };
-  
-// };
-
-
-// namespace CALO  =  CaloHLTConst; // just for easier notation
-// namespace EMCAL =  CaloHLTConst::EmcalHLTConst;
-// namespace PHOS  =  CaloHLTConst::PhosHLTConst;
-
-
-
-
 class AliHLTCaloConstants
 {
 public:
@@ -84,8 +37,8 @@ public:
   static  Int_t GetNALTROS()           { return ALTRO::NALTROS; };
   static  Int_t GetNALTROCHANNELS()    { return ALTRO::NALTROCHANNELS; };
   static  Int_t GetNBRANCHES()         { return CALO::NBRANCHES; };    
-  static Int_t GetMAXHWADDRESSES() { return CALO::MAXHWADDRESSES; }
-
+  //static  Int_t GetMAXHWADDRESSES() { return CALO::MAXHWADDRESSES; }
+  static  Int_t GetMAXHWADDRESSES() { return PHOS::MAXHWADDR; }
   // Detector specific stuff
   // PHOS Only, bad move somewher else, PTH
   virtual Int_t GetNZROWSRCU() const  { return   56 ; } ; 
index d13ed078b125aafce1794a42083ee2600608b32a..00d2369f45fb96e28ebb4c047a5364eb9e9b296c 100644 (file)
@@ -25,6 +25,7 @@ using EMCAL::NZROWSMOD;
 using EMCAL::NMODULES;
 using EMCAL::NRCUSPERMODULE;
 using EMCAL::NRCUSPERSECTOR;
+using EMCAL::MAXHWADDR;
 
 AliHLTEMCALMapper::AliHLTEMCALMapper(const unsigned long specification ) : AliHLTCaloMapper(specification, "EMCAL")
 {
@@ -54,7 +55,7 @@ AliHLTEMCALMapper::InitAltroMapping(const unsigned long specification )
 {
   char *base =  getenv("ALICE_ROOT");
   int  nChannels = 0;
-  int  maxaddr = 0;
+  int  maxaddr = 0; // keep as dummy for now
   int  tmpHwaddr = 0;
   int tmpZRow = 0;
   int tmpXCol = 0;
@@ -71,9 +72,11 @@ AliHLTEMCALMapper::InitAltroMapping(const unsigned long specification )
        {
          res = fscanf(fp, "%d\n", &nChannels);
          res = fscanf(fp, "%d\n", &maxaddr);
-         fHw2geomapPtr = new fAltromap[maxaddr +1]; 
-
-         for(int i=0; i< maxaddr + 1 ; i ++)
+         //      fHw2geomapPtr = new fAltromap[maxaddr +1]; 
+         fHw2geomapPtr = new fAltromap[MAXHWADDR +1];
+       
+         for(int i=0; i< MAXHWADDR + 1 ; i ++) 
+           //for(int i=0; i< maxaddr + 1 ; i ++)
            {
              fHw2geomapPtr[i].fXCol = 0;
              fHw2geomapPtr[i].fZRow = 0;
@@ -85,9 +88,12 @@ AliHLTEMCALMapper::InitAltroMapping(const unsigned long specification )
              
              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;