]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/src/AliL3ConfMapPoint.cxx
Setting more appropriate TOF resolution for TOF PID
[u/mrichter/AliRoot.git] / HLT / src / AliL3ConfMapPoint.cxx
index ab130037488f0bc32ee5a132df6bbd2d5fb9e325..ed94af24381945f5da0f8df05b83e2c61c477c26 100644 (file)
@@ -1,20 +1,28 @@
-//Author: Anders Strand Vestbo
+// @(#) $Id$
 
-//________________________________
-// AliL3ConfMapPoint
-//
-// Hit class for conformal mapper
+// Author: Anders Vestbo <mailto:vestbo$fi.uib.no>
+//*-- Copyright &copy ALICE HLT Group
 
-#include <iostream.h>
-#include <math.h>
-#include "AliL3Logging.h"
+#include "AliL3StandardIncludes.h"
 
+#include "AliL3Logging.h"
 #include "AliL3ConfMapPoint.h"
 #include "AliL3SpacePointData.h"
 #include "AliL3Vertex.h"
 #include "AliL3ConfMapTrack.h"
 
-//ClassImp(AliL3ConfMapPoint)
+/**
+<pre>
+//_____________________________________________________________
+// AliL3ConfMapPoint
+//
+// Hit class for conformal mapper
+</pre
+*/
+
+ClassImp(AliL3ConfMapPoint)
+
+Bool_t AliL3ConfMapPoint::fgDontMap=kFALSE;
 
 AliL3ConfMapPoint::AliL3ConfMapPoint()
 {
@@ -44,10 +52,12 @@ AliL3ConfMapPoint::AliL3ConfMapPoint()
 AliL3ConfMapPoint::~AliL3ConfMapPoint()
 {
   // Destructor.
-  // Does nothing except destruct. 
+  ;
 }
 
-Bool_t AliL3ConfMapPoint::ReadHits(AliL3SpacePointData* hits ){
+Bool_t AliL3ConfMapPoint::ReadHits(AliL3SpacePointData* hits )
+{
+  //read the hits
   SetHitNumber(hits->fID);
   SetPadRow(hits->fPadRow);
   Int_t slice = (hits->fID>>25) & 0x7f;
@@ -55,59 +65,68 @@ Bool_t AliL3ConfMapPoint::ReadHits(AliL3SpacePointData* hits ){
   SetX(hits->fX);
   SetY(hits->fY);
   SetZ(hits->fZ);
-  SetXerr(sqrt(hits->fXYErr));
-  SetYerr(sqrt(hits->fXYErr));
-  SetZerr(sqrt(hits->fZErr));
+  SetXerr(sqrt(hits->fSigmaY2));
+  SetYerr(sqrt(hits->fSigmaY2));
+  SetZerr(sqrt(hits->fSigmaZ2));
   return kTRUE;
 }
 
+void AliL3ConfMapPoint::Reset()
+{
+  //Reset this point.
+  SetUsage(kFALSE);
+  SetS(0);
+  fNextRowHit = 0;
+  fNextVolumeHit=0;
+  fNextTrackHit=0;
+}
+
 void AliL3ConfMapPoint::Setup(AliL3Vertex *vertex)
 {
-  //Setup. Sets the vertex, conformal coordinates, and phi and eta of each hit.
+  //Setup. Sets the vertex, conformal coordinates, 
+  //and phi and eta of each hit.
   
   SetIntPoint(vertex->GetX(),    vertex->GetY(),    vertex->GetZ(),
               vertex->GetXErr(), vertex->GetYErr(), vertex->GetZErr());
   SetShiftedCoord();
   SetConfCoord();
-  // The angles are set properly if they are set after the interaction point and the shifted coordinates
+  // The angles are set properly if they are set after 
+  // the interaction point and the shifted coordinates
   SetAngles();
   //SetDist(0., 0.);
-  
   return;
 }
 
-void AliL3ConfMapPoint::SetIntPoint(const Double_t in_x,const Double_t in_y, 
-                              const Double_t in_z,
-                              const Double_t in_x_err, const Double_t in_y_err, 
-                              const Double_t in_z_err)
+void AliL3ConfMapPoint::SetIntPoint(Double_t inx, Double_t iny, Double_t inz,
+                                   Double_t inxerr, Double_t inyerr, Double_t inzerr)
 {
   // Defines a new interaction point. This point is needed to calculate
   // the conformal coordinates.
 
-  SetXt(in_x);
-  SetYt(in_y);
-  SetZt(in_z);
-  SetXterr(in_x_err);
-  SetYterr(in_y_err);
-  SetZterr(in_z_err);
+  SetXt(inx);
+  SetYt(iny);
+  SetZt(inz);
+  SetXterr(inxerr);
+  SetYterr(inyerr);
+  SetZterr(inzerr);
 
   return;
 }
 
-void AliL3ConfMapPoint::SetAllCoord(const AliL3ConfMapPoint *preceding_hit)
+void AliL3ConfMapPoint::SetAllCoord(const AliL3ConfMapPoint *precedinghit)
 {
   // Sets the interaction point, the shifted coordinates, and the conformal mapping coordinates.
   // These values are calculated from the interaction point of the given cluster which should be a
   // already found cluster on the same track.
 
-  if (this == preceding_hit) {
-    SetIntPoint(preceding_hit->GetX(),    preceding_hit->GetY(),    preceding_hit->GetZ(),
-                preceding_hit->GetXerr(), preceding_hit->GetYerr(), preceding_hit->GetZerr());
+  if (this == precedinghit) {
+    SetIntPoint(precedinghit->GetX(),    precedinghit->GetY(),    precedinghit->GetZ(),
+                precedinghit->GetXerr(), precedinghit->GetYerr(), precedinghit->GetZerr());
   }
 
   else {
-    SetIntPoint(preceding_hit->GetXt(),    preceding_hit->GetYt(),    preceding_hit->GetZt(),
-                preceding_hit->GetXterr(), preceding_hit->GetYterr(), preceding_hit->GetZterr());
+    SetIntPoint(precedinghit->GetXt(),    precedinghit->GetYt(),    precedinghit->GetZt(),
+                precedinghit->GetXterr(), precedinghit->GetYterr(), precedinghit->GetZterr());
   }
 
   SetShiftedCoord();
@@ -138,6 +157,15 @@ void AliL3ConfMapPoint::SetConfCoord()
   // assumed to be at (0, 0, 0). Otherwise the function will use the
   // interaction point specified by fXt and fYt.
 
+  if(fgDontMap){
+    fXprime = fx;
+    fYprime = fy;
+    fWxy = 0;
+    fs = 0; //track trajectory
+    fWz = 0;
+    return;
+  }
+
   Double_t r2;
   Double_t xyErrorScale = 1;
   Double_t szErrorScale = 1;
@@ -146,26 +174,19 @@ void AliL3ConfMapPoint::SetConfCoord()
     {
       fXprime =  fXv / r2;
       fYprime = -fYv / r2;
-      //  fXprimeerr = TMath::Sqrt(TMath::Power((-fXv * fXv +   fYv*fYv) * fXverr, 2) + TMath::Power( 2*fXv*fYv*fYverr, 2)) / TMath::Power(fXv*fXv + fYv*fYv, 2);
-      // fXprimeerr = TMath::Sqrt(TMath::Power((-fXv * fXv - 3*fYv*fYv) * fYverr, 2) + TMath::Power(-2*fXv*fYv*fXverr, 2)) / TMath::Power(fXv*fXv + fYv*fYv, 2);
-    
       
       //set weights:
-      //fWxy = r2*r2 / (TMath::Power(xyErrorScale,2)*(TMath::Power(xerr,2)+TMath::Power(yerr,2)));
-      fWxy = r2*r2 / ((xyErrorScale*xyErrorScale)*((xerr*xerr)+(yerr*yerr)));
-      s = 0; //track trajectory
-      //fWz = (Double_t)(1./TMath::Power(szErrorScale*zerr,2));
-      fWz = (Double_t)(1./(szErrorScale*zerr*zerr));
-    }
-  
-  else {
+      fWxy = r2*r2 / ((xyErrorScale*xyErrorScale)*((fxerr*fxerr)+(fyerr*fyerr)));
+      fs = 0; //track trajectory
+      fWz = (Double_t)(1./(szErrorScale*fzerr*fzerr));
+    } else {
     fXprime    = 0.;
     fYprime    = 0.;
     fXprimeerr = 0.;
     fYprimeerr = 0.;
     fWxy = 0;
     fWz = 0;
-    s = 0;
+    fs = 0;
   }
 
   return;
@@ -206,13 +227,14 @@ void AliL3ConfMapPoint::SetAngles()
   }
   */
   //fPhi = TMath::ATan2(y,x);
-  fPhi = atan2(y,x);
+  fPhi = atan2(fy,fx);
   //if(fPhi<0) fPhi = fPhi + 2*TMath::Pi();
   
   //fEta = 0.5 * TMath::Log((r3dim + fZv)/(r3dim - fZv));
   fEta = 0.5 * log((r3dim + fZv)/(r3dim - fZv));
   return;
 }
+
 /*
 AliL3ConfMapTrack *AliL3ConfMapPoint::GetTrack(TClonesArray *tracks) const
 {