TOF residual information update: added also rhoXphi residuals (i.e. residuals in...
authordecaro <decaro@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 Oct 2009 22:39:21 +0000 (22:39 +0000)
committerdecaro <decaro@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 Oct 2009 22:39:21 +0000 (22:39 +0000)
TOF/AliTOFtracker.cxx
TOF/AliTOFtrackerMI.cxx
TOF/AliTOFtrackerV1.cxx

index 0adfcba..f87065f 100644 (file)
@@ -210,6 +210,11 @@ Int_t AliTOFtracker::PropagateBack(AliESDEvent* event) {
        Int_t tlab[3]; seed->GetTOFLabel(tlab);    
        t->SetTOFLabel(tlab);
 
+       Float_t info[10]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
+       seed->GetTOFInfo(info);
+       t->SetTOFInfo(info);
+       AliDebug(2,Form(" distance=%f; residual in the pad reference frame: dX=%f, dZ=%f", info[0],info[1],info[2]));
+
        AliTOFtrack *track = new AliTOFtrack(*seed);
        t->UpdateTrackParams(track,AliESDtrack::kTOFout); // to be checked - AdC
        delete track;
@@ -226,6 +231,13 @@ Int_t AliTOFtracker::PropagateBack(AliESDEvent* event) {
                        time[0], time[1], time[2], time[3], time[4]
                        )
                 );
+
+       //Double_t info[10]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
+       //seed->GetTOFInfo(info);
+       //t->SetTOFInfo(info);
+       t->GetTOFInfo(info);
+       AliDebug(2,Form(" (B)distance=%f; residual in the pad reference frame: dX=%f, dZ=%f", info[0],info[1],info[2]));
+
       }
     }
   }
@@ -370,6 +382,7 @@ void AliTOFtracker::MatchTracks( Bool_t mLastStep){
   Int_t         index[kNfoundMax];
   Float_t        dist[kNfoundMax];
   Float_t       distZ[kNfoundMax];
+  Float_t       distY[kNfoundMax]; // delta(rhoXphi) // AdC
   Float_t       cxpos[kNfoundMax];
   Float_t       crecL[kNfoundMax];
   const Int_t kNclusterMax = 1000; // related to fN value
@@ -382,6 +395,7 @@ void AliTOFtracker::MatchTracks( Bool_t mLastStep){
       index[ii] = -1;
       dist[ii] = 9999.;
       distZ[ii] = 9999.;
+      distY[ii] = 9999.;
       cxpos[ii] = 9999.;
       crecL[ii] = 0.;
     }
@@ -548,10 +562,19 @@ void AliTOFtracker::MatchTracks( Bool_t mLastStep){
          distZ[nfound] = dist3d[2]; // Z distance in the RF of the
                                     // hit pad closest to the
                                     // reconstructed track
+         distY[nfound] = dist3d[0]; // X distance in the RF of the
+                                    // hit pad closest to the
+                                    // reconstructed track
+                                    // It corresponds to Y coordinate
+                                    // in tracking RF
+
 
+         AliDebug(2,Form("   dist3dLoc[0] = %f --- distY[%d] = %f",
+                         dist3d[0],nfound,distY[nfound]));
          AliDebug(2,Form("   dist3dLoc[2] = %f --- distZ[%d] = %f",
                          dist3d[2],nfound,distZ[nfound]));
 
+
          crecL[nfound] = trackPos[3][istep];
          index[nfound] = clind[i]; // store cluster id             
          cxpos[nfound] = AliTOFGeometry::RinTOF()+istep*0.1; //store prop.radius
@@ -581,12 +604,16 @@ void AliTOFtracker::MatchTracks( Bool_t mLastStep){
     Float_t  xpos=0.;
     Float_t  mindist=1000.;
     Float_t  mindistZ=0.;
+    Float_t  mindistY=0.;
     for (Int_t iclus= 0; iclus<nfound;iclus++){
       if (dist[iclus]< mindist){
        mindist = dist[iclus];
        mindistZ = distZ[iclus]; // Z distance in the RF of the hit
                                 // pad closest to the reconstructed
                                 // track
+       mindistY = distY[iclus]; // Y distance in the RF of the hit
+                                // pad closest to the reconstructed
+                                // track
        xpos = cxpos[iclus];
         idclus =index[iclus]; 
         recL=crecL[iclus]+corrLen*0.5;
@@ -651,6 +678,12 @@ void AliTOFtracker::MatchTracks( Bool_t mLastStep){
     t->SetTOFsignalRaw(rawTime);
     t->SetTOFsignalDz(mindistZ);
 
+    Float_t info[10] = {mindist,mindistY,mindistZ,
+                       0.,0.,0.,0.,0.,0.,0.};
+    t->SetTOFInfo(info);
+    AliDebug(2,Form(" distance=%f; residual in the pad reference frame: dX=%f, dZ=%f", info[0],info[1],info[2]));
+
+
     Int_t ind[5];
     ind[0]=c->GetDetInd(0);
     ind[1]=c->GetDetInd(1);
index d8d37d8..b5afa90 100644 (file)
@@ -173,9 +173,7 @@ Int_t AliTOFtrackerMI::PropagateBack(AliESDEvent* event) {
        seed->GetTOFLabel(tlab);    
        t->SetTOFLabel(tlab);
        AliTOFtrack *track = new AliTOFtrack(*seed);
-       Float_t info[10];
        Double_t times[10];
-       seed->GetTOFInfo(info);
        seed->GetIntegratedTimes(times);
        t->UpdateTrackParams(track,AliESDtrack::kTOFout);
        t->SetIntegratedLength(seed->GetIntegratedLength());
@@ -183,6 +181,8 @@ Int_t AliTOFtrackerMI::PropagateBack(AliESDEvent* event) {
        t->SetTOFsignalToT(seed->GetTOFsignalToT());
        t->SetTOFCalChannel(seed->GetTOFCalChannel());
        //
+       Float_t info[10];
+       seed->GetTOFInfo(info);
        t->SetTOFInfo(info);
        delete track;
       }
@@ -517,8 +517,16 @@ void AliTOFtrackerMI::MatchTracksMI(Bool_t mLastStep){
     //    Double_t tof2=25.*cgold->GetTDC()-350; // in ps
     Double_t tof2=AliTOFGeometry::TdcBinWidth()*cgold->GetTDC()+kTofOffset; // in ps
     Float_t tgamma = TMath::Sqrt(cgold->GetR()*cgold->GetR()+cgold->GetZ()*cgold->GetZ())/0.03;
-    Float_t info[11]={dist3D[igold][0],dist3D[igold][1],dist3D[igold][2],dist3D[igold][3],dist3D[igold][4],mintimedist[igold],
-                     -1,tgamma, qualityGold,cgold->GetQuality(),0};
+    Float_t info[10]={dist3D[igold][0],
+                     dist3D[igold][1],
+                     dist3D[igold][2],
+                     dist3D[igold][3],
+                     dist3D[igold][4],
+                     mintimedist[igold],
+                     -1,
+                     tgamma,
+                     qualityGold,
+                     cgold->GetQuality()};
     //    GetLinearDistances(trackTOFin,cgold,&info[6]);
     if (inonfake>=0){
       info[6] = inonfake;
@@ -654,15 +662,15 @@ Int_t AliTOFtrackerMI::FindClusterIndex(Double_t z) const {
   return m;
 }
 
-
-
+//_________________________________________________________________________
 Float_t AliTOFtrackerMI::GetLinearDistances(AliTOFtrack * track, AliTOFcluster *cluster, Float_t distances[5])
 {
   //
   // calclates distance between cluster and track
   // use linear aproximation
   //
-  const Float_t kRaddeg = 180/3.14159265358979312;
+  //const Float_t kRaddeg = 180/3.14159265358979312;
+  const Float_t kRaddeg = TMath::RadToDeg();
   //
   //  Float_t tiltangle  = fGeom->GetAngles(cluster->fdetIndex[1],cluster->fdetIndex[2])/kRaddeg;  //tiltangle  
   Int_t cind[5];
@@ -684,7 +692,7 @@ Float_t AliTOFtrackerMI::GetLinearDistances(AliTOFtrack * track, AliTOFcluster *
   Float_t phi = TMath::ATan2(cpos[1],cpos[0]); 
   if(phi<0) phi=2.*TMath::Pi()+phi;
   //  Get the local angle in the sector philoc
-  Float_t phiangle   = (Int_t (phi*kRaddeg/20.) + 0.5)*20./kRaddeg;
+  Float_t phiangle = (Int_t (phi*kRaddeg/20.) + 0.5)*20./kRaddeg;
   //
   Double_t v0[3];
   Double_t dir[3];
@@ -705,27 +713,27 @@ Float_t AliTOFtrackerMI::GetLinearDistances(AliTOFtrack * track, AliTOFcluster *
   temp    =  cpos[0]*cosphi+cpos[1]*sinphi;
   cpos[1] = -cpos[0]*sinphi+cpos[1]*cosphi;
   cpos[0] = temp;
-  temp    =  v0[0]*cosphi+v0[1]*sinphi;
+  temp  =  v0[0]*cosphi+v0[1]*sinphi;
   v0[1] = -v0[0]*sinphi+v0[1]*cosphi;
   v0[0] = temp;
   //  
   temp    =  cpos[0]*costh+cpos[2]*sinth;
   cpos[2] = -cpos[0]*sinth+cpos[2]*costh;
   cpos[0] = temp;
-  temp    =  v0[0]*costh+v0[2]*sinth;
-  v0[2]   = -v0[0]*sinth+v0[2]*costh;
-  v0[0]   = temp;
+  temp   =  v0[0]*costh+v0[2]*sinth;
+  v0[2]  = -v0[0]*sinth+v0[2]*costh;
+  v0[0]  = temp;
   //
   //
   //rotate direction vector
   //
-  temp    =  dir[0]*cosphi+dir[1]*sinphi;
+  temp   =  dir[0]*cosphi+dir[1]*sinphi;
   dir[1] = -dir[0]*sinphi+dir[1]*cosphi;
   dir[0] = temp;
   //
-  temp    =  dir[0]*costh+dir[2]*sinth;
-  dir[2]  = -dir[0]*sinth+dir[2]*costh;
-  dir[0]  = temp;
+  temp   =  dir[0]*costh+dir[2]*sinth;
+  dir[2] = -dir[0]*sinth+dir[2]*costh;
+  dir[0] = temp;
   //
   Float_t v3[3];
   Float_t k = (cpos[0]-v0[0])/dir[0];
@@ -742,7 +750,9 @@ Float_t AliTOFtrackerMI::GetLinearDistances(AliTOFtrack * track, AliTOFcluster *
   //
   // Debuging part of the matching
   //
-  if (track->GetLabel()==cluster->GetLabel(0) ||track->GetLabel()==cluster->GetLabel(1) ){
+  if (track->GetLabel()==cluster->GetLabel(0) ||
+      track->GetLabel()==cluster->GetLabel(1) ||
+      track->GetLabel()==cluster->GetLabel(2) ){
     TTreeSRedirector& cstream = *fDebugStreamer;
     Float_t tdc = cluster->GetTDC();
     cstream<<"Tracks"<<
@@ -760,8 +770,7 @@ Float_t AliTOFtrackerMI::GetLinearDistances(AliTOFtrack * track, AliTOFcluster *
   return distances[3];
 }
 
-
-
+//_________________________________________________________________________
 void    AliTOFtrackerMI::GetLikelihood(Float_t dy, Float_t dz, const Double_t *cov, AliTOFtrack * /*track*/, Float_t & py, Float_t &pz)
 {
   //
index 8a4cf17..30d40f6 100644 (file)
@@ -193,6 +193,12 @@ Int_t AliTOFtrackerV1::PropagateBack(AliESDEvent* event) {
        t->SetTOFCalChannel(seed->GetTOFCalChannel());
        Int_t tlab[3]; seed->GetTOFLabel(tlab);
        t->SetTOFLabel(tlab);
+
+       Float_t info[10]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
+       seed->GetTOFInfo(info);
+       t->SetTOFInfo(info);
+       AliDebug(2,Form(" distance=%f; residual in the pad reference frame: dX=%f, dZ=%f", info[0],info[1],info[2]));
+
        AliTOFtrack *track = new AliTOFtrack(*seed);
        t->UpdateTrackParams(track,AliESDtrack::kTOFout); // to be checked - AdC
        delete track;
@@ -483,6 +489,18 @@ void AliTOFtrackerV1::MatchTracks( ){
     t->SetTOFsignalRaw(rawTime);
     t->SetTOFsignalDz(dzTW);
 
+
+    Float_t deltaY = trackTOFin->GetY()-bestCluster->GetY();
+
+    Float_t distR = (trackTOFin->GetX()-bestCluster->GetX())*
+      (trackTOFin->GetX()-bestCluster->GetX());
+    distR+=deltaY*deltaY;
+    distR+=dzTW*dzTW;
+    distR = TMath::Sqrt(distR);
+    Float_t info[10] = {distR, deltaY, dzTW,
+                       0.,0.,0.,0.,0.,0.,0.};
+    t->SetTOFInfo(info);
+
     Int_t ind[5];
     ind[0]=bestCluster->GetDetInd(0);
     ind[1]=bestCluster->GetDetInd(1);