]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPCcalibTracksGain.h
Adding histogram
[u/mrichter/AliRoot.git] / TPC / AliTPCcalibTracksGain.h
CommitLineData
10757ee9 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 */
b8601924 6
10757ee9 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
b8601924 19#include <AliTPCcalibBase.h>
20
10757ee9 21using namespace std;
22
23class TTreeSRedirector;
c6f3749a 24class TObjString;
10757ee9 25class TLinearFitter;
c6f3749a 26class TProfile;
27class TProfile2D;
28class TH1F;
10757ee9 29
30class AliTPCClusterParam;
31class AliTPCParamSR;
32class AliTPCCalROC;
33class AliTPCCalPad;
34class AliTPCseed;
35class AliTPCclusterMI;
36class AliTrackPointArray;
37class TTreeStream;
38class AliTPCcalibTracksCuts;
39class AliTPCFitPad;
8076baa0 40class TGraph;
41class AliTPCCClusterParam;
10757ee9 42
b8601924 43class AliTPCcalibTracksGain : public AliTPCcalibBase {
10757ee9 44public:
45 enum {
46 kShortPads = 0,
47 kMediumPads = 1,
48 kLongPads = 2
49 };
50 enum {
51 kSimpleFitter = 0,
52 kSqrtFitter = 1,
53 kLogFitter = 2
54 };
55
c6f3749a 56 AliTPCcalibTracksGain();
57 AliTPCcalibTracksGain(const AliTPCcalibTracksGain& obj);
58 AliTPCcalibTracksGain(const char* name, const char* title, AliTPCcalibTracksCuts* cuts, TNamed* debugStreamPrefix = 0, AliTPCcalibTracksGain* prevIter = 0);
59 virtual ~AliTPCcalibTracksGain();
60 AliTPCcalibTracksGain& operator=(const AliTPCcalibTracksGain& rhs);
b8601924 61 virtual Long64_t Merge(TCollection *list);
62 virtual void Process(AliTPCseed* seed);
63 virtual void Terminate();
64 virtual void Analyze();
2acad464 65 void SetGainMap(AliTPCCalPad *GainMap){fGainMap = GainMap;};
c6f3749a 66 //
2acad464 67 // Tracks and cluster manipulation
c6f3749a 68 //
2acad464 69 Float_t GetMaxNorm(AliTPCclusterMI * cl);
70 Float_t GetQNorm(AliTPCclusterMI * cl);
71 Float_t GetGain(AliTPCclusterMI* cl);
c6f3749a 72 void AddTrack(AliTPCseed* seed);
c6f3749a 73 void DumpTrack(AliTPCseed* track);
74 Bool_t GetDedx(AliTPCseed* track, Int_t padType, Int_t*rows,
75 Int_t &sector, Int_t& npoints,
76 TVectorD &dedxM, TVectorD &dedxQ,
77 TVectorD &parY, TVectorD &parZ, TVectorD & meanPos);
78 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);
79 void AddTracklet(UInt_t sector, UInt_t padType,TVectorD &dedxQ, TVectorD &dedxM,TVectorD& parY, TVectorD& parZ, TVectorD& meanPos);
10757ee9 80
c6f3749a 81 void AddCluster(AliTPCclusterMI* cluster);
c6f3749a 82 void Add(AliTPCcalibTracksGain* cal);
da7d274e 83
84 //
85 // Debug stream analyze part
86 //
87 static TVectorD * MakeQPosNorm(TTree * chain, Int_t ipad, Bool_t isMax, Int_t maxPoints=1000000, Int_t verbose=0);
88
89 static void MakeQPosNormAll(TTree * chain, AliTPCClusterParam * param, Int_t maxPoints=1000000, Int_t verbose=0);
90
c6f3749a 91 //
92 // Histogram part
93 //
94 TH1F * GetQM(Int_t sector=-1){return (TH1F*)(sector<0 ? fArrayQM->At(72): fArrayQM->At(sector));}
95 TH1F * GetQT(Int_t sector=-1){return (TH1F*)(sector<0 ? fArrayQT->At(72): fArrayQT->At(sector));}
96 TProfile* GetProfileQM(Int_t sector){return (TProfile*)(sector<0 ? fProfileArrayQM->At(36): fProfileArrayQM->At(sector));}
97 TProfile* GetProfileQT(Int_t sector){return (TProfile*)(sector<0 ? fProfileArrayQT->At(36): fProfileArrayQT->At(sector));}
98 TProfile2D* GetProfileQM2D(Int_t sector){return (TProfile2D*)(sector<0 ? fProfileArrayQM2D->At(36): fProfileArrayQM2D->At(sector));}
99 TProfile2D* GetProfileQT2D(Int_t sector){return (TProfile2D*)(sector<0 ? fProfileArrayQT2D->At(36): fProfileArrayQT2D->At(sector));}
100 //
101 // Get Derived results - gain maps
102 //
103 AliTPCCalPad* CreateFitCalPad(UInt_t fitType, Bool_t undoTransformation = kFALSE, Bool_t normalizeToPadSize = kFALSE);
104 AliTPCCalROC* CreateFitCalROC(UInt_t sector, UInt_t fitType, Bool_t undoTransformation = kFALSE, Bool_t normalizeToPadSize = kFALSE);
105 AliTPCCalROC* CreateFitCalROC(UInt_t sector, UInt_t padType, TVectorD &fitParam, UInt_t fitType, Bool_t undoTransformation = kFALSE, Bool_t normalizeToPadSize = kFALSE);
106 AliTPCCalROC* CreateCombinedCalROC(const AliTPCCalROC* roc1, const AliTPCCalROC* roc2);
107 //
108 void Evaluate(Bool_t robust = kFALSE, Double_t frac = -1.);
684602c8 109 Bool_t GetParameters(UInt_t segment, UInt_t padType, UInt_t fitType, TVectorD &fitParam);
c6f3749a 110 void GetErrors(UInt_t segment, UInt_t padType, UInt_t fitType, TVectorD &fitError);
111 Double_t GetRedChi2(UInt_t segment, UInt_t padType, UInt_t fitType);
112 void GetCovarianceMatrix(UInt_t segment, UInt_t padType, UInt_t fitType, TMatrixD& covMatrix);
8076baa0 113 //
114 //
115 void UpdateClusterParam(AliTPCClusterParam *param);
116 TGraph * CreateAmpGraph(Int_t ipad, Bool_t qmax);
117
118
c6f3749a 119 TLinearFitter* GetFitter(UInt_t segment, UInt_t padType, UInt_t fitType);
b8601924 120
121
c6f3749a 122public:
123 //
124 // Helper function
125 //
126 static Double_t GetPadLength(Double_t lx);
127 static Int_t GetPadType(Double_t lx);
128 static Bool_t GetRowPad(Double_t lx, Double_t ly, Int_t& row, Int_t& pad); // just for debugging
129 //
130 //
c6f3749a 131 AliTPCcalibTracksCuts* fCuts; // cuts that are used for sieving the tracks used for calibration
2acad464 132 AliTPCCalPad *fGainMap; // gain map to be applied
133 //
c6f3749a 134 //
135 // Simple Profiles and histograms - per chambers + 1 total
136 //
137 TObjArray* fArrayQM; // Qmax normalized
138 TObjArray* fArrayQT; // Qtot normalized
139 TObjArray* fProfileArrayQM; // Qmax normalized versus local X
140 TObjArray* fProfileArrayQT; // Qtot normalized versus local X
141 TObjArray* fProfileArrayQM2D; // Qmax normalized versus local X and phi
142 TObjArray* fProfileArrayQT2D; // Qtot normalized versus local X and phi
143 //
144 // Fitters
145 //
146 AliTPCFitPad* fSimpleFitter; // simple fitter for short pads
147 AliTPCFitPad* fSqrtFitter; // sqrt fitter for medium pads
148 AliTPCFitPad* fLogFitter; // log fitter for long pads
684602c8 149 //
c6f3749a 150 TLinearFitter* fFitter0M; // fitting of the atenuation, angular correction, and mean chamber gain
151 TLinearFitter* fFitter1M; // fitting of the atenuation, angular correction, and mean chamber gain
152 TLinearFitter* fFitter2M; // fitting of the atenuation, angular correction, and mean chamber gain
153 TLinearFitter* fFitter0T; // fitting of the atenuation, angular correction, and mean chamber gain
154 TLinearFitter* fFitter1T; // fitting of the atenuation, angular correction, and mean chamber gain
155 TLinearFitter* fFitter2T; // fitting of the atenuation, angular correction, and mean chamber gain
684602c8 156 //
157 // angular adn diffusion effect fitter
158 //
159 TLinearFitter* fDFitter0M; // fitting of the atenuation, angular correction
160 TLinearFitter* fDFitter1M; // fitting of the atenuation, angular correction
161 TLinearFitter* fDFitter2M; // fitting of the atenuation, angular correction
162 TLinearFitter* fDFitter0T; // fitting of the atenuation, angular correction
163 TLinearFitter* fDFitter1T; // fitting of the atenuation, angular correction
164 TLinearFitter* fDFitter2T; // fitting of the atenuation, angular correction
165 //
c6f3749a 166 AliTPCFitPad* fSingleSectorFitter; // just for debugging
167 //
168 // Conters
169 //
170 UInt_t fTotalTracks; // just for debugging
171 UInt_t fAcceptedTracks; // just for debugging
172 AliTPCCalPad* fDebugCalPadRaw; // just for debugging
173 AliTPCCalPad* fDebugCalPadCorr; // just for debugging
174 UInt_t fNShortClusters[36]; // number of clusters registered on short pads
175 UInt_t fNMediumClusters[36]; // number of clusters registered on medium pads
176 UInt_t fNLongClusters[36]; // number of clusters registered on long pads
177 //
178 //
c6f3749a 179 //
180 // Setup
181 //
10757ee9 182 static AliTPCParamSR* fgTPCparam; //! helper object for geometry related operations
183 static const Double_t fgkM; // value used in the transformation of the charge values for the logarithmic fitter
184 static const char* fgkDebugStreamFileName; // filename of the debug stream file
185 static const Bool_t fgkUseTotalCharge; // whether to use the cluster's total or maximum charge
186
187 ClassDef(AliTPCcalibTracksGain, 1);
188};
189
190#endif