]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCcalibTracksGain.h
Remove warning in TMap GetValue (Marian)
[u/mrichter/AliRoot.git] / TPC / AliTPCcalibTracksGain.h
1 #ifndef AliTPCCALIBTRACKSGAIN_H
2 #define AliTPCCALIBTRACKSGAIN_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 #include <TChain.h>
8 #include <TNamed.h>
9
10
11 #include <TObjArray.h>
12 #include <TH2D.h>
13 #include <TVectorD.h>
14 #include <TMatrixD.h>
15
16 #include <iostream>
17 #include <TH1F.h>
18
19 using namespace std;
20
21 class TTreeSRedirector;
22 class TObjString;
23 class TLinearFitter;
24 class TProfile; 
25 class TProfile2D; 
26 class TH1F; 
27
28 class AliTPCClusterParam; 
29 class AliTPCParamSR; 
30 class AliTPCCalROC;
31 class AliTPCCalPad;
32 class AliTPCseed; 
33 class AliTPCclusterMI; 
34 class AliTrackPointArray;
35 class TTreeStream;
36 class AliTPCcalibTracksCuts;
37 class AliTPCFitPad;
38 class TGraph;
39 class AliTPCCClusterParam;
40
41 class AliTPCcalibTracksGain : public TNamed {
42 public:
43    enum {
44       kShortPads = 0,
45       kMediumPads = 1,
46       kLongPads = 2
47    };
48    enum {
49       kSimpleFitter = 0,
50       kSqrtFitter = 1,
51       kLogFitter = 2
52    };
53    
54   AliTPCcalibTracksGain();
55   AliTPCcalibTracksGain(const AliTPCcalibTracksGain& obj);
56   AliTPCcalibTracksGain(const char* name, const char* title, AliTPCcalibTracksCuts* cuts, TNamed* debugStreamPrefix = 0, AliTPCcalibTracksGain* prevIter = 0);
57   virtual ~AliTPCcalibTracksGain();
58   AliTPCcalibTracksGain& operator=(const AliTPCcalibTracksGain& rhs);
59   static void     AddInfo(TChain* chain, char* debugStreamPrefix = 0, char* prevIterFileName = 0);
60   void            Terminate();
61   //
62   // Tracks manipulation
63   //
64   void            Process(AliTPCseed* seed);
65   void            AddTrack(AliTPCseed* seed);
66   Bool_t          AcceptTrack(AliTPCseed* track);
67   void            DumpTrack(AliTPCseed* track);
68   Bool_t          GetDedx(AliTPCseed* track, Int_t padType,  Int_t*rows,
69                           Int_t &sector, Int_t& npoints, 
70                           TVectorD &dedxM, TVectorD &dedxQ, 
71                           TVectorD &parY, TVectorD &parZ, TVectorD & meanPos);
72   void            AddCluster(AliTPCclusterMI* cluster, Float_t momenta, Float_t mdedx, Int_t padType, Float_t xcenter, TVectorD &dedxQ, TVectorD & dedxM, Float_t fraction, Float_t fraction2, Float_t dedge, TVectorD& parY, TVectorD& parZ, TVectorD& meanPos);
73   void            AddTracklet(UInt_t sector, UInt_t padType,TVectorD &dedxQ, TVectorD &dedxM,TVectorD& parY, TVectorD& parZ, TVectorD& meanPos);
74
75   void            AddCluster(AliTPCclusterMI* cluster);
76
77   //
78   // Merging of the component
79   //
80   Long64_t        Merge(TCollection *list);
81   void            Add(AliTPCcalibTracksGain* cal);
82   //
83   // Histogram part
84   //
85   TH1F  * GetQM(Int_t sector=-1){return (TH1F*)(sector<0 ?  fArrayQM->At(72): fArrayQM->At(sector));}
86   TH1F  * GetQT(Int_t sector=-1){return (TH1F*)(sector<0 ?  fArrayQT->At(72): fArrayQT->At(sector));}
87   TProfile* GetProfileQM(Int_t sector){return (TProfile*)(sector<0 ? fProfileArrayQM->At(36): fProfileArrayQM->At(sector));}
88   TProfile* GetProfileQT(Int_t sector){return (TProfile*)(sector<0 ? fProfileArrayQT->At(36): fProfileArrayQT->At(sector));}
89   TProfile2D* GetProfileQM2D(Int_t sector){return (TProfile2D*)(sector<0 ? fProfileArrayQM2D->At(36): fProfileArrayQM2D->At(sector));}
90   TProfile2D* GetProfileQT2D(Int_t sector){return (TProfile2D*)(sector<0 ? fProfileArrayQT2D->At(36): fProfileArrayQT2D->At(sector));}
91   //
92   // Get Derived results - gain maps
93   //
94   AliTPCCalPad*   CreateFitCalPad(UInt_t fitType, Bool_t undoTransformation = kFALSE, Bool_t normalizeToPadSize = kFALSE);
95   AliTPCCalROC*   CreateFitCalROC(UInt_t sector, UInt_t fitType, Bool_t undoTransformation = kFALSE, Bool_t normalizeToPadSize = kFALSE);
96   AliTPCCalROC*   CreateFitCalROC(UInt_t sector, UInt_t padType, TVectorD &fitParam, UInt_t fitType, Bool_t undoTransformation = kFALSE, Bool_t normalizeToPadSize = kFALSE);
97   AliTPCCalROC*   CreateCombinedCalROC(const AliTPCCalROC* roc1, const AliTPCCalROC* roc2);
98   //
99   void            Evaluate(Bool_t robust = kFALSE, Double_t frac = -1.);
100   void            GetParameters(UInt_t segment, UInt_t padType, UInt_t fitType, TVectorD &fitParam);
101   void            GetErrors(UInt_t segment, UInt_t padType, UInt_t fitType, TVectorD &fitError);
102   Double_t        GetRedChi2(UInt_t segment, UInt_t padType, UInt_t fitType);
103   void            GetCovarianceMatrix(UInt_t segment, UInt_t padType, UInt_t fitType, TMatrixD& covMatrix);
104   //
105   //
106   void            UpdateClusterParam(AliTPCClusterParam *param);
107   TGraph *        CreateAmpGraph(Int_t ipad, Bool_t qmax);
108
109
110   TLinearFitter*  GetFitter(UInt_t segment, UInt_t padType, UInt_t fitType);
111 public:
112   //
113   // Helper function
114   //
115   static Double_t GetPadLength(Double_t lx);
116   static Int_t    GetPadType(Double_t lx);  
117   static Bool_t   GetRowPad(Double_t lx, Double_t ly, Int_t& row, Int_t& pad); // just for debugging
118   //
119   //
120   TTreeSRedirector* fDebugStream;          //! debug stream for debugging
121   AliTPCcalibTracksCuts* fCuts;            // cuts that are used for sieving the tracks used for calibration
122   //
123   // Simple Profiles and histograms - per chambers + 1 total
124   //
125   TObjArray*        fArrayQM;                // Qmax normalized
126   TObjArray*        fArrayQT;                // Qtot normalized 
127   TObjArray*        fProfileArrayQM;         // Qmax normalized  versus local X
128   TObjArray*        fProfileArrayQT;         // Qtot normalized  versus local X 
129   TObjArray*        fProfileArrayQM2D;       // Qmax normalized  versus local X and phi
130   TObjArray*        fProfileArrayQT2D;       // Qtot normalized  versus local X and phi
131   //
132   // Fitters
133   //
134   AliTPCFitPad*     fSimpleFitter;         // simple fitter for short pads
135   AliTPCFitPad*     fSqrtFitter;           // sqrt fitter for medium pads
136   AliTPCFitPad*     fLogFitter;            // log fitter for long pads
137   TLinearFitter*    fFitter0M;          // fitting of the atenuation, angular correction, and mean chamber gain
138   TLinearFitter*    fFitter1M;          // fitting of the atenuation, angular correction, and mean chamber gain
139   TLinearFitter*    fFitter2M;          // fitting of the atenuation, angular correction, and mean chamber gain
140   TLinearFitter*    fFitter0T;          // fitting of the atenuation, angular correction, and mean chamber gain
141   TLinearFitter*    fFitter1T;          // fitting of the atenuation, angular correction, and mean chamber gain
142   TLinearFitter*    fFitter2T;          // fitting of the atenuation, angular correction, and mean chamber gain
143   AliTPCFitPad*     fSingleSectorFitter;   // just for debugging
144   //
145   // Conters
146   //
147   UInt_t          fTotalTracks;         // just for debugging
148   UInt_t          fAcceptedTracks;      // just for debugging
149   AliTPCCalPad*   fDebugCalPadRaw;      // just for debugging
150   AliTPCCalPad*   fDebugCalPadCorr;     // just for debugging
151   UInt_t          fNShortClusters[36];   // number of clusters registered on short pads
152   UInt_t          fNMediumClusters[36];  // number of clusters registered on medium pads
153   UInt_t          fNLongClusters[36];    // number of clusters registered on long pads
154   //
155   //
156   AliTPCcalibTracksGain* fPrevIter;        // the calibration object in its previous iteration (will not be owned by the new object, don't forget to delete it!)    
157   //
158   // Setup
159   //
160    static       AliTPCParamSR* fgTPCparam;              //! helper object for geometry related operations
161    static const Double_t       fgkM;                    // value used in the transformation of the charge values for the logarithmic fitter
162    static const char*          fgkDebugStreamFileName;  // filename of the debug stream file
163    static const Bool_t         fgkUseTotalCharge;       // whether to use the cluster's total or maximum charge
164
165    ClassDef(AliTPCcalibTracksGain, 1);
166 };
167
168 #endif