1 #ifndef ALITRDPREPROCESSOROFFLINE_H
2 #define ALITRDPREPROCESSOROFFLINE_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
9 // Class to create OCDB entries - processing the results of the OFFLINE calibration
14 #include "AliTRDCalChamberStatus.h"
19 class AliTRDCalibraVdriftLinearFit;
25 class AliTRDPreprocessorOffline:public TNamed {
38 enum { kGainNotEnoughStatsButFill = 2,
39 kVdriftNotEnoughStatsButFill = 4,
40 kGainNotEnoughStatsNotFill = 8,
41 kVdriftNotEnoughStatsNotFill = 16,
42 kTimeOffsetNotEnoughStatsNotFill = 32,
44 enum { kGainErrorOld = 2,
48 kVdriftErrorRange = 32,
49 kTimeOffsetErrorRange = 64,
50 kChamberStatusErrorRange = 128};
53 AliTRDPreprocessorOffline();
54 virtual ~AliTRDPreprocessorOffline();
56 Bool_t IsGainNotEnoughStatsButFill() const
57 { return CheckStatus(fStatusNeg, kGainNotEnoughStatsButFill); };
58 Bool_t IsGainNotEnoughStatsNotFill() const
59 { return CheckStatus(fStatusNeg, kGainNotEnoughStatsNotFill); };
60 Bool_t IsVdriftNotEnoughStatsButFill() const
61 { return CheckStatus(fStatusNeg, kVdriftNotEnoughStatsButFill); };
62 Bool_t IsVdriftNotEnoughStatsNotFill() const
63 { return CheckStatus(fStatusNeg, kVdriftNotEnoughStatsNotFill); };
64 Bool_t IsTimeOffsetNotEnoughStatsNotFill() const
65 { return CheckStatus(fStatusNeg, kTimeOffsetNotEnoughStatsNotFill); };
66 Bool_t IsExBErrorRange() const
67 { return CheckStatus(fStatusNeg, kExBErrorRange); };
69 Bool_t IsGainErrorOld() const
70 { return CheckStatus(fStatusPos, kGainErrorOld); };
71 Bool_t IsVdriftErrorOld() const
72 { return CheckStatus(fStatusPos, kVdriftErrorOld); };
73 Bool_t IsExBErrorOld() const
74 { return CheckStatus(fStatusPos, kExBErrorOld); };
75 Bool_t IsGainErrorRange() const
76 { return CheckStatus(fStatusPos, kGainErrorRange); };
77 Bool_t IsVdriftErrorRange() const
78 { return CheckStatus(fStatusPos, kVdriftErrorRange); };
79 Bool_t IsTimeOffsetErrorRange() const
80 { return CheckStatus(fStatusPos, kTimeOffsetErrorRange); };
81 Bool_t IsChamberStatusErrorRange() const
82 { return CheckStatus(fStatusPos, kChamberStatusErrorRange); };
84 Bool_t CheckStatus(Int_t status, Int_t bitMask) const;
85 void PrintStatus() const;
88 void SetLinearFitForVdrift(Bool_t methodsecond) { fMethodSecond = methodsecond;};
89 Bool_t GetLinearFitForVdrift() const { return fMethodSecond;};
90 void SetNameList(TString nameList) { fNameList = nameList;};
91 TString GetNameList() const { return fNameList;};
92 void SetCalDetGain(AliTRDCalDet *calDetGainUsed) {fCalDetGainUsed = calDetGainUsed;};
93 void SetCalDetVdrift(AliTRDCalDet *calDetVdriftUsed);
94 void SetCalDetVdriftExB(AliTRDCalDet *calDetVdriftUsed,AliTRDCalDet *calDetExBUsed) {fCalDetVdriftUsed = calDetVdriftUsed; fCalDetExBUsed = calDetExBUsed;};
95 void SetSwitchOnValidation(Bool_t switchOnValidation) {fSwitchOnValidation = switchOnValidation;};
96 AliTRDCalDet *GetCalDetGain() const { return fCalDetGainUsed;};
97 AliTRDCalDet *GetCalDetVdrift() const { return fCalDetVdriftUsed;};
99 Bool_t Init(const Char_t* fileName);
101 void CalibVdriftT0(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage="");
102 void CalibGain(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage="");
103 void CalibPRF(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage="");
104 void CalibChamberStatus(Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage="");
106 Bool_t ReadGainGlobal(const Char_t* fileName="CalibObjects.root");
107 Bool_t ReadVdriftT0Global(const Char_t* fileName="CalibObjects.root");
108 Bool_t ReadVdriftLinearFitGlobal(const Char_t* fileName="CalibObjects.root");
109 Bool_t ReadPRFGlobal(const Char_t* fileName="CalibObjects.root");
111 Bool_t AnalyzeGain();
112 Bool_t AnalyzeVdriftT0();
113 Bool_t AnalyzeVdriftLinearFit();
115 Bool_t AnalyzeChamberStatus();
117 void CorrectFromDetGainUsed();
118 void CorrectFromDetVdriftUsed();
120 void UpdateOCDBT0(Int_t startRunNumber, Int_t endRunNumber, const char* storagePath);
121 void UpdateOCDBVdrift(Int_t startRunNumber, Int_t endRunNumber, const char* storagePath);
122 void UpdateOCDBExB(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath);
123 void UpdateOCDBGain(Int_t startRunNumber, Int_t endRunNumber, const char* storagePath);
124 void UpdateOCDBPRF(Int_t startRunNumber, Int_t endRunNumber, const char* storagePath);
125 void UpdateOCDBChamberStatus(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath);
127 Bool_t ValidateGain();
128 Bool_t ValidateVdrift();
129 Bool_t ValidateExB();
131 Bool_t ValidatePRF() const;
132 Bool_t ValidateChamberStatus();
134 Int_t GetStatus() const;
135 Int_t GetStatusPos() const { return fStatusPos; }
136 Int_t GetStatusNeg() const { return fStatusNeg; }
137 Int_t GetVersionGainUsed() const { return fVersionGainUsed; }
138 Int_t GetSubVersionGainUsed() const { return fSubVersionGainUsed; }
139 Int_t GetFirstRunVdriftUsed() const { return fFirstRunVdriftUsed; }
140 Int_t GetVersionVdriftUsed() const { return fVersionVdriftUsed; }
141 Int_t GetSubVersionVdriftUsed() const { return fSubVersionVdriftUsed; }
143 void SetMinStatsVdriftT0PH(Int_t minStatsVdriftT0PH) { fMinStatsVdriftT0PH = minStatsVdriftT0PH; }
144 void SetMinStatsVdriftLinear(Int_t minStatsVdriftLinear) { fMinStatsVdriftLinear = minStatsVdriftLinear; }
145 void SetMinStatsGain(Int_t minStatsGain) { fMinStatsGain = minStatsGain; }
146 void SetMinStatsPRF(Int_t minStatsPRF) { fMinStatsPRF = minStatsPRF; }
147 void SetBackCorrectGain(Bool_t backCorrectGain) { fBackCorrectGain = backCorrectGain; }
148 void SetBackCorrectVdrift(Bool_t backCorrectVdrift) { fBackCorrectVdrift = backCorrectVdrift; }
153 Bool_t fMethodSecond; // Second Method for drift velocity
154 TString fNameList; // Name of the list
155 AliTRDCalDet *fCalDetGainUsed; // CalDet used and to be corrected for
156 AliTRDCalDet *fCalDetVdriftUsed; // CalDet used and to be corrected for
157 AliTRDCalDet *fCalDetExBUsed; // CalDet used and to be corrected for
159 TProfile2D *fPH2d; // Drift velocity first method
160 TProfile2D *fPRF2d; // PRF
161 AliTRDCalibraVdriftLinearFit *fAliTRDCalibraVdriftLinearFit; // Drift velocity second method
162 TH1I *fNEvents; // Number of events
163 TH2F *fAbsoluteGain; // Absolute Gain calibration
164 TObjArray * fPlots; // array with some plots to check
165 TObjArray * fCalibObjects; // array with calibration objects
166 Int_t fVersionGainUsed; // VersionGainUsed
167 Int_t fSubVersionGainUsed; // SubVersionGainUsed
168 Int_t fFirstRunVdriftUsed; // FirstRunVdrift
169 Int_t fVersionVdriftUsed; // VersionVdriftUsed
170 Int_t fSubVersionVdriftUsed; // SubVersionVdriftUsed
171 Bool_t fSwitchOnValidation; // Validation
172 Bool_t fVdriftValidated; // Vdrift validation
173 Bool_t fExBValidated; // ExB validation
174 Bool_t fT0Validated; // T0 validation
175 Int_t fMinStatsVdriftT0PH; // MinStats VdriftT0
176 Int_t fMinStatsVdriftLinear; // MinStats Vdrift Linear
177 Int_t fMinStatsGain; // MinStats Gain
178 Int_t fMinStatsPRF; // MinStats PRF
179 Bool_t fBackCorrectGain; // Back correction afterwards gain
180 Bool_t fBackCorrectVdrift; // Back correction afterwards vdrift
181 Bool_t fNotEnoughStatisticsForTheGain;// Take the chamber per chamber distribution from the default distribution
182 Bool_t fNotEnoughStatisticsForTheVdriftLinear;// Take the chamber per chamber distribution from the default distribution
183 Int_t fStatusNeg; // Info but ok
184 Int_t fStatusPos; // Problems
187 Int_t GetSubVersion(TString name) const;
188 Int_t GetVersion(TString name) const;
189 Int_t GetFirstRun(TString name) const;
194 AliTRDPreprocessorOffline& operator=(const AliTRDPreprocessorOffline&); // not implemented
195 AliTRDPreprocessorOffline(const AliTRDPreprocessorOffline&); // not implemented
196 ClassDef(AliTRDPreprocessorOffline,2)