]>
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(); |
d7f71269 | 53 | Bool_t AnalyzeGainDipAngle(Int_t padRegion = 0); |
6d64657a | 54 | Bool_t AnalyzeGainMultiplicity(); |
7e3e1a9c | 55 | Bool_t AnalyzeGainChamberByChamber(); |
88b09aaa | 56 | void SetTimeGainRange(Double_t minGain=2.0, Double_t maxGain = 3.0) |
57 | {fMinGain = minGain; fMaxGain = maxGain;}; | |
58 | Bool_t ValidateTimeGain(); | |
f3023796 | 59 | // |
60 | // Alignment time part | |
61 | // | |
62 | void MakeChainTime(); | |
63 | void MakePrimitivesTime(); | |
39c42ea2 | 64 | // static void RegisterPrimitiveTimes(); |
f3023796 | 65 | void CreateAlignTime(TString fstring, TVectorD paramC); |
66 | void MakeFitTime(); | |
67 | static Double_t EvalAt(Double_t phi, Double_t refX, Double_t theta, Int_t corr, Int_t ptype); | |
39c42ea2 | 68 | 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 | 69 | |
3f76dadb | 70 | // event/track counter related setters and getters |
71 | Int_t GetNeventsVdrift() const {return fNeventsVdrift;} | |
72 | Int_t GetNtracksVdrift() const {return fNtracksVdrift;} | |
73 | Int_t GetMinEventsVdrift() const {return fMinEventsVdrift;} | |
74 | Int_t GetMinTracksVdrift() const {return fMinTracksVdrift;} | |
75 | void SetMinEventsVdrift(Int_t min) {fMinEventsVdrift=min;} | |
76 | void SetMinTracksVdrift(Int_t min) {fMinTracksVdrift=min;} | |
77 | ||
da268e11 | 78 | // |
79 | // QA drawing part | |
80 | // | |
81 | static void SetPadStyle(TPad *pad, Float_t mx0, Float_t mx1, Float_t my0, Float_t my1); | |
82 | static void PrintArray(TObjArray *array); | |
f3023796 | 83 | TChain *GetAlignTree(){return fAlignTree;} |
da268e11 | 84 | // |
85 | // graph filtering part | |
86 | // | |
87 | static TGraphErrors* FilterGraphMedianAbs(TGraphErrors * graph, Float_t cut,Double_t &medianY); | |
88 | static TGraphErrors* FilterGraphDrift(TGraphErrors * graph, Float_t errSigmaCut, Float_t medianCutAbs); | |
89 | static TGraphErrors * MakeGraphFilter0(THnSparse *hisN, Int_t itime, Int_t ival, Int_t minEntries, Double_t offset=0); | |
90 | ||
68d461b2 | 91 | // |
92 | void SwitchOnValidation(Bool_t val = kTRUE) {fSwitchOnValidation = val;} | |
93 | Bool_t IsSwitchOnValidation() { return fSwitchOnValidation; } | |
94 | ||
3f76dadb | 95 | // |
96 | Int_t GetStatus(); | |
97 | enum ECalibStatusBit { kCalibFailedTimeDrift =0x0001, | |
98dff5dc | 98 | kCalibFailedTimeGain =0x0002 , |
99 | kCalibFailedExport =0x0004 | |
100 | }; | |
3f76dadb | 101 | |
40120adc | 102 | private: |
103 | Int_t fMinEntries; // minimal number of entries for fit | |
a9f9c69b | 104 | Int_t fStartRun; // start Run - used to make fast selection in THnSparse |
105 | Int_t fEndRun; // end Run - used to make fast selection in THnSparse | |
106 | Int_t fStartTime; // fStartTime - used to make fast selection in THnSparse | |
107 | Int_t fEndTime; // fEndTime - used to make fast selection in THnSparse | |
108 | AliCDBStorage* fOCDBstorage; // OCDB storage | |
40120adc | 109 | TObjArray * fVdriftArray; // array with output calibration graphs |
110 | AliTPCcalibTime * fTimeDrift; // input data to construct calibration graphs | |
da268e11 | 111 | TGraphErrors * fGraphMIP; // graph time dependence of MIP |
112 | TGraphErrors * fGraphCosmic; // graph time dependence at Plateu | |
391ffdb2 | 113 | TGraphErrors * fGraphAttachmentMIP; // graph time dependence of attachment (signal vs. mean driftlength) |
da268e11 | 114 | AliSplineFit * fFitMIP; // fit of dependence - MIP |
115 | AliSplineFit * fFitCosmic; // fit of dependence - Plateu | |
116 | TObjArray * fGainArray; // array to be stored in the OCDB | |
117 | AliTPCcalibTimeGain * fGainMIP; // calibration component for MIP | |
118 | AliTPCcalibTimeGain * fGainCosmic; // calibration component for cosmic | |
56b51ad9 | 119 | AliTPCcalibGainMult * fGainMult; // calibration component for pad region gain equalization and multiplicity dependence |
f3023796 | 120 | |
121 | TChain *fAlignTree; //alignment tree | |
122 | // | |
68d461b2 | 123 | Bool_t fSwitchOnValidation; // flag to switch on validation of OCDB parameters |
88b09aaa | 124 | Float_t fMinGain; // min gain |
125 | Float_t fMaxGain; // max gain | |
126 | Float_t fMaxVdriftCorr; // max v-drift correction | |
3f76dadb | 127 | Int_t fNtracksVdrift; // n tracks used for v drift determination |
128 | Int_t fMinTracksVdrift; // minimum numner of tracks for v drift determination | |
129 | Int_t fNeventsVdrift; // number of events used for drift calibration | |
130 | Int_t fMinEventsVdrift; // minimum number of events used for drift calibration | |
131 | ||
132 | Int_t fCalibrationStatus; // status of calibration, each set bit signifies a failure in a component (see ECalibStatusBit) | |
da268e11 | 133 | |
134 | private: | |
f12abd89 | 135 | AliTPCPreprocessorOffline& operator=(const AliTPCPreprocessorOffline&); // not implemented |
136 | AliTPCPreprocessorOffline(const AliTPCPreprocessorOffline&); // not implemented | |
da268e11 | 137 | ClassDef(AliTPCPreprocessorOffline,1) |
138 | }; | |
139 | ||
140 | #endif |