]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
corrections to write ESD format (Gaute)
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 9 Jul 2007 18:45:31 +0000 (18:45 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 9 Jul 2007 18:45:31 +0000 (18:45 +0000)
HLT/TPCLib/AliHLTTPCTrack.cxx
HLT/TPCLib/AliHLTTPCTrackArray.cxx

index 0a04924411a3ae5892827b0cd64954f98d7a9ed8..bbe313358752264c6ae4924809139e2143dad93b 100644 (file)
@@ -2,11 +2,12 @@
 // Original: AliHLTTrack.cxx,v 1.32 2005/06/14 10:55:21 cvetan 
 
 /**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * This file is property of and copyright by the ALICE HLT Project        * 
+ * ALICE Experiment at CERN, All rights reserved.                         *
  *                                                                        *
- * Authors: Anders Vestbo, Uli Frankenfeld                                *
- *          Matthias Richter <Matthias.Richter@ift.uib.no>                *
- *          for The ALICE Off-line Project.                               *
+ * Primary Authors: Anders Vestbo, Uli Frankenfeld, 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   *
@@ -649,11 +650,41 @@ int AliHLTTPCTrack::Convert2AliKalmanTrack()
   // sector A00 starts at 3 o'clock, sectors are counted counterclockwise
   // median of sector 00 is at 10 degrees, median of sector A04 at 90
   //
+  Double_t xhit;
+  Double_t charge=-1.0 * (double) GetCharge();
+  Double_t xx[5];
+  xx[1] = GetFirstPointZ();
+  xx[3] = GetTgl();
+  xx[4] = charge*(1.0/GetPt());
+
   Double_t alpha = 0;
-  alpha = fmod((2*GetSector()+1)*(TMath::Pi()/18),2*TMath::Pi());
-  if      (alpha < -TMath::Pi()) alpha += 2*TMath::Pi();
-  else if (alpha >= TMath::Pi()) alpha -= 2*TMath::Pi();
+  if(GetSector() == -1){
+    alpha = TMath::ATan(fabs(GetFirstPointY())/fabs(GetFirstPointX()));
 
+    if(GetFirstPointX()<0 && GetFirstPointY()>=0){
+      alpha = alpha + TMath::PiOver2();
+    }
+    else if(GetFirstPointX()<0 && GetFirstPointY()<0){
+      alpha = -TMath::Pi() + alpha;
+    }
+    else if(GetFirstPointX()>=0 && GetFirstPointY()<0){
+      alpha = -alpha;
+    }
+    xhit = GetFirstPointX()*TMath::Cos(alpha) + GetFirstPointY()*TMath::Sin(alpha);
+    xx[0] = -(GetFirstPointX()*TMath::Sin(alpha)) + GetFirstPointY()*TMath::Cos(alpha);
+    xx[2] = TMath::Sin(GetPsi()-alpha);
+  }
+  else{
+    alpha = fmod((2*GetSector()+1)*(TMath::Pi()/18),2*TMath::Pi());
+    if      (alpha < -TMath::Pi()) alpha += 2*TMath::Pi();
+    else if (alpha >= TMath::Pi()) alpha -= 2*TMath::Pi();
+    
+    xhit = GetFirstPointX();
+    xx[0] = GetFirstPointY();
+    xx[2] = TMath::Sin(GetPsi());
+  }
+  
+  
   //covariance matrix
   Double_t cov[15]={
     0.,
@@ -663,22 +694,11 @@ int AliHLTTPCTrack::Convert2AliKalmanTrack()
     0.,  0.,  0.,  0.,  0.
   };
 
-  Double_t charge=-1.0 * (double) GetCharge();
-  Double_t xhit = GetFirstPointX();
-  Double_t xx[5];
-  xx[0] = GetFirstPointY();
-  xx[1] = GetFirstPointZ();
-  xx[2] = TMath::Sin(GetPsi());
-  xx[3] = GetTgl();
-  xx[4] = charge*(1.0/GetPt());
-  //cout << "xhit=" << xhit << " y=" << xx[0] << " z=" << xx[1] << endl;
-  //cout << "alpha=" << alpha << endl;
-
   Int_t nCluster = GetNHits();
   fdEdx=0;
 
   // the Set function was not available in earlier versions, check done
-  // during configure; for the AliRoot build, by default ON 
+  // during configure; for the AliRoot build, by default ON
 #ifdef EXTERNALTRACKPARAM_V1
 #warning track conversion to ESD format needs AliRoot version > v4-05-04
   //TODO (Feb 07): make this a real warning when logging system is adapted
index c5348eace90d619a49c800951f8a524b82515603..86992a5215c6676c251b6a524b2d469e3f479c13 100644 (file)
@@ -2,11 +2,12 @@
 // Original: AliHLTTrackArray.cxx,v 1.21 2005/06/14 10:55:21 cvetan 
 
 /**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * This file is property of and copyright by the ALICE HLT Project        * 
+ * ALICE Experiment at CERN, All rights reserved.                         *
  *                                                                        *
- * Authors: Uli Frankenfeld                                               *
- *          Matthias Richter <Matthias.Richter@ift.uib.no>                *
- *          for The ALICE Off-line Project.                               *
+ * Primary Authors: Uli Frankenfeld, 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   *
@@ -299,17 +300,17 @@ void AliHLTTPCTrackArray::FillTracks(Int_t ntracks, AliHLTTPCTrackSegmentData* t
     track->SetLastPoint(last[0],last[1],last[2]);
     track->SetHits( trs->fNPoints, trs->fPointIDs );
 
-    if (slice>=0 && bTransform!=0)  {
+    //if (slice>=0 && bTransform!=0)  {
       // Matthias Feb07: as everything is now in global coordinates, sector should
       // be set to 0. But as the display does a check on the sector, we have to set
       // it to the slice no. I suspect, that the transformation is done twice.
       //track->SetSector(0);
       track->SetSector(slice);
-    } else {
+    //} else {
       // the parameters are in local coordinates, set the sector no
       //#ifndef INCLUDE_TPC_HOUGH
-      if (slice<0) track->SetSector(0);
-      else track->SetSector(slice);
+      //if (slice<0) track->SetSector(0);
+      //else track->SetSector(slice);
       //#else 
       // Matthias Feb 2007: this is some kind of legacy ...
       // the INCLUDE_TPC_HOUGH has never been switched on in the new TPCLib
@@ -327,7 +328,7 @@ void AliHLTTPCTrackArray::FillTracks(Int_t ntracks, AliHLTTPCTrackSegmentData* t
       }
       //track->SetSector(trs->fSector);
       //#endif // INCLUDE_TPC_HOUGH
-    }
+      //}
 
     // this is currently a quick hack for straight lines of the first version 
     // of the CA tracker.