add new mergeable classes for chamber status and trigger statistics
[u/mrichter/AliRoot.git] / PWGPP / 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
01ccc21a 22#ifndef Root_TNamed
23#include "TNamed.h"
24#endif
25
1ee39b3a 26class TH1;
27class TH2;
28class TF1;
29class TGraphErrors;
30class TObjArray;
92c40e64 31class TDatabasePDG;
1ee39b3a 32class AliTRDrecoParam;
33class AliTRDseedV1;
34class AliTRDtrackInfo;
08bdd9d1 35class AliTrackPoint;
1ee39b3a 36class AliTRDresolution : public AliTRDrecoTask
37{
38public:
1ee39b3a 39 enum ETRDresolutionSteer {
08bdd9d1 40 kVerbose = BIT(18) // switch verbosity
41 ,kVisual = BIT(19) // show partial results during processing
42 ,kTrackRefit = BIT(20) // steer track refit
00a56108 43 ,kTrackSelect= BIT(21) // steer track selection
3ed01fbe 44 ,kXchange = BIT(22) // use exchange containers
1ee39b3a 45 };
3ceb45ae 46 enum ETRDresolutionSlots {
705f8b0a 47 kClToTrk = 2
3ceb45ae 48 ,kClToMC
49 ,kTrkltToTrk
50 ,kTrkltToMC
51 ,kNSlots = 4
52 };
53 enum ETRDresolutionClass {
f073d500 54 kDetector=0 // cluster - detector
55 ,kCluster // cluster - track
3ceb45ae 56 ,kTracklet // tracklet - track residuals/pulls
57 ,kTrackIn // tracklet - track residuals/pulls at lower TRD entrance
3ceb45ae 58 ,kMCcluster // cluster-mc resolution/pulls
59 ,kMCtracklet // tracklet-mc resolution/pulls
60 ,kMCtrackIn // TPC track monitor
3ceb45ae 61 ,kMCtrack // TRD track monitor
f429b017 62/* ,kTrackOut // tracklet - track residuals/pulls at lower TRD entrance during refit
63 ,kMCtrackOut // TOF/HMPID track monitor*/
3ceb45ae 64 ,kNclasses // total number of resolution classes
65 };
0b366e97 66 enum ETRDresolutionClassProjs {
b9058d72 67 kDetNproj=460 // detector projections
68 ,kClNproj=2800 // cluster projections
8892a7f3 69 ,kTrkltNproj=8000 // tracklet projections
33056e04 70 ,kTrkInNproj=300 // trackIn projections
808d178e 71 ,kTrkNproj=2500 // track projections
56838f9d 72 ,kMCTrkInNproj=260 // trackIn projections
0b366e97 73 };
3ceb45ae 74 enum ETRDresolutionProjs {
75 kBC = 0 // bunch cross
76 ,kPhi
77 ,kEta
3ceb45ae 78 ,kYrez
3ceb45ae 79 ,kPrez
3ed01fbe 80 ,kZrez
81 ,kSpeciesChgRC
82 ,kPt
3ceb45ae 83 ,kNdim // no of dimensions in the THnSparse
56838f9d 84 ,kNdimDet = 4
f073d500 85 ,kNdimCl = 4
566c3d46 86 ,kNdimTrklt = 4
87 ,kNdimTrkIn = 7
3ceb45ae 88 ,kNbunchCross = 3 // no of classes for bunch crossing
35983729 89 ,kNpt = 3 // no of log bins in pt spectrum
cc98ff07 90 ,kNspc = 3 // no of species e, mu+pi, K+p
b9058d72 91 ,kNcharge = 2 // no of charges
92 ,kNpads = 4 // no of charges
9dcc64cc 93 };
1ee39b3a 94
95 AliTRDresolution();
3ed01fbe 96 AliTRDresolution(char* name, Bool_t xchange=kTRUE);
eb05d549 97 AliTRDresolution(const AliTRDresolution&);
98 AliTRDresolution& operator=(const AliTRDresolution&);
1ee39b3a 99 virtual ~AliTRDresolution();
100
3ed01fbe 101 static Bool_t FitTrack(const Int_t np, AliTrackPoint *points, Float_t params[10]);
102 static Bool_t FitTracklet(const Int_t ly, const Int_t np, const AliTrackPoint *points, const Float_t trackPars[10], Float_t trackletPars[3]);
103 void UserCreateOutputObjects();
3ceb45ae 104// Float_t GetCorrectionX(Int_t det, Int_t tb) const {return fXcorr[det][tb];}
b351a191 105 static void GetRangeZ(TH2 *h2, Float_t &m, Float_t &M);
3ed01fbe 106 Float_t GetPtThreshold() const {return fPtThreshold;}
107 static Int_t GetPtBin(Float_t pt);
108 Bool_t GetRefFigure(Int_t ifig);
3ceb45ae 109
566c3d46 110 virtual TObjArray* Histos();
3ceb45ae 111// Bool_t Load(const Char_t *file = "AnalysisResults.root", const Char_t *dir="TRD_Performance");
112// Bool_t LoadCorrection(const Char_t *file=NULL);
3ed01fbe 113 void MakeSummary();
114 static void MakePtSegmentation(Float_t pt0=0.5, Float_t dpt=0.002);
2589cf64 115
566c3d46 116 TObjArray* Results(ETRDresolutionClass c) const { if(!fProj) return NULL; return (TObjArray*)fProj->At(c);}
3ed01fbe 117 void UserExec(Option_t * opt);
118 void InitExchangeContainers();
566c3d46 119 Bool_t HasTrackRefit() const { return TestBit(kTrackRefit);}
120 Bool_t HasTrackSelection() const { return TestBit(kTrackSelect);}
121 Bool_t IsVerbose() const { return TestBit(kVerbose);}
122 Bool_t IsVisual() const { return TestBit(kVisual);}
123 Bool_t UseBCselectTOF() const { return fBCbinTOF>0;}
124 Bool_t UseBCselectFill() const { return fBCbinFill>0;}
125 Bool_t UseExchangeContainers() const { return TestBit(kXchange);}
3ed01fbe 126 Bool_t PostProcess();
127
f073d500 128 TH1* DetCluster(const TObjArray *cl=NULL);
3ed01fbe 129 TH1* PlotCluster(const AliTRDtrackV1 *t=NULL);
130 TH1* PlotTracklet(const AliTRDtrackV1 *t=NULL);
131 TH1* PlotTrackIn(const AliTRDtrackV1 *t=NULL);
f429b017 132// TH1* PlotTrackOut(const AliTRDtrackV1 *t=NULL);
3ed01fbe 133 TH1* PlotMC(const AliTRDtrackV1 *t=NULL);
134
b9058d72 135 static Bool_t Process(TH2* const /*h2*/, TGraphErrors **/*g*/, Int_t stat=100){ return Bool_t(stat);}
566c3d46 136 void SetPtThreshold(Float_t pt) { fPtThreshold = pt;}
dffc3357 137 void SetBCselectTOF(Int_t b=0) { fBCbinTOF = b;}
566c3d46 138 void SetBCselectFill(Int_t b=0) { fBCbinFill = b<0||b>3499?1:b+1;}
56838f9d 139 void SetBsign(Int_t b=0) { fBsign = Bool_t(b);}
b9058d72 140 void SetProcesses(Bool_t det, Bool_t cl, Bool_t trklt, Bool_t trkin);
33056e04 141 void SetDump3D(Bool_t det, Bool_t cl, Bool_t trklt, Bool_t trkin);
566c3d46 142 void SetVerbose(Bool_t v = kTRUE) { SetBit(kVerbose, v);}
143 void SetVisual(Bool_t v = kTRUE) { SetBit(kVisual, v);}
144 void SetTrackRefit(Bool_t v = kTRUE) { SetBit(kTrackRefit, v);}
145 void SetTrackSelection(Bool_t v = kTRUE) { SetBit(kTrackSelect, v);}
146 void SetUseExchangeContainers(Bool_t v = kTRUE) { SetBit(kXchange, v);}
1ee39b3a 147
3ed01fbe 148 void Terminate(Option_t * opt);
149 static Bool_t UseTrack(const Int_t np, const AliTrackPoint *points, Float_t params[10]);
3ceb45ae 150
3ed01fbe 151 void AdjustF1(TH1 *h, TF1 *f);
808d178e 152 void DrawSigma(TH2 *h2, const Char_t *t, Float_t m=0., Float_t M=-1., Float_t scale=1);
3ed01fbe 153 void GetLandauMpvFwhm(TF1 * const f, Float_t &mpv, Float_t &xm, Float_t &xM);
154 void GetRange(TH2 *h2, Char_t mod, Float_t *range);
155
156protected:
33056e04 157 Bool_t HasDump3DFor(ETRDresolutionClass cls) const { return TESTBIT(fSteer, 4+cls);}
158 Bool_t HasProcess(ETRDresolutionClass cls) const { return TESTBIT(fSteer, cls);}
f073d500 159 Bool_t MakeProjectionDetector();
f429b017 160 Bool_t MakeProjectionCluster(Bool_t mc=kFALSE);
161 Bool_t MakeProjectionTracklet(Bool_t mc=kFALSE);
162 Bool_t MakeProjectionTrackIn(Bool_t mc=kFALSE);
163 Bool_t MakeProjectionTrack();
b9058d72 164 Bool_t Process(TH2* const /*h2*/, TF1 */*f*/, Float_t /*k*/, TGraphErrors **/*g*/) { return kTRUE;}
3ed01fbe 165 Bool_t Pulls(Double_t dyz[2], Double_t cc[3], Double_t tilt) const;
1ee39b3a 166
b9058d72 167 UShort_t fSteer; // bit map to steer internal behaviour of class
33056e04 168 // MakeProjection [kTrackIn kTracklet kCluster kDetector]
169 // Dump3D [4+kTrackIn 4+kTracklet 4+kCluster 4+kDetector]
3ceb45ae 170 Float_t fPtThreshold; // pt threshold for some performance plots
566c3d46 171 Int_t fBCbinTOF; // set/select by TOF BC index
172 Int_t fBCbinFill; // set/select by Bunch Fill index
56838f9d 173 Bool_t fBsign; // sign of magnetic field (kFALSE[-] kTRUE[+])
3ceb45ae 174 static Char_t const *fgPerformanceName[kNclasses]; //! name of performance plot
3ceb45ae 175 static Int_t const fgkNbins[kNdim]; //! no of bins/projection
176 static Double_t const fgkMin[kNdim]; //! low limits for projections
177 static Double_t const fgkMax[kNdim]; //! high limits for projections
eb05d549 178 static Char_t const *fgkTitle[kNdim]; //! title of projection
56838f9d 179 static Float_t fgPtBin[25]; //! pt segmentation
3ceb45ae 180 TObjArray *fProj; //! result holder - sigma values
181 TDatabasePDG *fDBPDG; //! PDG database
1ee39b3a 182
183 // calibration containers
3ed01fbe 184 TObjArray *fCl; //! cluster2track calib
185 TObjArray *fMCcl; //! cluster2mc calib
1ee39b3a 186
dffc3357 187 ClassDef(AliTRDresolution, 11) // TRD tracking resolution task
1ee39b3a 188};
189#endif