]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG1/TRD/AliTRDresolution.h
event mixing as parameter
[u/mrichter/AliRoot.git] / PWG1 / TRD / AliTRDresolution.h
CommitLineData
1ee39b3a 1#ifndef ALITRDRESOLUTION_H
2#define ALITRDRESOLUTION_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id: AliTRDresolution.h 27496 2008-07-22 08:35:45Z cblume $ */
7
8////////////////////////////////////////////////////////////////////////////
9// //
10// TRD Resolution performance //
11// //
12// Authors: //
13// Alexandru Bercuci <A.Bercuci@gsi.de> //
14// Markus Fasel <M.Fasel@gsi.de> //
15// //
16////////////////////////////////////////////////////////////////////////////
17
18#ifndef ALITRDRECOTASK_H
19#include "AliTRDrecoTask.h"
20#endif
21
3ed01fbe 22class TAxis;
1ee39b3a 23class TH1;
24class TH2;
3ed01fbe 25class TH3;
1ee39b3a 26class TF1;
27class TGraphErrors;
28class TObjArray;
92c40e64 29class TDatabasePDG;
1ee39b3a 30class AliTRDrecoParam;
31class AliTRDseedV1;
32class AliTRDtrackInfo;
08bdd9d1 33class AliTrackPoint;
1ee39b3a 34class AliTRDresolution : public AliTRDrecoTask
35{
36public:
1ee39b3a 37 enum ETRDresolutionSteer {
08bdd9d1 38 kVerbose = BIT(18) // switch verbosity
39 ,kVisual = BIT(19) // show partial results during processing
40 ,kTrackRefit = BIT(20) // steer track refit
00a56108 41 ,kTrackSelect= BIT(21) // steer track selection
3ed01fbe 42 ,kXchange = BIT(22) // use exchange containers
1ee39b3a 43 };
3ceb45ae 44 enum ETRDresolutionSlots {
705f8b0a 45 kClToTrk = 2
3ceb45ae 46 ,kClToMC
47 ,kTrkltToTrk
48 ,kTrkltToMC
49 ,kNSlots = 4
50 };
51 enum ETRDresolutionClass {
52 kCluster=0 // cluster - track
53 ,kTracklet // tracklet - track residuals/pulls
54 ,kTrackIn // tracklet - track residuals/pulls at lower TRD entrance
55 ,kTrackOut // tracklet - track residuals/pulls at lower TRD entrance during refit
56 ,kMCcluster // cluster-mc resolution/pulls
57 ,kMCtracklet // tracklet-mc resolution/pulls
58 ,kMCtrackIn // TPC track monitor
59 ,kMCtrackOut // TOF/HMPID track monitor
60 ,kMCtrack // TRD track monitor
61 ,kNclasses // total number of resolution classes
62 };
63 enum ETRDresolutionProjs {
64 kBC = 0 // bunch cross
65 ,kPhi
66 ,kEta
3ceb45ae 67 ,kYrez
3ceb45ae 68 ,kPrez
3ed01fbe 69 ,kZrez
70 ,kSpeciesChgRC
71 ,kPt
3ceb45ae 72 ,kNdim // no of dimensions in the THnSparse
705f8b0a 73 };
9dcc64cc 74 enum ETRDresolutionSegmentation {
75 kSector = 0
76 ,kStack
77 ,kDetector
3ceb45ae 78 ,kNbunchCross = 3 // no of classes for bunch crossing
3ed01fbe 79 ,kNpt = 20 // no of log bins in pt spectrum
3ceb45ae 80 ,kNcharge = 2
9dcc64cc 81 };
1ee39b3a 82
83 AliTRDresolution();
3ed01fbe 84 AliTRDresolution(char* name, Bool_t xchange=kTRUE);
1ee39b3a 85 virtual ~AliTRDresolution();
86
3ed01fbe 87 static Bool_t FitTrack(const Int_t np, AliTrackPoint *points, Float_t params[10]);
88 static Bool_t FitTracklet(const Int_t ly, const Int_t np, const AliTrackPoint *points, const Float_t trackPars[10], Float_t trackletPars[3]);
89 void UserCreateOutputObjects();
3ceb45ae 90// Float_t GetCorrectionX(Int_t det, Int_t tb) const {return fXcorr[det][tb];}
3ed01fbe 91 Float_t GetDyRange() const {return fDyRange;}
92 static Float_t GetMeanStat(TH1 *h, Float_t cut=0., Option_t *opt="");
93 Float_t GetPtThreshold() const {return fPtThreshold;}
94 static Int_t GetPtBin(Float_t pt);
95 Bool_t GetRefFigure(Int_t ifig);
3ceb45ae 96
1ee39b3a 97 TObjArray* Histos();
3ceb45ae 98// Bool_t Load(const Char_t *file = "AnalysisResults.root", const Char_t *dir="TRD_Performance");
99// Bool_t LoadCorrection(const Char_t *file=NULL);
3ed01fbe 100 void MakeSummary();
101 static void MakePtSegmentation(Float_t pt0=0.5, Float_t dpt=0.002);
2589cf64 102
3ed01fbe 103 TObjArray* Results(ETRDresolutionClass c) const {if(!fProj) return NULL; return (TObjArray*)fProj->At(c);}
104 void UserExec(Option_t * opt);
105 void InitExchangeContainers();
3ceb45ae 106// Bool_t HasLoadCorrection() const {return TestBit(kLoadCorr);}
3ed01fbe 107 Bool_t HasTrackRefit() const {return TestBit(kTrackRefit);}
108 Bool_t HasTrackSelection() const {return TestBit(kTrackSelect);}
109 Bool_t IsVerbose() const {return TestBit(kVerbose);}
110 Bool_t IsVisual() const {return TestBit(kVisual);}
111 Bool_t UseExchangeContainers() const {return TestBit(kXchange);}
112 Bool_t PostProcess();
113
114 TH1* PlotCluster(const AliTRDtrackV1 *t=NULL);
115 TH1* PlotTracklet(const AliTRDtrackV1 *t=NULL);
116 TH1* PlotTrackIn(const AliTRDtrackV1 *t=NULL);
117 TH1* PlotTrackOut(const AliTRDtrackV1 *t=NULL);
118 TH1* PlotMC(const AliTRDtrackV1 *t=NULL);
119
120 static Bool_t Process(TH2* const h2, TGraphErrors **g, Int_t stat=100);
121 void SetDyRange(Float_t dy) {fDyRange = dy;}
3ceb45ae 122// void SetSegmentationLevel(Int_t l=0);
3ed01fbe 123 void SetPtThreshold(Float_t pt) {fPtThreshold = pt;}
3ceb45ae 124// void SetLoadCorrection(Bool_t v = kTRUE) {SetBit(kLoadCorr, v);}
3ed01fbe 125 void SetVerbose(Bool_t v = kTRUE) {SetBit(kVerbose, v);}
126 void SetVisual(Bool_t v = kTRUE) {SetBit(kVisual, v);}
127 void SetTrackRefit(Bool_t v = kTRUE) {SetBit(kTrackRefit, v);}
128 void SetTrackSelection(Bool_t v = kTRUE) {SetBit(kTrackSelect, v);}
129 void SetUseExchangeContainers(Bool_t v = kTRUE) {SetBit(kXchange, v);}
1ee39b3a 130
3ed01fbe 131 void Terminate(Option_t * opt);
132 static Bool_t UseTrack(const Int_t np, const AliTrackPoint *points, Float_t params[10]);
3ceb45ae 133
1ee39b3a 134private:
3ed01fbe 135 class AliTRDresolutionProjection{
136 friend class AliTRDresolution; // Friend class
137 public:
138 AliTRDresolutionProjection();
139 virtual ~AliTRDresolutionProjection();
140 void Build(const Char_t *n, const Char_t *t, Int_t ix, Int_t iy, Int_t iz, TAxis *aa[]);
141 void Increment(Int_t bin[], Double_t v);
142 TH2* Projection2D(const Int_t nstat, const Int_t ncol, const Int_t mid=0);
143 void SetRebinStrategy(Int_t n, Int_t rebx[], Int_t reby[]);
0b30040d 144 void SetShowRange(Float_t zm, Float_t zM, Float_t em=0., Float_t eM=0.) {fRange[0] = zm; fRange[1] = zM; fRange[2] = em; fRange[3] = eM;}
3ed01fbe 145 private:
146 AliTRDresolutionProjection(const AliTRDresolutionProjection&);
147 AliTRDresolutionProjection& operator=(const AliTRDresolutionProjection&);
148 protected:
149 TH3 *fH; // data container
150 Int_t fAx[3]; // projection axes
151 Int_t fNrebin; // no. of rebinning steps
152 Int_t *fRebinX; //[fNrebin] rebinning of the X axis
153 Int_t *fRebinY; //[fNrebin] rebinning of the Y axis
0b30040d 154 Float_t fRange[4]; //show range of the z processed
3ed01fbe 155 ClassDef(AliTRDresolutionProjection, 1) // wrapper for a projection container THnSparse -> TH3
156 };
157
1ee39b3a 158 AliTRDresolution(const AliTRDresolution&);
159 AliTRDresolution& operator=(const AliTRDresolution&);
afca20ef 160
3ed01fbe 161 void AdjustF1(TH1 *h, TF1 *f);
9dcc64cc 162 TObjArray* BuildMonitorContainerCluster(const char* name, Bool_t expand=kFALSE, Float_t range=-1.);
2589cf64 163 TObjArray* BuildMonitorContainerTracklet(const char* name, Bool_t expand=kFALSE);
3d2a3dff 164 TObjArray* BuildMonitorContainerTrack(const char* name);
0b30040d 165 void DrawSigma(TH2 *h2, Float_t scale=1, Float_t m=0., Float_t M=-1., const Char_t *t=NULL);
3ed01fbe 166 void GetLandauMpvFwhm(TF1 * const f, Float_t &mpv, Float_t &xm, Float_t &xM);
167 void GetRange(TH2 *h2, Char_t mod, Float_t *range);
168
169protected:
170 Bool_t MakeProjectionCluster();
171 Bool_t MakeProjectionTracklet();
172 Bool_t MakeProjectionTrackIn();
173 Bool_t Process(TH2* const h2, TF1 *f, Float_t k, TGraphErrors **g);
174 Bool_t Pulls(Double_t dyz[2], Double_t cc[3], Double_t tilt) const;
1ee39b3a 175
3ceb45ae 176 UShort_t fIdxPlot; // plot counter (internal)
177 UShort_t fIdxFrame; // frame counter (internal)
178 Float_t fPtThreshold; // pt threshold for some performance plots
179 Float_t fDyRange; // min/max dy
180 static Char_t const *fgPerformanceName[kNclasses]; //! name of performance plot
66e53ee9 181 static Int_t const fgkNproj[kNclasses];//! number of projections per task
3ceb45ae 182 static Int_t const fgkNbins[kNdim]; //! no of bins/projection
183 static Double_t const fgkMin[kNdim]; //! low limits for projections
184 static Double_t const fgkMax[kNdim]; //! high limits for projections
185 static Char_t const *fgkTitle[kNdim]; //! title of projection
186 static Float_t fgPtBin[kNpt+1]; //! pt segmentation
187 TObjArray *fProj; //! result holder - sigma values
188 TDatabasePDG *fDBPDG; //! PDG database
1ee39b3a 189
190 // calibration containers
3ed01fbe 191 TObjArray *fCl; //! cluster2track calib
192 TObjArray *fMCcl; //! cluster2mc calib
1ee39b3a 193
3ceb45ae 194 ClassDef(AliTRDresolution, 10) // TRD tracking resolution task
1ee39b3a 195};
196#endif