Moving the TPC calibration using tracks from separate directory to the TPC directory
[u/mrichter/AliRoot.git] / TPC / AliTPCcalibTracks.h
CommitLineData
10757ee9 1#ifndef AliTPCCALIBTRACKS_H
2#define AliTPCCALIBTRACKS_H
3
4
5///////////////////////////////////////////////////////////////////////////////
6// //
7// Class to analyse tracks for calibration //
8// to be used as a component in AliTPCSelectorTracks //
9// In the constructor you have to specify name and title //
10// to get the Object out of a file. //
11// The parameter 'clusterParam', a AliTPCClusterParam object //
12// (needed for TPC cluster error and shape parameterization) //
13// Normally you get this object out of the file 'TPCClusterParam.root' //
14// In the parameter 'cuts' the cuts are specified, that decide //
15// weather a track will be accepted for calibration or not. //
16// //
17// //
18///////////////////////////////////////////////////////////////////////////////
19
20
21
22#include <TNamed.h>
23class TF2;
24class TH3F;
25class TH1F;
26class TH1I;
27class TH2I;
28class TH2D;
29class TCollection;
30class TTreeSRedirector;
31class TLinearFitter;
32class AliTPCClusterParam;
33class TTreeSRedirector;
34class AliTPCROC;
35class AliTPCseed;
36class AliESDtrack;
37class AliTPCclusterMI;
38class AliTPCcalibTracksCuts;
39class AliTPCCalPadRegion;
40class AliTPCCalPad;
41class TChain;
42class TMutex;
43
44using namespace std;
45
46class AliTPCcalibTracks : public TNamed {
47public :
48 AliTPCcalibTracks(); // default constructor
49 AliTPCcalibTracks(AliTPCcalibTracks* ct); // copy constructor
50 AliTPCcalibTracks(const Text_t *name, const Text_t *title, AliTPCClusterParam *clusterParam, AliTPCcalibTracksCuts* cuts, Int_t logLevel = 0);
51 virtual ~AliTPCcalibTracks(); // destructor
52
53 static void AddInfo(TChain *chain, char *fileName); // add clusterParametrization as user info to the chain
54 void Process(AliTPCseed *track, AliESDtrack *esd); // to be called by the Selector
55
56 Int_t AcceptTrack(AliTPCseed * track);
57 void FillResolutionHistoLocal(AliTPCseed * track); // the MAIN-FUNCTION, called for each track to fill the histograms, called by Process(...)
58 static TH2D* MakeDiff(TH2D * hfit, TF2 * func);
59
60 Long64_t Merge(TCollection *li);
61 static AliTPCcalibTracks* TestMerge(AliTPCcalibTracks *ct, AliTPCClusterParam *clusterParam, Int_t nCalTracks = 50);
62
63 void SetStyle() const;
64 void Draw(Option_t* opt); // draw some exemplaric histograms for fast result-check
65 void MakeReport(Int_t stat, char* pathName = "plots"); // calls all functions that procude pictures, results are written to pathName, stat is the minimal statistic threshold
66 void MakeAmpPlots(Int_t stat, char* pathName = "plots");
67 void MakeDeltaPlots(char* pathName = "plots");
68 void MakeChargeVsDriftLengthPlotsOld(char* pathName = "plots");
69 void MakeChargeVsDriftLengthPlots(char* pathName = "plots");
70 void FitResolutionNew(char* pathName = "plots");
71 void FitRMSNew(char* pathName = "plots");
72 void MakeResPlotsQTree(Int_t minEntries = 100, char* pathName = "plots");
73 // Thread-stuff:
74 // void MakeResPlotsQTreeThread(Int_t minEntries = 100, char* pathName = "plots");
75 // static void* MakeResPlotsQTreeThreadFunction(void* arg);
76
77//protected:
78 TObjArray* GetfArrayAmpRow() {return fArrayAmpRow;}
79 TObjArray* GetfArrayAmp() {return fArrayAmp;}
80 TObjArray* GetfArrayQDY() {return fArrayQDY;}
81 TObjArray* GetfArrayQDZ() {return fArrayQDZ;}
82 TObjArray* GetfArrayQRMSY() {return fArrayQRMSY;}
83 TObjArray* GetfArrayQRMSZ() {return fArrayQRMSZ;}
84 TObjArray* GetfArrayChargeVsDriftlength() {return fArrayChargeVsDriftlength;}
85 TH1F* GetfDeltaY() {return fDeltaY;}
86 TH1F* GetfDeltaZ() {return fDeltaZ;}
87 TObjArray* GetfResolY() {return fResolY;}
88 TObjArray* GetfResolZ() {return fResolZ;}
89 TObjArray* GetfRMSY() {return fRMSY;}
90 TObjArray* GetfRMSZ() {return fRMSZ;}
91 TH1I* GetfHclus() {return fHclus;}
92 TH1I* GetfRejectedTracksHisto() {return fRejectedTracksHisto;}
93 TH1I* GetfHclusterPerPadrow() {return fHclusterPerPadrow;}
94 TH1I* GetfHclusterPerPadrowRaw() {return fHclusterPerPadrowRaw;}
95 TH2I* GetfClusterCutHisto() {return fClusterCutHisto;}
96 AliTPCCalPad* GetfCalPadClusterPerPad() {return fCalPadClusterPerPad; }
97 AliTPCCalPad* GetfCalPadClusterPerPadRaw() {return fCalPadClusterPerPadRaw;}
98 AliTPCCalPadRegion* GetCalPadRegionchargeVsDriftlength() {return fcalPadRegionChargeVsDriftlength;}
99 AliTPCcalibTracksCuts* GetCuts() {return fCuts;}
100 void SetLogLevel(Int_t level) {fDebugLevel = level;}
101 Int_t GetLogLevel() const {return fDebugLevel;}
102
103protected:
104 ClassDef(AliTPCcalibTracks,1)
105
106
107private:
108 static Int_t GetBin(Float_t q, Int_t pad);
109 static Int_t GetBin(Int_t iq, Int_t pad);
110 static Float_t GetQ(Int_t bin);
111 static Float_t GetPad(Int_t bin);
112 void FillResolutionHistoLocalDebugPart(AliTPCseed *track, AliTPCclusterMI *cluster0, Int_t irow, Float_t angley, Float_t anglez, Int_t nclFound, Int_t kDelta);
113 AliTPCClusterParam *fClusterParam; //! pointer to cluster parameterization
114 TTreeSRedirector *fDebugStream; //! debug stream for
115 AliTPCROC *fROC; //!
116 TObjArray *fArrayAmpRow; // array with amplitudes versus row for given sector
117 TObjArray *fArrayAmp; // array with amplitude for sectors
118 TObjArray *fArrayQDY; // q binned delta Y histograms
119 TObjArray *fArrayQDZ; // q binned delta Z histograms
120 TObjArray *fArrayQRMSY; // q binned delta Y histograms
121 TObjArray *fArrayQRMSZ; // q binned delta Z histograms
122 TObjArray *fArrayChargeVsDriftlength; // array of arrays of TProfiles with charge vs. driftlength for each padsize and sector
123 AliTPCCalPadRegion *fcalPadRegionChargeVsDriftlength; // CalPadRegion, one TProfile for charge vs. driftlength for each padsize and sector
124 TH1F *fDeltaY; // integrated delta y histo
125 TH1F *fDeltaZ; // integrated delta z histo
126 TObjArray *fResolY; // array of resolution histograms Y
127 TObjArray *fResolZ; // array of resolution histograms Z
128 TObjArray *fRMSY; // array of RMS histograms Y
129 TObjArray *fRMSZ; // array of RMS histograms Z
130 AliTPCcalibTracksCuts *fCuts; // object with cuts, that is passed to the constructor
131 TH1I *fHclus; // number of clusters per track
132 TH1I *fRejectedTracksHisto; // histogram of rejecteced tracks, the number coresponds to the failed cut
133 TH1I *fHclusterPerPadrow; // histogram showing the number of clusters per padRow
134 TH1I *fHclusterPerPadrowRaw;// histogram showing the number of clusters per padRow before cuts on clusters are applied
135 TH2I *fClusterCutHisto; // histogram showing in which padRow the clusters were cutted by which criterium
136 AliTPCCalPad *fCalPadClusterPerPad; // AliTPCCalPad showing the number of clusters per Pad
137 AliTPCCalPad *fCalPadClusterPerPadRaw; // AliTPCCalPad showing the number of clusters per Pad before cuts on clusters are applied
138 Int_t fDebugLevel; // log level - debug output: -1: silence, 0: default, 1: things like constructor called, 5: write fDebugStream, 6: waste your screen
139 TLinearFitter *fFitterLinY1; //!
140 TLinearFitter *fFitterLinZ1; //!
141 TLinearFitter *fFitterLinY2; //!
142 TLinearFitter *fFitterLinZ2; //!
143 TLinearFitter *fFitterParY; //!
144 TLinearFitter *fFitterParZ; //!
145
146/*
147 // Threads-stuff:
148 static Int_t fgLoopCounter; //! only for MakeResPlotsQTreeThread, display status
149 static TMutex *fgWriteMutex; //!
150 static TMutex *fgFitResMutex; //!
151 static TMutex *fgFitRmsMutex; //!
152 struct TthreadParameterStruct {
153 Int_t logLevel;
154 Int_t minEntries;
155 Int_t dim;
156 Int_t pad;
157 TH3F *(*resArray)[2][3][11];
158 TH3F *(*rmsArray)[2][3][11];
159 TString *fileName;
160 TTreeSRedirector *fTreeResol;
161 };
162
163*/
164
165};
166
167#endif