Use event specie to identufy laser events
[u/mrichter/AliRoot.git] / TPC / AliTPCcalibLaser.h
CommitLineData
c6914c83 1#ifndef ALITPCCALIBLASER_H
2#define ALITPCCALIBLASER_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7////
8////
9////
10
11#include "TObject.h"
12#include "TObjArray.h"
13#include "TLinearFitter.h"
14#include "AliTPCcalibBase.h"
15#include "TH1.h"
be113f6e 16#include "TH2F.h"
d3ce44cb 17#include "THnSparse.h"
c6914c83 18
c18f4385 19
c6914c83 20class AliExternalTrackParam;
21class AliESDtrack;
e9f38a4b 22class AliESDEvent;
23class AliESDfriend;
c6914c83 24class TGraphErrors;
1fd56785 25class TTree;
be113f6e 26class TH2F;
27class AliTPCLaserTrack;
592a0c8f 28class TCut;
c18f4385 29
c6914c83 30class AliTPCcalibLaser:public AliTPCcalibBase {
31public:
32 AliTPCcalibLaser();
3ac724f0 33 AliTPCcalibLaser(const Text_t *name, const Text_t *title, Bool_t full=kTRUE);
be113f6e 34 AliTPCcalibLaser(const AliTPCcalibLaser& laser);
35 AliTPCcalibLaser & operator=(const AliTPCcalibLaser& calibLaser);
c6914c83 36 virtual ~AliTPCcalibLaser();
e9f38a4b 37 virtual void Process(AliESDEvent *event);
592a0c8f 38 Int_t GetNtracks(){return fNtracks;}
c6914c83 39 virtual void Analyze();
c03e3250 40 virtual Long64_t Merge(TCollection *li);
cc65e4f5 41 virtual void DumpMeanInfo(Int_t run=-1);
592a0c8f 42 static void DumpScanInfo(TTree * tree, const char * cutUser="entries>300&&(gz2<0.15&&gphi2<0.1&&gp42<0.02&&abs(gp41)<0.03)");
e5c59218 43 static void DumpFitInfo(TTree * chainFit, Int_t id);
be113f6e 44 static TH1* GetLaserProjection(TH2F* his, Int_t laser){return his->ProjectionY("aaa",laser+1,laser+1);}
e9f38a4b 45 //
46 //
47 virtual void DumpLaser(Int_t id);
61ae0623 48 virtual void RefitLaserJW(Int_t id);
c18f4385 49 void FitDriftV();
f6220766 50 Bool_t FitDriftV(Float_t minFraction);
51 //
be113f6e 52 void MakeDistHisto(Int_t id);
61ae0623 53 void AddCut(Double_t xcut, Double_t ycut, Double_t ncl){fEdgeXcuts[fNcuts]=xcut; fEdgeYcuts[fNcuts]=ycut; fNClCuts[fNcuts]=ncl; fNcuts++;}
54
e9f38a4b 55 Int_t FindMirror(AliESDtrack *track, AliTPCseed *seed);
c18f4385 56 Bool_t AcceptLaser(Int_t id);
be113f6e 57 Float_t GetDistance(AliExternalTrackParam *track, AliTPCLaserTrack *ltrp);
58 void MakeFitHistos();
59 void MergeFitHistos(AliTPCcalibLaser * add);
1aa15e8d 60 void Process(AliESDtrack *track, Int_t runNo=-1){AliTPCcalibBase::Process(track,runNo);};
61 void Process(AliTPCseed *track){return AliTPCcalibBase::Process(track);}
62 //
7af539c6 63 void SetBeamParameters(TVectorD& meanOffset, TVectorD& meanSlope,
64 TVectorD& sectorArray, Int_t option);
41a1f702 65 void SetFixedDriftVConstant(Double_t aside0, Double_t aside1,
66 Double_t cside0, Double_t cside1)
67 {fUseFixedDriftV = 1; fFixedFitAside0=aside0; fFixedFitAside1=aside1;
68 fFixedFitCside0=cside0; fFixedFitCside1=cside1;}
be113f6e 69
e9f38a4b 70 AliESDEvent * fESD; //! ESD event - not OWNER
71 AliESDfriend * fESDfriend; //! ESD event - not OWNER
592a0c8f 72 Int_t fNtracks; //! counter of associated laser tracks
73 //
e9f38a4b 74 TObjArray fTracksMirror; //! tracks with mirror information
75 TObjArray fTracksEsd; //! tracks with reconstructed information -
76 // not owner ESD
77 TObjArray fTracksEsdParam; //! tracks with reconstructed information -
78 // is owner ESD at mirror
79 TObjArray fTracksTPC; //! tracks with reconstructed information - TPC
be113f6e 80 Int_t fCounter[336]; //! counter of usage
81 Float_t fClusterCounter[336]; //!couter of clusters in "sensitive are"
82 Float_t fClusterSatur[336]; //!couter of saturated clusters in "sensitive are"
3ac724f0 83 Bool_t fFullCalib; // do full calibrration
be113f6e 84 Float_t fFitZ[336]; //fitted z position
c18f4385 85 //
2b35e8e6 86 TObjArray fDeltaZ; //-> array of histograms of delta z for each track
be113f6e 87 TObjArray fDeltaP3; //-> array of histograms of P3 for each track
88 TObjArray fDeltaP4; //-> array of histograms of P4 for each track
592a0c8f 89 TObjArray fDeltaPhi; //-> array of histograms of delta Phi for each track
90 TObjArray fDeltaPhiP; //-> array of histograms of delta Phi direction for each track
2b35e8e6 91 TObjArray fSignals; //->Array of dedx signals
7af539c6 92
95a0e09b 93 //
be113f6e 94 // Refit residuals histogram
95 //
d3ce44cb 96 THnSparseS *fHisLaser; // N dim histogram of laser
be113f6e 97 TH2F *fHisNclIn; //->Number of clusters inner
98 TH2F *fHisNclOut; //->Number of clusters outer
99 TH2F *fHisNclIO; //->Number of cluster inner outer
100 TH2F *fHisLclIn; //->Level arm inner
101 TH2F *fHisLclOut; //->Level arm outer
102 TH2F *fHisLclIO; //->Level aram inner outer
103
104 TH2F *fHisdEdx; //->dEdx histo
105 TH2F *fHisdZfit; //->distance to the mirror after linear fit
106 //
107 //
108 TH2F *fHisChi2YIn1; //->chi2 y inner - line
109 TH2F *fHisChi2YOut1; //->chi2 y inner - line
110 TH2F *fHisChi2YIn2; //->chi2 y inner - parabola
111 TH2F *fHisChi2YOut2; //->chi2 y inner - parabola
112 TH2F *fHisChi2YIO1; //->chi2 y IO - common
113 TH2F *fHisChi2ZIn1; //->chi2 z inner - line
114 TH2F *fHisChi2ZOut1; //->chi2 z inner - line
115 TH2F *fHisChi2ZIn2; //->chi2 z inner - parabola
116 TH2F *fHisChi2ZOut2; //->chi2 z inner - parabola
117 TH2F *fHisChi2ZIO1; //->chi2 z IO - common
118 //
119 //
120 TH2F *fHisPy1vP0; //-> delta y P0outer-P0inner - line
121 TH2F *fHisPy2vP0; //-> delta y P0outer-P0inner - parabola
122 TH2F *fHisPy3vP0; //-> delta y P0outer-P0inner - common parabola
123 TH2F *fHisPy1vP1; //-> delta ky P1outer-P1inner - line
124 TH2F *fHisPy2vP1; //-> delta ky P1outer-P1inner - parabola
125 TH2F *fHisPy3vP1; //-> delta ky P1outer-P1inner - common parabola
126 TH2F *fHisPy2vP2In; //-> Curv P2inner - parabola
127 TH2F *fHisPy2vP2Out; //-> Curv P2outer - parabola
128 TH2F *fHisPy3vP2IO; //-> Curv P2outerinner - common parabola
129 //
130 //
131 TH2F *fHisPz1vP0; //-> delta z P0outer-P0inner - line
132 TH2F *fHisPz2vP0; //-> delta z P0outer-P0inner - parabola
133 TH2F *fHisPz3vP0; //-> delta z P0outer-P0inner - common parabola
134 TH2F *fHisPz1vP1; //-> delta kz P1outer-P1inner - line
135 TH2F *fHisPz2vP1; //-> delta kz P1outer-P1inner - parabola
136 TH2F *fHisPz3vP1; //-> delta kz P1outer-P1inner - common parabola
137 TH2F *fHisPz2vP2In; //-> Curv P2inner - parabola
138 TH2F *fHisPz2vP2Out; //-> Curv P2outer - parabola
139 TH2F *fHisPz3vP2IO; //-> Curv P2outerinner - common parabola
140 //
95a0e09b 141 // Residual histograms
142 //
143 TObjArray fDeltaYres; //-> array of histograms of delta y residuals for each track
144 TObjArray fDeltaZres; //-> array of histograms of delta z residuals for each track
108953e9 145 TObjArray fDeltaYres2; //-> array of histograms of delta y residuals for each track
146 TObjArray fDeltaZres2; //-> array of histograms of delta z residuals for each track
7af539c6 147 TObjArray fDeltaYresAbs; //-> array of histograms of absolute delta y residuals for each track
41a1f702 148 TH1F *fHisYAbsErrors; //-> Number of errors (wrongly assigned tracks) per beam
7af539c6 149 TObjArray fDeltaZresAbs; //-> array of histograms of absolute delta z residuals for each track
41a1f702 150 TH1F *fHisZAbsErrors; //-> Number of errors (wrongly assigned tracks or missing drift velocity) per beam
108953e9 151 // TObjArray fDeltaYres3; //-> array of histograms of delta y residuals for each track
152 //TObjArray fDeltaZres3; //-> array of histograms of delta z residuals for each track
153
95a0e09b 154 //
c18f4385 155 TVectorD* fFitAside; //! drift fit - A side
156 TVectorD* fFitCside; //! drift fit - C- side
108953e9 157 TVectorD* fFitACside; //! drift fit - A+C- side
c18f4385 158 //
61ae0623 159 TVectorD fEdgeXcuts; //! cuts in local x direction; used in the refit of the laser tracks
160 TVectorD fEdgeYcuts; //! cuts in local y direction; used in the refit of the laser tracks
161 TVectorD fNClCuts; //! cuts on the number of clusters per tracklet; used in the refit of the laser tracks
162 Int_t fNcuts; //! number of cuts
7af539c6 163 TVectorD fBeamSectorOuter; //! sector map for beams in outer sector
164 TVectorD fBeamSectorInner; //! sector map for beams in inner sector
165 TVectorD fBeamOffsetYOuter; //! absolute y beam offset in outer sector
166 TVectorD fBeamSlopeYOuter; //! absolute y beam slope in outer sector
167 TVectorD fBeamOffsetYInner; //! absolute y beam offset in inner sector
168 TVectorD fBeamSlopeYInner; //! absolute y beam slope in inner sector
169 TVectorD fBeamOffsetZOuter; //! absolute z beam offset in outer sectror
170 TVectorD fBeamSlopeZOuter; //! absolute z beam slope in outer sector
171 TVectorD fBeamOffsetZInner; //! absolute z beam offset in inner sectror
172 TVectorD fBeamSlopeZInner; //! absolute z beam slope in inner sector
173 Bool_t fInverseSlopeZ; //! invert slope in z - mismatch between database and lasers
41a1f702 174 Int_t fUseFixedDriftV; // flag for fixed drift velocity for abs res
175 Double_t fFixedFitAside0; // Fixed drift v constant 0 - A side
176 Double_t fFixedFitAside1; // Fixed drift v constant 1 - A side
177 Double_t fFixedFitCside0; // Fixed drift v constant 0 - C side
178 Double_t fFixedFitCside1; // Fixed drift v constant 1 - C side
61ae0623 179 //
c18f4385 180private:
41a1f702 181 ClassDef(AliTPCcalibLaser,5)
c6914c83 182};
183
184
185
186
187
188#endif