streamed selection of the backup track for refit and moved to
authorabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Mar 2010 12:51:58 +0000 (12:51 +0000)
committerabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Mar 2010 12:51:58 +0000 (12:51 +0000)
MakeBackupTrack.

      "chi2/tracklet < 5.0
      "occupancy > 0.7
      "NCross == 0
      "Abs(snp) < 0.85
      "NClusters > 20
to be further tuned.

TRD/AliTRDseedV1.cxx
TRD/AliTRDseedV1.h
TRD/AliTRDtrackV1.cxx
TRD/AliTRDtrackV1.h
TRD/AliTRDtrackerV1.cxx

index f1670df..f7d159f 100644 (file)
@@ -531,6 +531,20 @@ Float_t AliTRDseedV1::GetMomentum(Float_t *err) const
   return p;
 }
 
+//____________________________________________________________________
+Float_t AliTRDseedV1::GetOccupancyTB() const
+{
+// Returns procentage of TB occupied by clusters
+
+  Int_t n(0);
+  AliTRDcluster *c(NULL);
+  for(int ic=0; ic<AliTRDtrackerV1::GetNTimeBins(); ic++){
+    if(!(c = fClusters[ic]) && !(c = fClusters[ic+kNtb])) continue;
+    n++;
+  }
+
+  return Float_t(n)/AliTRDtrackerV1::GetNTimeBins();
+}
 
 //____________________________________________________________________
 Float_t* AliTRDseedV1::GetProbability(Bool_t force)
index 3e93580..ffa9945 100644 (file)
@@ -131,6 +131,7 @@ public:
   Int_t     GetN2() const            { return GetN();}
   Int_t     GetNUsed() const         { return Int_t((fN>>kNbits)&kMask);}
   Int_t     GetNShared() const       { return Int_t(((fN>>kNbits)>>kNbits)&kMask);}
+  Float_t   GetOccupancyTB() const;
   Float_t   GetQuality(Bool_t kZcorr) const;
   Float_t   GetPadLength() const     { return fPad[0];}
   Float_t   GetPadWidth() const      { return fPad[1];}
index baf5286..e18528e 100644 (file)
@@ -189,7 +189,7 @@ AliTRDtrackV1::AliTRDtrackV1(AliTRDseedV1 * const trklts, const Double_t p[5], c
   Double_t mostProbablePt=AliExternalTrackParam::GetMostProbablePt();
   Double_t p0=TMath::Sign(1/mostProbablePt,pp[4]);
   Double_t w0=cc[14]/(cc[14] + p0*p0), w1=p0*p0/(cc[14] + p0*p0);
-  AliDebug(4, Form("Pt mixing : w0[%4.2f] 1/pt0[%5.3f] w1[%4.2f] 1/pt[%5.3f]", w0, 1./p0, w1, 1./pp[4]));
+  AliDebug(2, Form("Pt mixing : w0[%4.2f] pt0[%5.3f] w1[%4.2f] pt[%5.3f]", w0, 1./p0, w1, 1./pp[4]));
   pp[4] = w0*p0 + w1*pp[4];
 
 
@@ -511,18 +511,57 @@ Bool_t AliTRDtrackV1::IsElectron() const
 
        
 //_____________________________________________________________________________
-void AliTRDtrackV1::MakeBackupTrack()
+Int_t AliTRDtrackV1::MakeBackupTrack()
 {
-  //
-  // Creates a backup track
-  //
+//
+// Creates a backup track
+// TO DO update quality check of the track.
+//
+
+  Float_t occupancy(0.); Int_t n(0), ncls(0);
+  for(Int_t il(AliTRDgeometry::kNlayer); il--;){ 
+    if(!fTracklet[il]) continue;
+    n++; 
+    occupancy+=fTracklet[il]->GetOccupancyTB();
+    ncls += fTracklet[il]->GetN();
+  }
+  if(!n) return -1;
+  occupancy/=n;
+
+  //Float_t ratio1 = Float_t(t.GetNumberOfClusters()+1) / Float_t(t.GetNExpected()+1);  
+  
+  Int_t failedCutId(0);
+  if(GetChi2()/n > 5.0) failedCutId=1; 
+  if(occupancy < 0.7) failedCutId=2;
+  //if(ratio1 >   0.6) && 
+  //if(ratio0+ratio1  >   1.5) && 
+  if(GetNCross() != 0)  failedCutId=3;
+  if(TMath::Abs(GetSnp()) > 0.85) failedCutId=4;
+  if(ncls < 20) failedCutId=5;
+
+  if(failedCutId){ 
+    AliDebug(2, Form("\n"
+      "chi2/tracklet < 5.0   [%c] %5.2f\n"
+      "occupancy > 0.7       [%c] %4.2f\n"
+      "NCross == 0           [%c] %d\n"
+      "Abs(snp) < 0.85       [%c] %4.2f\n"
+      "NClusters > 20        [%c] %d"
+      ,(GetChi2()/n<5.0)?'y':'n', GetChi2()/n
+      ,(occupancy>0.7)?'y':'n', occupancy
+      ,(GetNCross()==0)?'y':'n', GetNCross()
+      ,(TMath::Abs(GetSnp())<0.85)?'y':'n', TMath::Abs(GetSnp())
+      ,(ncls>20)?'y':'n', ncls
+    ));
+    return failedCutId;
+  }
 
   if(fBackupTrack) {
     fBackupTrack->~AliTRDtrackV1();
     new(fBackupTrack) AliTRDtrackV1((AliTRDtrackV1&)(*this));
-    return;
+    return 0;
   }
   fBackupTrack = new AliTRDtrackV1((AliTRDtrackV1&)(*this));
+  return 0;
 }
 
 //_____________________________________________________________________________
index 10ec473..d4fdf9b 100644 (file)
@@ -108,7 +108,7 @@ public:
   inline static Bool_t IsTrackError(ETRDtrackError error, UInt_t status);
   inline static Bool_t IsLayerError(ETRDlayerError error, Int_t layer, UInt_t status);
 
-  void           MakeBackupTrack();
+  Int_t          MakeBackupTrack();
   void           Print(Option_t *o="") const;
 
   Bool_t         PropagateTo(Double_t xr, Double_t x0 = 8.72, Double_t rho = 5.86e-3);
index 8bd3557..7a10c70 100644 (file)
@@ -276,12 +276,11 @@ Int_t AliTRDtrackerV1::PropagateBack(AliESDEvent *event)
   }
   AliTRDCalibraFillHisto *calibra = AliTRDCalibraFillHisto::Instance(); // Calibration monitor
   if (!calibra) AliInfo("Could not get Calibra instance");
-
-  printf("TB[%d] new TB[%d]\n", fgNTimeBins, fkReconstructor->GetNTimeBins());
   if (!fgNTimeBins) fgNTimeBins = fkReconstructor->GetNTimeBins(); 
 
   // Define scalers
   Int_t nFound   = 0, // number of tracks found
+        nBacked  = 0, // number of tracks backed up for refit
         nSeeds   = 0, // total number of ESD seeds
         nTRDseeds= 0, // number of seeds in the TRD acceptance
         nTPCseeds= 0; // number of TPC seeds
@@ -388,7 +387,7 @@ fkRecoParam->IsOverPtThreshold(track.Pt())){
         // Full gold track
         if (track.GetChi2() / track.GetNumberOfClusters() < 5) {
           if (track.GetBackupTrack()) seed->UpdateTrackParams(track.GetBackupTrack(),AliESDtrack::kTRDbackup);
-
+          nBacked++;
           isGold = kTRUE;
         }
   
@@ -396,13 +395,14 @@ fkRecoParam->IsOverPtThreshold(track.Pt())){
         if ((!isGold)  && (track.GetNCross() == 0) &&  (track.GetChi2() / track.GetNumberOfClusters()  < 7)) {
           //seed->UpdateTrackParams(track, AliESDtrack::kTRDbackup);
           if (track.GetBackupTrack()) seed->UpdateTrackParams(track.GetBackupTrack(),AliESDtrack::kTRDbackup);
-  
+          nBacked++;
           isGold = kTRUE;
         }
         
         if ((!isGold) && (track.GetBackupTrack())) {
           if ((track.GetBackupTrack()->GetNumberOfClusters() > foundMin) && ((track.GetBackupTrack()->GetChi2()/(track.GetBackupTrack()->GetNumberOfClusters()+1)) < 7)) {
             seed->UpdateTrackParams(track.GetBackupTrack(),AliESDtrack::kTRDbackup);
+            nBacked++;
             isGold = kTRUE;
           }
         }
@@ -452,7 +452,7 @@ fkRecoParam->IsOverPtThreshold(track.Pt())){
   if(quality) delete [] quality;
 
   AliInfo(Form("Number of seeds: TPCout[%d] TRDin[%d]", nTPCseeds, nTRDseeds));
-  AliInfo(Form("Number of tracks: TRDout[%d]", nFound));
+  AliInfo(Form("Number of tracks: TRDout[%d] TRDbackup[%d]", nFound, nBacked));
 
   // run stand alone tracking
   if (fkReconstructor->IsSeeding()) Clusters2Tracks(event);
@@ -972,31 +972,8 @@ Int_t AliTRDtrackerV1::FollowBackProlongation(AliTRDtrackV1 &t)
 //     if(ilayer>0 && t.GetTracklet(ilayer-1) && ptrTracklet->GetN() + t.GetTracklet(ilayer-1)->GetN() > 20) t.SetBudget(2, 0.);
 
     // Make backup of the track until is gold
-    // TO DO update quality check of the track.
-    // consider comparison with fTimeBinsRange
-    Float_t ratio0 = ptrTracklet->GetN() / Float_t(fgNTimeBins);
-    //Float_t ratio1 = Float_t(t.GetNumberOfClusters()+1) / Float_t(t.GetNExpected()+1);       
-    
-    if( (chi2                    <  18.0) &&  
-        (ratio0                  >   0.8) && 
-        //(ratio1                  >   0.6) && 
-        //(ratio0+ratio1           >   1.5) && 
-        (t.GetNCross()           ==    0) && 
-        (TMath::Abs(t.GetSnp())  <  0.85) &&
-        (t.GetNumberOfClusters() >    20)){
-      t.MakeBackupTrack();
-    } else AliDebug(2, Form("Failed backup : \n"
-        "chi2 < 18.0                [%c] chi2=%f\n"
-        "ratio0 > 0.8               [%c] ratio=%f\n"
-        "t.GetNCross()==0           [%c] crosses=%d\n"
-        "Abs(t.GetSnp())<0.85       [%c] snp=%f\n"
-        "t.GetNumberOfClusters()>20 [%c] ncls=%d"
-        ,(chi2<18.0)?'y':'n', chi2
-        ,(ratio0>0.8)?'y':'n', ratio0
-        ,(t.GetNCross()==0)?'y':'n', t.GetNCross()
-        ,(TMath::Abs(t.GetSnp())<0.85)?'y':'n', TMath::Abs(t.GetSnp())
-        ,(t.GetNumberOfClusters()>20)?'y':'n', t.GetNumberOfClusters()
-      ));
+    Int_t failed(0);
+    if((failed = t.MakeBackupTrack())) AliDebug(2, Form("Failed backup on cut[%d]", failed));
 
   } // end layers loop
   //printf("clusters[%d] chi2[%f] x[%f] status[%d ", n, t.GetChi2(), t.GetX(), t.GetStatusTRD());