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 | |
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"); |
98937d93 |
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(); |
98937d93 |
39 | |
46ae650f |
40 | Bool_t ReadAlignObjs(const char *alignObjFileName = "AlignObjs.root", const char* arrayName = "Alignment"); |
98937d93 |
41 | |
42 | void SetTrackFitter(AliTrackFitter *fitter) { fTrackFitter = fitter; } |
43 | void SetMinimizer(AliTrackResiduals *minimizer) { fMinimizer = minimizer; } |
44 | |
25be1e5c |
45 | void AlignDetector(AliGeomManager::ELayerID firstLayer, |
46 | AliGeomManager::ELayerID lastLayer, |
47 | AliGeomManager::ELayerID layerRangeMin = AliGeomManager::kFirstLayer, |
48 | AliGeomManager::ELayerID layerRangeMax = AliGeomManager::kLastLayer,Int_t iterations = 1); |
49 | void AlignLayer(AliGeomManager::ELayerID layer, |
50 | AliGeomManager::ELayerID layerRangeMin = AliGeomManager::kFirstLayer, |
51 | AliGeomManager::ELayerID layerRangeMax = AliGeomManager::kLastLayer, |
98937d93 |
52 | Int_t iterations = 1); |
cc345ce3 |
53 | void AlignVolume(UShort_t volId, UShort_t volIdFit, |
54 | Int_t iterations); |
55 | void AlignVolumes(const TArrayI *volids, const TArrayI *volidsfit = 0x0, |
25be1e5c |
56 | AliGeomManager::ELayerID layerRangeMin = AliGeomManager::kFirstLayer, |
57 | AliGeomManager::ELayerID layerRangeMax = AliGeomManager::kLastLayer, |
46ae650f |
58 | Int_t iterations = 1); |
98937d93 |
59 | |
cc345ce3 |
60 | AliAlignObj* GetAlignObj(UShort_t volid) const { |
61 | Int_t iModule; |
25be1e5c |
62 | AliGeomManager::ELayerID iLayer = AliGeomManager::VolUIDToLayer(volid,iModule); |
63 | return fAlignObjs[iLayer-AliGeomManager::kFirstLayer][iModule]; |
cc345ce3 |
64 | } |
91264393 |
65 | void SetUpdate(Bool_t update){fDoUpdate = update;} |
66 | Bool_t GetUpdate() const { return fDoUpdate;} |
98937d93 |
67 | protected: |
68 | |
69 | void InitIndex(); |
70 | void ResetIndex(); |
71 | void DeleteIndex(); |
72 | |
73 | void InitAlignObjs(); |
74 | void ResetAlignObjs(); |
75 | void DeleteAlignObjs(); |
76 | |
cc345ce3 |
77 | Int_t LoadPoints(const TArrayI *volids, AliTrackPointArray** &points); |
98937d93 |
78 | void UnloadPoints(Int_t n, AliTrackPointArray **points); |
79 | |
80 | AliTrackFitter *CreateFitter(); |
81 | AliTrackResiduals *CreateMinimizer(); |
82 | |
46ae650f |
83 | Bool_t Misalign(const char *misalignObjFileName, const char* arrayName); |
84 | |
98937d93 |
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 |
46ae650f |
93 | AliAlignObj ***fMisalignObjs; // Array with alignment objects used to introduce misalignment of the space-points |
98937d93 |
94 | AliTrackFitter *fTrackFitter; // Pointer to the track fitter |
95 | AliTrackResiduals*fMinimizer; // Pointer to track residuals minimizer |
91264393 |
96 | Bool_t fDoUpdate; // Indicator - update Alignment object after minimization |
75e3794b |
97 | |
98 | private: |
99 | AliAlignmentTracks(const AliAlignmentTracks & alignment); |
100 | AliAlignmentTracks& operator= (const AliAlignmentTracks& alignment); |
101 | |
91264393 |
102 | ClassDef(AliAlignmentTracks,2) |
98937d93 |
103 | |
104 | }; |
105 | |
106 | #endif |