Coverity warnings corrected.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 26 Nov 2011 19:19:53 +0000 (19:19 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 26 Nov 2011 19:19:53 +0000 (19:19 +0000)
JETAN/AliJetGrid.cxx
JETAN/AliJetUnitArray.cxx

index a0b18b0..8592d94 100644 (file)
@@ -169,39 +169,42 @@ AliJetGrid::AliJetGrid(const AliJetGrid& grid) :
 AliJetGrid& AliJetGrid::operator=(const AliJetGrid& other)
 {
   // Assignment
-  fGrid = other.fGrid;
-  fNphi = other.fNphi;        
-  fNeta = other.fNeta;      
-  fPhi    = 0;       
-  fEta    = 0;       
-  fIndex  = 0;     
-  fIndexI = other.fIndexI;    
-  fIndexJ = other.fIndexJ;    
-  fPhiMin = other.fPhiMin;    
-  fPhiMax = other.fPhiMax;    
-  fEtaMin = other.fEtaMin;    
-  fEtaMax = other.fEtaMax;    
-  fEtaBinInTPCAcc   = other.fEtaBinInTPCAcc;   
-  fPhiBinInTPCAcc   = other.fPhiBinInTPCAcc;   
-  fEtaBinInEMCalAcc = other.fEtaBinInEMCalAcc; 
-  fPhiBinInEMCalAcc = other.fPhiBinInEMCalAcc; 
-  fNbinEta = other.fNbinEta;
-  fNbinPhi = other.fNbinPhi;
-  fMaxPhi  = other.fMaxPhi;
-  fMinPhi  = other.fMinPhi;
-  fMaxEta  = other.fMaxEta;
-  fMinEta  = other.fMinEta;
-  fDebug   = other.fDebug;
-  fPhi = new TArrayD(fNphi+1);
-  for(Int_t i=0; i<fNphi+1; i++) (*fPhi)[i] = other.fPhi->At(i);
-  fEta = new TArrayD(fNeta+1);
-  for(Int_t i=0; i<fNeta+1; i++) (*fEta)[i] = other.fEta->At(i);
+    if (this != &other) {
+       fGrid = other.fGrid;
+       fNphi = other.fNphi;        
+       fNeta = other.fNeta;      
+       fPhi    = 0;       
+       fEta    = 0;       
+       fIndex  = 0;     
+       fIndexI = other.fIndexI;    
+       fIndexJ = other.fIndexJ;    
+       fPhiMin = other.fPhiMin;    
+       fPhiMax = other.fPhiMax;    
+       fEtaMin = other.fEtaMin;    
+       fEtaMax = other.fEtaMax;    
+       fEtaBinInTPCAcc   = other.fEtaBinInTPCAcc;   
+       fPhiBinInTPCAcc   = other.fPhiBinInTPCAcc;   
+       fEtaBinInEMCalAcc = other.fEtaBinInEMCalAcc; 
+       fPhiBinInEMCalAcc = other.fPhiBinInEMCalAcc; 
+       fNbinEta = other.fNbinEta;
+       fNbinPhi = other.fNbinPhi;
+       fMaxPhi  = other.fMaxPhi;
+       fMinPhi  = other.fMinPhi;
+       fMaxEta  = other.fMaxEta;
+       fMinEta  = other.fMinEta;
+       fDebug   = other.fDebug;
+       fPhi = new TArrayD(fNphi+1);
+       for(Int_t i=0; i<fNphi+1; i++) (*fPhi)[i] = other.fPhi->At(i);
+       fEta = new TArrayD(fNeta+1);
+       for(Int_t i=0; i<fNeta+1; i++) (*fEta)[i] = other.fEta->At(i);
   
-  fIndex = new TMatrixD(fNphi+1,fNeta+1);
-  for(Int_t i=0; i<fNphi+1; i++) {
-    for(Int_t j=0; j<fNeta+1; j++) (*fIndex)(i,j)=(*other.fIndex)(i,j);
-  }
-  return *this;
+       fIndex = new TMatrixD(fNphi+1,fNeta+1);
+       for(Int_t i=0; i<fNphi+1; i++) {
+           for(Int_t j=0; j<fNeta+1; j++) (*fIndex)(i,j)=(*other.fIndex)(i,j);
+       }
+    }
+    
+    return *this;
 }
 
 //__________________________________________________________
index cdad53b..7f024e5 100644 (file)
@@ -150,30 +150,31 @@ AliJetUnitArray::AliJetUnitArray(const AliJetUnitArray& rUnit):
 AliJetUnitArray& AliJetUnitArray::operator=(const AliJetUnitArray& rhs)
 {
   // Assignment
-  fUnitEnergy = rhs.fUnitEnergy;
-  fUnitEta = rhs.fUnitEta;
-  fUnitPhi = rhs.fUnitPhi;
-  fUnitDeta = rhs.fUnitDeta;
-  fUnitDphi = rhs.fUnitDphi;
-  fUnitID = rhs.fUnitID;
-  fUnitTrackID = rhs.fUnitTrackID;
-  fUnitNum = rhs.fUnitNum;
-  fUnitClusterID = rhs.fUnitClusterID;
-  fUnitFlag = rhs.fUnitFlag;
-  fUnitCutFlag = rhs.fUnitCutFlag;
-  fUnitCutFlag2 = rhs.fUnitCutFlag2;
-  fUnitSignalFlag = rhs.fUnitSignalFlag;
-  fUnitDetectorFlag = rhs.fUnitDetectorFlag;
-  fUnitPx = rhs.fUnitPx;
-  fUnitPy = rhs.fUnitPy;
-  fUnitPz = rhs.fUnitPz;
-  fUnitMass = rhs.fUnitMass;
-  fVc = rhs.fVc;
-  fVn = rhs.fVn;
-  fUnitTrackRef = rhs.fUnitTrackRef;
-  fUnitCellRef = rhs.fUnitCellRef;
-  fUnitClusterRef = rhs.fUnitClusterRef;
-
+    if (this != &rhs) {
+       fUnitEnergy = rhs.fUnitEnergy;
+       fUnitEta = rhs.fUnitEta;
+       fUnitPhi = rhs.fUnitPhi;
+       fUnitDeta = rhs.fUnitDeta;
+       fUnitDphi = rhs.fUnitDphi;
+       fUnitID = rhs.fUnitID;
+       fUnitTrackID = rhs.fUnitTrackID;
+       fUnitNum = rhs.fUnitNum;
+       fUnitClusterID = rhs.fUnitClusterID;
+       fUnitFlag = rhs.fUnitFlag;
+       fUnitCutFlag = rhs.fUnitCutFlag;
+       fUnitCutFlag2 = rhs.fUnitCutFlag2;
+       fUnitSignalFlag = rhs.fUnitSignalFlag;
+       fUnitDetectorFlag = rhs.fUnitDetectorFlag;
+       fUnitPx = rhs.fUnitPx;
+       fUnitPy = rhs.fUnitPy;
+       fUnitPz = rhs.fUnitPz;
+       fUnitMass = rhs.fUnitMass;
+       fVc = rhs.fVc;
+       fVn = rhs.fVn;
+       fUnitTrackRef = rhs.fUnitTrackRef;
+       fUnitCellRef = rhs.fUnitCellRef;
+       fUnitClusterRef = rhs.fUnitClusterRef;
+    }
   return *this;
 
 }