]>
Commit | Line | Data |
---|---|---|
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(Bool_t onlyITS=kFALSE,Int_t minITSpts=0, | |
37 | Bool_t cuts=kTRUE, | |
38 | Float_t minAngleWrtITSModulePlanes=0., | |
39 | Float_t minMom=0.3,Float_t maxMom=1.e9, | |
40 | Float_t minAbsSinPhi=0.,Float_t maxAbsSinPhi=1., | |
41 | Float_t minSinTheta=0.,Float_t maxSinTheta=1.); | |
42 | void ProcessESDCosmics(Bool_t onlyITS=kFALSE,Int_t minITSpts=0, | |
43 | Float_t maxMatchingAngle=0.17, // 10 deg | |
44 | Bool_t cuts=kTRUE, | |
45 | Float_t minAngleWrtITSModulePlanes=0., | |
46 | Float_t minMom=0.3,Float_t maxMom=1.e9, | |
47 | Float_t minAbsSinPhi=0.,Float_t maxAbsSinPhi=1., | |
48 | Float_t minSinTheta=0.,Float_t maxSinTheta=1.); | |
49 | ||
50 | void BuildIndex(); | |
51 | ||
52 | Bool_t ReadAlignObjs(const char *alignObjFileName = "AlignObjs.root", const char* arrayName = "Alignment"); | |
53 | ||
54 | void SetTrackFitter(AliTrackFitter *fitter) { fTrackFitter = fitter; } | |
55 | void SetMinimizer(AliTrackResiduals *minimizer) { fMinimizer = minimizer; } | |
56 | ||
57 | Bool_t AlignDetector(AliGeomManager::ELayerID firstLayer, | |
58 | AliGeomManager::ELayerID lastLayer, | |
59 | AliGeomManager::ELayerID layerRangeMin = AliGeomManager::kFirstLayer, | |
60 | AliGeomManager::ELayerID layerRangeMax = AliGeomManager::kLastLayer,Int_t iterations = 1); | |
61 | Bool_t AlignLayer(AliGeomManager::ELayerID layer, | |
62 | AliGeomManager::ELayerID layerRangeMin = AliGeomManager::kFirstLayer, | |
63 | AliGeomManager::ELayerID layerRangeMax = AliGeomManager::kLastLayer, | |
64 | Int_t iterations = 1); | |
65 | Bool_t AlignVolume(UShort_t volId, UShort_t volIdFit, | |
66 | Int_t iterations); | |
67 | Bool_t AlignVolumes(const TArrayI *volids, const TArrayI *volidsfit = 0x0, | |
68 | AliGeomManager::ELayerID layerRangeMin = AliGeomManager::kFirstLayer, | |
69 | AliGeomManager::ELayerID layerRangeMax = AliGeomManager::kLastLayer, | |
70 | Int_t iterations = 1); | |
71 | ||
72 | AliAlignObj* GetAlignObj(UShort_t volid) const { | |
73 | Int_t iModule; | |
74 | AliGeomManager::ELayerID iLayer = AliGeomManager::VolUIDToLayer(volid,iModule); | |
75 | return fAlignObjs[iLayer-AliGeomManager::kFirstLayer][iModule]; | |
76 | } | |
77 | void SetUpdate(Bool_t update){fDoUpdate = update;} | |
78 | void SetCovIsUsed(Bool_t covisused){fCovIsUsed=covisused;} | |
79 | Bool_t GetUpdate() const { return fDoUpdate;} | |
80 | void WriteRealignObjArray(TString outfilename,AliGeomManager::ELayerID layerRangeMin,AliGeomManager::ELayerID layerRangeMax); | |
81 | Int_t GetLastIndex(Int_t iLayer,Int_t iModule) const { return fLastIndex[iLayer][iModule]; } | |
82 | ||
83 | protected: | |
84 | ||
85 | void InitIndex(); | |
86 | void ResetIndex(); | |
87 | void DeleteIndex(); | |
88 | ||
89 | void InitAlignObjs(); | |
90 | void ResetAlignObjs(); | |
91 | void DeleteAlignObjs(); | |
92 | ||
93 | Int_t LoadPoints(const TArrayI *volids, AliTrackPointArray** &points,Int_t &pointsdim); | |
94 | void UnloadPoints(Int_t n, AliTrackPointArray **points); | |
95 | ||
96 | AliTrackFitter *CreateFitter(); | |
97 | AliTrackResiduals *CreateMinimizer(); | |
98 | ||
99 | Bool_t Misalign(const char *misalignObjFileName, const char* arrayName); | |
100 | ||
101 | TChain *fESDChain; //! Chain with ESDs | |
102 | TString fPointsFilename; // Name of the file containing the track point arrays | |
103 | TFile *fPointsFile; // File containing the track point arrays | |
104 | TTree *fPointsTree; // Tree with the track point arrays | |
105 | Int_t **fLastIndex; //! Last filled index in volume arrays | |
106 | TArrayI ***fArrayIndex; //! Volume arrays which contains the tree index | |
107 | Bool_t fIsIndexBuilt; // Is points tree index built | |
108 | AliAlignObj ***fAlignObjs; // Array with alignment objects | |
109 | AliAlignObj ***fMisalignObjs; // Array with alignment objects used to introduce misalignment of the space-points | |
110 | AliTrackFitter *fTrackFitter; // Pointer to the track fitter | |
111 | AliTrackResiduals*fMinimizer; // Pointer to track residuals minimizer | |
112 | Bool_t fDoUpdate; // Indicator - update Alignment object after minimization | |
113 | Bool_t fCovIsUsed; // Indicator - use AlignObjs' Cov matrices | |
114 | ||
115 | private: | |
116 | AliAlignmentTracks(const AliAlignmentTracks & alignment); | |
117 | AliAlignmentTracks& operator= (const AliAlignmentTracks& alignment); | |
118 | ||
119 | ClassDef(AliAlignmentTracks,2) | |
120 | ||
121 | }; | |
122 | ||
123 | #endif |