]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
cosmetic changes to the code in which the number of time bins have been introduced...
authorcblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 19 Feb 2008 15:06:10 +0000 (15:06 +0000)
committercblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 19 Feb 2008 15:06:10 +0000 (15:06 +0000)
TRD/AliTRDseed.cxx
TRD/AliTRDseed.h
TRD/AliTRDseedV1.cxx
TRD/AliTRDtrackerV1.cxx
TRD/AliTRDtrackerV1.h
TRD/AliTRDtrackingChamber.cxx
TRD/AliTRDtrackingChamber.h
TRD/AliTRDtrackingSector.cxx
TRD/AliTRDtrackingSector.h

index f0b93697ad1a86991038ad13e0ab6372cada1a1a..66f79a8e634c256755a65006b8005de0d86b4418 100644 (file)
 #include "AliTRDcalibDB.h"
 #include "AliTRDcluster.h"
 #include "AliTRDtracker.h"
+#include "AliTRDtrackerV1.h"
 
 ClassImp(AliTRDseed)
 
-Int_t AliTRDseed::fgTimeBins = 0;
-
 //_____________________________________________________________________________
 AliTRDseed::AliTRDseed() 
   :TObject()
@@ -222,7 +221,7 @@ void AliTRDseed::CookLabels()
   Int_t out[200];
   Int_t nlab = 0;
 
-  for (Int_t i = 0; i < fgTimeBins+1; i++) {
+  for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins()+1; i++) {
     if (!fClusters[i]) continue;
     for (Int_t ilab = 0; ilab < 3; ilab++) {
       if (fClusters[i]->GetLabel(ilab) >= 0) {
@@ -248,7 +247,7 @@ void AliTRDseed::UseClusters()
   // Use clusters
   //
 
-  for (Int_t i = 0; i < fgTimeBins+1; i++) {
+  for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins()+1; i++) {
     if (!fClusters[i]) continue;
     if (!(fClusters[i]->IsUsed())) fClusters[i]->Use();
   }
@@ -310,7 +309,7 @@ void AliTRDseed::Update()
   
   fN  = 0; 
   fN2 = 0;
-  for (Int_t i = 0; i < fgTimeBins; i++) {
+  for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins(); i++) {
     yres[i] = 10000.0;
     if (!fClusters[i]) continue;
     if(!fClusters[i]->IsInChamber()) continue;
@@ -346,22 +345,22 @@ void AliTRDseed::Update()
     // with maximal number of accepted clusters
     //
     fNChange = 1;
-    for (Int_t i = 0; i < fgTimeBins; i++) {
+    for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins(); i++) {
       cumul[i][0] = counts[0];
       cumul[i][1] = counts[1];
       if (TMath::Abs(fZ[i]-zouts[0]) < 2) counts[0]++;
       if (TMath::Abs(fZ[i]-zouts[2]) < 2) counts[1]++;
     }
     Int_t  maxcount = 0;
-    for (Int_t i = 0; i < fgTimeBins; i++) {
-      Int_t after  = cumul[fgTimeBins][0] - cumul[i][0];
+    for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins(); i++) {
+      Int_t after  = cumul[AliTRDtrackerV1::GetNTimeBins()][0] - cumul[i][0];
       Int_t before = cumul[i][1];
       if (after + before > maxcount) { 
        maxcount  = after + before; 
        breaktime = i;
        mbefore   = kFALSE;
       }
-      after  = cumul[fgTimeBins-1][1] - cumul[i][1];
+      after  = cumul[AliTRDtrackerV1::GetNTimeBins()-1][1] - cumul[i][1];
       before = cumul[i][0];
       if (after + before > maxcount) { 
        maxcount  = after + before; 
@@ -374,18 +373,18 @@ void AliTRDseed::Update()
 
   }
 
-  for (Int_t i = 0; i < fgTimeBins+1; i++) {
+  for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins()+1; i++) {
     if (i >  breaktime) allowedz[i] =   mbefore  ? zouts[2] : zouts[0];
     if (i <= breaktime) allowedz[i] = (!mbefore) ? zouts[2] : zouts[0];
   }  
 
-  if (((allowedz[0] > allowedz[fgTimeBins]) && (fZref[1] < 0)) ||
-      ((allowedz[0] < allowedz[fgTimeBins]) && (fZref[1] > 0))) {
+  if (((allowedz[0] > allowedz[AliTRDtrackerV1::GetNTimeBins()]) && (fZref[1] < 0)) ||
+      ((allowedz[0] < allowedz[AliTRDtrackerV1::GetNTimeBins()]) && (fZref[1] > 0))) {
     //
     // Tracklet z-direction not in correspondance with track z direction 
     //
     fNChange = 0;
-    for (Int_t i = 0; i < fgTimeBins+1; i++) {
+    for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins()+1; i++) {
       allowedz[i] = zouts[0];  // Only longest taken
     } 
   }
@@ -394,7 +393,7 @@ void AliTRDseed::Update()
     //
     // Cross pad -row tracklet  - take the step change into account
     //
-    for (Int_t i = 0; i < fgTimeBins+1; i++) {
+    for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins()+1; i++) {
       if (!fClusters[i]) continue; 
       if(!fClusters[i]->IsInChamber()) continue;
       if (TMath::Abs(fZ[i] - allowedz[i]) > 2) continue;
@@ -409,7 +408,7 @@ void AliTRDseed::Update()
   Double_t yres2[knTimebins];
   Double_t mean;
   Double_t sigma;
-  for (Int_t i = 0; i < fgTimeBins+1; i++) {
+  for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins()+1; i++) {
     if (!fClusters[i]) continue;
     if(!fClusters[i]->IsInChamber()) continue;
     if (TMath::Abs(fZ[i] - allowedz[i]) > 2) continue;
@@ -440,7 +439,7 @@ void AliTRDseed::Update()
   fMeanz = 0;
   fMPads = 0;
 
-  for (Int_t i = 0; i < fgTimeBins+1; i++) {
+  for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins()+1; i++) {
 
     fUsable[i] = kFALSE;
     if (!fClusters[i]) continue;
@@ -486,7 +485,7 @@ void AliTRDseed::Update()
   fYfitR[1]    = (sumw   * sumwxy - sumwx * sumwy)  / det;
   
   fSigmaY2 = 0;
-  for (Int_t i = 0; i < fgTimeBins+1; i++) {
+  for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins()+1; i++) {
     if (!fUsable[i]) continue;
     Float_t delta = yres[i] - fYfitR[0] - fYfitR[1] * fX[i];
     fSigmaY2 += delta*delta;
@@ -518,7 +517,7 @@ void AliTRDseed::UpdateUsed()
   //
 
   fNUsed = 0;
-  for (Int_t i = 0; i < fgTimeBins; i++) {
+  for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins(); i++) {
     if (!fClusters[i]) continue;
                if(!fUsable[i]) continue;   
     if ((fClusters[i]->IsUsed())) fNUsed++;
@@ -547,7 +546,7 @@ Float_t AliTRDseed::FitRiemanTilt(AliTRDseed * cseed, Bool_t terror)
     if (!cseed[iLayer].IsOK()) continue;
     Double_t tilt = cseed[iLayer].fTilt;
 
-    for (Int_t itime = 0; itime < fgTimeBins+1; itime++) {
+    for (Int_t itime = 0; itime < AliTRDtrackerV1::GetNTimeBins()+1; itime++) {
 
       if (!cseed[iLayer].fUsable[itime]) continue;
       // x relative to the midle chamber
index 3581ba983aa3a9010b507cc4d2869e7ad0f5c1f8..d2179545c93f3e3ddd1f1ecc56753b501a7f004d 100644 (file)
@@ -65,7 +65,6 @@ class AliTRDseed : public TObject {
           Float_t  GetCC() const                            { return fCC;            }
           Float_t  GetChi2() const                          { return fChi2;          }
           Float_t  GetChi2Z() const                         { return fChi2Z;         }
-          Int_t    GetNTimeBins() const                   { return fgTimeBins; }
 
                                
           void     SetTilt(Float_t tilt)                    { fTilt        = tilt;   }
@@ -95,13 +94,11 @@ class AliTRDseed : public TObject {
           void     SetCC(Float_t cc)                        { fCC          = cc;     }
           void     SetChi2(Float_t chi2)                    { fChi2        = chi2;   }
           void     SetChi2Z(Float_t chi2z)                  { fChi2Z       = chi2z;  }
-  static  void     SetNTimeBins(Int_t nTB)                { fgTimeBins  = nTB; }
 
  protected:
 
           void     Copy(TObject &o) const;
           
-  static  Int_t          fgTimeBins;            //  Local copy of the total number of TB
           Float_t        fTilt;                 //  Tilting angle
           Float_t        fPadLength;            //  Pad length
           Float_t        fX0;                   //  X0 position
index ff89e04a338a69900e1d52efec38e7e3d39af685..898de01bf8f8f0730c688fd69b8a7fa28871112a 100644 (file)
@@ -201,7 +201,7 @@ void AliTRDseedV1::CookdEdx(Int_t nslices)
        Float_t clength = (/*.5 * */AliTRDgeometry::AmThick() + AliTRDgeometry::DrThick());
 
        AliTRDcluster *cluster = 0x0;
-       for(int ic=0; ic<fgTimeBins; ic++){
+       for(int ic=0; ic<AliTRDtrackerV1::GetNTimeBins(); ic++){
                if(!(cluster = fClusters[ic])) continue;
                Float_t x = cluster->GetX();
                
@@ -356,7 +356,7 @@ Bool_t      AliTRDseedV1::AttachClustersIter(AliTRDtrackingChamber *chamber, Float_t
                clusters.SetOwner(kTRUE);
                AliTRDcluster *cc = 0x0;
                Int_t det=-1, ncl, ncls = 0;
-               for (Int_t iTime = 0; iTime < fgTimeBins; iTime++) {
+               for (Int_t iTime = 0; iTime < AliTRDtrackerV1::GetNTimeBins(); iTime++) {
                        if(!(layer = chamber->GetTB(iTime))) continue;
                        if(!(ncl = Int_t(*layer))) continue;
                        for(int ic=0; ic<ncl; ic++){ 
@@ -391,7 +391,7 @@ Bool_t      AliTRDseedV1::AttachClustersIter(AliTRDtrackingChamber *chamber, Float_t
        // start seed update
        for (Int_t iter = 0; iter < niter; iter++) {
                ncl = 0;
-               for (Int_t iTime = 0; iTime < fgTimeBins; iTime++) {
+               for (Int_t iTime = 0; iTime < AliTRDtrackerV1::GetNTimeBins(); iTime++) {
                        if(!(layer = chamber->GetTB(iTime))) continue;
                        if(!Int_t(*layer)) continue;
                        
@@ -424,7 +424,7 @@ Bool_t      AliTRDseedV1::AttachClustersIter(AliTRDtrackingChamber *chamber, Float_t
                if(ncl>1){      
                        // calculate length of the time bin (calibration aware)
                        Int_t irp = 0; Float_t x[2]; Int_t tb[2];
-                       for (Int_t iTime = 0; iTime < fgTimeBins; iTime++) {
+                       for (Int_t iTime = 0; iTime < AliTRDtrackerV1::GetNTimeBins(); iTime++) {
                                if(!fClusters[iTime]) continue;
                                x[irp]  = fClusters[iTime]->GetX();
                                tb[irp] = iTime;
@@ -434,14 +434,14 @@ Bool_t    AliTRDseedV1::AttachClustersIter(AliTRDtrackingChamber *chamber, Float_t
                        fdX = (x[1] - x[0]) / (tb[0] - tb[1]);
        
                        // update X0 from the clusters (calibration/alignment aware)
-                       for (Int_t iTime = 0; iTime < fgTimeBins; iTime++) {
+                       for (Int_t iTime = 0; iTime < AliTRDtrackerV1::GetNTimeBins(); iTime++) {
                                if(!(layer = chamber->GetTB(iTime))) continue;
                                if(!layer->IsT0()) continue;
                                if(fClusters[iTime]){ 
                                        fX0 = fClusters[iTime]->GetX();
                                        break;
                                } else { // we have to infere the position of the anode wire from the other clusters
-                                       for (Int_t jTime = iTime+1; jTime < fgTimeBins; jTime++) {
+                                       for (Int_t jTime = iTime+1; jTime < AliTRDtrackerV1::GetNTimeBins(); jTime++) {
                                                if(!fClusters[jTime]) continue;
                                                fX0 = fClusters[jTime]->GetX() + fdX * (jTime - iTime);
                                        }
@@ -453,7 +453,7 @@ Bool_t      AliTRDseedV1::AttachClustersIter(AliTRDtrackingChamber *chamber, Float_t
                        // TODO
                        
                        // update x reference positions (calibration/alignment aware)
-                       for (Int_t iTime = 0; iTime < fgTimeBins; iTime++) {
+                       for (Int_t iTime = 0; iTime < AliTRDtrackerV1::GetNTimeBins(); iTime++) {
                                if(!fClusters[iTime]) continue;
                                fX[iTime] = fClusters[iTime]->GetX() - fX0;
                        } 
@@ -518,7 +518,7 @@ Bool_t      AliTRDseedV1::AttachClusters(AliTRDtrackingChamber *chamber
        // Do cluster projection
        AliTRDchamberTimeBin *layer = 0x0;
        Int_t nYclusters = 0; Bool_t kEXIT = kFALSE;
-       for (Int_t iTime = 0; iTime < fgTimeBins; iTime++) {
+       for (Int_t iTime = 0; iTime < AliTRDtrackerV1::GetNTimeBins(); iTime++) {
                if(!(layer = chamber->GetTB(iTime))) continue;
                if(!Int_t(*layer)) continue;
                
@@ -571,7 +571,7 @@ Bool_t      AliTRDseedV1::AttachClusters(AliTRDtrackingChamber *chamber
        // Select only one cluster/TimeBin
        Int_t lastCluster = 0;
        fN2 = 0;
-       for (Int_t iTime = 0; iTime < fgTimeBins; iTime++) {
+       for (Int_t iTime = 0; iTime < AliTRDtrackerV1::GetNTimeBins(); iTime++) {
                ncl = tboundary[iTime] - lastCluster;
                if(!ncl) continue;
                Int_t iptr = lastCluster;
@@ -596,7 +596,7 @@ Bool_t      AliTRDseedV1::AttachClusters(AliTRDtrackingChamber *chamber
        }
        
        // number of minimum numbers of clusters expected for the tracklet
-       Int_t kClmin = Int_t(AliTRDReconstructor::RecoParam()->GetFindableClusters()*fgTimeBins);
+       Int_t kClmin = Int_t(AliTRDReconstructor::RecoParam()->GetFindableClusters()*AliTRDtrackerV1::GetNTimeBins());
   if (fN2 < kClmin){
                AliWarning(Form("Not enough clusters to fit the tracklet %d [%d].", fN2, kClmin));
     fN2 = 0;
@@ -605,7 +605,7 @@ Bool_t      AliTRDseedV1::AttachClusters(AliTRDtrackingChamber *chamber
 
        // update used clusters
        fNUsed = 0;
-       for (Int_t iTime = 0; iTime < fgTimeBins; iTime++) {
+       for (Int_t iTime = 0; iTime < AliTRDtrackerV1::GetNTimeBins(); iTime++) {
                if(!fClusters[iTime]) continue;
                if((fClusters[iTime]->IsUsed())) fNUsed++;
        }
@@ -646,7 +646,7 @@ Bool_t AliTRDseedV1::Fit()
              zout[2*knTimebins];//
        
        fN = 0;
-       for (Int_t iTime = 0; iTime < fgTimeBins; iTime++) {
+       for (Int_t iTime = 0; iTime < AliTRDtrackerV1::GetNTimeBins(); iTime++) {
     if (!fClusters[iTime]) continue;
     if (!fClusters[iTime]->IsInChamber()) continue;
     yres[iTime] = fY[iTime] - fYref[0] - (fYref[1] + anglecor) * fX[iTime] + fTilt * (fZ[iTime] - fZref[0]);
@@ -655,7 +655,7 @@ Bool_t AliTRDseedV1::Fit()
        }
 
        // calculate pad row boundary crosses
-       Int_t kClmin = Int_t(AliTRDReconstructor::RecoParam()->GetFindableClusters()*fgTimeBins);
+       Int_t kClmin = Int_t(AliTRDReconstructor::RecoParam()->GetFindableClusters()*AliTRDtrackerV1::GetNTimeBins());
        Int_t nz = AliMathBase::Freq(fN, zint, zout, kFALSE);
   fZProb   = zout[0];
   if(nz <= 1) zout[3] = 0;
@@ -678,7 +678,7 @@ Bool_t AliTRDseedV1::Fit()
   fMPads = 0;
        fMeanz = 0.;
        // we will use only the clusters which are in the detector range
-       for(int iTime=0; iTime<fgTimeBins; iTime++){
+       for(int iTime=0; iTime<AliTRDtrackerV1::GetNTimeBins(); iTime++){
     fUsable[iTime] = kFALSE;
     if (!fClusters[iTime]) continue;
                npads = fClusters[iTime]->GetNPads();
@@ -717,7 +717,7 @@ Bool_t AliTRDseedV1::Fit()
   fYfitR[1]    = (sumw   * sumwxy - sumwx * sumwy)  / det;
   
   fSigmaY2 = 0;
-  for (Int_t i = 0; i < fgTimeBins+1; i++) {
+  for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins()+1; i++) {
     if (!fUsable[i]) continue;
     Float_t delta = yres[i] - fYfitR[0] - fYfitR[1] * fX[i];
     fSigmaY2 += delta*delta;
@@ -744,14 +744,11 @@ void AliTRDseedV1::Print()
   // Printing the seedstatus
   //
 
-       AliTRDcalibDB *cal = AliTRDcalibDB::Instance();
-       Int_t nTimeBins = cal->GetNumberOfTimeBins();
-       
        printf("Seed status :\n");
        printf("  fTilt      = %f\n", fTilt);
        printf("  fPadLength = %f\n", fPadLength);
        printf("  fX0        = %f\n", fX0);
-       for(int ic=0; ic<nTimeBins; ic++) {
+       for(int ic=0; ic<AliTRDtrackerV1::GetNTimeBins(); ic++) {
           const Char_t *isUsable = fUsable[ic]?"Yes":"No";
          printf("  %d X[%f] Y[%f] Z[%f] Indexes[%d] clusters[%p] usable[%s]\n"
                 , ic
index 40f481feafca1737dc28d81aca727b2f45f28c99..99bc18db53b459445a46c3d6e0e234e087d63ee1 100644 (file)
@@ -80,6 +80,7 @@ Double_t AliTRDtrackerV1::fgTopologicQA[kNConfigs] = {
                0.0786, 0.0786, 0.0579, 0.0579, 0.0474,
                0.0474, 0.0408, 0.0335, 0.0335, 0.0335
 };
+Int_t AliTRDtrackerV1::fgNTimeBins = 0;
 TTreeSRedirector *AliTRDtrackerV1::fgDebugStreamer = 0x0;
 AliRieman* AliTRDtrackerV1::fgRieman = 0x0;
 TLinearFitter* AliTRDtrackerV1::fgTiltedRieman = 0x0;
@@ -92,7 +93,6 @@ AliTRDtrackerV1::AliTRDtrackerV1()
   ,fClusters(0x0)
   ,fTracklets(0x0)
   ,fTracks(0x0)
-  ,fTimeBinsPerPlane(0)
   ,fSieveSeeding(0)
 {
   //
@@ -101,9 +101,9 @@ AliTRDtrackerV1::AliTRDtrackerV1()
   if (!AliTRDcalibDB::Instance()) {
     AliFatal("Could not get calibration object");
   }
-  fTimeBinsPerPlane = AliTRDcalibDB::Instance()->GetNumberOfTimeBins();
+  fgNTimeBins = AliTRDcalibDB::Instance()->GetNumberOfTimeBins();
 
-       for (Int_t isector = 0; isector < AliTRDgeometry::kNsect; isector++) new(&fTrSec[isector]) AliTRDtrackingSector(fGeom, isector, fTimeBinsPerPlane);
+       for (Int_t isector = 0; isector < AliTRDgeometry::kNsect; isector++) new(&fTrSec[isector]) AliTRDtrackingSector(fGeom, isector);
   
   if(AliTRDReconstructor::StreamLevel() > 1){
                TDirectory *savedir = gDirectory; 
@@ -252,7 +252,6 @@ Int_t AliTRDtrackerV1::PropagateBack(AliESDEvent *event)
        Int_t   found    = 0;     // number of tracks found
        Float_t foundMin = 20.0;
        
-       AliTRDseed::SetNTimeBins(fTimeBinsPerPlane);
        Int_t    nSeed   = event->GetNumberOfTracks();
        if(!nSeed){
                // run stand alone tracking
@@ -693,7 +692,7 @@ Int_t AliTRDtrackerV1::FollowBackProlongation(AliTRDtrackV1 &t)
                        
                                if(!(chamber = fTrSec[sector].GetChamber(stack, iplane))) continue;
                        
-                               if(chamber->GetNClusters() < fTimeBinsPerPlane*AliTRDReconstructor::AliTRDReconstructor::RecoParam()->GetFindableClusters()) continue;
+                               if(chamber->GetNClusters() < fgNTimeBins*AliTRDReconstructor::RecoParam()->GetFindableClusters()) continue;
                        
                                x = chamber->GetX();
                        
@@ -706,7 +705,7 @@ Int_t AliTRDtrackerV1::FollowBackProlongation(AliTRDtrackV1 &t)
                                if(!tracklet.AttachClustersIter(chamber, 1000.)) continue;
                                tracklet.Init(&t);
                
-               if(tracklet.GetN() < fTimeBinsPerPlane * AliTRDReconstructor::RecoParam()->GetFindableClusters()) continue;
+               if(tracklet.GetN() < fgNTimeBins * AliTRDReconstructor::RecoParam()->GetFindableClusters()) continue;
                        
                                break;
                        }
@@ -760,7 +759,7 @@ Int_t AliTRDtrackerV1::FollowBackProlongation(AliTRDtrackV1 &t)
                // Make backup of the track until is gold
                // TO DO update quality check of the track.
                // consider comparison with fTimeBinsRange
-               Float_t ratio0 = tracklet.GetN() / Float_t(fTimeBinsPerPlane);
+               Float_t ratio0 = tracklet.GetN() / Float_t(fgNTimeBins);
                //Float_t ratio1 = Float_t(t.GetNumberOfClusters()+1) / Float_t(t.GetNExpected()+1);    
     //printf("tracklet.GetChi2() %f     [< 18.0]\n", tracklet.GetChi2()); 
                //printf("ratio0    %f              [>   0.8]\n", ratio0);
@@ -892,9 +891,6 @@ Float_t AliTRDtrackerV1::FitTiltedRiemanConstraint(AliTRDseedV1 *tracklets, Doub
 // debug level 5
 //
 
-       AliTRDcalibDB *cal = AliTRDcalibDB::Instance();
-       Int_t nTimeBins = cal->GetNumberOfTimeBins();
-       
        TLinearFitter *fitter = GetTiltedRiemanFitterConstraint();
        fitter->StoreData(kTRUE);
        fitter->ClearPoints();
@@ -904,7 +900,7 @@ Float_t AliTRDtrackerV1::FitTiltedRiemanConstraint(AliTRDseedV1 *tracklets, Doub
        Int_t nPoints = 0;
   for(Int_t ipl = 0; ipl < AliTRDgeometry::kNplan; ipl++){
                if(!tracklets[ipl].IsOK()) continue;
-               for(Int_t itb = 0; itb < nTimeBins; itb++){
+               for(Int_t itb = 0; itb < fgNTimeBins; itb++){
                        if(!tracklets[ipl].IsUsable(itb)) continue;
                        x = tracklets[ipl].GetX(itb) + tracklets[ipl].GetX0();
                        y = tracklets[ipl].GetY(itb);
@@ -982,10 +978,6 @@ Float_t AliTRDtrackerV1::FitTiltedRieman(AliTRDseedV1 *tracklets, Bool_t sigErro
 //
 // debug level 5
 //
-
-       AliTRDcalibDB *cal = AliTRDcalibDB::Instance();
-       Int_t nTimeBins = cal->GetNumberOfTimeBins();
-
        TLinearFitter *fitter = GetTiltedRiemanFitter();
   fitter->StoreData(kTRUE);
        fitter->ClearPoints();
@@ -1013,7 +1005,7 @@ Float_t AliTRDtrackerV1::FitTiltedRieman(AliTRDseedV1 *tracklets, Bool_t sigErro
                if(!tracklets[ipl].IsOK()) continue;
                dzMean += tracklets[ipl].GetZfitR(1);
                dzcounter++;
-               for(Int_t itb = 0; itb < nTimeBins; itb++){
+               for(Int_t itb = 0; itb < fgNTimeBins; itb++){
                        if (!tracklets[ipl].IsUsable(itb)) continue;
                        x = tracklets[ipl].GetX(itb) + tracklets[ipl].GetX0();
                        y = tracklets[ipl].GetY(itb);
@@ -1441,7 +1433,7 @@ Int_t AliTRDtrackerV1::Clusters2TracksSM(Int_t sector, AliESDEvent *esd)
                nChambers = 0;
                for(int iplane=0; iplane<AliTRDgeometry::kNplan; iplane++){
                        if(!(chamber = stack[iplane])) continue;
-                       if(chamber->GetNClusters() < fTimeBinsPerPlane * AliTRDReconstructor::RecoParam()->GetFindableClusters()) continue;
+                       if(chamber->GetNClusters() < fgNTimeBins * AliTRDReconstructor::RecoParam()->GetFindableClusters()) continue;
                        nChambers++;
                        //AliInfo(Form("sector %d stack %d plane %d clusters %d", sector, istack, iplane, chamber->GetNClusters()));
                }
@@ -1566,7 +1558,7 @@ Int_t AliTRDtrackerV1::Clusters2TracksStack(AliTRDtrackingChamber **stack, TClon
                                        nlayers++;
        
                                        // Cooking label
-                                       for (Int_t itime = 0; itime < fTimeBinsPerPlane; itime++) {
+                                       for (Int_t itime = 0; itime < fgNTimeBins; itime++) {
                                                if(!sseed[jseed].IsUsable(itime)) continue;
                                                naccepted++;
                                                Int_t tindex = 0, ilab = 0;
@@ -1792,7 +1784,7 @@ Double_t AliTRDtrackerV1::BuildSeedingConfigs(AliTRDtrackingChamber **stack, Int
        AliTRDtrackingChamber *chamber = 0x0;
        for(int iplane=0; iplane<kNPlanes; iplane++){
                if(!(chamber = stack[iplane])) continue;
-               chamberQ[iplane] = (chamber = stack[iplane]) ?  chamber->GetQuality(fTimeBinsPerPlane) : 0.;
+               chamberQ[iplane] = (chamber = stack[iplane]) ?  chamber->GetQuality() : 0.;
        }
 
        Double_t tconfig[kNConfigs];
@@ -2348,8 +2340,6 @@ Double_t AliTRDtrackerV1::CookLikelihood(AliTRDseedV1 *cseed, Int_t planes[4]
   // (date). They have to be checked to assure consistency of estimation.
   //
  
-       AliTRDcalibDB *cal = AliTRDcalibDB::Instance();
-       Int_t nTimeBins = cal->GetNumberOfTimeBins();
        // ratio of the total number of clusters/track which are expected to be found by the tracker.
        Float_t fgFindable = AliTRDReconstructor::RecoParam()->GetFindableClusters();
 
@@ -2365,7 +2355,7 @@ Double_t AliTRDtrackerV1::CookLikelihood(AliTRDseedV1 *cseed, Int_t planes[4]
        Double_t likechi2y  = 0.0000000001;
        if (chi2[1] < 0.5) likechi2y += TMath::Exp(-TMath::Sqrt(chi2[1]) * 7.73);
        Double_t likechi2z = TMath::Exp(-chi2[0] * 0.088) / TMath::Exp(-chi2[0] * 0.019);
-       Int_t enc = Int_t(fgFindable*4.*nTimeBins);     // Expected Number Of Clusters, normally 72
+       Int_t enc = Int_t(fgFindable*4.*fgNTimeBins);   // Expected Number Of Clusters, normally 72
        Double_t likeN     = TMath::Exp(-(enc - nclusters) * 0.19);
        
        Double_t like      = likea * likechi2y * likechi2z * likeN;
@@ -2390,198 +2380,6 @@ Double_t AliTRDtrackerV1::CookLikelihood(AliTRDseedV1 *cseed, Int_t planes[4]
 }
 
 
-//___________________________________________________________________
-void AliTRDtrackerV1::GetMeanCLStack(AliTRDtrackingChamber *chamber, Int_t *planes, Double_t *params)
-{
-  //
-  // Determines the Mean number of clusters per layer.
-  // Needed to determine good Seeding Layers
-  //
-  // Parameters:
-  //    - Array of AliTRDchamberTimeBins
-  //    - Container for the params
-  //
-  // Detailed description
-  //
-  // Two Iterations:
-  // In the first Iteration the mean is calculted using all layers.
-  // After this, all layers outside the 1-sigma-region are rejected.
-  // Then the mean value and the standard-deviation are calculted a second
-  // time in order to select all layers in the 1-sigma-region as good-candidates.
-  //
-
-       Float_t mean = 0, stdev = 0;
-       Double_t ncl[kNTimeBins*kNSeedPlanes], mcl[kNTimeBins*kNSeedPlanes];
-       Int_t position = 0;
-       memset(ncl, 0, sizeof(Int_t)*kNTimeBins*kNSeedPlanes);
-       memset(mcl, 0, sizeof(Int_t)*kNTimeBins*kNSeedPlanes);
-       Int_t nused = 0;
-       AliTRDchamberTimeBin *layers = chamber->GetTB(0);
-       for(Int_t ipl = 0; ipl < kNSeedPlanes; ipl++){
-               for(Int_t ils = 0; ils < fTimeBinsPerPlane; ils++){
-                       position = planes[ipl]*fTimeBinsPerPlane + ils;
-                       ncl[ipl * fTimeBinsPerPlane + ils] = layers[position].GetNClusters();
-                       nused = 0;
-                       for(Int_t icl = 0; icl < ncl[ipl * fTimeBinsPerPlane + ils]; icl++)
-                               if((layers[position].GetCluster(icl))->IsUsed()) nused++;
-                       ncl[ipl * fTimeBinsPerPlane + ils] -= nused;
-               }
-       }
-       // Declaration of quartils:
-       //Double_t qvals[3] = {0.0, 0.0, 0.0};
-       //Double_t qprop[3] = {0.16667, 0.5, 0.83333};
-       // Iterations
-       Int_t counter;
-       Double_t *array;
-       Int_t *limit;
-       Int_t nLayers = fTimeBinsPerPlane * kNSeedPlanes;
-       for(Int_t iter = 0; iter < 2; iter++){
-               array = (iter == 0) ? &ncl[0] : &mcl[0];
-               limit = (iter == 0) ? &nLayers : &counter;
-               counter = 0;
-               if(iter == 1){
-                       for(Int_t i = 0; i < fTimeBinsPerPlane *kNSeedPlanes; i++){
-                               if((ncl[i] >  mean + stdev) || (ncl[i] <  mean - stdev)) continue; // Outside 1-sigma region
-//                             if((ncl[i] >  qvals[2]) || (ncl[i] <  qvals[0])) continue; // Outside 1-sigma region
-                               if(ncl[i] == 0) continue;                                                // 0-Layers also rejected
-                               mcl[counter] = ncl[i];
-                               counter++;
-                       }
-               }
-               if(*limit == 0) break;
-               printf("Limit = %d\n", *limit);
-               //using quartils instead of mean and RMS 
-//             TMath::Quantiles(*limit,3,array,qvals,qprop,kFALSE);
-               mean = TMath::Median(*limit, array, 0x0);
-               stdev  = TMath::RMS(*limit, array);
-       }
-//     printf("Quantiles: 0.16667 = %3.3f, 0.5 = %3.3f, 0.83333 = %3.3f\n", qvals[0],qvals[1],qvals[2]);
-//     memcpy(params,qvals,sizeof(Double_t)*3);
-       params[1] = (Double_t)TMath::Nint(mean);
-       params[0] = (Double_t)TMath::Nint(mean - stdev);
-       params[2] = (Double_t)TMath::Nint(mean + stdev);
-
-}
-
-//___________________________________________________________________
-Int_t AliTRDtrackerV1::GetSeedingLayers(AliTRDtrackingChamber *chamber, Double_t *params)
-{
-  //
-  // Algorithm to find optimal seeding layer
-  // Layers inside one sigma region (given by Quantiles) are sorted
-  // according to their difference.
-  // All layers outside are sorted according t
-  //
-  // Parameters:
-  //     - Array of AliTRDchamberTimeBins (in the current plane !!!)
-  //     - Container for the Indices of the seeding Layer candidates
-  //
-  // Output:
-  //     - Number of Layers inside the 1-sigma-region
-  //
-  // The optimal seeding layer should contain the mean number of
-  // custers in the layers in one chamber.
-  //
-
-       //printf("Params: %3.3f, %3.3f, %3.3f\n", params[0], params[1], params[2]);
-       const Int_t kMaxClustersLayer = AliTRDchamberTimeBin::kMaxClustersLayer;
-       Int_t ncl[kNTimeBins], indices[kNTimeBins], bins[kMaxClustersLayer];
-       memset(ncl, 0, sizeof(Int_t)*kNTimeBins);
-       memset(indices, 0, sizeof(Int_t)*kNTimeBins);
-       memset(bins, 0, sizeof(Int_t)*kMaxClustersLayer);
-       
-       AliTRDchamberTimeBin *layers = chamber->GetTB(0);
-       Int_t nused = 0;
-       for(Int_t ils = 0; ils < fTimeBinsPerPlane; ils++){
-               ncl[ils] = layers[ils].GetNClusters();
-               nused = 0;
-               for(Int_t icl = 0; icl < ncl[ils]; icl++)
-                       if((layers[ils].GetCluster(icl))->IsUsed()) nused++;
-               ncl[ils] -= nused;
-       }
-       
-       Float_t mean = params[1];
-       for(Int_t ils = 0; ils < fTimeBinsPerPlane; ils++){
-               memmove(indices + bins[ncl[ils]+1] + 1, indices + bins[ncl[ils]+1], sizeof(Int_t)*(fTimeBinsPerPlane - ils));
-               indices[bins[ncl[ils]+1]] = ils;
-               for(Int_t i = ncl[ils]+1; i < kMaxClustersLayer; i++)
-                       bins[i]++;
-       }
-       
-       //for(Int_t i = 0; i < nTimeBins; i++) printf("Bin %d = %d\n", i, bins[i]);
-       Int_t sbin = -1;
-       Int_t nElements;
-       Int_t position = 0;
-       TRandom *r = new TRandom();
-       Int_t iter = 0;
-       while(1){
-               while(sbin < (Int_t)params[0] || sbin > (Int_t)params[2]){
-                       // Randomly selecting one bin
-                       sbin = (Int_t)r->Poisson(mean);
-               }
-               printf("Bin = %d\n",sbin);
-               //Randomly selecting one Layer in the bin
-               nElements = bins[sbin + 1] - bins[sbin];
-               printf("nElements = %d\n", nElements);
-               if(iter == 5){
-                       position = (Int_t)(gRandom->Rndm()*(fTimeBinsPerPlane-1));
-                       break;
-               }
-               else if(nElements==0){
-                       iter++;
-                       continue;
-               }
-               position = (Int_t)(gRandom->Rndm()*(nElements-1)) + bins[sbin];
-               break;
-       }
-       delete r;
-       return indices[position];
-}
-
-//____________________________________________________________________
-AliTRDcluster *AliTRDtrackerV1::FindSeedingCluster(AliTRDtrackingChamber *chamber, AliTRDseedV1* reference) const
-{
-  //
-  // Finds a seeding Cluster for the extrapolation chamber.
-  //
-  // The seeding cluster should be as close as possible to the assumed
-  // track which is represented by a Rieman fit.
-  // Therefore the selecting criterion is the minimum distance between
-  // the best fitting cluster and the Reference which is derived from
-  // the AliTRDseed. Because all layers are assumed to be equally good
-  // a linear search is performed.
-  //
-  // Imput parameters: - layers: array of AliTRDchamberTimeBins (in one chamber!!!)
-  //                   - sfit: the reference
-  //
-  // Output:           - the best seeding cluster
-  //
-
-       
-       // distances as squared distances
-       Int_t index = 0;
-       Float_t ypos = 0.0, zpos = 0.0, distance = 0.0, nearestDistance =100000.0; 
-       ypos = reference->GetYref(0);
-       zpos = reference->GetZref(0);
-       AliTRDcluster *currentBest = 0x0, *temp = 0x0;
-       AliTRDchamberTimeBin *layers = chamber->GetTB(0);
-       for(Int_t ils = 0; ils < fTimeBinsPerPlane; ils++){
-               // Reference positions
-//             ypos = reference->GetYat(layers[ils].GetX());
-//             zpos = reference->GetZat(layers[ils].GetX());
-               index = layers[ils].SearchNearestCluster(ypos, zpos, AliTRDReconstructor::RecoParam()->GetRoad2y(), AliTRDReconstructor::RecoParam()->GetRoad2z());
-               if(index == -1) continue;
-               temp = layers[ils].GetCluster(index);
-               if(!temp) continue;
-               distance = (temp->GetY() - ypos) * (temp->GetY() - ypos) + (temp->GetZ() - zpos) * (temp->GetZ() - zpos);
-               if(distance < nearestDistance){
-                       nearestDistance = distance;
-                       currentBest = temp;
-               }
-       }
-       return currentBest;
-}
-
 
 //____________________________________________________________________
 void AliTRDtrackerV1::GetSeedingConfig(Int_t iconfig, Int_t planes[4])
index aa7e361926a6abe272ab4007d43ddc4be56630a4..a5afc1e0f7fa10affd20ba4699b1900eb2de9107 100644 (file)
@@ -69,6 +69,7 @@ public:
   static TTreeSRedirector* DebugStreamer() {return fgDebugStreamer;}
   AliCluster*    GetCluster(Int_t index) const;
        static void    GetExtrapolationConfig(Int_t iconfig, Int_t planes[2]);
+       static const Int_t   GetNTimeBins() {return fgNTimeBins;}
        static void    GetSeedingConfig(Int_t iconfig, Int_t planes[4]);
        static TLinearFitter *GetTiltedRiemanFitter();
        static TLinearFitter *GetTiltedRiemanFitterConstraint();
@@ -95,9 +96,6 @@ protected:
        Int_t          Clusters2TracksSM(Int_t sector, AliESDEvent *esd);
        Int_t          Clusters2TracksStack(AliTRDtrackingChamber **stack, TClonesArray *esdTrackList);
        void           CookLabel(AliKalmanTrack *pt, Float_t wrong) const;
-       AliTRDcluster* FindSeedingCluster(AliTRDtrackingChamber *chamber, AliTRDseedV1 *sfit) const;
-       Int_t          GetSeedingLayers(AliTRDtrackingChamber *chamber, Double_t *params);
-       void           GetMeanCLStack(AliTRDtrackingChamber *chamber, Int_t *planes, Double_t *params);
        AliTRDseedV1*  GetTracklet(AliTRDtrackV1 *trk, Int_t plane, Int_t &idx);
        Bool_t         GetTrackPoint(Int_t index, AliTrackPoint &p) const;      
        Int_t          MakeSeeds(AliTRDtrackingChamber **stack, AliTRDseedV1 *sseed, Int_t *ipar);
@@ -119,7 +117,6 @@ private:
        TClonesArray        *fClusters;                       // List of clusters
        TClonesArray        *fTracklets;                      // List of tracklets
        TClonesArray        *fTracks;                         // List of tracks
-  Int_t                    fTimeBinsPerPlane;              // Timebins per plane in track prolongation 
   
   // should go to the recoParam
   static const Double_t    fgkMaxChi2;                     // Max increment in track chi2 
@@ -129,15 +126,16 @@ private:
   static const Double_t    fgkMaxStep;                     // Maximal step for tracking  
        
        // stand alone tracking
-       static Double_t      fgTopologicQA[kNConfigs];         //  Topologic quality
+       static Double_t      fgTopologicQA[kNConfigs];        //  Topologic quality
        Double_t             fTrackQuality[kMaxTracksStack];  //  Track quality 
        Int_t                fSeedLayer[kMaxTracksStack];     //  Seed layer
        Int_t                fSieveSeeding;                   //! Seeding iterator
        
-       static TLinearFitter *fgTiltedRieman;                   //  Fitter for the tilted Rieman fit without vertex constriant
-       static TLinearFitter *fgTiltedRiemanConstrained;        //  Fitter for the tilted Rieman fit with vertex constraint     
-       static AliRieman     *fgRieman;                             //  Fitter for the untilted Rieman fit
-  static TTreeSRedirector *fgDebugStreamer;                 //!Debug streamer
+  static Int_t         fgNTimeBins;                     // Timebins per plane in track prolongation 
+       static TLinearFitter *fgTiltedRieman;                 //  Fitter for the tilted Rieman fit without vertex constriant
+       static TLinearFitter *fgTiltedRiemanConstrained;      //  Fitter for the tilted Rieman fit with vertex constraint       
+       static AliRieman     *fgRieman;                       //  Fitter for the untilted Rieman fit
+  static TTreeSRedirector *fgDebugStreamer;             //!Debug streamer
 
        ClassDef(AliTRDtrackerV1, 2)                          //  TRD tracker development class
 
index f3ed5d6cd45597287175768db3f7cfe8426e590b..226293095097976e0415a70cbcf472905f54b9e2 100644 (file)
@@ -104,7 +104,7 @@ Int_t AliTRDtrackingChamber::GetNClusters() const
 }      
 
 //_______________________________________________________
-Double_t AliTRDtrackingChamber::GetQuality(Int_t timeBins)
+Double_t AliTRDtrackingChamber::GetQuality()
 {
   //
   // Calculate chamber quality for seeding.
@@ -138,7 +138,7 @@ Double_t AliTRDtrackingChamber::GetQuality(Int_t timeBins)
        
        // calculate the deviation of the mean number of clusters from the
        // closest integer values
-       Float_t nclMed = float(ncl-nused)/timeBins;
+       Float_t nclMed = float(ncl-nused)/AliTRDtrackerV1::GetNTimeBins();
        Int_t ncli = Int_t(nclMed);
        Float_t nclDev = TMath::Abs(nclMed - TMath::Max(ncli, 1));
        nclDev -= (nclDev>.5) && ncli ? 1. : 0.;
index be945fd69d8d57db3d398ee6b550d24cab10938e..6ca144001557f186c90233d7783aee13f98c948a 100644 (file)
@@ -36,7 +36,7 @@ public:
   void     Clear(const Option_t *opt = 0x0);
        Int_t    GetDetector() const {return fDetector;}
        Int_t    GetNClusters() const;
-       Double_t GetQuality(Int_t ntb);
+       Double_t GetQuality();
        AliTRDchamberTimeBin *GetSeedingLayer(AliTRDgeometry *geo);
        Float_t  GetX()        const {return fX0;}
        AliTRDchamberTimeBin* GetTB(int tb) {return tb >= 0 && tb < kNTimeBins ? &fTB[tb] : 0x0;}
index ccec10139e9dad9917dbfe4511f0f4ff9e490da2..68a1810bd58572eb93b5da40fdbfe43723308cd4 100644 (file)
@@ -36,8 +36,7 @@ ClassImp(AliTRDtrackingSector)
 
 //_____________________________________________________________________________
 AliTRDtrackingSector::AliTRDtrackingSector()
-  :fTimeBinsPerPlane(0)
-  ,fSector(-1)
+  :fSector(-1)
   ,fN(0)
   ,fGeom(0x0)
 {
@@ -51,9 +50,8 @@ AliTRDtrackingSector::AliTRDtrackingSector()
 }
 
 //_____________________________________________________________________________
-AliTRDtrackingSector::AliTRDtrackingSector(AliTRDgeometry *geo, Int_t gs, Int_t tb)
-  :fTimeBinsPerPlane(tb)
-  ,fSector(gs)
+AliTRDtrackingSector::AliTRDtrackingSector(AliTRDgeometry *geo, Int_t gs)
+  :fSector(gs)
   ,fN(0)
   ,fGeom(geo)
 {
@@ -70,8 +68,7 @@ AliTRDtrackingSector::AliTRDtrackingSector(AliTRDgeometry *geo, Int_t gs, Int_t
 
 //_____________________________________________________________________________
 AliTRDtrackingSector::AliTRDtrackingSector(const AliTRDtrackingSector &/*t*/)
-  :fTimeBinsPerPlane(0)
-  ,fSector(-1)
+  :fSector(-1)
   ,fN(0)
   ,fGeom(0x0)
 {
index 9f37e8bf3d982748972ffe92aae3f01559f2ccf7..0224f8ae667dda9df4379bffc5c3dd732503aa3d 100644 (file)
@@ -35,7 +35,7 @@ public:
        };
        
        AliTRDtrackingSector();
-       AliTRDtrackingSector(AliTRDgeometry* geo, Int_t gs, Int_t tbs);
+       AliTRDtrackingSector(AliTRDgeometry* geo, Int_t gs);
        AliTRDtrackingSector(const AliTRDtrackingSector &/*t*/);
        virtual ~AliTRDtrackingSector();
        
@@ -48,19 +48,13 @@ public:
        AliTRDtrackingChamber* GetChamber(Int_t stack, Int_t plane, Bool_t build = kFALSE);
        AliTRDtrackingChamber** GetStack(Int_t stack);
        Int_t    GetSector() const {return fSector;}    
+
        void     Init();
+       void     Print(Option_t *opt = 0x0);
        
        void     SetGeometry(AliTRDgeometry *geo) {fGeom = geo;}
         
-       // temporary ... some of this functions are obsolete
-       void Print(Option_t *opt = 0x0);
-//     void     MapTimeBinLayers();
-//     Int_t    Find(Double_t x) const; 
-//     void     InsertLayer(AliTRDchamberTimeBin *pl);
-//     Int_t    CookTimeBinIndex(Int_t plane, Int_t localTB) const;     
-       
 private:
-       UChar_t        fTimeBinsPerPlane; // no. of time bins
        Char_t         fSector;           // Sector# in AliTRDgeometry
        UChar_t        fN;                // Total number of chambers allocated
        Char_t         fIndex[kNChambersSector]; // indexes of allocated chambers
@@ -68,6 +62,7 @@ private:
        AliTRDgeometry *fGeom;            // Geometry
        AliTRDtrackingChamber *fChamber[kNChambersSector];// chambers   
        AliTRDtrackingChamber *fStack[kNplane]; //! temporary holding one stack
+
        ClassDef(AliTRDtrackingSector, 1) // TRD tracker container for one sector
 };