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"
26 #include "AliTRDCalTrapConfig.h"
27 #include "AliTRDtrapConfig.h"
33 class AliTRDrecoParam;
34 class AliTRDCalTrkAttach;
36 class AliTRDCalMonitoring;
39 class AliTRDCalSingleChamberStatus;
40 class AliTRDCalOnlineGainTableROC;
42 class AliTRDcalibDB : public TObject {
51 static AliTRDcalibDB *Instance();
52 static void Terminate();
54 void SetRun(Long64_t run);
55 Long64_t GetRun() const { return fRun; }
57 Float_t GetNoise(Int_t det, Int_t col, Int_t row);
58 AliTRDCalROC *GetNoiseROC(Int_t det);
59 const AliTRDCalDet *GetNoiseDet();
61 Float_t GetVdrift(Int_t det, Int_t col, Int_t row);
62 Float_t GetVdriftAverage(Int_t det);
63 AliTRDCalROC *GetVdriftROC(Int_t det);
64 const AliTRDCalDet *GetVdriftDet();
66 const AliTRDCalDet *GetExBDet();
68 Float_t GetT0(Int_t det, Int_t col, Int_t row);
69 Float_t GetT0Average(Int_t det);
70 AliTRDCalROC *GetT0ROC(Int_t det);
71 const AliTRDCalDet *GetT0Det();
73 Float_t GetGainFactor(Int_t det, Int_t col, Int_t row);
74 Float_t GetGainFactorAverage(Int_t det);
75 AliTRDCalROC *GetGainFactorROC(Int_t det);
76 const AliTRDCalDet *GetGainFactorDet();
78 Float_t GetOnlineGainFactor(Int_t det, Int_t col, Int_t row);
79 AliTRDCalOnlineGainTableROC *GetOnlineGainTableROC(Int_t det);
81 AliTRDCalROC *GetPRFROC(Int_t det);
82 Float_t GetPRFWidth(Int_t det, Int_t col, Int_t row);
84 Float_t* GetSampledPRF() const { return fPRFsmp; };
85 Int_t GetPRFbin() const { return fPRFbin; };
86 Float_t GetPRFlo() const { return fPRFlo; };
87 Float_t GetPRFhi() const { return fPRFhi; };
89 Int_t GetNumberOfTimeBinsDCS();
90 void GetFilterType(TString &filterType);
91 void GetGlobalConfiguration(TString &config);
92 void GetGlobalConfigurationVersion(TString &version);
94 Int_t GetOnlineGainTableID();
96 Bool_t HasOnlineFilterPedestal();
97 Bool_t HasOnlineFilterGain();
98 Bool_t HasOnlineTailCancellation();
100 Char_t GetPadStatus(Int_t det, Int_t col, Int_t row);
101 AliTRDCalSingleChamberStatus *GetPadStatusROC(Int_t det);
102 AliTRDrecoParam* GetRecoParam(Int_t *eventtype);
103 AliTRDPIDResponse *GetPIDResponse(AliTRDPIDResponse::ETRDPIDMethod m);
105 Char_t GetChamberStatus(Int_t det);
107 Bool_t IsPadMasked(Int_t det, Int_t col, Int_t row);
108 Bool_t IsPadBridgedLeft(Int_t det, Int_t col, Int_t row);
109 Bool_t IsPadBridgedRight(Int_t det, Int_t col, Int_t row);
110 Bool_t IsPadNotConnected(Int_t det, Int_t col, Int_t row);
112 Bool_t IsChamberGood(Int_t det);
113 Bool_t IsChamberNoData(Int_t det);
114 Bool_t IsHalfChamberNoData(Int_t det, Int_t side);
115 Bool_t IsChamberBadCalibrated(Int_t det);
117 const AliTRDCalMonitoring *GetMonitoringObject();
118 const AliTRDCalPID *GetPIDObject(AliTRDpidUtil::ETRDPIDMethod m);
119 const AliTRDCalTrkAttach *GetAttachObject();
121 // Related functions, these depend on calibration data
122 Int_t PadResponse(Double_t signal, Double_t dist
123 , Int_t layer, Double_t *pad) const;
125 AliTRDtrapConfig* GetTrapConfig();
126 void GetTrapConfig(TString &name, TString &version) { name = fTrapConfigName; version = fTrapConfigVersion; }
127 void SetTrapConfig(const TString name, const TString version) { fTrapConfigName = name; fTrapConfigVersion = version; }
128 void SetTrapConfig(AliTRDtrapConfig *trapcfg) { fTrapConfig = trapcfg; }
132 AliTRDtrapConfig* LoadTrapConfig(const TString &name = "", const TString &version = "");
134 // For caching see also implentation of GetCachedCDBObject in the .cxx file
135 enum { kIDVdriftPad = 0
141 , kIDGainFactorChamber
142 , kIDOnlineGainFactor
161 , kCDBCacheSize }; // IDs of cached objects
163 const TObject *GetCachedCDBObject(Int_t id);
168 AliCDBEntry *GetCDBEntry(const Char_t *cdbPath);
169 const TObject *CacheCDBEntry(Int_t id, const Char_t *cdbPath);
171 static AliTRDcalibDB *fgInstance; // Instance of this class (singleton implementation)
172 static Bool_t fgTerminated; // Defines if this class has already been terminated
174 AliCDBEntry *fCDBEntries[kCDBCacheSize]; // Cache for CDB entries
175 TObject *fCDBCache[kCDBCacheSize]; // Cache for calibration objects.
177 Long64_t fRun; // Run Number
179 Float_t *fPRFsmp; //! Sampled pad response
180 Int_t fPRFbin; // Number of bins for the PRF
181 Float_t fPRFlo; // Lower boundary of the PRF
182 Float_t fPRFhi; // Higher boundary of the PRF
183 Float_t fPRFwid; // Bin width of the sampled PRF
184 Int_t fPRFpad; // Distance to next pad in PRF
186 AliTRDPIDResponse *fPIDResponse; // TRD PID Response function
188 Int_t fOnlineGainTableID; // ID for online gain table
190 AliTRDtrapConfig* fTrapConfig; // TRAP configuration
191 TString fTrapConfigName; // name of the TRAPconfig
192 TString fTrapConfigVersion; // version of the TRAPconfig
196 AliTRDcalibDB(); // This is a singleton, constructor is private!
197 AliTRDcalibDB(const AliTRDcalibDB &c);
198 AliTRDcalibDB &operator=(const AliTRDcalibDB &c);
199 virtual ~AliTRDcalibDB();
201 ClassDef(AliTRDcalibDB, 8) // Provides central access to the CDB