Fixes for coverity.
[u/mrichter/AliRoot.git] / STEER / 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");
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);
babbb915 36 void ProcessESD(Bool_t onlyITS=kFALSE,Int_t minITSpts=0,
37 Bool_t cuts=kTRUE,
d6116b3f 38 Float_t minAngleWrtITSModulePlanes=0.,
9a1304f0 39 Float_t minMom=0.3,Float_t maxMom=1.e9,
babbb915 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,
9a1304f0 43 Float_t maxMatchingAngle=0.17, // 10 deg
44 Bool_t cuts=kTRUE,
d6116b3f 45 Float_t minAngleWrtITSModulePlanes=0.,
9a1304f0 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.);
98937d93 49
50 void BuildIndex();
98937d93 51
46ae650f 52 Bool_t ReadAlignObjs(const char *alignObjFileName = "AlignObjs.root", const char* arrayName = "Alignment");
98937d93 53
54 void SetTrackFitter(AliTrackFitter *fitter) { fTrackFitter = fitter; }
55 void SetMinimizer(AliTrackResiduals *minimizer) { fMinimizer = minimizer; }
56
6fdedff6 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);
98937d93 71
cc345ce3 72 AliAlignObj* GetAlignObj(UShort_t volid) const {
73 Int_t iModule;
25be1e5c 74 AliGeomManager::ELayerID iLayer = AliGeomManager::VolUIDToLayer(volid,iModule);
75 return fAlignObjs[iLayer-AliGeomManager::kFirstLayer][iModule];
cc345ce3 76 }
91264393 77 void SetUpdate(Bool_t update){fDoUpdate = update;}
6b7c7eba 78 void SetCovIsUsed(Bool_t covisused){fCovIsUsed=covisused;}
91264393 79 Bool_t GetUpdate() const { return fDoUpdate;}
193b509e 80 void WriteRealignObjArray(TString outfilename,AliGeomManager::ELayerID layerRangeMin,AliGeomManager::ELayerID layerRangeMax);
6d210c37 81 Int_t GetLastIndex(Int_t iLayer,Int_t iModule) const { return fLastIndex[iLayer][iModule]; }
82
52338825 83 Bool_t Misalign(const char *misalignObjFileName, const char* arrayName);
84
98937d93 85 protected:
86
87 void InitIndex();
88 void ResetIndex();
89 void DeleteIndex();
90
91 void InitAlignObjs();
92 void ResetAlignObjs();
93 void DeleteAlignObjs();
94
a5b84e94 95 Int_t LoadPoints(const TArrayI *volids, AliTrackPointArray** &points,Int_t &pointsdim);
98937d93 96 void UnloadPoints(Int_t n, AliTrackPointArray **points);
97
98 AliTrackFitter *CreateFitter();
99 AliTrackResiduals *CreateMinimizer();
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
46ae650f 109 AliAlignObj ***fMisalignObjs; // Array with alignment objects used to introduce misalignment of the space-points
98937d93 110 AliTrackFitter *fTrackFitter; // Pointer to the track fitter
111 AliTrackResiduals*fMinimizer; // Pointer to track residuals minimizer
91264393 112 Bool_t fDoUpdate; // Indicator - update Alignment object after minimization
6b7c7eba 113 Bool_t fCovIsUsed; // Indicator - use AlignObjs' Cov matrices
75e3794b 114
115 private:
116 AliAlignmentTracks(const AliAlignmentTracks & alignment);
117 AliAlignmentTracks& operator= (const AliAlignmentTracks& alignment);
118
91264393 119 ClassDef(AliAlignmentTracks,2)
98937d93 120
121};
122
123#endif