]>
Commit | Line | Data |
---|---|---|
da268e11 | 1 | #ifndef ALITPCPREPROCESSOROFFLINE_H |
2 | #define ALITPCPREPROCESSOROFFLINE_H | |
3 | ||
4 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
5 | * See cxx source for full Copyright notice */ | |
6 | ||
f12abd89 | 7 | // |
da268e11 | 8 | // |
9 | // Class to create OCDB entries - processing the results of the OFFLINE calibration | |
f12abd89 | 10 | // |
11 | ||
da268e11 | 12 | |
13 | #include "TNamed.h" | |
14 | class TObjArray; | |
15 | class AliTPCcalibTime; | |
16 | class AliTPCcalibTimeGain; | |
56b51ad9 | 17 | class AliTPCcalibGainMult; |
da268e11 | 18 | class AliTPCROC; |
f12abd89 | 19 | class AliTPCParam; |
20 | class TPad; | |
21 | class AliCDBRunRange; | |
a9f9c69b | 22 | class AliCDBStorage; |
da268e11 | 23 | |
f12abd89 | 24 | class AliTPCPreprocessorOffline:public TNamed { |
da268e11 | 25 | public: |
26 | AliTPCPreprocessorOffline(); | |
27 | virtual ~AliTPCPreprocessorOffline(); | |
a9f9c69b | 28 | void UpdateOCDBDrift(Int_t ustartRun, Int_t uendRun, AliCDBStorage* storage); |
29 | void UpdateOCDBGain(Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* storage); | |
30 | void UpdateDriftParam(AliTPCParam *param, TObjArray *const arr, Int_t lstartRun); | |
da268e11 | 31 | |
32 | // | |
33 | // v drift part | |
34 | // | |
40120adc | 35 | void GetRunRange(AliTPCcalibTime* const timeDrift); |
a9f9c69b | 36 | void CalibTimeVdrift(const Char_t* file, Int_t ustartRun, Int_t uendRun,AliCDBStorage* ocdbStorage=0x0); |
40120adc | 37 | void AddHistoGraphs( TObjArray * vdriftArray, AliTPCcalibTime * const timeDrift, Int_t minEntries); |
38 | void AddAlignmentGraphs( TObjArray * vdriftArray, AliTPCcalibTime * const timeDrift); | |
da268e11 | 39 | void AddLaserGraphs( TObjArray * vdriftArray, AliTPCcalibTime *timeDrift); |
40 | void SetDefaultGraphDrift(TGraph *graph, Int_t color, Int_t style); | |
40120adc | 41 | void MakeDefaultPlots(TObjArray * const arr, TObjArray *picArray); |
88b09aaa | 42 | void SetMaxVDriftCorr(Double_t maxVDriftCorr=0.03) {fMaxVdriftCorr=maxVDriftCorr;}; |
43 | Bool_t ValidateTimeDrift(); | |
da268e11 | 44 | // |
45 | // Gain part | |
46 | // | |
a9f9c69b | 47 | void CalibTimeGain(const Char_t* fileName, Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* ocdbStorage); |
40120adc | 48 | void ReadGainGlobal(const Char_t* fileName="CalibObjectsTrain1.root"); |
da268e11 | 49 | void MakeQAPlot(Float_t FPtoMIPratio); |
50 | Bool_t AnalyzeGain(Int_t startRunNumber, Int_t endRunNumber, Int_t minEntriesGaussFit = 500, Float_t FPtoMIPratio = 1.43); | |
391ffdb2 | 51 | Bool_t AnalyzeAttachment(Int_t startRunNumber, Int_t endRunNumber, Int_t minEntriesFit = 2000); |
56b51ad9 | 52 | Bool_t AnalyzePadRegionGain(); |
6d64657a | 53 | Bool_t AnalyzeGainMultiplicity(); |
7e3e1a9c | 54 | Bool_t AnalyzeGainChamberByChamber(); |
88b09aaa | 55 | void SetTimeGainRange(Double_t minGain=2.0, Double_t maxGain = 3.0) |
56 | {fMinGain = minGain; fMaxGain = maxGain;}; | |
57 | Bool_t ValidateTimeGain(); | |
f3023796 | 58 | // |
59 | // Alignment time part | |
60 | // | |
61 | void MakeChainTime(); | |
62 | void MakePrimitivesTime(); | |
39c42ea2 | 63 | // static void RegisterPrimitiveTimes(); |
f3023796 | 64 | void CreateAlignTime(TString fstring, TVectorD paramC); |
65 | void MakeFitTime(); | |
66 | static Double_t EvalAt(Double_t phi, Double_t refX, Double_t theta, Int_t corr, Int_t ptype); | |
39c42ea2 | 67 | static Double_t EvalAtPar(Double_t phi, Double_t snp, Double_t refX, Double_t theta, Int_t corr, Int_t ptype, Int_t nstep); |
f3023796 | 68 | |
3f76dadb | 69 | // event/track counter related setters and getters |
70 | Int_t GetNeventsVdrift() const {return fNeventsVdrift;} | |
71 | Int_t GetNtracksVdrift() const {return fNtracksVdrift;} | |
72 | Int_t GetMinEventsVdrift() const {return fMinEventsVdrift;} | |
73 | Int_t GetMinTracksVdrift() const {return fMinTracksVdrift;} | |
74 | void SetMinEventsVdrift(Int_t min) {fMinEventsVdrift=min;} | |
75 | void SetMinTracksVdrift(Int_t min) {fMinTracksVdrift=min;} | |
76 | ||
da268e11 | 77 | // |
78 | // QA drawing part | |
79 | // | |
80 | static void SetPadStyle(TPad *pad, Float_t mx0, Float_t mx1, Float_t my0, Float_t my1); | |
81 | static void PrintArray(TObjArray *array); | |
f3023796 | 82 | TChain *GetAlignTree(){return fAlignTree;} |
da268e11 | 83 | // |
84 | // graph filtering part | |
85 | // | |
86 | static TGraphErrors* FilterGraphMedianAbs(TGraphErrors * graph, Float_t cut,Double_t &medianY); | |
87 | static TGraphErrors* FilterGraphDrift(TGraphErrors * graph, Float_t errSigmaCut, Float_t medianCutAbs); | |
88 | static TGraphErrors * MakeGraphFilter0(THnSparse *hisN, Int_t itime, Int_t ival, Int_t minEntries, Double_t offset=0); | |
89 | ||
68d461b2 | 90 | // |
91 | void SwitchOnValidation(Bool_t val = kTRUE) {fSwitchOnValidation = val;} | |
92 | Bool_t IsSwitchOnValidation() { return fSwitchOnValidation; } | |
93 | ||
3f76dadb | 94 | // |
95 | Int_t GetStatus(); | |
96 | enum ECalibStatusBit { kCalibFailedTimeDrift =0x0001, | |
97 | kCalibFailedTimeGain =0x0002 }; | |
98 | ||
40120adc | 99 | private: |
100 | Int_t fMinEntries; // minimal number of entries for fit | |
a9f9c69b | 101 | Int_t fStartRun; // start Run - used to make fast selection in THnSparse |
102 | Int_t fEndRun; // end Run - used to make fast selection in THnSparse | |
103 | Int_t fStartTime; // fStartTime - used to make fast selection in THnSparse | |
104 | Int_t fEndTime; // fEndTime - used to make fast selection in THnSparse | |
105 | AliCDBStorage* fOCDBstorage; // OCDB storage | |
40120adc | 106 | TObjArray * fVdriftArray; // array with output calibration graphs |
107 | AliTPCcalibTime * fTimeDrift; // input data to construct calibration graphs | |
da268e11 | 108 | TGraphErrors * fGraphMIP; // graph time dependence of MIP |
109 | TGraphErrors * fGraphCosmic; // graph time dependence at Plateu | |
391ffdb2 | 110 | TGraphErrors * fGraphAttachmentMIP; // graph time dependence of attachment (signal vs. mean driftlength) |
da268e11 | 111 | AliSplineFit * fFitMIP; // fit of dependence - MIP |
112 | AliSplineFit * fFitCosmic; // fit of dependence - Plateu | |
113 | TObjArray * fGainArray; // array to be stored in the OCDB | |
114 | AliTPCcalibTimeGain * fGainMIP; // calibration component for MIP | |
115 | AliTPCcalibTimeGain * fGainCosmic; // calibration component for cosmic | |
56b51ad9 | 116 | AliTPCcalibGainMult * fGainMult; // calibration component for pad region gain equalization and multiplicity dependence |
f3023796 | 117 | |
118 | TChain *fAlignTree; //alignment tree | |
119 | // | |
68d461b2 | 120 | Bool_t fSwitchOnValidation; // flag to switch on validation of OCDB parameters |
88b09aaa | 121 | Float_t fMinGain; // min gain |
122 | Float_t fMaxGain; // max gain | |
123 | Float_t fMaxVdriftCorr; // max v-drift correction | |
3f76dadb | 124 | Int_t fNtracksVdrift; // n tracks used for v drift determination |
125 | Int_t fMinTracksVdrift; // minimum numner of tracks for v drift determination | |
126 | Int_t fNeventsVdrift; // number of events used for drift calibration | |
127 | Int_t fMinEventsVdrift; // minimum number of events used for drift calibration | |
128 | ||
129 | Int_t fCalibrationStatus; // status of calibration, each set bit signifies a failure in a component (see ECalibStatusBit) | |
da268e11 | 130 | |
131 | private: | |
f12abd89 | 132 | AliTPCPreprocessorOffline& operator=(const AliTPCPreprocessorOffline&); // not implemented |
133 | AliTPCPreprocessorOffline(const AliTPCPreprocessorOffline&); // not implemented | |
da268e11 | 134 | ClassDef(AliTPCPreprocessorOffline,1) |
135 | }; | |
136 | ||
137 | #endif |