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 {
58 static AliTRDcalibDB *Instance();
59 static void Terminate();
60 void SetRun(Long64_t run);
61 Long64_t GetRun() const { return fRun; }
63 Float_t GetNoise(Int_t det, Int_t col, Int_t row);
64 AliTRDCalROC *GetNoiseROC(Int_t det);
65 const AliTRDCalDet *GetNoiseDet();
67 Float_t GetVdrift(Int_t det, Int_t col, Int_t row);
68 Float_t GetVdriftAverage(Int_t det);
69 AliTRDCalROC *GetVdriftROC(Int_t det);
70 const AliTRDCalDet *GetVdriftDet();
72 const AliTRDCalDet *GetExBDet();
74 Float_t GetT0(Int_t det, Int_t col, Int_t row);
75 Float_t GetT0Average(Int_t det);
76 AliTRDCalROC *GetT0ROC(Int_t det);
77 const AliTRDCalDet *GetT0Det();
79 Float_t GetGainFactor(Int_t det, Int_t col, Int_t row);
80 Float_t GetGainFactorAverage(Int_t det);
81 AliTRDCalROC *GetGainFactorROC(Int_t det);
82 const AliTRDCalDet *GetGainFactorDet();
84 Float_t GetOnlineGainFactor(Int_t det, Int_t col, Int_t row);
85 AliTRDCalOnlineGainTableROC *GetOnlineGainTableROC(Int_t det);
87 AliTRDCalROC *GetPRFROC(Int_t det);
88 Float_t GetPRFWidth(Int_t det, Int_t col, Int_t row);
90 Float_t* GetSampledPRF() const { return fPRFsmp; };
91 Int_t GetPRFbin() const { return fPRFbin; };
92 Float_t GetPRFlo() const { return fPRFlo; };
93 Float_t GetPRFhi() const { return fPRFhi; };
95 Int_t ExtractTimeBinsFromString(TString tbstr);
96 Int_t GetNumberOfTimeBinsDCS();
97 void GetFilterType(TString &filterType);
98 void GetGlobalConfiguration(TString &config);
99 void GetGlobalConfigurationByChamber(TString &config,Int_t par, Int_t opt=0);
100 void GetGlobalConfigurationVersion(TString &version);
101 Int_t GetNumberOfParsDCS(TString cname, Char_t delimiter='_');
102 Int_t GetNumberOfOptsDCS(TString cname, Int_t cfgType);
103 void GetDCSConfigParOption(TString cname, Int_t cfgType, Int_t option, TString &cfgo);
105 Int_t GetOnlineGainTableID();
107 Bool_t HasOnlineFilterPedestal();
108 Bool_t HasOnlineFilterGain();
109 Bool_t HasOnlineTailCancellation();
111 Char_t GetPadStatus(Int_t det, Int_t col, Int_t row);
112 AliTRDCalSingleChamberStatus *GetPadStatusROC(Int_t det);
113 AliTRDrecoParam* GetRecoParam(Int_t *eventtype);
114 AliTRDPIDResponse *GetPIDResponse(AliTRDPIDResponse::ETRDPIDMethod m);
116 Char_t GetChamberStatus(Int_t det);
118 Bool_t IsPadMasked(Int_t det, Int_t col, Int_t row);
119 Bool_t IsPadBridgedLeft(Int_t det, Int_t col, Int_t row);
120 Bool_t IsPadBridgedRight(Int_t det, Int_t col, Int_t row);
121 Bool_t IsPadNotConnected(Int_t det, Int_t col, Int_t row);
123 Bool_t IsChamberGood(Int_t det);
124 Bool_t IsChamberNoData(Int_t det);
125 Bool_t IsHalfChamberNoData(Int_t det, Int_t side);
126 Bool_t IsChamberBadCalibrated(Int_t det);
127 Bool_t IsChamberNotCalibrated(Int_t det);
129 const AliTRDCalMonitoring *GetMonitoringObject();
130 const AliTRDCalPID *GetPIDObject(AliTRDpidUtil::ETRDPIDMethod m);
131 const AliTRDCalTrkAttach *GetAttachObject();
133 // Related functions, these depend on calibration data
134 Int_t PadResponse(Double_t signal, Double_t dist
135 , Int_t layer, Double_t *pad) const;
137 AliTRDtrapConfig* GetTrapConfig();
138 void GetTrapConfig(TString &name, TString &version) { name = fTrapConfigName; version = fTrapConfigVersion; }
139 void SetTrapConfig(const TString name, const TString version) { fTrapConfigName = name; fTrapConfigVersion = version; }
140 void SetTrapConfig(AliTRDtrapConfig *trapcfg) { fTrapConfig = trapcfg; }
145 AliTRDtrapConfig* LoadTrapConfig(const TString &name = "", const TString &version = "");
146 Int_t GetNumberOfTimeBinsDCSBoard(); // Old method as fallback for patched OCDB
147 virtual ~AliTRDcalibDB();
148 // For caching see also implentation of GetCachedCDBObject in the .cxx file
149 enum { kIDVdriftPad = 0
155 , kIDGainFactorChamber
156 , kIDOnlineGainFactor
175 , kCDBCacheSize }; // IDs of cached objects
177 const TObject *GetCachedCDBObject(Int_t id);
181 AliCDBEntry *GetCDBEntry(const Char_t *cdbPath);
182 const TObject *CacheCDBEntry(Int_t id, const Char_t *cdbPath);
184 static AliTRDcalibDB *fgInstance; // Instance of this class (singleton implementation)
185 static Bool_t fgTerminated; // Defines if this class has already been terminated
187 AliCDBEntry *fCDBEntries[kCDBCacheSize]; // Cache for CDB entries
188 TObject *fCDBCache[kCDBCacheSize]; // Cache for calibration objects.
190 Long64_t fRun; // Run Number
192 Float_t *fPRFsmp; //! Sampled pad response
193 Int_t fPRFbin; // Number of bins for the PRF
194 Float_t fPRFlo; // Lower boundary of the PRF
195 Float_t fPRFhi; // Higher boundary of the PRF
196 Float_t fPRFwid; // Bin width of the sampled PRF
197 Int_t fPRFpad; // Distance to next pad in PRF
199 AliTRDPIDResponse *fPIDResponse; // TRD PID Response function
201 Int_t fOnlineGainTableID; // ID for online gain table
203 AliTRDtrapConfig* fTrapConfig; // TRAP configuration
204 TString fTrapConfigName; // name of the TRAPconfig
205 TString fTrapConfigVersion; // version of the TRAPconfig
209 AliTRDcalibDB(); // This is a singleton, constructor is private!
210 AliTRDcalibDB(const AliTRDcalibDB &c);
211 AliTRDcalibDB &operator=(const AliTRDcalibDB &c);
213 ClassDef(AliTRDcalibDB, 8) // Provides central access to the CDB