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 Float_t GetT0(Int_t det, Int_t col, Int_t row);
64 Float_t GetT0Average(Int_t det);
65 AliTRDCalROC *GetT0ROC(Int_t det);
66 const AliTRDCalDet *GetT0Det();
68 Float_t GetGainFactor(Int_t det, Int_t col, Int_t row);
69 Float_t GetGainFactorAverage(Int_t det);
70 AliTRDCalROC *GetGainFactorROC(Int_t det);
71 const AliTRDCalDet *GetGainFactorDet();
73 Float_t GetOnlineGainFactor(Int_t det, Int_t col, Int_t row);
74 AliTRDCalOnlineGainTableROC *GetOnlineGainTableROC(Int_t det);
76 AliTRDCalROC *GetPRFROC(Int_t det);
77 Float_t GetPRFWidth(Int_t det, Int_t col, Int_t row);
79 Float_t* GetSampledPRF() const { return fPRFsmp; };
80 Int_t GetPRFbin() const { return fPRFbin; };
81 Float_t GetPRFlo() const { return fPRFlo; };
82 Float_t GetPRFhi() const { return fPRFhi; };
84 Int_t GetNumberOfTimeBinsDCS();
85 void GetFilterType(TString &filterType);
86 void GetGlobalConfiguration(TString &config);
88 Int_t GetOnlineGainTableID();
90 Bool_t HasOnlineFilterPedestal();
91 Bool_t HasOnlineFilterGain();
92 Bool_t HasOnlineTailCancellation();
94 Char_t GetPadStatus(Int_t det, Int_t col, Int_t row);
95 AliTRDCalSingleChamberStatus *GetPadStatusROC(Int_t det);
96 AliTRDrecoParam* GetRecoParam(Int_t *eventtype);
97 AliTRDPIDResponse *GetPIDResponse(AliTRDPIDResponse::ETRDPIDMethod m);
99 Char_t GetChamberStatus(Int_t det);
101 Bool_t IsPadMasked(Int_t det, Int_t col, Int_t row);
102 Bool_t IsPadBridgedLeft(Int_t det, Int_t col, Int_t row);
103 Bool_t IsPadBridgedRight(Int_t det, Int_t col, Int_t row);
104 Bool_t IsPadNotConnected(Int_t det, Int_t col, Int_t row);
106 Bool_t IsChamberInstalled(Int_t det);
107 Bool_t IsChamberMasked(Int_t det);
108 Bool_t IsHalfChamberMasked(Int_t det, Int_t side);
110 const AliTRDCalMonitoring *GetMonitoringObject();
111 const AliTRDCalPID *GetPIDObject(AliTRDpidUtil::ETRDPIDMethod m);
112 const AliTRDCalTrkAttach *GetAttachObject();
114 // Related functions, these depend on calibration data
115 Int_t PadResponse(Double_t signal, Double_t dist
116 , Int_t layer, Double_t *pad) const;
120 // For caching see also implentation of GetCachedCDBObject in the .cxx file
121 enum { kIDVdriftPad = 0
126 , kIDGainFactorChamber
127 , kIDOnlineGainFactor
144 , kCDBCacheSize }; // IDs of cached objects
146 const TObject *GetCachedCDBObject(Int_t id);
151 AliCDBEntry *GetCDBEntry(const Char_t *cdbPath);
152 const TObject *CacheCDBEntry(Int_t id, const Char_t *cdbPath);
154 static AliTRDcalibDB *fgInstance; // Instance of this class (singleton implementation)
155 static Bool_t fgTerminated; // Defines if this class has already been terminated
157 AliCDBEntry *fCDBEntries[kCDBCacheSize]; // Cache for CDB entries
158 TObject *fCDBCache[kCDBCacheSize]; // Cache for calibration objects.
160 Long64_t fRun; // Run Number
162 Float_t *fPRFsmp; //! Sampled pad response
163 Int_t fPRFbin; // Number of bins for the PRF
164 Float_t fPRFlo; // Lower boundary of the PRF
165 Float_t fPRFhi; // Higher boundary of the PRF
166 Float_t fPRFwid; // Bin width of the sampled PRF
167 Int_t fPRFpad; // Distance to next pad in PRF
169 AliTRDPIDResponse *fPIDResponse; // TRD PID Response function
171 Int_t fOnlineGainTableID; // ID for online gain table
175 AliTRDcalibDB(); // This is a singleton, constructor is private!
176 AliTRDcalibDB(const AliTRDcalibDB &c);
177 AliTRDcalibDB &operator=(const AliTRDcalibDB &c);
178 virtual ~AliTRDcalibDB();
180 ClassDef(AliTRDcalibDB, 7) // Provides central access to the CDB