Integrating the Cooked Matrix tracker into the commom reconstruction framework
[u/mrichter/AliRoot.git] / ITS / UPGRADE / AliITSURecoDet.h
1 #ifndef ALIITSURECODET
2 #define ALIITSURECODET
3
4 #include <TNamed.h>
5 #include <TObjArray.h>
6 #include "AliITSURecoLayer.h"
7 class AliITSUGeomTGeo;
8 class TTree;
9
10 ///////////////////////////////////////////////////////////////////////
11 //                                                                   //
12 //  Class AliITSURecoDet                                             //
13 //  Interface between the framework and reconstruction for ITS       //
14 //                                                                   //
15 ///////////////////////////////////////////////////////////////////////
16
17
18 class AliITSURecoDet : public TNamed
19 {
20  public:
21   //
22   AliITSURecoDet(AliITSUGeomTGeo* geom, const char* name="");
23   virtual ~AliITSURecoDet();
24   //
25   Double_t           GetRMin()                     const {return fRMin;}
26   Double_t           GetRMax()                     const {return fRMax;}
27   Double_t           GetRITSTPCRef()               const {return fRITSTPCRef;}
28   Int_t              GetNLayers()                  const {return fNLayers;}
29   Int_t              GetNLayersActive()            const {return fNLayersActive;}
30   Int_t              GetLrIDActive(Int_t lrActID)  const;
31   Int_t              FindLastLayerID(Double_t r, int dir)  const;
32   Int_t              FindFirstLayerID(Double_t r, int dir) const;
33   AliITSURecoLayer*  GetLayer(Int_t i)             const;
34   AliITSURecoLayer*  GetLayerActive(Int_t i)       const;
35   AliITSUGeomTGeo*   GetGeom()                     const {return fGeom;}
36   //
37   void               SetRMin(Double_t r)                 {fRMin = r;}
38   void               SetRMax(Double_t r)                 {fRMax = r;}
39   void               SetRITSTPCRef(Double_t r)           {fRITSTPCRef = r;}
40   //
41   void               AddLayer(const AliITSURecoLayer* lr);
42   //
43   void               ProcessClusters(Int_t mode=0);
44   void               CreateClusterArrays();
45   Int_t              LoadClusters(TTree* treeRP);
46   //
47   virtual void       Print(Option_t* option = "")  const;
48   //
49  protected:
50   Bool_t             Build();
51   void               IndexLayers();
52   //
53  protected:
54   Int_t              fNLayers;        // total number of layers
55   Int_t              fNLayersActive;  // N of active layers
56   Double_t           fRMax;           // max  R
57   Double_t           fRMin;           // min  R
58   Double_t           fRITSTPCRef;     // reference radius for ITS/TPC matching check
59   TObjArray          fLayers;         // layers
60   TObjArray          fLayersActive;   // active layers
61   AliITSUGeomTGeo*   fGeom;           // ITS geometry
62   //
63  protected:
64   static const Char_t*     fgkBeamPipeVolName;    // name of the beam pipe volume
65
66  private:
67   AliITSURecoDet(const AliITSURecoDet &source); 
68   AliITSURecoDet& operator=(const AliITSURecoDet &source); 
69   //
70   ClassDef(AliITSURecoDet,1); // helper for ITS data in reco
71 };
72
73
74
75 //_____________________________________________________________
76 inline Int_t AliITSURecoDet::GetLrIDActive(Int_t lrActID) const 
77 {
78   // get global layer id from active id
79   return (lrActID<fNLayersActive) ? ((AliITSURecoLayer*)fLayersActive.UncheckedAt(lrActID))->GetID() 
80     : GetLayerActive(fNLayersActive-1)->GetID()+1;
81 }
82
83 //_____________________________________________________________
84 inline AliITSURecoLayer* AliITSURecoDet::GetLayer(Int_t i) const 
85 {
86   // get layer with global id=i
87   return i>=0&&i<fNLayers ? (AliITSURecoLayer*)fLayers.UncheckedAt(i):0;
88 }
89
90 //_____________________________________________________________
91 inline AliITSURecoLayer* AliITSURecoDet::GetLayerActive(Int_t i) const
92 {
93   // get layer with activeID=i
94   return i>=0&&i<fNLayersActive ? (AliITSURecoLayer*)fLayersActive.UncheckedAt(i):0;
95 }
96
97 //______________________________________________________
98 inline void AliITSURecoDet::ProcessClusters(Int_t mode)
99 {
100   // prepare clsuters for reconstrunction
101   for (int ilr=fNLayersActive;ilr--;) GetLayerActive(ilr)->ProcessClusters(mode);
102 }
103
104 #endif