]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG1/TRD/AliTRDresolution.h
General macro for QA checks
[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
3ceb45ae 55 ,kMCcluster // cluster-mc resolution/pulls
56 ,kMCtracklet // tracklet-mc resolution/pulls
57 ,kMCtrackIn // TPC track monitor
3ceb45ae 58 ,kMCtrack // TRD track monitor
f429b017 59/* ,kTrackOut // tracklet - track residuals/pulls at lower TRD entrance during refit
60 ,kMCtrackOut // TOF/HMPID track monitor*/
3ceb45ae 61 ,kNclasses // total number of resolution classes
62 };
0b366e97 63 enum ETRDresolutionClassProjs {
64 kClNproj=48 // cluster projections
566c3d46 65 ,kTrkltNproj=258 // tracklet projections
66 ,kTrkInNproj=42 // trackIn projections
0b366e97 67 ,kTrkNproj=72 // track projections
566c3d46 68 ,kMCTrkInNproj=62 // trackIn projections
0b366e97 69 };
3ceb45ae 70 enum ETRDresolutionProjs {
71 kBC = 0 // bunch cross
72 ,kPhi
73 ,kEta
3ceb45ae 74 ,kYrez
3ceb45ae 75 ,kPrez
3ed01fbe 76 ,kZrez
77 ,kSpeciesChgRC
78 ,kPt
3ceb45ae 79 ,kNdim // no of dimensions in the THnSparse
705f8b0a 80 };
566c3d46 81 enum ETRDresolutionSize {
82 kNdimCl = 4
83 ,kNdimTrklt = 4
84 ,kNdimTrkIn = 7
3ceb45ae 85 ,kNbunchCross = 3 // no of classes for bunch crossing
35983729 86 ,kNpt = 3 // no of log bins in pt spectrum
3ceb45ae 87 ,kNcharge = 2
9dcc64cc 88 };
1ee39b3a 89
90 AliTRDresolution();
3ed01fbe 91 AliTRDresolution(char* name, Bool_t xchange=kTRUE);
1ee39b3a 92 virtual ~AliTRDresolution();
93
3ed01fbe 94 static Bool_t FitTrack(const Int_t np, AliTrackPoint *points, Float_t params[10]);
95 static Bool_t FitTracklet(const Int_t ly, const Int_t np, const AliTrackPoint *points, const Float_t trackPars[10], Float_t trackletPars[3]);
96 void UserCreateOutputObjects();
3ceb45ae 97// Float_t GetCorrectionX(Int_t det, Int_t tb) const {return fXcorr[det][tb];}
3ed01fbe 98 Float_t GetDyRange() const {return fDyRange;}
99 static Float_t GetMeanStat(TH1 *h, Float_t cut=0., Option_t *opt="");
100 Float_t GetPtThreshold() const {return fPtThreshold;}
101 static Int_t GetPtBin(Float_t pt);
102 Bool_t GetRefFigure(Int_t ifig);
3ceb45ae 103
566c3d46 104 virtual TObjArray* Histos();
3ceb45ae 105// Bool_t Load(const Char_t *file = "AnalysisResults.root", const Char_t *dir="TRD_Performance");
106// Bool_t LoadCorrection(const Char_t *file=NULL);
3ed01fbe 107 void MakeSummary();
108 static void MakePtSegmentation(Float_t pt0=0.5, Float_t dpt=0.002);
2589cf64 109
566c3d46 110 TObjArray* Results(ETRDresolutionClass c) const { if(!fProj) return NULL; return (TObjArray*)fProj->At(c);}
3ed01fbe 111 void UserExec(Option_t * opt);
112 void InitExchangeContainers();
566c3d46 113 Bool_t HasTrackRefit() const { return TestBit(kTrackRefit);}
114 Bool_t HasTrackSelection() const { return TestBit(kTrackSelect);}
115 Bool_t IsVerbose() const { return TestBit(kVerbose);}
116 Bool_t IsVisual() const { return TestBit(kVisual);}
117 Bool_t UseBCselectTOF() const { return fBCbinTOF>0;}
118 Bool_t UseBCselectFill() const { return fBCbinFill>0;}
119 Bool_t UseExchangeContainers() const { return TestBit(kXchange);}
3ed01fbe 120 Bool_t PostProcess();
121
122 TH1* PlotCluster(const AliTRDtrackV1 *t=NULL);
123 TH1* PlotTracklet(const AliTRDtrackV1 *t=NULL);
124 TH1* PlotTrackIn(const AliTRDtrackV1 *t=NULL);
f429b017 125// TH1* PlotTrackOut(const AliTRDtrackV1 *t=NULL);
3ed01fbe 126 TH1* PlotMC(const AliTRDtrackV1 *t=NULL);
127
128 static Bool_t Process(TH2* const h2, TGraphErrors **g, Int_t stat=100);
129 void SetDyRange(Float_t dy) {fDyRange = dy;}
3ceb45ae 130// void SetSegmentationLevel(Int_t l=0);
566c3d46 131 void SetPtThreshold(Float_t pt) { fPtThreshold = pt;}
132 void SetBCselectTOF(Int_t b=0) { fBCbinTOF = b==0?2:(b<0?1:3);}
133 void SetBCselectFill(Int_t b=0) { fBCbinFill = b<0||b>3499?1:b+1;}
134 void SetVerbose(Bool_t v = kTRUE) { SetBit(kVerbose, v);}
135 void SetVisual(Bool_t v = kTRUE) { SetBit(kVisual, v);}
136 void SetTrackRefit(Bool_t v = kTRUE) { SetBit(kTrackRefit, v);}
137 void SetTrackSelection(Bool_t v = kTRUE) { SetBit(kTrackSelect, v);}
138 void SetUseExchangeContainers(Bool_t v = kTRUE) { SetBit(kXchange, v);}
1ee39b3a 139
3ed01fbe 140 void Terminate(Option_t * opt);
141 static Bool_t UseTrack(const Int_t np, const AliTrackPoint *points, Float_t params[10]);
3ceb45ae 142
1ee39b3a 143private:
3ed01fbe 144 class AliTRDresolutionProjection{
145 friend class AliTRDresolution; // Friend class
146 public:
147 AliTRDresolutionProjection();
148 virtual ~AliTRDresolutionProjection();
35983729 149 AliTRDresolutionProjection& operator+=(const AliTRDresolutionProjection& other);
3ed01fbe 150 void Build(const Char_t *n, const Char_t *t, Int_t ix, Int_t iy, Int_t iz, TAxis *aa[]);
151 void Increment(Int_t bin[], Double_t v);
152 TH2* Projection2D(const Int_t nstat, const Int_t ncol, const Int_t mid=0);
153 void SetRebinStrategy(Int_t n, Int_t rebx[], Int_t reby[]);
0b30040d 154 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 155 private:
156 AliTRDresolutionProjection(const AliTRDresolutionProjection&);
157 AliTRDresolutionProjection& operator=(const AliTRDresolutionProjection&);
158 protected:
159 TH3 *fH; // data container
160 Int_t fAx[3]; // projection axes
161 Int_t fNrebin; // no. of rebinning steps
162 Int_t *fRebinX; //[fNrebin] rebinning of the X axis
163 Int_t *fRebinY; //[fNrebin] rebinning of the Y axis
0b30040d 164 Float_t fRange[4]; //show range of the z processed
3ed01fbe 165 ClassDef(AliTRDresolutionProjection, 1) // wrapper for a projection container THnSparse -> TH3
166 };
167
1ee39b3a 168 AliTRDresolution(const AliTRDresolution&);
169 AliTRDresolution& operator=(const AliTRDresolution&);
afca20ef 170
3ed01fbe 171 void AdjustF1(TH1 *h, TF1 *f);
9dcc64cc 172 TObjArray* BuildMonitorContainerCluster(const char* name, Bool_t expand=kFALSE, Float_t range=-1.);
2589cf64 173 TObjArray* BuildMonitorContainerTracklet(const char* name, Bool_t expand=kFALSE);
3d2a3dff 174 TObjArray* BuildMonitorContainerTrack(const char* name);
0b30040d 175 void DrawSigma(TH2 *h2, Float_t scale=1, Float_t m=0., Float_t M=-1., const Char_t *t=NULL);
3ed01fbe 176 void GetLandauMpvFwhm(TF1 * const f, Float_t &mpv, Float_t &xm, Float_t &xM);
177 void GetRange(TH2 *h2, Char_t mod, Float_t *range);
178
179protected:
f429b017 180 Bool_t MakeProjectionCluster(Bool_t mc=kFALSE);
181 Bool_t MakeProjectionTracklet(Bool_t mc=kFALSE);
182 Bool_t MakeProjectionTrackIn(Bool_t mc=kFALSE);
183 Bool_t MakeProjectionTrack();
3ed01fbe 184 Bool_t Process(TH2* const h2, TF1 *f, Float_t k, TGraphErrors **g);
185 Bool_t Pulls(Double_t dyz[2], Double_t cc[3], Double_t tilt) const;
1ee39b3a 186
3ceb45ae 187 UShort_t fIdxPlot; // plot counter (internal)
188 UShort_t fIdxFrame; // frame counter (internal)
189 Float_t fPtThreshold; // pt threshold for some performance plots
190 Float_t fDyRange; // min/max dy
566c3d46 191 Int_t fBCbinTOF; // set/select by TOF BC index
192 Int_t fBCbinFill; // set/select by Bunch Fill index
3ceb45ae 193 static Char_t const *fgPerformanceName[kNclasses]; //! name of performance plot
3ceb45ae 194 static Int_t const fgkNbins[kNdim]; //! no of bins/projection
195 static Double_t const fgkMin[kNdim]; //! low limits for projections
196 static Double_t const fgkMax[kNdim]; //! high limits for projections
197 static Char_t const *fgkTitle[kNdim]; //! title of projection
198 static Float_t fgPtBin[kNpt+1]; //! pt segmentation
199 TObjArray *fProj; //! result holder - sigma values
200 TDatabasePDG *fDBPDG; //! PDG database
1ee39b3a 201
202 // calibration containers
3ed01fbe 203 TObjArray *fCl; //! cluster2track calib
204 TObjArray *fMCcl; //! cluster2mc calib
1ee39b3a 205
3ceb45ae 206 ClassDef(AliTRDresolution, 10) // TRD tracking resolution task
1ee39b3a 207};
208#endif