1 #ifndef ALITRDCALIBDB_H
2 #define ALITRDCALIBDB_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
6 ///////////////////////////////////////////////////////////////////////////////
8 // Class providing the calibration parameters by accessing the CDB //
10 ///////////////////////////////////////////////////////////////////////////////
18 #ifndef ALITRDPIDUTIL_H
19 #include "AliTRDpidUtil.h"
22 #ifndef ALITRDPIDRESPONSE_H
23 #include "AliTRDPIDResponse.h"
30 class AliTRDrecoParam;
31 class AliTRDCalTrkAttach;
33 class AliTRDCalMonitoring;
36 class AliTRDCalSingleChamberStatus;
37 class AliTRDCalOnlineGainTableROC;
39 class AliTRDcalibDB : public TObject {
48 static AliTRDcalibDB *Instance();
49 static void Terminate();
51 void SetRun(Long64_t run);
52 Long64_t GetRun() const { return fRun; }
54 Float_t GetNoise(Int_t det, Int_t col, Int_t row);
55 AliTRDCalROC *GetNoiseROC(Int_t det);
56 const AliTRDCalDet *GetNoiseDet();
58 Float_t GetVdrift(Int_t det, Int_t col, Int_t row);
59 Float_t GetVdriftAverage(Int_t det);
60 AliTRDCalROC *GetVdriftROC(Int_t det);
61 const AliTRDCalDet *GetVdriftDet();
63 const AliTRDCalDet *GetExBDet();
65 Float_t GetT0(Int_t det, Int_t col, Int_t row);
66 Float_t GetT0Average(Int_t det);
67 AliTRDCalROC *GetT0ROC(Int_t det);
68 const AliTRDCalDet *GetT0Det();
70 Float_t GetGainFactor(Int_t det, Int_t col, Int_t row);
71 Float_t GetGainFactorAverage(Int_t det);
72 AliTRDCalROC *GetGainFactorROC(Int_t det);
73 const AliTRDCalDet *GetGainFactorDet();
75 Float_t GetOnlineGainFactor(Int_t det, Int_t col, Int_t row);
76 AliTRDCalOnlineGainTableROC *GetOnlineGainTableROC(Int_t det);
78 AliTRDCalROC *GetPRFROC(Int_t det);
79 Float_t GetPRFWidth(Int_t det, Int_t col, Int_t row);
81 Float_t* GetSampledPRF() const { return fPRFsmp; };
82 Int_t GetPRFbin() const { return fPRFbin; };
83 Float_t GetPRFlo() const { return fPRFlo; };
84 Float_t GetPRFhi() const { return fPRFhi; };
86 Int_t GetNumberOfTimeBinsDCS();
87 void GetFilterType(TString &filterType);
88 void GetGlobalConfiguration(TString &config);
89 void GetGlobalConfigurationVersion(TString &version);
91 Int_t GetOnlineGainTableID();
93 Bool_t HasOnlineFilterPedestal();
94 Bool_t HasOnlineFilterGain();
95 Bool_t HasOnlineTailCancellation();
97 Char_t GetPadStatus(Int_t det, Int_t col, Int_t row);
98 AliTRDCalSingleChamberStatus *GetPadStatusROC(Int_t det);
99 AliTRDrecoParam* GetRecoParam(Int_t *eventtype);
100 AliTRDPIDResponse *GetPIDResponse(AliTRDPIDResponse::ETRDPIDMethod m);
102 Char_t GetChamberStatus(Int_t det);
104 Bool_t IsPadMasked(Int_t det, Int_t col, Int_t row);
105 Bool_t IsPadBridgedLeft(Int_t det, Int_t col, Int_t row);
106 Bool_t IsPadBridgedRight(Int_t det, Int_t col, Int_t row);
107 Bool_t IsPadNotConnected(Int_t det, Int_t col, Int_t row);
109 Bool_t IsChamberGood(Int_t det);
110 Bool_t IsChamberNoData(Int_t det);
111 Bool_t IsHalfChamberNoData(Int_t det, Int_t side);
112 Bool_t IsChamberBadCalibrated(Int_t det);
114 const AliTRDCalMonitoring *GetMonitoringObject();
115 const AliTRDCalPID *GetPIDObject(AliTRDpidUtil::ETRDPIDMethod m);
116 const AliTRDCalTrkAttach *GetAttachObject();
118 // Related functions, these depend on calibration data
119 Int_t PadResponse(Double_t signal, Double_t dist
120 , Int_t layer, Double_t *pad) const;
124 // For caching see also implentation of GetCachedCDBObject in the .cxx file
125 enum { kIDVdriftPad = 0
131 , kIDGainFactorChamber
132 , kIDOnlineGainFactor
150 , kCDBCacheSize }; // IDs of cached objects
152 const TObject *GetCachedCDBObject(Int_t id);
157 AliCDBEntry *GetCDBEntry(const Char_t *cdbPath);
158 const TObject *CacheCDBEntry(Int_t id, const Char_t *cdbPath);
160 static AliTRDcalibDB *fgInstance; // Instance of this class (singleton implementation)
161 static Bool_t fgTerminated; // Defines if this class has already been terminated
163 AliCDBEntry *fCDBEntries[kCDBCacheSize]; // Cache for CDB entries
164 TObject *fCDBCache[kCDBCacheSize]; // Cache for calibration objects.
166 Long64_t fRun; // Run Number
168 Float_t *fPRFsmp; //! Sampled pad response
169 Int_t fPRFbin; // Number of bins for the PRF
170 Float_t fPRFlo; // Lower boundary of the PRF
171 Float_t fPRFhi; // Higher boundary of the PRF
172 Float_t fPRFwid; // Bin width of the sampled PRF
173 Int_t fPRFpad; // Distance to next pad in PRF
175 AliTRDPIDResponse *fPIDResponse; // TRD PID Response function
177 Int_t fOnlineGainTableID; // ID for online gain table
181 AliTRDcalibDB(); // This is a singleton, constructor is private!
182 AliTRDcalibDB(const AliTRDcalibDB &c);
183 AliTRDcalibDB &operator=(const AliTRDcalibDB &c);
184 virtual ~AliTRDcalibDB();
186 ClassDef(AliTRDcalibDB, 7) // Provides central access to the CDB