]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFtrackerV1.cxx
Merging of the three alignment macros into one
[u/mrichter/AliRoot.git] / TOF / AliTOFtrackerV1.cxx
index 0b0c002a2582ba9e87d677516d8646e326437a55..a20f6018029bf8dd9eb212f0335eef8b6091d42d 100644 (file)
@@ -84,67 +84,6 @@ AliTOFtrackerV1::AliTOFtrackerV1():
 
    InitCheckHists();
 
-}
-//_____________________________________________________________________________
-AliTOFtrackerV1::AliTOFtrackerV1(const AliTOFtrackerV1 &t):
-  AliTracker(),
-  fRecoParam(0x0),
-  fPid(0x0),
-  fN(0),
-  fNseeds(0),
-  fNseedsTOF(0),
-  fngoodmatch(0),
-  fnbadmatch(0),
-  fnunmatch(0),
-  fnmatch(0),
-  fTracks(new TClonesArray("AliTOFtrack")),
-  fSeeds(new TClonesArray("AliESDtrack")),
-  fHDigClusMap(0x0),
-  fHDigNClus(0x0),
-  fHDigClusTime(0x0),
-  fHDigClusToT(0x0),
-  fHRecNClus(0x0),
-  fHRecChi2(0x0),
-  fHRecDistZ(0x0),
-  fHRecSigYVsP(0x0),
-  fHRecSigZVsP(0x0),
-  fHRecSigYVsPWin(0x0),
-  fHRecSigZVsPWin(0x0)
- { 
-  //AliTOFtrackerV1 copy Ctor
-
-  fNseeds=t.fNseeds;
-  fNseeds=t.fNseeds;
-  fNseedsTOF=t.fNseedsTOF;
-  fngoodmatch=t.fngoodmatch;
-  fnbadmatch=t.fnbadmatch;
-  fnunmatch=t.fnunmatch;
-  fnmatch=t.fnmatch;
-  fRecoParam=t.fRecoParam;
-  fPid=t.fPid;
-  fSeeds=t.fSeeds;
-  fTracks=t.fTracks;
-  fN=t.fN;
-}
-
-//_____________________________________________________________________________
-AliTOFtrackerV1& AliTOFtrackerV1::operator=(const AliTOFtrackerV1 &t)
-{ 
-  //AliTOFtrackerV1 assignment operator
-
-  this->fNseeds=t.fNseeds;
-  this->fNseedsTOF=t.fNseedsTOF;
-  this->fngoodmatch=t.fngoodmatch;
-  this->fnbadmatch=t.fnbadmatch;
-  this->fnunmatch=t.fnunmatch;
-  this->fnmatch=t.fnmatch;
-  this->fRecoParam = t.fRecoParam;
-  this->fPid = t.fPid;
-  this->fSeeds=t.fSeeds;
-  this->fTracks=t.fTracks;
-  this->fN=t.fN;
-  return *this;
-
 }
 //_____________________________________________________________________________
 AliTOFtrackerV1::~AliTOFtrackerV1() {
@@ -196,7 +135,7 @@ Int_t AliTOFtrackerV1::PropagateBack(AliESDEvent* event) {
     AliFatal("No Reco Param found for TOF!!!");
   }
   //fRecoParam->Dump();
-  if(fRecoParam->GetApplyPbPbCuts())fRecoParam=fRecoParam->GetPbPbparam();
+  //if(fRecoParam->GetApplyPbPbCuts())fRecoParam=fRecoParam->GetPbPbparam();
   //fRecoParam->PrintParameters();
 
   Double_t parPID[2];   
@@ -393,7 +332,8 @@ void AliTOFtrackerV1::MatchTracks( ){
     Int_t index[kncmax];//to keep track of the cluster index
     for (Int_t k=FindClusterIndex(z-dz); k<fN; k++) {  
       AliTOFcluster *c=fClusters[k];
-      if(nc>kncmax)break;
+      //      if(nc>kncmax)break; /* R+ fix (buffer overflow) */
+      if(nc>=kncmax)break; /* R+ fix (buffer overflow protection) */
       if(c->GetZ() > z+dz) break;
       if(c->IsUsed()) continue;      
       if(!c->GetStatus()) {
@@ -422,7 +362,7 @@ void AliTOFtrackerV1::MatchTracks( ){
        break;
       }
     } else if (ysect <-ymax) {
-      if (!trackTOFin->Rotate(AliTOFGeometry::GetAlpha())) {
+      if (!trackTOFin->Rotate(-AliTOFGeometry::GetAlpha())) {
        break;
       }
     }
@@ -434,7 +374,8 @@ void AliTOFtrackerV1::MatchTracks( ){
     AliTOFcluster *bestCluster=0;
     Double_t bestChi2=maxChi2; 
     Int_t idclus=-1;
-    for (Int_t i=0; i<nc; i++){
+    //    for (Int_t i=0; i<nc; i++){ /* R+ fix (unsafe) */
+    for (Int_t i=0; i<nc && i<kncmax; i++){ /* R+ fix (buffer overflow protection) */
       AliTOFcluster *c=clusters[i];  // one of the preselected clusters     
       Double_t chi2=trackTOFin->GetPredictedChi2((AliCluster3D*)c); 
       if (chi2 >= bestChi2) continue;
@@ -480,6 +421,8 @@ void AliTOFtrackerV1::MatchTracks( ){
     //Propagate the track to the best matched cluster
     trackTOFin->PropagateTo(bestCluster);
 
+    // Fill the track residual histograms.
+    FillResiduals(trackTOFin,bestCluster,kFALSE);
 
     //now take the local distance in Z from the pad center for time walk correction
     Float_t tiltangle = AliTOFGeometry::GetAngles(bestCluster->GetDetInd(1),bestCluster->GetDetInd(2))*TMath::DegToRad();