]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliAlignmentTracks.h
Updated PaintContour() method
[u/mrichter/AliRoot.git] / STEER / AliAlignmentTracks.h
1 #ifndef ALIALIGNMENTTRACKS_H
2 #define ALIALIGNMENTTRACKS_H
3
4 //*************************************************************************
5 // AliAlignmentTracks: main steering class which deals with the alignment *
6 // procedures based on reconstructed tracks.                              *
7 // More comments will come with the development of the interfaces and     *
8 // functionalities of the class.                                          *
9 //*************************************************************************
10
11 #include <TObject.h>
12
13 #include "AliAlignObj.h"
14
15 class TChain;
16 class AliTrackPointArray;
17 class AliAlignObj;
18 class AliTrackFitter;
19 class AliTrackResiduals;
20
21 class AliAlignmentTracks : public TObject {
22
23  public:
24
25   AliAlignmentTracks();
26   AliAlignmentTracks(TChain *esdchain);
27   AliAlignmentTracks(const char *esdfilename, const char *esdtreename = "esdTree");
28   virtual ~AliAlignmentTracks();
29
30   void AddESD(TChain *esdchain);
31   void AddESD(const char *esdfilename, const char *esdtreename = "esdTree");
32
33   void SetPointsFilename(const char *pointsfilename = "AliTrackPoints.root") { fPointsFilename = pointsfilename; }
34
35   void ProcessESD(TSelector *selector);
36   void ProcessESD();
37
38   void BuildIndex();
39
40   Bool_t ReadAlignObjs(const char *alignObjFileName = "AlignObjs.root", const char* arrayName = "Alignment");
41
42   void SetTrackFitter(AliTrackFitter *fitter) { fTrackFitter = fitter; }
43   void SetMinimizer(AliTrackResiduals *minimizer) { fMinimizer = minimizer; }
44
45   void AlignDetector(AliAlignObj::ELayerID firstLayer,
46                      AliAlignObj::ELayerID lastLayer,
47                      AliAlignObj::ELayerID layerRangeMin = AliAlignObj::kFirstLayer,
48                      AliAlignObj::ELayerID layerRangeMax = AliAlignObj::kLastLayer,Int_t iterations = 1);
49   void AlignLayer(AliAlignObj::ELayerID layer,
50                   AliAlignObj::ELayerID layerRangeMin = AliAlignObj::kFirstLayer,
51                   AliAlignObj::ELayerID layerRangeMax = AliAlignObj::kLastLayer,
52                   Int_t iterations = 1);
53   void AlignVolume(UShort_t volId, UShort_t volIdFit,
54                    Int_t iterations);
55   void AlignVolumes(const TArrayI *volids, const TArrayI *volidsfit = 0x0,
56                    AliAlignObj::ELayerID layerRangeMin = AliAlignObj::kFirstLayer,
57                    AliAlignObj::ELayerID layerRangeMax = AliAlignObj::kLastLayer,
58                    Int_t iterations = 1);
59
60   AliAlignObj* GetAlignObj(UShort_t volid) const {
61     Int_t iModule;
62     AliAlignObj::ELayerID iLayer = AliAlignObj::VolUIDToLayer(volid,iModule);
63     return fAlignObjs[iLayer-AliAlignObj::kFirstLayer][iModule];
64   }
65   void    SetUpdate(Bool_t update){fDoUpdate = update;}
66   Bool_t  GetUpdate() const { return fDoUpdate;}
67  protected:
68
69   void InitIndex();
70   void ResetIndex();
71   void DeleteIndex();
72
73   void InitAlignObjs();
74   void ResetAlignObjs();
75   void DeleteAlignObjs();
76
77   Int_t LoadPoints(const TArrayI *volids, AliTrackPointArray** &points);
78   void  UnloadPoints(Int_t n, AliTrackPointArray **points);
79
80   AliTrackFitter *CreateFitter();
81   AliTrackResiduals *CreateMinimizer();
82
83   Bool_t Misalign(const char *misalignObjFileName, const char* arrayName);
84
85   TChain           *fESDChain;       //! Chain with ESDs
86   TString           fPointsFilename; //  Name of the file containing the track point arrays
87   TFile            *fPointsFile;     //  File containing the track point arrays
88   TTree            *fPointsTree;     //  Tree with the track point arrays
89   Int_t           **fLastIndex;      //! Last filled index in volume arrays
90   TArrayI        ***fArrayIndex;     //! Volume arrays which contains the tree index
91   Bool_t            fIsIndexBuilt;   //  Is points tree index built
92   AliAlignObj    ***fAlignObjs;      //  Array with alignment objects
93   AliAlignObj    ***fMisalignObjs;   //  Array with alignment objects used to introduce misalignment of the space-points
94   AliTrackFitter   *fTrackFitter;    //  Pointer to the track fitter
95   AliTrackResiduals*fMinimizer;      //  Pointer to track residuals minimizer
96   Bool_t            fDoUpdate;       //  Indicator - update Alignment object after minimization
97
98  private:
99   AliAlignmentTracks(const AliAlignmentTracks & alignment);
100   AliAlignmentTracks& operator= (const AliAlignmentTracks& alignment);
101
102   ClassDef(AliAlignmentTracks,2)
103
104 };
105
106 #endif