- fixing coverity issues
authorodjuvsla <odjuvsla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 21 Mar 2011 16:51:09 +0000 (16:51 +0000)
committerodjuvsla <odjuvsla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 21 Mar 2011 16:51:09 +0000 (16:51 +0000)
HLT/PHOS/AliHLTPHOSClusterizerComponentNbyN.cxx
HLT/PHOS/AliHLTPHOSDigitMakerComponent.cxx
HLT/PHOS/AliHLTPHOSRawAnalyzerCrudeComponent.h
HLT/PHOS/AliHLTPHOSRecoParamHandler.cxx

index de761ed..180f53f 100644 (file)
@@ -62,7 +62,14 @@ int AliHLTPHOSClusterizerComponentNbyN::ScanConfigurationArgument(int argc, cons
         if (++i >= argc) return -EPROTO;
         argument = argv[i];
        AliHLTCaloClusterizerNbyN* tmp = dynamic_cast<AliHLTCaloClusterizerNbyN*>(fClusterizerPtr);
-        tmp->SetGridDimension(argument.Atoi());
+       if(tmp) 
+         {
+           tmp->SetGridDimension(argument.Atoi());
+         }
+       else 
+         {
+           return -1;
+         }
         return 1;
     }
     
index 8bdd1a1..3158f1b 100644 (file)
@@ -163,14 +163,18 @@ AliHLTPHOSDigitMakerComponent::DoEvent(const AliHLTComponentEventData& evtData,
       {
         AliHLTPHOSMapper mapper;
         Int_t module = mapper.GetModuleFromSpec(iter->fSpecification);
-        for(Int_t x = 0; x < fCaloConstants->GetNXCOLUMNSMOD(); x++)
-        {
-           for(Int_t z = 0; z < fCaloConstants->GetNZROWSMOD(); z++)
-           {
-               fDigitMakerPtr->SetGain(x, z, fCalibData->GetHighLowRatioEmc(5-module, z+1, x+1), fCalibData->GetADCchannelEmc(5-module, z+1, x+1));
-           }
+        if(module >= 0 && module < 5)
+          {
+            for(Int_t x = 0; x < fCaloConstants->GetNXCOLUMNSMOD(); x++)
+              {
+                for(Int_t z = 0; z < fCaloConstants->GetNZROWSMOD(); z++)
+                  {
+                    fDigitMakerPtr->SetGain(x, z, fCalibData->GetHighLowRatioEmc(5-module, z+1, x+1), fCalibData->GetADCchannelEmc(5-module, z+1, x+1));
+                  }
+              }
+            fGainsInitialised = true;
         }
-        fGainsInitialised = true;
+
       }
 
       specification |= iter->fSpecification;
index 13dd4b5..e3bc1fe 100644 (file)
@@ -19,7 +19,7 @@ class AliHLTPHOSRawAnalyzerCrudeComponent: public AliHLTPHOSRawAnalyzerComponent
   AliHLTPHOSRawAnalyzerCrudeComponent();
   virtual ~AliHLTPHOSRawAnalyzerCrudeComponent();
   AliHLTPHOSRawAnalyzerCrudeComponent(const AliHLTPHOSRawAnalyzerCrudeComponent & );
-  AliHLTPHOSRawAnalyzerCrudeComponent & operator = (const AliHLTPHOSRawAnalyzerCrudeComponent)
+  AliHLTPHOSRawAnalyzerCrudeComponent & operator = (const AliHLTPHOSRawAnalyzerCrudeComponent&)
   {
     return *this;
   };
index 7b45b6a..20dc530 100644 (file)
@@ -46,11 +46,12 @@ Float_t AliHLTPHOSRecoParamHandler::GetCorrectedEnergy ( Float_t e )
 void AliHLTPHOSRecoParamHandler::FillParameters()
 {
    //See header file for class documentation
-   if(fRecoParamPtr)
+  AliPHOSRecoParam *tmp = dynamic_cast<AliPHOSRecoParam*>(fRecoParamPtr);
+   if(tmp)
    {
-      fLogWeight = dynamic_cast<AliPHOSRecoParam*>(fRecoParamPtr)->GetEMCLogWeight();
-      fRecPointMemberThreshold = dynamic_cast<AliPHOSRecoParam*>(fRecoParamPtr)->GetEMCMinE();
-      fRecPointThreshold = dynamic_cast<AliPHOSRecoParam*>(fRecoParamPtr)->GetEMCClusteringThreshold();
+      fLogWeight = tmp->GetEMCLogWeight();
+      fRecPointMemberThreshold = tmp->GetEMCMinE();
+      fRecPointThreshold = tmp->GetEMCClusteringThreshold();
    }
 }