]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/Rec/AliTPCtracker.cxx
RelVal: more retries w/pauses on VM + small fixes
[u/mrichter/AliRoot.git] / TPC / Rec / AliTPCtracker.cxx
index 47179c9d836dcd648cf39e51c52ce64024831a4b..8ac4f8cfabb4765cb0ed769cf97c7213bd4013c0 100644 (file)
@@ -302,6 +302,15 @@ Int_t AliTPCtracker::UpdateTrack(AliTPCseed * track, Int_t accept){
     //  new(larr[ihelix]) AliHelix(*track) ;    
     //}
   }
+  if (AliTPCReconstructor::StreamLevel()>5) {
+    Int_t event = (fEvent==NULL)? 0: fEvent->GetEventNumberInFile();
+    AliExternalTrackParam param(*track);
+    TTreeSRedirector &cstream = *fDebugStreamer;
+    cstream<<"Update"<<
+      "cl.="<<c<<
+      "track.="<<&param<<
+      "\n";
+  }
   track->SetNoCluster(0);
   return track->Update(c,chi2,i);
 }
@@ -330,7 +339,8 @@ Int_t AliTPCtracker::AcceptCluster(AliTPCseed * seed, AliTPCclusterMI * cluster)
   Double_t rdistance2  = rdistancey2+rdistancez2;
   //Int_t  accept =0;
   
-  if (AliTPCReconstructor::StreamLevel()>2 && seed->GetNumberOfClusters()>20) {
+  if (AliTPCReconstructor::StreamLevel()>2 && ( (fIteration>0)|| (seed->GetNumberOfClusters()>20))) {
+    //  if (AliTPCReconstructor::StreamLevel()>2 && seed->GetNumberOfClusters()>20) {
     Float_t rmsy2 = seed->GetCurrentSigmaY2();
     Float_t rmsz2 = seed->GetCurrentSigmaZ2();
     Float_t rmsy2p30 = seed->GetCMeanSigmaY2p30();
@@ -343,11 +353,13 @@ Int_t AliTPCtracker::AcceptCluster(AliTPCseed * seed, AliTPCclusterMI * cluster)
     param.GetXYZ(gcl.GetMatrixArray());
     cluster->GetGlobalXYZ(gclf);
     gcl[0]=gclf[0];    gcl[1]=gclf[1];    gcl[2]=gclf[2];
-
+    Int_t nclSeed=seed->GetNumberOfClusters();
     
     if (AliTPCReconstructor::StreamLevel()>2) {
     (*fDebugStreamer)<<"ErrParam"<<
+      "iter="<<fIteration<<
       "Cl.="<<cluster<<
+      "nclSeed="<<nclSeed<<
       "T.="<<&param<<
       "dy="<<dy<<
       "dz="<<dz<<
@@ -532,7 +544,10 @@ void AliTPCtracker::FillESD(const TObjArray* arr)
   //
   //
   //fill esds using updated tracks
+
   if (!fEvent) return;
+
+  AliESDtrack iotrack;
   
     // write tracks to the event
     // store index of the track
@@ -554,8 +569,10 @@ void AliTPCtracker::FillESD(const TObjArray* arr)
       }
  
       if (( pt->GetPoints()[2]- pt->GetPoints()[0])>5 && pt->GetPoints()[3]>0.8){
-       AliESDtrack iotrack;
+       iotrack.~AliESDtrack();
+       new(&iotrack) AliESDtrack;
        iotrack.UpdateTrackParams(pt,AliESDtrack::kTPCin);
+        iotrack.SetTPCsignal(pt->GetdEdx(), pt->GetSDEDX(0), pt->GetNCDEDX(0)); 
        iotrack.SetTPCPoints(pt->GetPoints());
        iotrack.SetKinkIndexes(pt->GetKinkIndexes());
        iotrack.SetV0Indexes(pt->GetV0Indexes());
@@ -567,8 +584,10 @@ void AliTPCtracker::FillESD(const TObjArray* arr)
       }
        
       if ( (pt->GetNumberOfClusters()>70)&& (Float_t(pt->GetNumberOfClusters())/Float_t(pt->GetNFoundable()))>0.55) {
-       AliESDtrack iotrack;
+       iotrack.~AliESDtrack();
+       new(&iotrack) AliESDtrack;
        iotrack.UpdateTrackParams(pt,AliESDtrack::kTPCin);
+        iotrack.SetTPCsignal(pt->GetdEdx(), pt->GetSDEDX(0), pt->GetNCDEDX(0)); 
        iotrack.SetTPCPoints(pt->GetPoints());
        //iotrack.SetTPCindex(i);
        iotrack.SetKinkIndexes(pt->GetKinkIndexes());
@@ -585,8 +604,10 @@ void AliTPCtracker::FillESD(const TObjArray* arr)
        Int_t found,foundable,shared;
        pt->GetClusterStatistic(0,60,found, foundable,shared,kFALSE);
        if ( (found>20) && (pt->GetNShared()/float(pt->GetNumberOfClusters())<0.2)){
-         AliESDtrack iotrack;
+         iotrack.~AliESDtrack();
+         new(&iotrack) AliESDtrack;
          iotrack.UpdateTrackParams(pt,AliESDtrack::kTPCin);    
+         iotrack.SetTPCsignal(pt->GetdEdx(), pt->GetSDEDX(0), pt->GetNCDEDX(0)); 
          //iotrack.SetTPCindex(i);
          iotrack.SetTPCPoints(pt->GetPoints());
          iotrack.SetKinkIndexes(pt->GetKinkIndexes());
@@ -604,8 +625,10 @@ void AliTPCtracker::FillESD(const TObjArray* arr)
        if (found<20) continue;
        if (pt->GetNShared()/float(pt->GetNumberOfClusters())>0.2) continue;
        //
-       AliESDtrack iotrack;
+       iotrack.~AliESDtrack();
+       new(&iotrack) AliESDtrack;
        iotrack.UpdateTrackParams(pt,AliESDtrack::kTPCin);      
+        iotrack.SetTPCsignal(pt->GetdEdx(), pt->GetSDEDX(0), pt->GetNCDEDX(0)); 
        iotrack.SetTPCPoints(pt->GetPoints());
        iotrack.SetKinkIndexes(pt->GetKinkIndexes());
        iotrack.SetV0Indexes(pt->GetV0Indexes());
@@ -621,8 +644,10 @@ void AliTPCtracker::FillESD(const TObjArray* arr)
        Int_t found,foundable,shared;
        pt->GetClusterStatistic(128,158,found, foundable,shared,kFALSE);
        if ( (found>20) && (pt->GetNShared()/float(pt->GetNumberOfClusters())<0.2) &&float(found)/float(foundable)>0.8){
-         AliESDtrack iotrack;
+         iotrack.~AliESDtrack();
+         new(&iotrack) AliESDtrack;
          iotrack.UpdateTrackParams(pt,AliESDtrack::kTPCin);    
+         iotrack.SetTPCsignal(pt->GetdEdx(), pt->GetSDEDX(0), pt->GetNCDEDX(0)); 
          iotrack.SetTPCPoints(pt->GetPoints());
          iotrack.SetKinkIndexes(pt->GetKinkIndexes());
          iotrack.SetV0Indexes(pt->GetV0Indexes());
@@ -642,8 +667,10 @@ void AliTPCtracker::FillESD(const TObjArray* arr)
        if (pt->GetNShared()/float(pt->GetNumberOfClusters())>0.2) continue;
        if (float(found)/float(foundable)<0.8) continue;
        //
-       AliESDtrack iotrack;
+       iotrack.~AliESDtrack();
+       new(&iotrack) AliESDtrack;
        iotrack.UpdateTrackParams(pt,AliESDtrack::kTPCin);      
+        iotrack.SetTPCsignal(pt->GetdEdx(), pt->GetSDEDX(0), pt->GetNCDEDX(0)); 
        iotrack.SetTPCPoints(pt->GetPoints());
        iotrack.SetKinkIndexes(pt->GetKinkIndexes());
        iotrack.SetV0Indexes(pt->GetV0Indexes());
@@ -670,6 +697,7 @@ void AliTPCtracker::FillESD(const TObjArray* arr)
        kink->SetIndex(it, knkId<0 ? 0:1); // update track index of the kink: mother at 0, daughter at 1
       }
     }
+
     // << account for suppressed tracks in the kink indices (RS)  
     AliInfo(Form("Number of filled ESDs-\t%d\n",fEvent->GetNumberOfTracks()));
   
@@ -1425,7 +1453,7 @@ void   AliTPCtracker::Transform(AliTPCclusterMI * cluster){
     return;
   }
   transform->SetCurrentRecoParam((AliTPCRecoParam*)AliTPCReconstructor::GetRecoParam());
-  Double_t x[3]={cluster->GetRow(),cluster->GetPad(),cluster->GetTimeBin()};
+  Double_t x[3]={static_cast<Double_t>(cluster->GetRow()),static_cast<Double_t>(cluster->GetPad()),static_cast<Double_t>(cluster->GetTimeBin())};
   Int_t i[1]={cluster->GetDetector()};
   transform->Transform(x,i,0,1);  
   //  if (cluster->GetDetector()%36>17){
@@ -1586,7 +1614,7 @@ void  AliTPCtracker::ApplyTailCancellation(){
               qMaxArray[icl0]+=ionTailMax;
 
               // Dump some info for debugging while clusters are being corrected
-              if (AliTPCReconstructor::StreamLevel()==1) {
+              if (AliTPCReconstructor::StreamLevel()>2) {
                 TTreeSRedirector &cstream = *fDebugStreamer;
                 if (gRandom->Rndm() > 0.999){
                   cstream<<"IonTail"<<
@@ -1605,7 +1633,7 @@ void  AliTPCtracker::ApplyTailCancellation(){
             cl0->SetMax(TMath::Nint(Float_t(cl0->GetMax())+qMaxArray[icl0]));
           
             // Dump some info for debugging after clusters are corrected 
-            if (AliTPCReconstructor::StreamLevel()==1) {
+            if (AliTPCReconstructor::StreamLevel()>2) {
               TTreeSRedirector &cstream = *fDebugStreamer;
               if (gRandom->Rndm() > 0.999){
               cstream<<"IonTailCorrected"<<
@@ -1635,7 +1663,7 @@ void  AliTPCtracker::ApplyTailCancellation(){
   }// end of side loop
 }
 //_____________________________________________________________________________
-void AliTPCtracker::GetTailValue(const Float_t ampfactor,Double_t &ionTailMax, Double_t &ionTailTotal,TGraphErrors **graphRes,Float_t *indexAmpGraphs,AliTPCclusterMI *cl0,AliTPCclusterMI *cl1){
+void AliTPCtracker::GetTailValue(Float_t ampfactor,Double_t &ionTailMax, Double_t &ionTailTotal,TGraphErrors **graphRes,Float_t *indexAmpGraphs,AliTPCclusterMI *cl0,AliTPCclusterMI *cl1){
 
   //
   // Function in order to calculate the amount of the correction to be added for a given cluster, return values are ionTailTaoltal and ionTailMax
@@ -2973,8 +3001,9 @@ Int_t AliTPCtracker::RefitInward(AliESDEvent *event)
   PropagateForward2(fSeeds);
   RemoveUsed2(fSeeds,0.4,0.4,20);
 
-  TObjArray arraySeed(fSeeds->GetEntries());
-  for (Int_t i=0;i<fSeeds->GetEntries();i++) {
+  Int_t entriesSeed=fSeeds->GetEntries();
+  TObjArray arraySeed(entriesSeed);
+  for (Int_t i=0;i<entriesSeed;i++) {
     arraySeed.AddAt(fSeeds->At(i),i);    
   }
   SignShared(&arraySeed);
@@ -3240,6 +3269,7 @@ void AliTPCtracker::ReadSeeds(const AliESDEvent *const event, Int_t direction)
 
     }
     if (((status&AliESDtrack::kITSout)==0)&&(direction==1)) seed->ResetCovariance(10.); 
+    //RS    if ( direction ==2 &&(status & AliESDtrack::kTRDrefit) == 0 ) seed->ResetCovariance(10.);
     if ( direction ==2 &&(status & AliESDtrack::kTRDrefit) == 0 ) seed->ResetCovariance(10.);
     //if ( direction ==2 && ((status & AliESDtrack::kTPCout) == 0) ) {
     //  fSeeds->AddAt(0,i);
@@ -5372,7 +5402,7 @@ void  AliTPCtracker::FindKinks(TObjArray * array, AliESDEvent *esd)
       kink->SetDaughter(paramd);
       kink->Update();
 
-      Float_t x[3] = { kink->GetPosition()[0],kink->GetPosition()[1],kink->GetPosition()[2]};
+      Float_t x[3] = { static_cast<Float_t>(kink->GetPosition()[0]),static_cast<Float_t>(kink->GetPosition()[1]),static_cast<Float_t>(kink->GetPosition()[2])};
       Int_t index[4];
       fkParam->Transform0to1(x,index);
       fkParam->Transform1to2(x,index);
@@ -6094,7 +6124,7 @@ void  AliTPCtracker::FindKinks(TObjArray * array, AliESDEvent *esd)
       kink->SetDaughter(paramd);
       kink->Update();
 
-      Float_t x[3] = { kink->GetPosition()[0],kink->GetPosition()[1],kink->GetPosition()[2]};
+      Float_t x[3] = { static_cast<Float_t>(kink->GetPosition()[0]),static_cast<Float_t>(kink->GetPosition()[1]),static_cast<Float_t>(kink->GetPosition()[2])};
       Int_t index[4];
       fkParam->Transform0to1(x,index);
       fkParam->Transform1to2(x,index);