1 #ifndef AliTPCCALIBTRACKSGAIN_H
2 #define AliTPCCALIBTRACKSGAIN_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
11 #include <TObjArray.h>
21 class TTreeSRedirector;
28 class AliTPCClusterParam;
33 class AliTPCclusterMI;
34 class AliTrackPointArray;
36 class AliTPCcalibTracksCuts;
39 class AliTPCCClusterParam;
41 class AliTPCcalibTracksGain : public TNamed {
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);
62 // Tracks manipulation
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 §or, 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);
75 void AddCluster(AliTPCclusterMI* cluster);
78 // Merging of the component
80 Long64_t Merge(TCollection *list);
81 void Add(AliTPCcalibTracksGain* cal);
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));}
92 // Get Derived results - gain maps
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);
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);
106 void UpdateClusterParam(AliTPCClusterParam *param);
107 TGraph * CreateAmpGraph(Int_t ipad, Bool_t qmax);
110 TLinearFitter* GetFitter(UInt_t segment, UInt_t padType, UInt_t fitType);
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
120 TTreeSRedirector* fDebugStream; //! debug stream for debugging
121 AliTPCcalibTracksCuts* fCuts; // cuts that are used for sieving the tracks used for calibration
123 // Simple Profiles and histograms - per chambers + 1 total
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
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
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
156 AliTPCcalibTracksGain* fPrevIter; // the calibration object in its previous iteration (will not be owned by the new object, don't forget to delete it!)
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
165 ClassDef(AliTPCcalibTracksGain, 1);