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