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);
40 AliTRDCalROC *GetVdriftROC(Int_t det);
41 const AliTRDCalDet *GetVdriftDet();
43 Float_t GetT0(Int_t det, Int_t col, Int_t row);
44 Float_t GetT0Average(Int_t det);
45 AliTRDCalROC *GetT0ROC(Int_t det);
46 const AliTRDCalDet *GetT0Det();
48 Float_t GetGainFactor(Int_t det, Int_t col, Int_t row);
49 Float_t GetGainFactorAverage(Int_t det);
50 AliTRDCalROC *GetGainFactorROC(Int_t det);
51 const AliTRDCalDet *GetGainFactorDet();
53 AliTRDCalROC *GetPRFROC(Int_t det);
54 Float_t GetPRFWidth(Int_t det, Int_t col, Int_t row);
56 Int_t GetNumberOfTimeBins();
58 Char_t GetPadStatus(Int_t det, Int_t col, Int_t row);
59 Char_t GetChamberStatus(Int_t det);
61 Bool_t IsPadMasked(Int_t det, Int_t col, Int_t row);
62 Bool_t IsPadBridgedLeft(Int_t det, Int_t col, Int_t row);
63 Bool_t IsPadBridgedRight(Int_t det, Int_t col, Int_t row);
65 Bool_t IsChamberInstalled(Int_t det);
66 Bool_t IsChamberMasked(Int_t det);
68 const AliTRDCalMonitoring *GetMonitoringObject();
69 const AliTRDCalPIDLQ *GetPIDLQObject();
71 // Related functions, these depend on calibration data
72 static Float_t GetOmegaTau(Float_t vdrift, Float_t bz);
73 Int_t PadResponse(Double_t signal, Double_t dist
74 , Int_t plane, Double_t *pad) const;
78 // For caching see also implentation of GetCachedCDBObject in the .cxx file
79 enum { kCDBCacheSize = 15 }; // Number of cached objects
80 enum { kIDVdriftPad = 0
85 , kIDGainFactorChamber
94 , kIDPadStatus }; // IDs of cached objects
96 const TObject *GetCachedCDBObject(Int_t id);
101 AliCDBEntry *GetCDBEntry(const Char_t *cdbPath);
102 const TObject *CacheCDBEntry(Int_t id, const Char_t *cdbPath);
104 static AliTRDcalibDB *fgInstance; // Instance of this class (singleton implementation)
105 static Bool_t fgTerminated; // Defines if this class has already been terminated
107 AliCDBEntry *fCDBEntries[kCDBCacheSize]; // Cache for CDB entries
108 TObject *fCDBCache[kCDBCacheSize]; // Cache for calibration objects.
110 Long64_t fRun; // Run Number
112 Float_t *fPRFsmp; //! Sampled pad response
113 Int_t fPRFbin; // Number of bins for the PRF
114 Float_t fPRFlo; // Lower boundary of the PRF
115 Float_t fPRFhi; // Higher boundary of the PRF
116 Float_t fPRFwid; // Bin width of the sampled PRF
117 Int_t fPRFpad; // Distance to next pad in PRF
121 AliTRDcalibDB(); // This is a singleton, constructor is private!
122 AliTRDcalibDB(const AliTRDcalibDB &c);
123 AliTRDcalibDB &operator=(const AliTRDcalibDB &c);
124 virtual ~AliTRDcalibDB();
126 ClassDef(AliTRDcalibDB,3) // Provides central access to the CDB