]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFtracker.cxx
Introduction of a new TOF constant (i.e. TDC bin width)
[u/mrichter/AliRoot.git] / TOF / AliTOFtracker.cxx
index a81a2e718af451e9ff4ea107ac745310413415f1..121bad30b0d97180a16ad9e2cc4e163b6b293df8 100644 (file)
 // --         : Silvia.Arcelli@bo.infn.it
 //--------------------------------------------------------------------
 
+#include <Rtypes.h>
 #include "AliTOFtracker.h"
 #include "AliTOFtrack.h"
 #include "TClonesArray.h"
-#include "TError.h"
+#include "AliLog.h"
 #include "AliTOFdigit.h"
 #include "AliTOFGeometry.h"
-#include "AliTOF.h"
 #include "AliRun.h"
 #include "AliModule.h"
 
@@ -90,7 +90,7 @@ void AliTOFtracker::Init() {
   AliModule* frame=gAlice->GetModule("FRAME"); 
 
   if(!frame) {
-    Error("Init","Could Not load FRAME! Assume Frame with Holes \n");
+    AliError("Could Not load FRAME! Assume Frame with Holes");
     fHoles=true;
   } else{
     if(frame->IsVersion()==1) {fHoles=false;}    
@@ -135,9 +135,9 @@ Int_t AliTOFtracker::PropagateBack(AliESD* event) {
   //Second Step with Looser Matching Criterion
   MatchTracks(kTRUE);
 
-  Info("PropagateBack","Number of matched tracks: %d",fnmatch);
-  Info("PropagateBack","Number of good matched tracks: %d",fngoodmatch);
-  Info("PropagateBack","Number of bad  matched tracks: %d",fnbadmatch);
+  AliInfo(Form("Number of matched tracks: %d",fnmatch));
+  AliInfo(Form("Number of good matched tracks: %d",fngoodmatch));
+  AliInfo(Form("Number of bad  matched tracks: %d",fnbadmatch));
 
   //Update the matched ESD tracks
 
@@ -183,10 +183,11 @@ void AliTOFtracker::CollectESD() {
 
     // TRD good tracks, already propagated at 371 cm
 
-    if (
-       ((t->GetStatus()&AliESDtrack::kTRDout)!=0) && 
-       ((t->GetStatus()&AliESDtrack::kTRDStop)==0)){
-      AliTOFtrack *track = new AliTOFtrack(*t); 
+    AliTOFtrack *track = new AliTOFtrack(*t); // New
+    Double_t x = track->GetX(); //New
+
+    if (((t->GetStatus()&AliESDtrack::kTRDout)!=0 ) && 
+        ( x >= AliTOFGeometry::RinTOF()) ){
       track->SetSeedIndex(i);
       t->UpdateTrackParams(track,AliESDtrack::kTOFout);    
       new(aTOFTrack[fNseedsTOF]) AliTOFtrack(*track);
@@ -197,7 +198,6 @@ void AliTOFtracker::CollectESD() {
     // Propagate the rest of TPCbp  
 
     else {
-      AliTOFtrack *track = new AliTOFtrack(*t);
       if(track->PropagateToInnerTOF(fHoles)){ // temporary solution
        //      if(track->PropagateToInnerTOF(fGeom->GetHoles())){
        track->SetSeedIndex(i);
@@ -218,10 +218,6 @@ void AliTOFtracker::MatchTracks( Bool_t mLastStep){
 
   //Match ESD tracks to clusters in TOF
 
-  static const Double_t kMasses[]={
-    0.000511, 0.105658, 0.139570, 0.493677, 0.938272, 1.875613
-  };
-  
   Int_t nSteps=(Int_t)(fTOFHeigth/0.1);
 
   //PH Arrays (moved outside of the loop)
@@ -414,13 +410,14 @@ void AliTOFtracker::MatchTracks( Bool_t mLastStep){
 
     delete trackTOFin;
 
-    Double_t tof=50*c->GetTDC()+32; // in ps
+    //Double_t tof=50*c->GetTDC()+32; // in ps
+    Double_t tof=AliTOFGeometry::TdcBinWidth()*c->GetTDC()+32; // in ps
     t->SetTOFsignal(tof);
     t->SetTOFcluster(c->GetIndex());
     Double_t time[10]; t->GetIntegratedTimes(time);
     Double_t mom=t->GetP();
-    for(Int_t j=0;j<=5;j++){
-      Double_t mass=kMasses[j];
+    for(Int_t j=0;j<=AliPID::kSPECIES;j++){
+      Double_t mass=AliPID::ParticleMass(j);
       time[j]+=(recL-trackPos[3][0])/3e-2*TMath::Sqrt(mom*mom+mass*mass)/mom;
     }
 
@@ -443,7 +440,7 @@ Int_t AliTOFtracker::LoadClusters(TTree *dTree) {
 
   TBranch *branch=dTree->GetBranch("TOF");
   if (!branch) { 
-    Error("LoadClusters"," can't get the branch with the TOF digits !\n");
+    AliError("can't get the branch with the TOF digits !");
     return 1;
   }
 
@@ -452,7 +449,7 @@ Int_t AliTOFtracker::LoadClusters(TTree *dTree) {
 
   dTree->GetEvent(0);
   Int_t nd=digits->GetEntriesFast();
-  Info("LoadClusters","number of digits: %d",nd);
+  AliInfo(Form("number of digits: %d",nd));
 
   for (Int_t i=0; i<nd; i++) {
     AliTOFdigit *d=(AliTOFdigit*)digits->UncheckedAt(i);
@@ -491,7 +488,7 @@ Int_t AliTOFtracker::InsertCluster(AliTOFcluster *c) {
   //This function adds a cluster to the array of clusters sorted in Z
   //--------------------------------------------------------------------
   if (fN==kMaxCluster) {
-    Error("InsertCluster","Too many clusters !\n");
+    AliError("Too many clusters !");
     return 1;
   }