]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/UPGRADE/AliITSUTrackHyp.h
Little fix in the treatment of event species
[u/mrichter/AliRoot.git] / ITS / UPGRADE / AliITSUTrackHyp.h
1 #ifndef ALIITSUTRACKHYP_H
2 #define ALIITSUTRACKHYP_H
3
4 #include <TObject.h>
5 #include <TObjArray.h>
6 #include "AliKalmanTrack.h"
7 #include "AliITSUSeed.h"
8 class AliESDtrack;
9 class AliCluster;
10
11 // Container for track hypotheses
12
13 class AliITSUTrackHyp: public AliKalmanTrack
14 {
15  public:
16   enum {kSkip=BIT(14)};
17   AliITSUTrackHyp(Int_t nlr=0);
18   AliITSUTrackHyp(const AliITSUTrackHyp& src);
19   AliITSUTrackHyp(const AliKalmanTrack& src);
20   AliITSUTrackHyp(const AliESDtrack& src);
21   AliITSUTrackHyp &operator=(const AliITSUTrackHyp &src);
22   AliITSUTrackHyp &operator=(const AliESDtrack &src);
23   AliITSUTrackHyp &operator=(const AliKalmanTrack &src);
24   virtual ~AliITSUTrackHyp();
25   //
26   void               InitFrom(const AliITSUTrackHyp *src);
27   Int_t              GetNLayers()        const {return fNLayers;}
28   Int_t              GetNSeeds(Int_t lr) const {return fLayerSeeds[lr].GetEntriesFast();}
29   AliITSUSeed*       GetSeed(Int_t lr, Int_t id) const {return (AliITSUSeed*)fLayerSeeds[lr].UncheckedAt(id);}
30   AliITSUSeed*       RemoveSeed(Int_t lr, Int_t id) const {return (AliITSUSeed*)fLayerSeeds[lr].RemoveAt(id);}
31   AliITSUSeed*       GetWinner()         const;
32   AliESDtrack*       GetESDTrack()       const {return fESDTrack;}
33   Int_t              GetITSLabel()       const {return fITSLabel;}
34   AliITSUSeed*       DefineWinner(Int_t lr=0, Int_t id=0);
35   void               SetWinner(AliITSUSeed* w) {fWinner = w;}
36   const TObjArray*   GetLayerSeeds(Int_t lr) const {return lr<fNLayers ? &fLayerSeeds[lr] : 0;}
37   void               AddSeed(AliITSUSeed* seed, Int_t lr);
38   void               SetESDTrack(AliESDtrack* esdtr) {fESDTrack = esdtr;}
39   void               SetITSLabel(Int_t lb)    {fITSLabel=lb;}
40   Int_t              FetchClusterInfo(Int_t* clIDarr) const;
41   //
42   void               SetChi2(Double_t chi2) {fChi2 = chi2;}
43   Double_t           Update(const AliCluster* c);
44   Bool_t             Update(Double_t p[2],Double_t cov[3])                  {return AliExternalTrackParam::Update(p,cov);}
45   Double_t           GetPredictedChi2(Double_t p[2],Double_t cov[3])  const {return AliExternalTrackParam::GetPredictedChi2(p,cov);}
46   Double_t           GetPredictedChi2(const AliExternalTrackParam *t) const {return AliExternalTrackParam::GetPredictedChi2(t);}
47   AliExternalTrackParam* GetTPCSeed() const {return fTPCSeed;}
48   void               SetTPCSeed(AliExternalTrackParam* seed) {fTPCSeed = seed;}
49   //
50   virtual Double_t   GetPredictedChi2(const AliCluster *c) const;
51   
52   virtual Bool_t     PropagateTo(Double_t xr, Double_t x0, Double_t rho);
53   virtual Bool_t     Update(const AliCluster* c, Double_t chi2, Int_t index);
54   virtual Int_t      GetNumberOfClusters()   const;
55   virtual Int_t      GetClusterIndex(Int_t ind)  const;
56   //  virtual Int_t      GetTrackletIndex(Int_t) const { return -1;}
57   virtual Double_t   GetPIDsignal()          const { return 0;}
58   //
59   virtual void       Print(Option_t* option = "") const;
60   //
61   Bool_t             GetSkip()               const {return TestBit(kSkip);}
62   void               SetSkip(Bool_t v=kTRUE)       {SetBit(kSkip,v);}
63   //
64  protected:
65   UChar_t          fNLayers;               // number of layers
66   Int_t            fITSLabel;              // ITS MC Label, the global one (wrt TPC) is fLab
67   AliESDtrack*     fESDTrack;              // reference esd track
68   AliITSUSeed*     fWinner;                // winner seed
69   AliExternalTrackParam* fTPCSeed;         // kinematics of TPC track at outer radius
70   TObjArray*       fLayerSeeds;            // seeds of given layer
71   //
72   ClassDef(AliITSUTrackHyp,1)
73 };
74
75 //___________________________________________________________________
76 inline void AliITSUTrackHyp::AddSeed(AliITSUSeed* seed, Int_t lr) 
77 {
78   // add seed to hypothesis
79   fLayerSeeds[lr].AddLast(seed);
80   AliITSUSeed* par = (AliITSUSeed*)seed->GetParent();
81   if (par) par->IncChildren();
82 }
83
84 #endif