]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/TPCLib/AliHLTTPCConfMapTrack.cxx
- coverity fix 10181
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCConfMapTrack.cxx
index 2515436dcb782b2a6a8bf7fa6b2651afd1c0aee8..58c457cd77ac97e67cf21ef62f4135267989bd93 100644 (file)
@@ -1,9 +1,28 @@
 // @(#) $Id$
+// Original: AliHLTConfMapTrack.cxx,v 1.16 2005/06/14 10:55:21 cvetan 
 
-// Author: Anders Vestbo <mailto:vestbo@fi.uib.no>, Uli Frankenfeld <mailto:franken@fi.uib.no>
-//*-- Copyright &copy ALICE HLT Group 
+//**************************************************************************
+//* This file is property of and copyright by the ALICE HLT Project        * 
+//* ALICE Experiment at CERN, All rights reserved.                         *
+//*                                                                        *
+//* Primary Authors: Anders Vestbo, maintained by                          *
+//*                  Matthias Richter <Matthias.Richter@ift.uib.no>        *
+//*                  for The ALICE HLT Project.                            *
+//*                                                                        *
+//* Permission to use, copy, modify and distribute this software and its   *
+//* documentation strictly for non-commercial purposes is hereby granted   *
+//* without fee, provided that the above copyright notice appears in all   *
+//* copies and that both the copyright notice and this permission notice   *
+//* appear in the supporting documentation. The authors make no claims     *
+//* about the suitability of this software for any purpose. It is          *
+//* provided "as is" without express or implied warranty.                  *
+//**************************************************************************
 
-#include "AliHLTTPCStandardIncludes.h"
+/** @file   AliHLTTPCConfMapTrack.cxx
+    @author Anders Vestbo, maintained by Matthias Richter
+    @date   
+    @brief  Track class for conformal mapper
+*/
 
 #include "AliHLTTPCRootTypes.h"
 #include "AliHLTTPCLogging.h"
 #include "AliHLTTPCConfMapFit.h"
 #include "AliHLTTPCConfMapTrack.h"
 #include "AliHLTTPCTransform.h"
-#include "AliHLTTPC.h"
-
-/** \class AliHLTTPCConfMapTrack
-<pre>
-//_____________________________________________________________
-// AliHLTTPCConfMapTrack
-//
-// Track class for conformal mapper
-</pre>
-*/
 
 #if __GNUC__ >= 3
 using namespace std;
@@ -31,6 +40,26 @@ ClassImp(AliHLTTPCConfMapTrack)
 
 
 AliHLTTPCConfMapTrack::AliHLTTPCConfMapTrack()
+  :
+  fCurrentHit(0),
+  fLastHit(0),
+  fFirstHit(0),
+  fs11Xy(0),
+  fs12Xy(0),
+  fs22Xy(0),
+  fg1Xy(0),
+  fg2Xy(0),
+  fs11Sz(0),
+  fs12Sz(0),
+  fs22Sz(0),
+  fg1Sz(0),
+  fg2Sz(0),
+  fddXy(0),
+  fa1Xy(0),
+  fa2Xy(0),
+  fddSz(0),
+  fa1Sz(0),
+  fa2Sz(0)
 {
   //Constructor
   fChiSq[0] = 0.;
@@ -164,37 +193,80 @@ void AliHLTTPCConfMapTrack::UpdateParam(AliHLTTPCConfMapPoint *thisHit)
 
 void AliHLTTPCConfMapTrack::Fill(AliHLTTPCVertex *vertex,Double_t max_Dca)
 {
-  //Fill track variables with or without fit.
-  
-  //fRadius = sqrt(fa2Xy*fa2Xy+1)/(2*fabs(fa1Xy));
-  Double_t radius = sqrt(fa2Xy*fa2Xy+1)/(2*fabs(fa1Xy));
-  SetRadius(radius);
-
-  //fPt = (Double_t)(AliHLTTPCTransform::GetBFieldValue() * fRadius);
-  Double_t pt = (Double_t)(AliHLTTPCTransform::GetBFieldValue() * GetRadius());
-  SetPt(pt);
+    //Fill track variables with or without fit.
+    
+    // for straight line fit
+    if (AliHLTTPCTransform::GetBFieldValue() == 0.0 ){
 
-  if(GetPt() > max_Dca) //go for fit of helix in real space
-    {
-      AliHLTTPCConfMapFit *fit = new AliHLTTPCConfMapFit(this,vertex);
-      ComesFromMainVertex(AliHLTTPC::DoVertexFit());
-      fit->FitHelix();
-      
-      //AliHLTTPCConfMapPoint *lHit = (AliHLTTPCConfMapPoint*)fLastHit;
-      AliHLTTPCConfMapPoint *fHit = (AliHLTTPCConfMapPoint*)fFirstHit;
-      SetLastPoint(fHit->GetX(),fHit->GetY(),fHit->GetZ());
+       SetRadius(0.);  
+       SetPt(0.);
+       
+       //go for fit of straight line in real space
+       AliHLTTPCConfMapFit *fit = new AliHLTTPCConfMapFit(this,vertex);
+    /* Matthias 13.12.2006
+     * the global variable AliHLTTPCS::fgDoVertexFit has never been used so far
+     * and has always been kTRUE.
+     * In order to remove the AliHLTTPC class (which is the old steering class for
+     * HLT (TPC) tracking) from the compilation, this function can not be activated
+     * again. We have to think about a more elegant way to specify the parameters
+     * anyway. 
+       ComesFromMainVertex(AliHLTTPC::DoVertexFit());
+     */
+       ComesFromMainVertex(kTRUE);
+       fit->FitStraightLine();
+           
+       AliHLTTPCConfMapPoint *fHit = (AliHLTTPCConfMapPoint*)fFirstHit;
+       SetLastPoint(fHit->GetX(),fHit->GetY(),fHit->GetZ());
+       
+       UpdateToFirstPoint();
+       
+       delete fit;
+       
+    }
+    // for helix fit
+    else { 
+      //fRadius = sqrt(fa2Xy*fa2Xy+1)/(2*fabs(fa1Xy));
+      Double_t radius = sqrt(fa2Xy*fa2Xy+1)/(2*fabs(fa1Xy));
+      SetRadius(radius);
       
-      UpdateToFirstPoint();
+      //fPt = (Double_t)(AliHLTTPCTransform::GetBFieldValue() * fRadius);
+      Double_t pt = (Double_t)(AliHLTTPCTransform::GetBFieldValue() * GetRadius());
+      SetPt(pt);
+      //Set Error here?????
       
-      delete fit;
-    }
-  else if(GetPt() == 0)
-    LOG(AliHLTTPCLog::kError,"AliHLTTPCConfMapTrack::Fill","Tracks")<<AliHLTTPCLog::kDec<<
-      "Found track with Pt=0!!!"<<ENDLOG;
-  else
-    {
-      LOG(AliHLTTPCLog::kError,"AliHLTTPCConfMapTrack::Fill","Tracks")<<AliHLTTPCLog::kDec<<
-       "Track with pt<max_Dca :"<<GetPt()<<ENDLOG;
+      if(GetPt() > max_Dca) //go for fit of helix in real space
+       {
+         AliHLTTPCConfMapFit *fit = new AliHLTTPCConfMapFit(this,vertex);
+    /* Matthias 13.12.2006
+     * the global variable AliHLTTPCS::fgDoVertexFit has never been used so far
+     * and has always been kTRUE.
+     * In order to remove the AliHLTTPC class (which is the old steering class for
+     * HLT (TPC) tracking) from the compilation, this function can not be activated
+     * again. We have to think about a more elegant way to specify the parameters
+     * anyway. 
+           ComesFromMainVertex(AliHLTTPC::DoVertexFit());
+     */
+         ComesFromMainVertex(kTRUE);
+         fit->FitHelix();
+         
+         //AliHLTTPCConfMapPoint *lHit = (AliHLTTPCConfMapPoint*)fLastHit;
+         AliHLTTPCConfMapPoint *fHit = (AliHLTTPCConfMapPoint*)fFirstHit;
+         SetLastPoint(fHit->GetX(),fHit->GetY(),fHit->GetZ());
+         
+         UpdateToFirstPoint();
+         
+         delete fit;
+       }
+      else if(GetPt() == 0) 
+       {
+         LOG(AliHLTTPCLog::kError,"AliHLTTPCConfMapTrack::Fill","Tracks")<<AliHLTTPCLog::kDec<<
+           "Found track with Pt=0!!!"<<ENDLOG;
+       }
+      else
+       {
+         LOG(AliHLTTPCLog::kError,"AliHLTTPCConfMapTrack::Fill","Tracks")<<AliHLTTPCLog::kDec<<
+           "Track with pt<max_Dca :"<<GetPt()<<ENDLOG;
+       }
     }
 }