]>
Commit | Line | Data |
---|---|---|
b3fcfd96 | 1 | #ifndef ALITRDPREPROCESSOROFFLINE_H |
2 | #define ALITRDPREPROCESSOROFFLINE_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 | // Class to create OCDB entries - processing the results of the OFFLINE calibration | |
10 | // | |
11 | ||
12 | ||
13 | #include "TNamed.h" | |
81a5aeca | 14 | #include "AliTRDCalChamberStatus.h" |
b3fcfd96 | 15 | class TObjArray; |
01239968 | 16 | class AliTRDCalDet; |
b3fcfd96 | 17 | class TH2I; |
18 | class TProfile2D; | |
19 | class AliTRDCalibraVdriftLinearFit; | |
20 | class TH1I; | |
21 | class TH2F; | |
01239968 | 22 | class TString; |
b3fcfd96 | 23 | |
24 | ||
25 | class AliTRDPreprocessorOffline:public TNamed { | |
26 | public: | |
27 | enum{ | |
28 | kGain = 0, | |
29 | kVdriftPHDet = 1, | |
30 | kVdriftPHPad = 2, | |
31 | kT0PHDet = 3, | |
32 | kT0PHPad = 4, | |
33 | kVdriftLinear = 5, | |
34 | kLorentzLinear = 6, | |
a5dcf618 | 35 | kChamberStatus = 7, |
36 | kPRF = 8 | |
b3fcfd96 | 37 | }; |
82b413fd | 38 | enum { kGainNotEnoughStatsButFill = 2, kVdriftNotEnoughStatsButFill = 4, kGainNotEnoughStatsNotFill = 8, kVdriftNotEnoughStatsNotFill = 16, kTimeOffsetNotEnoughStatsNotFill = 32}; |
39 | enum { kGainErrorOld = 2, kVdriftErrorOld = 4, kGainErrorRange = 8, kVdriftErrorRange = 16, kTimeOffsetErrorRange = 32, kChamberStatusErrorRange = 64}; | |
40 | ||
41 | ||
b3fcfd96 | 42 | AliTRDPreprocessorOffline(); |
43 | virtual ~AliTRDPreprocessorOffline(); | |
44 | ||
82b413fd | 45 | Bool_t IsGainNotEnoughStatsButFill() const |
46 | { return CheckStatus(fStatusNeg, kGainNotEnoughStatsButFill); }; | |
47 | Bool_t IsGainNotEnoughStatsNotFill() const | |
48 | { return CheckStatus(fStatusNeg, kGainNotEnoughStatsNotFill); }; | |
49 | Bool_t IsVdriftNotEnoughStatsButFill() const | |
50 | { return CheckStatus(fStatusNeg, kVdriftNotEnoughStatsButFill); }; | |
51 | Bool_t IsVdriftNotEnoughStatsNotFill() const | |
52 | { return CheckStatus(fStatusNeg, kVdriftNotEnoughStatsNotFill); }; | |
53 | Bool_t IsTimeOffsetNotEnoughStatsNotFill() const | |
54 | { return CheckStatus(fStatusNeg, kVdriftNotEnoughStatsNotFill); }; | |
55 | ||
56 | Bool_t IsGainErrorOld() const | |
57 | { return CheckStatus(fStatusPos, kGainErrorOld); }; | |
58 | Bool_t IsVdriftErrorOld() const | |
59 | { return CheckStatus(fStatusPos, kVdriftErrorOld); }; | |
60 | Bool_t IsGainErrorRange() const | |
61 | { return CheckStatus(fStatusPos, kGainErrorRange); }; | |
62 | Bool_t IsVdriftErrorRange() const | |
63 | { return CheckStatus(fStatusPos, kVdriftErrorRange); }; | |
64 | Bool_t IsTimeOffsetErrorRange() const | |
65 | { return CheckStatus(fStatusPos, kTimeOffsetErrorRange); }; | |
66 | Bool_t IsChamberStatusErrorRange() const | |
67 | { return CheckStatus(fStatusPos, kChamberStatusErrorRange); }; | |
68 | ||
69 | Bool_t CheckStatus(Int_t status, Int_t bitMask) const; | |
70 | void PrintStatus() const; | |
71 | ||
72 | ||
b3fcfd96 | 73 | void SetLinearFitForVdrift(Bool_t methodsecond) { fMethodSecond = methodsecond;}; |
74 | Bool_t GetLinearFitForVdrift() const { return fMethodSecond;}; | |
01239968 | 75 | void SetNameList(TString nameList) { fNameList = nameList;}; |
76 | TString GetNameList() const { return fNameList;}; | |
77 | void SetCalDetGain(AliTRDCalDet *calDetGainUsed) {fCalDetGainUsed = calDetGainUsed;}; | |
4c865c34 | 78 | void SetCalDetVdrift(AliTRDCalDet *calDetVdriftUsed) {fCalDetVdriftUsed = calDetVdriftUsed;}; |
008817a3 | 79 | void SetSwitchOnValidation(Bool_t switchOnValidation) {fSwitchOnValidation = switchOnValidation;}; |
01239968 | 80 | AliTRDCalDet *GetCalDetGain() const { return fCalDetGainUsed;}; |
4c865c34 | 81 | AliTRDCalDet *GetCalDetVdrift() const { return fCalDetVdriftUsed;}; |
b3fcfd96 | 82 | |
4c865c34 | 83 | Bool_t Init(const Char_t* fileName); |
84 | ||
b3fcfd96 | 85 | void CalibVdriftT0(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage=""); |
86 | void CalibGain(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage=""); | |
87 | void CalibPRF(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage=""); | |
a5dcf618 | 88 | void CalibChamberStatus(Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage=""); |
81a5aeca | 89 | |
b3fcfd96 | 90 | Bool_t ReadGainGlobal(const Char_t* fileName="CalibObjects.root"); |
91 | Bool_t ReadVdriftT0Global(const Char_t* fileName="CalibObjects.root"); | |
92 | Bool_t ReadVdriftLinearFitGlobal(const Char_t* fileName="CalibObjects.root"); | |
93 | Bool_t ReadPRFGlobal(const Char_t* fileName="CalibObjects.root"); | |
94 | ||
95 | Bool_t AnalyzeGain(); | |
96 | Bool_t AnalyzeVdriftT0(); | |
97 | Bool_t AnalyzeVdriftLinearFit(); | |
a5dcf618 | 98 | Bool_t AnalyzePRF(); |
99 | Bool_t AnalyzeChamberStatus(); | |
b3fcfd96 | 100 | |
01239968 | 101 | void CorrectFromDetGainUsed(); |
4c865c34 | 102 | void CorrectFromDetVdriftUsed(); |
a5dcf618 | 103 | |
b3fcfd96 | 104 | void UpdateOCDBT0(Int_t startRunNumber, Int_t endRunNumber, const char* storagePath); |
105 | void UpdateOCDBVdrift(Int_t startRunNumber, Int_t endRunNumber, const char* storagePath); | |
eec29d56 | 106 | void UpdateOCDBExB(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath); |
b3fcfd96 | 107 | void UpdateOCDBGain(Int_t startRunNumber, Int_t endRunNumber, const char* storagePath); |
108 | void UpdateOCDBPRF(Int_t startRunNumber, Int_t endRunNumber, const char* storagePath); | |
a5dcf618 | 109 | void UpdateOCDBChamberStatus(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath); |
b3fcfd96 | 110 | |
54f2ff1c | 111 | Bool_t ValidateGain(); |
00d203b6 | 112 | Bool_t ValidateVdrift(); |
113 | Bool_t ValidateT0(); | |
114 | Bool_t ValidatePRF() const; | |
82b413fd | 115 | Bool_t ValidateChamberStatus(); |
00d203b6 | 116 | |
82b413fd | 117 | Int_t GetStatus() const; |
118 | Int_t GetStatusPos() const { return fStatusPos; } | |
119 | Int_t GetStatusNeg() const { return fStatusNeg; } | |
4c865c34 | 120 | Int_t GetVersionGainUsed() const { return fVersionGainUsed; } |
121 | Int_t GetSubVersionGainUsed() const { return fSubVersionGainUsed; } | |
ca7e6e64 | 122 | Int_t GetFirstRunVdriftUsed() const { return fFirstRunVdriftUsed; } |
4c865c34 | 123 | Int_t GetVersionVdriftUsed() const { return fVersionVdriftUsed; } |
124 | Int_t GetSubVersionVdriftUsed() const { return fSubVersionVdriftUsed; } | |
a2a4ec8e | 125 | |
126 | void SetMinStatsVdriftT0PH(Int_t minStatsVdriftT0PH) { fMinStatsVdriftT0PH = minStatsVdriftT0PH; } | |
127 | void SetMinStatsVdriftLinear(Int_t minStatsVdriftLinear) { fMinStatsVdriftLinear = minStatsVdriftLinear; } | |
128 | void SetMinStatsGain(Int_t minStatsGain) { fMinStatsGain = minStatsGain; } | |
129 | void SetMinStatsPRF(Int_t minStatsPRF) { fMinStatsPRF = minStatsPRF; } | |
54f2ff1c | 130 | void SetBackCorrectGain(Bool_t backCorrectGain) { fBackCorrectGain = backCorrectGain; } |
131 | void SetBackCorrectVdrift(Bool_t backCorrectVdrift) { fBackCorrectVdrift = backCorrectVdrift; } | |
81a5aeca | 132 | |
a5dcf618 | 133 | |
4c865c34 | 134 | |
135 | private: | |
81a5aeca | 136 | Bool_t fMethodSecond; // Second Method for drift velocity |
137 | TString fNameList; // Name of the list | |
138 | AliTRDCalDet *fCalDetGainUsed; // CalDet used and to be corrected for | |
139 | AliTRDCalDet *fCalDetVdriftUsed; // CalDet used and to be corrected for | |
140 | TH2I *fCH2d; // Gain | |
141 | TProfile2D *fPH2d; // Drift velocity first method | |
142 | TProfile2D *fPRF2d; // PRF | |
b3fcfd96 | 143 | AliTRDCalibraVdriftLinearFit *fAliTRDCalibraVdriftLinearFit; // Drift velocity second method |
144 | TH1I *fNEvents; // Number of events | |
145 | TH2F *fAbsoluteGain; // Absolute Gain calibration | |
146 | TObjArray * fPlots; // array with some plots to check | |
147 | TObjArray * fCalibObjects; // array with calibration objects | |
4c865c34 | 148 | Int_t fVersionGainUsed; // VersionGainUsed |
149 | Int_t fSubVersionGainUsed; // SubVersionGainUsed | |
ca7e6e64 | 150 | Int_t fFirstRunVdriftUsed; // FirstRunVdrift |
4c865c34 | 151 | Int_t fVersionVdriftUsed; // VersionVdriftUsed |
152 | Int_t fSubVersionVdriftUsed; // SubVersionVdriftUsed | |
00d203b6 | 153 | Bool_t fSwitchOnValidation; // Validation |
154 | Bool_t fVdriftValidated; // Vdrift validation | |
155 | Bool_t fT0Validated; // T0 validation | |
a2a4ec8e | 156 | Int_t fMinStatsVdriftT0PH; // MinStats VdriftT0 |
157 | Int_t fMinStatsVdriftLinear; // MinStats Vdrift Linear | |
158 | Int_t fMinStatsGain; // MinStats Gain | |
159 | Int_t fMinStatsPRF; // MinStats PRF | |
54f2ff1c | 160 | Bool_t fBackCorrectGain; // Back correction afterwards gain |
161 | Bool_t fBackCorrectVdrift; // Back correction afterwards vdrift | |
162 | Bool_t fNotEnoughStatisticsForTheGain;// Take the chamber per chamber distribution from the default distribution | |
163 | Bool_t fNotEnoughStatisticsForTheVdriftLinear;// Take the chamber per chamber distribution from the default distribution | |
82b413fd | 164 | Int_t fStatusNeg; // Info but ok |
165 | Int_t fStatusPos; // Problems | |
a2a4ec8e | 166 | |
b3fcfd96 | 167 | |
4c865c34 | 168 | Int_t GetSubVersion(TString name) const; |
169 | Int_t GetVersion(TString name) const; | |
ca7e6e64 | 170 | Int_t GetFirstRun(TString name) const; |
b3fcfd96 | 171 | |
172 | ||
173 | ||
174 | private: | |
175 | AliTRDPreprocessorOffline& operator=(const AliTRDPreprocessorOffline&); // not implemented | |
176 | AliTRDPreprocessorOffline(const AliTRDPreprocessorOffline&); // not implemented | |
54f2ff1c | 177 | ClassDef(AliTRDPreprocessorOffline,2) |
b3fcfd96 | 178 | }; |
179 | ||
180 | #endif | |
01239968 | 181 | |
a5dcf618 | 182 |