]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
fixing Coverity defects
authoramastros <amastros@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 21 Jan 2011 10:34:36 +0000 (10:34 +0000)
committeramastros <amastros@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 21 Jan 2011 10:34:36 +0000 (10:34 +0000)
ITS/UPGRADE/AliITSUpgradeClusterFinder.cxx
ITS/UPGRADE/AliITSlayerUpgrade.cxx
ITS/UPGRADE/AliITSlayerUpgrade.h
ITS/UPGRADE/AliITSupgradeDigitizer.cxx

index ba6135911ed819ffc3e836faa275e4ac3a0e0777..04fe2116d3fd499eb9e7d28bb30d0b987b50797d 100644 (file)
@@ -60,6 +60,10 @@ AliITSUpgradeClusterFinder::AliITSUpgradeClusterFinder() :
   fTmpLabel[1]=-5;
   fTmpLabel[2]=-5;
   for(int il=0; il<10;il++) fLabels[il]=-5;
+  for(int k=0; k<999999; k++){
+  fHitCol[k]=999;
+  fHitRow[k]=999;
+  }
 }
 
 //___________________________________________________________________________________
index 8dbcadbd4c3cf11043df0696b7c9b3cbbe777ec6..bb38968b9e1730392212dc710deb9ed116a7403e 100644 (file)
@@ -28,6 +28,10 @@ AliITSlayerUpgrade::AliITSlayerUpgrade():
 {  //--------------------------------------------------------------------
   //default AliITSlayerUpgrade constructor
   //--------------------------------------------------------------------
+  for (Int_t i=0; i<AliITSRecoParam::fgkMaxClusterPerLayer; i++) {
+  fIndex[i] = -1;
+  fClusters[i]= 0x0;
+  }
 }
 //___________________________________________________________________________
 AliITSlayerUpgrade::AliITSlayerUpgrade(Double_t p,Double_t z):
@@ -40,7 +44,10 @@ AliITSlayerUpgrade::AliITSlayerUpgrade(Double_t p,Double_t z):
   //main AliITSlayerUpgrade constructor
   //--------------------------------------------------------------------
 
-  for (Int_t i=0; i<AliITSRecoParam::fgkMaxClusterPerLayer; i++) fClusters[i]=0;
+  for (Int_t i=0; i<AliITSRecoParam::fgkMaxClusterPerLayer; i++) {
+  fIndex[i] = -1;
+  fClusters[i]= 0x0;
+  }
 
 }
 
@@ -56,9 +63,14 @@ void AliITSlayerUpgrade::ResetClusters() {
   // This function removes loaded clusters
   //--------------------------------------------------------------------
 
-for (Int_t i=0; i<fN; i++) delete fClusters[i];
+  for (Int_t i=0; i<fN; i++) {
+  fIndex[i]=-1;
+  if(fClusters[i]) {
+    delete fClusters[i];
+    }
+  }
   fN=0;
-return;
+  return;
 }
 
 
@@ -67,7 +79,7 @@ Int_t AliITSlayerUpgrade::InsertCluster(AliITSRecPoint *c) {
   // This function inserts a cluster to this layer in increasing
   // order of the cluster's fZ
   //--------------------------------------------------------------------
-fClusters[fN]=c;
+  fClusters[fN]=c;
   fN++;
   return 0;
 }
@@ -86,10 +98,4 @@ const AliITSRecPoint *AliITSlayerUpgrade::GetNextCluster(Int_t &ci){
   }
   return c;
 }
-//_____________________________________________________________________
-  Int_t AliITSlayerUpgrade::GetNumberOfClusters() const {
-  Int_t n=0;
-  n=fN;
-return n;
-}
 
index bb85c9e7c1acd9284c8559e4eff07c1817ebb01a..4a68142696e675db6e7bfd100f413bcdde0a28c6 100644 (file)
     void ResetClusters();
     const AliITSRecPoint *GetNextCluster(Int_t &ci);
     AliITSRecPoint *GetCluster(Int_t i) const { return fClusters[i]; }
-    Int_t GetNumberOfClusters() const;
+    Int_t GetNumberOfClusters() const { return fN; }
   protected:
     AliITSlayerUpgrade(const AliITSlayerUpgrade&);
     AliITSlayerUpgrade &operator=(const AliITSlayerUpgrade &tr);
     Double_t fPhiOffset;        // offset of the first detector in Phi
     Double_t fZOffset;          // offset of the first detector in Z
-//    AliITSdetector *fDetectors; // array of detectors
 
     AliITSRecPoint *fClusters[AliITSRecoParam::fgkMaxClusterPerLayer]; // pointers to clusters
     Int_t fNsel;         // numbers of selected clusters 
index 4599812b8bfdf64c0a9589aef1e87fa40f1cc2d8..754ce1b618a0fdb54d0f3c6951000727630b338f 100644 (file)
@@ -150,8 +150,8 @@ void AliITSupgradeDigitizer::Sdigits2Digits(TClonesArray *pSDigitList,TObjArray
       if(tmpdig->GetPixId()==pixid) { 
        iNdigPart++; 
        if(iNdigPart<=3) {
-          tids[iNdigPart] = tmpdig->GetTrack(0);
-          elossID[iNdigPart] = tmpdig->GetSignal();
+          tids[iNdigPart-1] = tmpdig->GetTrack(0);
+          elossID[iNdigPart-1] = tmpdig->GetSignal();
        }     
        eloss+=tmpdig->GetSignal();
        nele+=tmpdig->GetNelectrons();