]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDcluster.cxx
Coverity fixes
[u/mrichter/AliRoot.git] / TRD / AliTRDcluster.cxx
index 1a04dd53fecfdb67ce2918baed3afc1600dfa131..4c612bfcbb0d5a5b09651a90a9e5e63b9b458f1b 100644 (file)
@@ -131,6 +131,11 @@ AliTRDcluster::AliTRDcluster(const AliTRDtrackletWord *const tracklet, Int_t det
   //
   // Constructor from online tracklet 
   //
+
+  for (Int_t i = 0; i < 7; i++) {
+    fSignals[i] = 0;
+  }
+
 }
 
 //_____________________________________________________________________________
@@ -170,15 +175,40 @@ AliTRDcluster &AliTRDcluster::operator=(const AliTRDcluster &c)
 {
   //
   // Assignment operator
-  // 
+  //
 
-  if (this != &c) {
-    ((AliTRDcluster &) c).Copy(*this);
+  if (&c == this) {
+     return *this;
+  }
+
+  // Call the assignment operator of the base class
+  AliCluster::operator=(c);
+
+  fPadCol         = c.fPadCol;
+  fPadRow         = c.fPadRow;
+  fPadTime        = c.fPadTime;
+  fLocalTimeBin   = c.fLocalTimeBin;
+  fNPads          = c.fNPads;
+  fClusterMasking = c.fClusterMasking;
+  fDetector       = c.fDetector;
+  fQ              = c.fQ;
+  fCenter         = c.fCenter;
+
+  SetLabel(c.GetLabel(0),0);
+  SetLabel(c.GetLabel(1),1);
+  SetLabel(c.GetLabel(2),2);
+
+  SetY(c.GetY());
+  SetZ(c.GetZ());
+  SetSigmaZ2(c.GetSigmaZ2());
+
+  for (Int_t i = 0; i < 7; i++) {
+    fSignals[i] = c.fSignals[i];
   }
 
   return *this;
 
-}
+} 
 
 //_____________________________________________________________________________
 void AliTRDcluster::AddTrackIndex(const Int_t * const track)
@@ -778,6 +808,8 @@ void AliTRDcluster::SetSigmaY2(Float_t s2, Float_t dt, Float_t exb, Float_t x, F
   }
 
   // store tg^2(phi-a_L) and tg^2(a_L)
+  // limit parametrization to a maximum angle of 25 deg
+  if(TMath::Abs(tgp)>0.466) tgp = (tgp>0.)?0.466:-0.466;
   Double_t tgg = (tgp-exb)/(1.+tgp*exb); tgg *= tgg;
   Double_t exb2= exb*exb;