Improved protection
[u/mrichter/AliRoot.git] / STEER / AliAlignmentTracks.h
CommitLineData
98937d93 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
15class TChain;
16class AliTrackPointArray;
17class AliAlignObj;
18class AliTrackFitter;
19class AliTrackResiduals;
20
21class AliAlignmentTracks : public TObject {
22
23 public:
24
25 AliAlignmentTracks();
26 AliAlignmentTracks(TChain *esdchain);
27 AliAlignmentTracks(const char *esdfilename, const char *esdtreename = "esdTree");
28 AliAlignmentTracks(const AliAlignmentTracks & alignment);
29 AliAlignmentTracks& operator= (const AliAlignmentTracks& alignment);
30 virtual ~AliAlignmentTracks();
31
32 void AddESD(TChain *esdchain);
33 void AddESD(const char *esdfilename, const char *esdtreename = "esdTree");
34
35 void SetPointsFilename(const char *pointsfilename = "AliTrackPoints.root") { fPointsFilename = pointsfilename; }
36
37 void ProcessESD(TSelector *selector);
38 void ProcessESD();
39
40 void BuildIndex();
98937d93 41
46ae650f 42 Bool_t ReadAlignObjs(const char *alignObjFileName = "AlignObjs.root", const char* arrayName = "Alignment");
98937d93 43
44 void SetTrackFitter(AliTrackFitter *fitter) { fTrackFitter = fitter; }
45 void SetMinimizer(AliTrackResiduals *minimizer) { fMinimizer = minimizer; }
46
cc345ce3 47 void AlignDetector(AliAlignObj::ELayerID firstLayer,
48 AliAlignObj::ELayerID lastLayer,
49 AliAlignObj::ELayerID layerRangeMin = AliAlignObj::kFirstLayer,
50 AliAlignObj::ELayerID layerRangeMax = AliAlignObj::kLastLayer,Int_t iterations = 1);
98937d93 51 void AlignLayer(AliAlignObj::ELayerID layer,
52 AliAlignObj::ELayerID layerRangeMin = AliAlignObj::kFirstLayer,
53 AliAlignObj::ELayerID layerRangeMax = AliAlignObj::kLastLayer,
54 Int_t iterations = 1);
cc345ce3 55 void AlignVolume(UShort_t volId, UShort_t volIdFit,
56 Int_t iterations);
57 void AlignVolumes(const TArrayI *volids, const TArrayI *volidsfit = 0x0,
98937d93 58 AliAlignObj::ELayerID layerRangeMin = AliAlignObj::kFirstLayer,
46ae650f 59 AliAlignObj::ELayerID layerRangeMax = AliAlignObj::kLastLayer,
60 Int_t iterations = 1);
98937d93 61
cc345ce3 62 AliAlignObj* GetAlignObj(UShort_t volid) const {
63 Int_t iModule;
64 AliAlignObj::ELayerID iLayer = AliAlignObj::VolUIDToLayer(volid,iModule);
65 return fAlignObjs[iLayer-AliAlignObj::kFirstLayer][iModule];
66 }
67
98937d93 68 protected:
69
70 void InitIndex();
71 void ResetIndex();
72 void DeleteIndex();
73
74 void InitAlignObjs();
75 void ResetAlignObjs();
76 void DeleteAlignObjs();
77
cc345ce3 78 Int_t LoadPoints(const TArrayI *volids, AliTrackPointArray** &points);
98937d93 79 void UnloadPoints(Int_t n, AliTrackPointArray **points);
80
81 AliTrackFitter *CreateFitter();
82 AliTrackResiduals *CreateMinimizer();
83
46ae650f 84 Bool_t Misalign(const char *misalignObjFileName, const char* arrayName);
85
98937d93 86 TChain *fESDChain; //! Chain with ESDs
87 TString fPointsFilename; // Name of the file containing the track point arrays
88 TFile *fPointsFile; // File containing the track point arrays
89 TTree *fPointsTree; // Tree with the track point arrays
90 Int_t **fLastIndex; //! Last filled index in volume arrays
91 TArrayI ***fArrayIndex; //! Volume arrays which contains the tree index
92 Bool_t fIsIndexBuilt; // Is points tree index built
93 AliAlignObj ***fAlignObjs; // Array with alignment objects
46ae650f 94 AliAlignObj ***fMisalignObjs; // Array with alignment objects used to introduce misalignment of the space-points
98937d93 95 AliTrackFitter *fTrackFitter; // Pointer to the track fitter
96 AliTrackResiduals*fMinimizer; // Pointer to track residuals minimizer
97
98 ClassDef(AliAlignmentTracks,1)
99
100};
101
102#endif