]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTrackParam.cxx
Coverity warning
[u/mrichter/AliRoot.git] / MUON / AliMUONTrackParam.cxx
index 42f218a496062dd943e35964225480214c6be251..af0500dc42c23f99b2a4223f6f6f007336763131 100644 (file)
 
 #include <Riostream.h>
 
+using std::setw;
+using std::setprecision;
+using std::endl;
+using std::cout;
 /// \cond CLASSIMP
 ClassImp(AliMUONTrackParam) // Class implementation in ROOT context
 /// \endcond
@@ -52,6 +56,7 @@ AliMUONTrackParam::AliMUONTrackParam()
     fLocalChi2(0.)
 {
   /// Constructor
+  fParameters.Zero();
 }
 
   //_________________________________________________________________________
@@ -232,7 +237,7 @@ Double_t AliMUONTrackParam::P() const
   if (TMath::Abs(fParameters(4,0)) > 0) {
     Double_t pYZ = TMath::Abs(1.0 / fParameters(4,0));
     Double_t pZ = - pYZ / (TMath::Sqrt(1.0 + fParameters(3,0) * fParameters(3,0)));  // spectro. (z<0)
-    return TMath::Abs(pZ) * TMath::Sqrt(1.0 + fParameters(3,0) * fParameters(3,0) + fParameters(1,0) * fParameters(1,0));
+    return - pZ * TMath::Sqrt(1.0 + fParameters(3,0) * fParameters(3,0) + fParameters(1,0) * fParameters(1,0));
   } else return FLT_MAX;
 }
 
@@ -423,7 +428,7 @@ Bool_t AliMUONTrackParam::CompatibleTrackParam(const AliMUONTrackParam &trackPar
   
   // check Z parameters
   if (fZ != trackParam.fZ)
-    AliWarning(Form("Parameters are given at different Z position (%le : %le): results are meaningless", fZ, trackParam.fZ));
+    AliWarning(Form("Parameters are given at different Z position (%e : %e): results are meaningless", fZ, trackParam.fZ));
   
   // compute the parameter residuals
   TMatrixD deltaParam(fParameters, TMatrixD::kMinus, trackParam.fParameters);
@@ -470,7 +475,8 @@ void AliMUONTrackParam::Print(Option_t* opt) const
       "," <<  setw(5) << setprecision(3) << fZ <<
       ") cm, (px,py,pz)=(" << setw(5) << setprecision(3) << Px() <<
       "," << setw(5) << setprecision(3) << Py() <<
-      "," << setw(5) << setprecision(3) << Pz() << ") GeV/c" << endl;
+      "," << setw(5) << setprecision(3) << Pz() << ") GeV/c"
+      "," << "local chi2=" << GetLocalChi2() << endl;
   }
   else {
     cout << "<AliMUONTrackParam>"  << endl;