]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSResidualsAnalysis.h
Coding violations corrected.
[u/mrichter/AliRoot.git] / ITS / AliITSResidualsAnalysis.h
1 #ifndef ALIITSRESIDUALSANALYSIS_H
2 #define ALIITSRESIDUALSANALYSIS_H
3
4 /* Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7
8 //*************************************************************************
9 // AliITSResidualAnalysis: class which deals with the analysis of the     *
10 // tracks residuals in the ITS                                            *
11 // More comments will come with the development of the interfaces and     *
12 // functionalities of the class.                                          *
13 //*************************************************************************
14
15 #include "AliAlignmentTracks.h"
16
17 class TObject;
18 class TCanvas;
19 class TH1F;
20 class TH2F;
21 class TArrayI;
22
23 class AliTrackPointArray;
24 class AliTrackResiduals;
25 class AliAlignObj;
26
27 class AliITSResidualsAnalysis : public AliAlignmentTracks {
28   
29
30  public:
31     
32   AliITSResidualsAnalysis();  
33   AliITSResidualsAnalysis(const TString aliTrackPoints,const TString geom);
34   AliITSResidualsAnalysis(const TArrayI *volIDs);
35   ~AliITSResidualsAnalysis();
36
37
38
39   void ListVolUsed(TTree *pointsTree,TArrayI ***arrayIndex,Int_t **lastIndex);
40   void ListVolUsed(){if(!fIsIndexBuilt)return;ListVolUsed(fPointsTree,fArrayIndex,fLastIndex);};
41
42   void  InitHistograms(const TArrayI *volIDs);
43   void FillResidualsH(AliTrackPointArray *trackClust,AliTrackPointArray *trackFitPoints) const;
44   void  DrawHists() const;
45   Bool_t SaveHists(Int_t minNpoints=10,TString outname="ResidualsAnalysisTree.root") const;
46
47   void FillVolumeCorrelationHists(Int_t ivol,Int_t volIDalignable,Int_t volIDpoint,Bool_t used) const;
48   Bool_t SetBinning(const TArrayI *volids,Float_t *phiBin,Float_t *zBin);
49   Float_t** CheckSingleLayer(const TArrayI *volids);
50   TArrayI* GetITSLayersVolids(Int_t layers[6]) const;
51   TArrayI* GetSPDSectorsVolids(Int_t sectors[10]) const;
52   Int_t WhichSector(Int_t module) const;
53   Int_t GetBinPhiZ(const Int_t volID,Int_t *binz) const;
54   void GetTrackDirClusterCov(AliTrackPoint *point,Double_t &phi,Double_t &lambda,Double_t &lambda2,Double_t &alpha,Double_t &xovery,Double_t &zovery) const;
55   void CalculateResiduals(const TArrayI *volids,const TArrayI *volidsfit,AliGeomManager::ELayerID layerRangeMin,AliGeomManager::ELayerID layerRangeMax,TString outname="ResidualsAnalysisTree.root");
56   void ProcessVolumes(Int_t fit=0,TArrayI *volIDs=0,TArrayI *volIDsFit=0,TString misalignmentFile="",TString outname="ResidualsAnalysisTree.root",Int_t minPoints=2);
57   TString GetFileNameTrackPoints() const { return fAliTrackPoints; };
58   TString GetFileNameGeometry() const { return fGeom; };
59   void SetFileNameTrackPoints(TString name) { fAliTrackPoints=name; };
60   void SetFileNameGeometry(TString name) { fGeom=name; };
61   void SetUseGausFit(Bool_t opt=kTRUE) {fUseGausFit=opt;}
62
63   enum ModulePhiZ{
64     kPhiSPD1=20,
65     kZSPD1=4,
66     kPhiSPD2=40,
67     kZSPD2=4,
68     kPhiSDD1=14,
69     kZSDD1=6,
70     kPhiSDD2=22,
71     kZSDD2=8,
72     kPhiSSD1=34,
73     kZSSD1=22,
74     kPhiSSD2=38,
75     kZSSD2=25
76   };
77
78  protected:
79     
80   Int_t fnHist;    // number of histogram = number of alignable volumes considered
81   Int_t fnPhi;     // coordinate of the volume (Phi)
82   Int_t fnZ;       // coordinate of the volume (Z)
83   Int_t **fvolidsToBin;         // array with volID and bin
84   Int_t *fLastVolVolid;         // Last Vol Volid
85   Double_t ***fCoordToBinTable; // array with coordinate and bin
86   TH1F **fVolResHistRPHI;       //  Histogram of Residuals along Global rphi 
87   TH1F **fResHistZ;             //  Histogram of Residuals along Global Z 
88   TH1F **fResHistX;             //  Histogram of Residuals along Global X 
89   TH1F **fResHistXLocsddL;      //  Histogram of Residuals along Local X
90                                 //  SDD left side of module
91   TH1F **fResHistXLocsddR;      //  Histogram of Residuals along Local X 
92                                 //  SDD right side of module 
93   TH1F **fHistCoordGlobY;       //  Histogram of the Y coordinate in Global Reference
94   TH1F **fPullHistRPHI;         //  Misc Histogram ...
95   TH1F **fPullHistZ;            //  Misc Histogram ...
96   TH1F **fTrackDirPhi;          //  Misc Histogram ...
97   TH1F **fTrackDirLambda;       //  Misc Histogram ...
98   TH1F **fTrackDirLambda2;      //  Misc Histogram ...
99   TH1F **fTrackDirAlpha;        //  Misc Histogram ...
100   TH1F *fTrackDirPhiAll;        //  Misc Histogram ...
101   TH1F *fTrackDirLambdaAll;     //  Misc Histogram ...
102   TH1F *fTrackDirLambda2All;    //  Misc Histogram ...
103   TH1F *fTrackDirAlphaAll;      //  Misc Histogram ...
104   TH2F **fTrackDir;             //  Misc Histogram ...
105   TH2F *fTrackDirAll;           //  Misc Histogram ...
106   TH2F *fTrackDir2All;          //  Misc Histogram ...
107   TH2F *fTrackDirXZAll;         //  Misc Histogram ...
108   TH1F **fResHistGlob;          //  Histogram of Residuals
109   TH2F **fhistCorrVol;          //  Misc Histogram ...
110   TH2F *fVolNTracks;       // Histogram to see how many tracks pass through a given module 
111   TH2F *fhEmpty;           // Histogram to get/set the binning
112   TH2F *fhistVolNptsUsed;  // Histogram with the numer of points used per volume
113   TH2F *fhistVolUsed;      // Histogram with the numer of volumes udes
114   TH2F *fSigmaVolZ;        // Histogram with the sigma vs volume Z
115   Bool_t fsingleLayer;     // Tag for single layer
116   Bool_t fWriteHist;       // Tag for histograms
117   TArrayI *fpTrackVolIDs;  // array that gives the volID for the i^(th) entry 
118   TArrayI **fVolVolids;    // array with the volumes to analyze
119   TArrayI **fVolUsed;      // array with the volumes to use
120   Bool_t fRealignObjFileIsOpen; // indicator- if the file fRealignObjFilename is opened
121   TClonesArray *fClonesArray;   // pointer to the TClonesArray with the final AliAlignObjParams
122   TString fAliTrackPoints;      // Filename with the AliTrackPoints
123   TString fGeom;                // Filename with the Geometry
124   Bool_t  fUseGausFit;          // Fit residual histos with gaussians
125
126 private:
127   AliITSResidualsAnalysis(const AliITSResidualsAnalysis&); // Not implemented
128   AliITSResidualsAnalysis& operator=(const AliITSResidualsAnalysis&); // Not implemented
129
130
131   ClassDef(AliITSResidualsAnalysis,3) // Residuals analysis for the ITS
132     
133     };
134     
135 #endif
136