]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITStrackerV2.h
Typo in the calculation of procetile-target distance is corrected
[u/mrichter/AliRoot.git] / ITS / AliITStrackerV2.h
index 311702db9a136b31683375a84bd325d768f7fb5e..dc7f52eb6ccc0ac49ab4902073c4a610112261d2 100644 (file)
@@ -21,94 +21,113 @@ class TFile;
 class AliITStrackerV2 : public AliTracker {
 public:
   AliITStrackerV2():AliTracker(){}
-  AliITStrackerV2(const AliITSgeom *geom) throw (const Char_t *);
-
+  AliITStrackerV2(const AliITSgeom *geom,Int_t event=0) throw (const Char_t *);
   AliCluster *GetCluster(Int_t index) const;
   Int_t Clusters2Tracks(const TFile *in, TFile *out);
-  Int_t PropagateBack(const TFile *in, TFile *out) {return 0;}
+  Int_t PropagateBack(const TFile *in, TFile *out);
+  void SetupFirstPass(Int_t *flags, Double_t *cuts=0);
+  void SetupSecondPass(Int_t *flags, Double_t *cuts=0);
+
+  class AliITSdetector {
+  public:
+    AliITSdetector(){}
+    AliITSdetector(Double_t r,Double_t phi) {fR=r; fPhi=phi;}
+    void *operator new(size_t s,AliITSdetector *p) {return p;}
+    Double_t GetR()   const {return fR;}
+    Double_t GetPhi() const {return fPhi;}
+  private:
+    Double_t fR;    // polar coordinates 
+    Double_t fPhi;  // of this detector
+  };
+
+  class AliITSlayer {
+  public:
+    AliITSlayer();
+    AliITSlayer(Double_t r, Double_t p, Double_t z, Int_t nl, Int_t nd);
+   ~AliITSlayer();
+    Int_t InsertCluster(AliITSclusterV2 *c);
+    void SelectClusters(Double_t zmi,Double_t zma,Double_t ymi,Double_t yma);
+    const AliITSclusterV2 *GetNextCluster(Int_t &ci);
+    void *operator new(size_t s, AliITSlayer *p) {return p;}
+    Double_t GetR() const {return fR;}
+    AliITSclusterV2 *GetCluster(Int_t i) const {return fClusters[i];} 
+    AliITSdetector &GetDetector(Int_t n) const { return fDetectors[n]; }
+    Int_t FindDetectorIndex(Double_t phi, Double_t z) const;
+    Double_t GetThickness(Double_t phi, Double_t z) const;
+    Int_t InRoad() const ;
+    Int_t GetNumberOfClusters() const {return fN;}
+  private:
+    Double_t fR;                // mean radius of this layer
+    Double_t fPhiOffset;        // offset of the first detector in Phi
+    Int_t fNladders;            // number of ladders
+    Double_t fZOffset;          // offset of the first detector in Z
+    Int_t fNdetectors;          // detectors/ladder
+    AliITSdetector *fDetectors; // array of detectors
+    Int_t fN;                   // number of clusters
+    AliITSclusterV2 *fClusters[kMaxClusterPerLayer]; // pointers to clusters
+    Double_t fZmax;      //    edges
+    Double_t fYmin;      //   of  the
+    Double_t fYmax;      //   "window"
+    Int_t fI;            // index of the current cluster within the "window"
+    Int_t FindClusterIndex(Double_t z) const;
+  };
 
 private:
-
+  void CookLabel(AliKalmanTrack *t,Float_t wrong) const;
   Double_t GetEffectiveThickness(Double_t phi, Double_t z) const;
-
   void  FollowProlongation();
   Int_t TakeNextProlongation();
-
   void ResetBestTrack() {
      fBestTrack.~AliITStrackV2();
      new(&fBestTrack) AliITStrackV2(fTrackToFollow);
   }
-
   void ResetTrackToFollow(const AliITStrackV2 &t) {
      fTrackToFollow.~AliITStrackV2();
      new(&fTrackToFollow) AliITStrackV2(t);
   }
-
-  //The two subclasses are public in order to access one from the another
- public: 
-class AliITSdetector {
-private:
-  Double_t fR;    // polar coordinates 
-  Double_t fPhi;  // of this detector
-
-public:
-  AliITSdetector(){}
-  AliITSdetector(Double_t r,Double_t phi) {fR=r; fPhi=phi;}
-
-  void *operator new(size_t s,AliITSdetector *p) {return p;}
-
-  Double_t GetR()   const {return fR;}
-  Double_t GetPhi() const {return fPhi;}
-};
-
-class AliITSlayer {
-  Double_t fR;                // mean radius of this layer
-  Double_t fPhiOffset;        // offset of the first detector in Phi
-  Int_t fNladders;            // number of ladders
-  Double_t fZOffset;          // offset of the first detector in Z
-  Int_t fNdetectors;          // detectors/ladder
-  AliITSdetector *fDetectors; // array of detectors
-
-  Int_t fN;                   // number of clusters
-  AliITSclusterV2 *fClusters[kMaxClusterPerLayer];    // pointers to clusters
-
-  Double_t fZmax;      //       edges
-  Double_t fYmin;      //      of  the
-  Double_t fYmax;      //      "window"
-  Int_t fI;            // index of the current cluster within the "window"
-
-  Int_t FindClusterIndex(Double_t z) const;
-
-public:
-  AliITSlayer();
-  AliITSlayer(Double_t r, Double_t p, Double_t z, Int_t nl, Int_t nd);
- ~AliITSlayer();
-  Int_t InsertCluster(AliITSclusterV2 *c);
-  void SelectClusters(Double_t zmin,Double_t zmax,Double_t ymin,Double_t ymax);
-  const AliITSclusterV2 *GetNextCluster(Int_t &ci);
-
-  void *operator new(size_t s, AliITSlayer *p) {return p;}
-
-  Double_t GetR() const {return fR;}
-  AliITSclusterV2 *GetCluster(Int_t i) const {return fClusters[i];} 
-  AliITSdetector &GetDetector(Int_t n) const { return fDetectors[n]; }
-  Int_t FindDetectorIndex(Double_t phi, Double_t z) const;
-  Double_t GetThickness(Double_t phi, Double_t z) const;
-
-  Int_t InRoad() const ;
-};
-
- private:
-  Int_t fI;                       // index of the current layer
+  Int_t fEventN;                         //event number
+  Int_t fI;                              // index of the current layer
   static AliITSlayer fLayers[kMaxLayer]; // ITS layers
-  AliITStrackV2 fTracks[kMaxLayer]; // track estimations at the ITS layers
-  AliITStrackV2 fBestTrack;         // "best" track 
-  AliITStrackV2 fTrackToFollow;     // followed track
-
-  Double_t fYV;                   // Y-coordinate of the primary vertex
-  Double_t fZV;                   // Z-coordinate of the primary vertex
+  AliITStrackV2 fTracks[kMaxLayer];      // track estimations at the ITS layers
+  AliITStrackV2 fBestTrack;              // "best" track 
+  AliITStrackV2 fTrackToFollow;          // followed track
+  Int_t fPass;                           // current pass through the data 
+  Int_t fConstraint[2];                  // constraint flags
 };
 
 
+inline void AliITStrackerV2::SetupFirstPass(Int_t *flags, Double_t *cuts) {
+  // This function sets up flags and cuts for the first tracking pass   
+  //
+  //   flags[0] - vertex constaint flag                                
+  //              negative means "skip the pass"                        
+  //              0        means "no constraint"                        
+  //              positive means "normal constraint"                    
+
+   fConstraint[0]=flags[0];
+   if (cuts==0) return;
+}
+
+inline void AliITStrackerV2::SetupSecondPass(Int_t *flags, Double_t *cuts) {
+  // This function sets up flags and cuts for the second tracking pass   
+  //
+  //   flags[0] - vertex constaint flag                                
+  //              negative means "skip the pass"                        
+  //              0        means "no constraint"                        
+  //              positive means "normal constraint"                    
+
+   fConstraint[1]=flags[0];
+   if (cuts==0) return;
+}
+
+inline void AliITStrackerV2::CookLabel(AliKalmanTrack *t,Float_t wrong) const {
+  //--------------------------------------------------------------------
+  //This function "cooks" a track label. If label<0, this track is fake.
+  //--------------------------------------------------------------------
+   Int_t tpcLabel=t->GetLabel();
+   if (tpcLabel<0) return;
+   AliTracker::CookLabel(t,wrong);
+   if (tpcLabel != t->GetLabel()) t->SetLabel(-tpcLabel); 
+}
 
 #endif