Possibility to stop tracking at a given layer (default is 1). Added new method AliITS...
authormasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 10 Apr 2003 09:13:58 +0000 (09:13 +0000)
committermasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 10 Apr 2003 09:13:58 +0000 (09:13 +0000)
ITS/AliITSFindTracksV2.C
ITS/AliITSrecoV2.h
ITS/AliITStrackV2.cxx
ITS/AliITStrackerV2.cxx
ITS/AliITStrackerV2.h

index 2199a9fae4309f05eddde7dcbf8590833f7572f6..af6c5fd7b8a50449dc7824b544b365310638d088 100644 (file)
@@ -1,10 +1,10 @@
 #ifndef __CINT__
-  #include <Riostream.h>
-  #include "AliITSgeom.h"
-  #include "AliITStrackerV2.h"
-
+  #include "Riostream.h"
   #include "TFile.h"
   #include "TStopwatch.h"
+
+  #include "AliITSgeom.h"
+  #include "AliITStrackerV2.h"
 #endif
 
 Int_t AliITSFindTracksV2(Int_t nev=1) {  //number of events to process
@@ -30,9 +30,12 @@ Int_t AliITSFindTracksV2(Int_t nev=1) {  //number of events to process
      tracker.SetEventNumber(i);
      //Double_t xyz[]={0.,0.,0.}, ers[]={0.,0.,0.01};//main vertex with errors
      //tracker.SetVertex(xyz,ers);
-     //Int_t flag[]={1};                                   //some default flags
-     //flag[0]= 0; tracker.SetupFirstPass(flag);           //no constraint
-     //flag[0]=-1; tracker.SetupSecondPass(flag);          //skip second pass
+     //Int_t flag[]={1};                                 //some default flags
+     //flag[0]= 0; tracker.SetupFirstPass(flag);         //no constraint
+     //flag[0]=-1; tracker.SetupSecondPass(flag);        //skip second pass
+     //tracker.SetLastLayerToTrackTo(2);            //track down to the layer 2
+     //Int_t mask[6]={1,1,0,0,0,0};                 //not to skip pixels !
+     //tracker.SetLayersNotToSkip(mask);            //
      rc=tracker.Clusters2Tracks(in,out);
    }
    timer.Stop(); timer.Print();
index be1d9701f26b217cd242b95c4d2b7a6d92ebfaa0..1cac9ab4c6499224f9733a6eb02207a67128834f 100644 (file)
@@ -13,7 +13,9 @@
 //namespace AliITSreco {    
    const Int_t kMaxClusterPerLayer=7000*10;
    const Int_t kMaxDetectorPerLayer=1000;
-   const Int_t kLayersToSkip=0;
+
+   const Int_t kLayersNotToSkip[]={1,1,1,1,1,1};
+   const Int_t kLastLayerToTrackTo=0;
 
    const Int_t kMaxLayer=6;
    const Double_t kSigmaY2[kMaxLayer]={
index 59693f272d423e0f56f6649569f0d21d9ca68340..d592f47ebbde160a68b4a2d65d7dd56a441dc433 100644 (file)
@@ -650,10 +650,15 @@ void AliITStrackV2::CookdEdx(Double_t low, Double_t up) {
   // This function calculates dE/dX within the "low" and "up" cuts.
   // Origin: Boris Batyunya, JINR, Boris.Batiounia@cern.ch 
   //-----------------------------------------------------------------
-  Int_t i;
-  Int_t nc=4;
   // The clusters order is: SSD-2, SSD-1, SDD-2, SDD-1, SPD-2, SPD-1
-  // Take only SSD and SDD
+
+  Int_t i;
+  Int_t nc=0;
+  for (i=0; i<GetNumberOfClusters(); i++) {
+    Int_t idx=GetClusterIndex(i);
+    idx=(idx&0xf0000000)>>28;
+    if (idx>1) nc++; // Take only SSD and SDD
+  }
 
   Int_t swap;//stupid sorting
   do {
@@ -671,7 +676,7 @@ void AliITStrackV2::CookdEdx(Double_t low, Double_t up) {
                                            // nu=2
   Float_t dedx=0;
   for (i=nl; i<nu; i++) dedx += fdEdxSample[i];
-  dedx /= (nu-nl);
+  if (nu-nl>0) dedx /= (nu-nl);
 
   SetdEdx(dedx);
 }
index f27b2f8deae01982b71b910fbb36ec8210807d6b..9f1d8f274cc515cc59924728a0cef2fbcbba1ced 100644 (file)
@@ -84,6 +84,17 @@ AliITStrackerV2::AliITStrackerV2(const AliITSgeom *geom) : AliTracker() {
 
   Double_t xyz[]={kXV,kYV,kZV}, ers[]={kSigmaXV,kSigmaYV,kSigmaZV}; 
   SetVertex(xyz,ers);
+
+  for (Int_t i=0; i<kMaxLayer; i++) fLayersNotToSkip[i]=kLayersNotToSkip[i];
+  fLastLayerToTrackTo=kLastLayerToTrackTo;
+
+}
+
+void AliITStrackerV2::SetLayersNotToSkip(Int_t *l) {
+  //--------------------------------------------------------------------
+  //This function set masks of the layers which must be not skipped
+  //--------------------------------------------------------------------
+  for (Int_t i=0; i<kMaxLayer; i++) fLayersNotToSkip[i]=l[i];
 }
 
 Int_t AliITStrackerV2::LoadClusters() {
@@ -251,7 +262,7 @@ Int_t AliITStrackerV2::Clusters2Tracks(const TFile *inp, TFile *out) {
           while (TakeNextProlongation()) FollowProlongation();
        }
 
-       if (fBestTrack.GetNumberOfClusters() < kMaxLayer-kLayersToSkip)continue;
+       if (fBestTrack.GetNumberOfClusters() == 0) continue;
 
        if (fConstraint[fPass]) {
          if (!RefitAt(3.7, t, &fBestTrack)) continue;
@@ -504,9 +515,7 @@ void AliITStrackerV2::FollowProlongation() {
   //--------------------------------------------------------------------
   //This function finds a track prolongation 
   //--------------------------------------------------------------------
-  Int_t tryAgain=kLayersToSkip;
-
-  while (fI) {
+  while (fI>fLastLayerToTrackTo) {
     Int_t i=fI-1;
 
     AliITSlayer &layer=fLayers[i];
@@ -520,7 +529,7 @@ void AliITStrackerV2::FollowProlongation() {
        if (i==1) {rs=9.; d=0.0097; x0=42;}
        if (!fTrackToFollow.PropagateTo(rs,d,x0)) {
         //Warning("FollowProlongation","propagation failed !\n");
-         break;
+         return;
        }
     }
 
@@ -528,13 +537,13 @@ void AliITStrackerV2::FollowProlongation() {
     Double_t x,y,z;  
     if (!fTrackToFollow.GetGlobalXYZat(r,x,y,z)) {
       //Warning("FollowProlongation","failed to estimate track !\n");
-      break;
+      return;
     }
     Double_t phi=TMath::ATan2(y,x);
     Int_t idet=layer.FindDetectorIndex(phi,z);
     if (idet<0) {
       //Warning("FollowProlongation","failed to find a detector !\n");
-      break;
+      return;
     }
 
     //propagate to the intersection
@@ -542,7 +551,7 @@ void AliITStrackerV2::FollowProlongation() {
     phi=det.GetPhi();
     if (!fTrackToFollow.Propagate(phi,det.GetR())) {
       //Warning("FollowProlongation","propagation failed !\n");
-      break;
+      return;
     }
     fTrackToFollow.SetDetectorIndex(idet);
 
@@ -560,16 +569,16 @@ void AliITStrackerV2::FollowProlongation() {
     if (dz < 0.5*TMath::Abs(track.GetTgl())) dz=0.5*TMath::Abs(track.GetTgl());
     if (dz > kMaxRoad) {
       //Warning("FollowProlongation","too broad road in Z !\n");
-      break;
+      return;
     }
 
-    if (TMath::Abs(fTrackToFollow.GetZ()-GetZ()) > r+dz) break;
+    if (TMath::Abs(fTrackToFollow.GetZ()-GetZ()) > r+dz) return;
 
     //Double_t dy=4*TMath::Sqrt(track.GetSigmaY2() + kSigmaY2[i]);
     if (dy < 0.5*TMath::Abs(track.GetSnp())) dy=0.5*TMath::Abs(track.GetSnp());
     if (dy > kMaxRoad) {
       //Warning("FollowProlongation","too broad road in Y !\n");
-      break;
+      return;
     }
 
     Double_t zmin=track.GetZ() - dz; 
@@ -580,8 +589,8 @@ void AliITStrackerV2::FollowProlongation() {
     fI--;
 
     //take another prolongation
-    if (!TakeNextProlongation()) if (!tryAgain--) break;
-    tryAgain=kLayersToSkip;
+    if (!TakeNextProlongation()) 
+       if (fLayersNotToSkip[fI]) return;
 
   } 
 
index b415b186d624b378da2a16449687952a1af14a93..fee6c81f7454a1e34fdad9e0641244eaff9f15b2 100644 (file)
@@ -31,6 +31,9 @@ public:
   void SetupFirstPass(Int_t *flags, Double_t *cuts=0);
   void SetupSecondPass(Int_t *flags, Double_t *cuts=0);
 
+  void SetLastLayerToTrackTo(Int_t l=0) {fLastLayerToTrackTo=l;} 
+  void SetLayersNotToSkip(Int_t *l);
+
   void UseClusters(const AliKalmanTrack *t, Int_t from=0) const;
 
   class AliITSdetector {
@@ -105,6 +108,9 @@ private:
   Int_t fPass;                           // current pass through the data 
   Int_t fConstraint[2];                  // constraint flags
 
+  Int_t fLayersNotToSkip[kMaxLayer];     // layer masks
+  Int_t fLastLayerToTrackTo;             // the innermost layer to track to
+
   ClassDef(AliITStrackerV2,1)   //ITS tracker V2
 };