618713c10c6f679e21ec98fb2ecf8f29f32de6fd
[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   Int_t              GetNLayers()                  const {return fNLayers;}
28   Int_t              GetNLayersActive()            const {return fNLayersActive;}
29   Int_t              GetLrIDActive(Int_t lrActID)  const;
30   Int_t              FindLastLayerID(Double_t r, int dir)  const;
31   Int_t              FindFirstLayerID(Double_t r, int dir) const;
32   AliITSURecoLayer*  GetLayer(Int_t i)             const;
33   AliITSURecoLayer*  GetLayerActive(Int_t i)       const;
34   AliITSUGeomTGeo*   GetGeom()                     const {return fGeom;}
35   //
36   void               SetRMin(Double_t r)                 {fRMin = r;}
37   void               SetRMax(Double_t r)                 {fRMax = r;}
38   //
39   void               AddLayer(const AliITSURecoLayer* lr);
40   //
41   void               ProcessClusters(Int_t mode=0);
42   void               CreateClusterArrays();
43   Int_t              LoadClusters(TTree* treeRP);
44   //
45   virtual void       Print(Option_t* option = "")  const;
46   //
47  protected:
48   Bool_t             Build();
49   void               IndexLayers();
50   //
51  protected:
52   Int_t              fNLayers;        // total number of layers
53   Int_t              fNLayersActive;  // N of active layers
54   Double_t           fRMax;           // max  R
55   Double_t           fRMin;           // min  R
56   TObjArray          fLayers;         // layers
57   TObjArray          fLayersActive;   // active layers
58   AliITSUGeomTGeo*   fGeom;           // ITS geometry
59   //
60  protected:
61   static const Char_t*     fgkBeamPipeVolName;    // name of the beam pipe volume
62
63  private:
64   AliITSURecoDet(const AliITSURecoDet &source); 
65   AliITSURecoDet& operator=(const AliITSURecoDet &source); 
66   //
67   ClassDef(AliITSURecoDet,1); // helper for ITS data in reco
68 };
69
70
71
72 //_____________________________________________________________
73 inline Int_t AliITSURecoDet::GetLrIDActive(Int_t lrActID) const 
74 {
75   // get global layer id from active id
76   return (lrActID<fNLayersActive) ? ((AliITSURecoLayer*)fLayersActive.UncheckedAt(lrActID))->GetID() : fNLayers;
77 }
78
79 //_____________________________________________________________
80 inline AliITSURecoLayer* AliITSURecoDet::GetLayer(Int_t i) const 
81 {
82   // get layer with global id=i
83   return i>=0&&i<fNLayers ? (AliITSURecoLayer*)fLayers.UncheckedAt(i):0;
84 }
85
86 //_____________________________________________________________
87 inline AliITSURecoLayer* AliITSURecoDet::GetLayerActive(Int_t i) const
88 {
89   // get layer with activeID=i
90   return i>=0&&i<fNLayersActive ? (AliITSURecoLayer*)fLayersActive.UncheckedAt(i):0;
91 }
92
93 //______________________________________________________
94 inline void AliITSURecoDet::ProcessClusters(Int_t mode)
95 {
96   // prepare clsuters for reconstrunction
97   for (int ilr=fNLayersActive;ilr--;) GetLayerActive(ilr)->ProcessClusters(mode);
98 }
99
100 #endif