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 {
39 AliTRDPreprocessorOffline();
40 virtual ~AliTRDPreprocessorOffline();
42 void SetLinearFitForVdrift(Bool_t methodsecond) { fMethodSecond = methodsecond;};
43 Bool_t GetLinearFitForVdrift() const { return fMethodSecond;};
44 void SetNameList(TString nameList) { fNameList = nameList;};
45 TString GetNameList() const { return fNameList;};
46 void SetCalDetGain(AliTRDCalDet *calDetGainUsed) {fCalDetGainUsed = calDetGainUsed;};
47 void SetCalDetVdrift(AliTRDCalDet *calDetVdriftUsed) {fCalDetVdriftUsed = calDetVdriftUsed;};
48 void SetSwitchOnValidation(Bool_t switchOnValidation) {fSwitchOnValidation = switchOnValidation;};
49 AliTRDCalDet *GetCalDetGain() const { return fCalDetGainUsed;};
50 AliTRDCalDet *GetCalDetVdrift() const { return fCalDetVdriftUsed;};
52 Bool_t Init(const Char_t* fileName);
54 void CalibVdriftT0(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage="");
55 void CalibGain(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage="");
56 void CalibPRF(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage="");
57 void CalibChamberStatus(Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage="");
59 Bool_t ReadGainGlobal(const Char_t* fileName="CalibObjects.root");
60 Bool_t ReadVdriftT0Global(const Char_t* fileName="CalibObjects.root");
61 Bool_t ReadVdriftLinearFitGlobal(const Char_t* fileName="CalibObjects.root");
62 Bool_t ReadPRFGlobal(const Char_t* fileName="CalibObjects.root");
65 Bool_t AnalyzeVdriftT0();
66 Bool_t AnalyzeVdriftLinearFit();
68 Bool_t AnalyzeChamberStatus();
70 void CorrectFromDetGainUsed();
71 void CorrectFromDetVdriftUsed();
73 void UpdateOCDBT0(Int_t startRunNumber, Int_t endRunNumber, const char* storagePath);
74 void UpdateOCDBVdrift(Int_t startRunNumber, Int_t endRunNumber, const char* storagePath);
75 void UpdateOCDBExB(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath);
76 void UpdateOCDBGain(Int_t startRunNumber, Int_t endRunNumber, const char* storagePath);
77 void UpdateOCDBPRF(Int_t startRunNumber, Int_t endRunNumber, const char* storagePath);
78 void UpdateOCDBChamberStatus(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath);
80 Bool_t ValidateGain();
81 Bool_t ValidateVdrift();
83 Bool_t ValidatePRF() const;
84 Bool_t ValidateChamberStatus() const;
86 Int_t GetStatus() const { return fStatus; }
87 Int_t GetVersionGainUsed() const { return fVersionGainUsed; }
88 Int_t GetSubVersionGainUsed() const { return fSubVersionGainUsed; }
89 Int_t GetFirstRunVdriftUsed() const { return fFirstRunVdriftUsed; }
90 Int_t GetVersionVdriftUsed() const { return fVersionVdriftUsed; }
91 Int_t GetSubVersionVdriftUsed() const { return fSubVersionVdriftUsed; }
93 void SetMinStatsVdriftT0PH(Int_t minStatsVdriftT0PH) { fMinStatsVdriftT0PH = minStatsVdriftT0PH; }
94 void SetMinStatsVdriftLinear(Int_t minStatsVdriftLinear) { fMinStatsVdriftLinear = minStatsVdriftLinear; }
95 void SetMinStatsGain(Int_t minStatsGain) { fMinStatsGain = minStatsGain; }
96 void SetMinStatsPRF(Int_t minStatsPRF) { fMinStatsPRF = minStatsPRF; }
97 void SetBackCorrectGain(Bool_t backCorrectGain) { fBackCorrectGain = backCorrectGain; }
98 void SetBackCorrectVdrift(Bool_t backCorrectVdrift) { fBackCorrectVdrift = backCorrectVdrift; }
103 Bool_t fMethodSecond; // Second Method for drift velocity
104 TString fNameList; // Name of the list
105 AliTRDCalDet *fCalDetGainUsed; // CalDet used and to be corrected for
106 AliTRDCalDet *fCalDetVdriftUsed; // CalDet used and to be corrected for
108 TProfile2D *fPH2d; // Drift velocity first method
109 TProfile2D *fPRF2d; // PRF
110 AliTRDCalibraVdriftLinearFit *fAliTRDCalibraVdriftLinearFit; // Drift velocity second method
111 TH1I *fNEvents; // Number of events
112 TH2F *fAbsoluteGain; // Absolute Gain calibration
113 TObjArray * fPlots; // array with some plots to check
114 TObjArray * fCalibObjects; // array with calibration objects
115 Int_t fVersionGainUsed; // VersionGainUsed
116 Int_t fSubVersionGainUsed; // SubVersionGainUsed
117 Int_t fFirstRunVdriftUsed; // FirstRunVdrift
118 Int_t fVersionVdriftUsed; // VersionVdriftUsed
119 Int_t fSubVersionVdriftUsed; // SubVersionVdriftUsed
120 Bool_t fSwitchOnValidation; // Validation
121 Bool_t fVdriftValidated; // Vdrift validation
122 Bool_t fT0Validated; // T0 validation
123 Int_t fMinStatsVdriftT0PH; // MinStats VdriftT0
124 Int_t fMinStatsVdriftLinear; // MinStats Vdrift Linear
125 Int_t fMinStatsGain; // MinStats Gain
126 Int_t fMinStatsPRF; // MinStats PRF
127 Bool_t fBackCorrectGain; // Back correction afterwards gain
128 Bool_t fBackCorrectVdrift; // Back correction afterwards vdrift
129 Bool_t fNotEnoughStatisticsForTheGain;// Take the chamber per chamber distribution from the default distribution
130 Bool_t fNotEnoughStatisticsForTheVdriftLinear;// Take the chamber per chamber distribution from the default distribution
131 Int_t fStatus; // Status of the TRD offline preprocessor: -1 nothing but do not worry; 0 everything ok; 1 not enough stat vdrift, 2 not enough stat to, 3 not enough stat gain and chammber status, 4 not enough stat vdrift but could put a mean, 5 not enough stat gain but could put a mean
134 Int_t GetSubVersion(TString name) const;
135 Int_t GetVersion(TString name) const;
136 Int_t GetFirstRun(TString name) const;
141 AliTRDPreprocessorOffline& operator=(const AliTRDPreprocessorOffline&); // not implemented
142 AliTRDPreprocessorOffline(const AliTRDPreprocessorOffline&); // not implemented
143 ClassDef(AliTRDPreprocessorOffline,2)