]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSRecPoint.cxx
fix for the new geometry (L. Gaudichet)
[u/mrichter/AliRoot.git] / ITS / AliITSRecPoint.cxx
index fab9a4edc9230f43c3b69e701525e59fee1c0e54..25cd6644b7b08154e0245278037157b319c482c7 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.5  2002/10/14 14:57:00  hristov
-Merging the VirtualMC branch to the main development branch (HEAD)
+/* $Id$ */
 
-Revision 1.3.12.1  2002/10/14 13:14:08  hristov
-Updating VirtualMC to v3-09-02
-
-Revision 1.4  2002/09/09 17:28:02  nilsen
-Added class iostreamer funcionality and Print and Read functions. cleaned
-up files.
-
-*/
-////////////////////////////////////////////////
-//  Reconstructed point class for set:ITS     //
-////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+//  Reconstructed space point class for set:ITS   
+//  Reconstructed points are expressed simultaneously in two different 
+//  reference frames, both differing from the global system.
+//  The first is referred to the sensor (see AliITSsegmentation for the
+//  definition) and each point is represented by two coordinates: fXloc and
+//  fZloc. This system in the code is referred to as "local"
+//  The second is used for tracking (V2, SA and MI versions) and the X axis 
+//  represents the radial coordinate (this system is, in the bending plane, 
+//  a rotated system w.r.t. the global reference system). 
+//  Each reaconstructed point is represented by two coordinates: fY and fZ, 
+//  inherited from AliCluster. This system in the code is referred to as 
+//  "trackingV2".
+///////////////////////////////////////////////////////////////////////////////
 
 
 #include "AliITSRecPoint.h"
+#include "AliAlignObj.h"
+
 ClassImp(AliITSRecPoint)
 
-AliITSRecPoint::AliITSRecPoint() {
-    // default creator
-    fTracks[0]=fTracks[1]=fTracks[2]=-3; 
-    fX=fZ=fQ=fdEdX=0.;
-    fSigmaX2=fSigmaZ2=0.;
+//_____________________________________________________________
+AliITSRecPoint::AliITSRecPoint(): AliCluster(),
+fXloc(0),
+fZloc(0),
+fdEdX(0),
+fIndex(0),
+fQ(0),
+fLayer(0),
+fNz(0),
+fNy(0),
+fChargeRatio(0),
+fType(0),
+fDeltaProb(0)
+{
+    // default constructor
+}
+
+//________________________________________________________________________
+AliITSRecPoint::AliITSRecPoint(Int_t *lab,Float_t *hit, Int_t *info, Bool_t local):
+AliCluster(AliAlignObj::LayerToVolUID((info[2]+AliAlignObj::kSPD1),lab[3]&0x3FF),hit,0,0,lab),
+fXloc(0),
+fZloc(0),
+fdEdX(0),
+fIndex(lab[3]),
+fQ(hit[4]),
+fLayer(info[2]),
+fNz(info[1]),
+fNy(info[0]),
+fChargeRatio(0),
+fType(0),
+fDeltaProb(0)
+{
+  //standard constructor used in AliITSClusterFinderV2
+
+  if (!local) { // Cluster V2
+    Double_t txyz[3] = {GetX(), GetY(), GetZ()};
+    Double_t lxyz[3] = {0, 0, 0};
+    GetTracking2LocalMatrix()->LocalToMaster(txyz,lxyz);
+    fXloc = lxyz[0]; fZloc = lxyz[2];
+  }
+  else {
+    switch (fLayer) {
+    case 0:
+    case 1:
+      fdEdX = 0;
+      break;
+    case 2:
+    case 3:
+      fdEdX=fQ*1e-6;
+      break;
+    case 4:
+    case 5:
+      fdEdX=fQ*2.16;
+      break;
+    default:
+      AliError(Form("Wrong ITS layer %d (0 -> 5)",fLayer));
+      break;
+    }
+    fXloc = hit[0];
+    fZloc = hit[1];
+    Double_t lxyz[3] = {fXloc, 0, fZloc};
+    Double_t txyz[3] = {0, 0, 0};
+    GetTracking2LocalMatrix()->MasterToLocal(lxyz,txyz);
+
+    SetX(0.); SetY(txyz[1]); SetZ(txyz[2]);
+
+  }
+
 }
+
+//_______________________________________________________________________
+AliITSRecPoint::AliITSRecPoint(const AliITSRecPoint& pt):AliCluster(pt),
+fXloc(pt.fXloc),
+fZloc(pt.fZloc),
+fdEdX(pt.fdEdX),
+fIndex(pt.fIndex),
+fQ(pt.fQ),
+fLayer(pt.fLayer),
+fNz(pt.fNz),
+fNy(pt.fNy),
+fChargeRatio(pt.fChargeRatio),
+fType(pt.fType),
+fDeltaProb(pt.fDeltaProb)
+{
+  //Copy constructor
+
+}
+
+//______________________________________________________________________
+AliITSRecPoint& AliITSRecPoint::operator=(const AliITSRecPoint& source){
+  // Assignment operator
+
+  this->~AliITSRecPoint();
+  new(this) AliITSRecPoint(source);
+  return *this;
+
+}
+
 //----------------------------------------------------------------------
 void AliITSRecPoint::Print(ostream *os){
     ////////////////////////////////////////////////////////////////////////
@@ -52,7 +146,7 @@ void AliITSRecPoint::Print(ostream *os){
     Int_t fmt;
 #endif
 #else
-#if defined __ICC || defined __ECC
+#if defined __ICC || defined __ECC || defined __xlC__
     ios::fmtflags fmt;
 #else
     Int_t fmt;
@@ -60,12 +154,12 @@ void AliITSRecPoint::Print(ostream *os){
 #endif
  
     fmt = os->setf(ios::fixed);  // set fixed floating point output
-    *os << fTracks[0]<< " " << fTracks[1] << " " << fTracks[2] << " ";
-    *os << fX << " " << fZ << " " << fQ << " ";
+    *os << GetLabel(0) << " " << GetLabel(1) << " " << GetLabel(2) << " ";
+    *os << fXloc << " " << fZloc << " " << fQ << " ";
     fmt = os->setf(ios::scientific); // set scientific for dEdX.
     *os << fdEdX << " ";
     fmt = os->setf(ios::fixed); // every fixed
-    *os << fSigmaX2 << " " << fSigmaZ2;
+    *os << GetSigmaY2() << " " << GetSigmaZ2();
     os->flags(fmt); // reset back to old formating.
     return;
 }
@@ -75,10 +169,16 @@ void AliITSRecPoint::Read(istream *is){
 // Standard input format for this class.
 ////////////////////////////////////////////////////////////////////////
  
+  Int_t lab[4];
+  Float_t hit[5];
+  lab[3] = 0; // ??
+  *is >> lab[0] >> lab[1] >> lab[2] >> hit[0] >> hit[1] >> hit[4];
+  *is >> fdEdX >> hit[2] >> hit[3];
+  Int_t info[3] = {0,0,0};
+  AliITSRecPoint rp(lab,hit,info,kTRUE);
+  *this = rp;
 
-    *is >> fTracks[0] >> fTracks[1] >> fTracks[2] >> fX >> fZ >> fQ;
-    *is >> fdEdX >> fSigmaX2 >> fSigmaZ2;
-    return;
+  return;
 }
 //----------------------------------------------------------------------
 ostream &operator<<(ostream &os,AliITSRecPoint &p){