]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTrackReconstructor.cxx
Update HFE v2 analyses
[u/mrichter/AliRoot.git] / MUON / AliMUONTrackReconstructor.cxx
index 303af9148c0f32a2752958a21ab2fbbbc2fa0968..8a41b4c726e3fd9e9d862f464255703a981f5acf 100644 (file)
@@ -36,6 +36,7 @@
 #include "AliMUONTrackParam.h"
 #include "AliMUONTrackExtrap.h"
 #include "AliMUONRecoParam.h"
+#include "AliMUONGeometryTransformer.h"
 
 #include "AliMpArea.h"
 
 #include <Riostream.h>
 #include <TMath.h>
 #include <TMatrixD.h>
+#include <TClonesArray.h>
 
 // Functions to be minimized with Minuit
 void TrackChi2(Int_t &nParam, Double_t *gradient, Double_t &chi2, Double_t *param, Int_t flag);
 
+using std::endl;
+using std::cout;
 /// \cond CLASSIMP
 ClassImp(AliMUONTrackReconstructor) // Class implementation in ROOT context
 /// \endcond
 
   //__________________________________________________________________________
-AliMUONTrackReconstructor::AliMUONTrackReconstructor(const AliMUONRecoParam* recoParam, AliMUONVClusterServer* clusterServer)
-  : AliMUONVTrackReconstructor(recoParam,clusterServer)
+AliMUONTrackReconstructor::AliMUONTrackReconstructor(const AliMUONRecoParam* recoParam, AliMUONVClusterServer* clusterServer,
+                                                    const AliMUONGeometryTransformer* transformer)
+  : AliMUONVTrackReconstructor(recoParam, clusterServer, transformer)
 {
   /// Constructor
 }
@@ -124,21 +129,17 @@ Bool_t AliMUONTrackReconstructor::MakeTrackCandidates(AliMUONVClusterStore& clus
          fNRecTracks--;
        } else if (fNRecTracks > GetRecoParam()->GetMaxTrackCandidates()) {
          AliError(Form("Too many track candidates (%d tracks). Stop tracking.", fNRecTracks));
-         delete segments;
          return kFALSE;
        }
       } else {
        if ((fNRecTracks + segments->GetEntriesFast() - iseg - 1) > GetRecoParam()->GetMaxTrackCandidates()) {
          AliError(Form("Too many track candidates (%d tracks). Stop tracking.", fNRecTracks + segments->GetEntriesFast() - iseg - 1));
-         delete segments;
          return kFALSE;
        }
       }
       
     }
     
-    // delete the array of segments
-    delete segments;
   }
   
   // Keep all different tracks or only the best ones as required
@@ -209,14 +210,11 @@ Bool_t AliMUONTrackReconstructor::MakeMoreTrackCandidates(AliMUONVClusterStore&
        // abort tracking if there are too many candidates
        if ((fNRecTracks + segments->GetEntriesFast() - iSegment - 1) > GetRecoParam()->GetMaxTrackCandidates()) {
          AliError(Form("Too many track candidates (%d tracks). Stop tracking.", fNRecTracks + segments->GetEntriesFast() - iSegment - 1));
-         delete segments;
          return kFALSE;
        }
        
       }
       
-      // delete the array of segments
-      delete segments;
     }
   }
   
@@ -1256,6 +1254,7 @@ void AliMUONTrackReconstructor::Fit(AliMUONTrack &track, Bool_t includeMCS, Bool
     // Covariance matrix according to HESSE status
     // If problem then keep only the diagonal terms (variances)
     Double_t matrix[5][5];
+    for (Int_t i=0; i<5; i++) for (Int_t j=0; j<5; j++) matrix[i][j] = 0.;
     gMinuit->mnemat(&matrix[0][0],5);
     if (covStatus == 3) trackParam->SetCovariances(matrix);
     else trackParam->SetVariances(matrix);