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 ///////////////////////////////////////////////////////////////////////////////
19 class AliTRDCalMonitoring;
23 class AliTRDcalibDB : public TObject {
32 static AliTRDcalibDB *Instance();
33 static void Terminate();
35 void SetRun(Long64_t run);
36 Long64_t GetRun() { return fRun; }
38 Float_t GetVdrift(Int_t det, Int_t col, Int_t row);
39 Float_t GetVdriftAverage(Int_t det);
41 Float_t GetT0(Int_t det, Int_t col, Int_t row);
42 Float_t GetT0Average(Int_t det);
43 AliTRDCalROC *GetT0ROC(Int_t det);
44 const AliTRDCalDet *GetT0Det();
46 Float_t GetGainFactor(Int_t det, Int_t col, Int_t row);
47 Float_t GetGainFactorAverage(Int_t det);
48 AliTRDCalROC *GetGainFactorROC(Int_t det);
49 const AliTRDCalDet *GetGainFactorDet();
51 Float_t GetPRFWidth(Int_t det, Int_t col, Int_t row);
53 Int_t GetNumberOfTimeBins();
55 Char_t GetPadStatus(Int_t det, Int_t col, Int_t row);
56 Char_t GetChamberStatus(Int_t det);
58 Bool_t IsPadMasked(Int_t det, Int_t col, Int_t row);
59 Bool_t IsPadBridgedLeft(Int_t det, Int_t col, Int_t row);
60 Bool_t IsPadBridgedRight(Int_t det, Int_t col, Int_t row);
62 Bool_t IsChamberInstalled(Int_t det);
63 Bool_t IsChamberMasked(Int_t det);
65 const AliTRDCalMonitoring *GetMonitoringObject();
66 const AliTRDCalPIDLQ *GetPIDLQObject();
68 // Related functions, these depend on calibration data
69 static Float_t GetOmegaTau(Float_t vdrift, Float_t bz);
70 Int_t PadResponse(Double_t signal, Double_t dist
71 , Int_t plane, Double_t *pad) const;
75 // For caching see also implentation of GetCachedCDBObject in the .cxx file
76 enum { kCDBCacheSize = 15 }; // Number of cached objects
77 enum { kIDVdriftPad = 0
82 , kIDGainFactorChamber
91 , kIDPadStatus }; // IDs of cached objects
93 const TObject *GetCachedCDBObject(Int_t id);
98 AliCDBEntry *GetCDBEntry(const Char_t *cdbPath);
99 const TObject *CacheCDBEntry(Int_t id, const Char_t *cdbPath);
101 static AliTRDcalibDB *fgInstance; // Instance of this class (singleton implementation)
102 static Bool_t fgTerminated; // Defines if this class has already been terminated
104 AliCDBEntry *fCDBEntries[kCDBCacheSize]; // Cache for CDB entries
105 TObject *fCDBCache[kCDBCacheSize]; // Cache for calibration objects.
107 Long64_t fRun; // Run Number
109 Float_t *fPRFsmp; //! Sampled pad response
110 Int_t fPRFbin; // Number of bins for the PRF
111 Float_t fPRFlo; // Lower boundary of the PRF
112 Float_t fPRFhi; // Higher boundary of the PRF
113 Float_t fPRFwid; // Bin width of the sampled PRF
114 Int_t fPRFpad; // Distance to next pad in PRF
118 AliTRDcalibDB(); // This is a singleton, constructor is private!
119 AliTRDcalibDB(const AliTRDcalibDB &c);
120 AliTRDcalibDB &operator=(const AliTRDcalibDB &c);
121 virtual ~AliTRDcalibDB();
123 ClassDef(AliTRDcalibDB,3) // Provides central access to the CDB