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;
22 class AliTRDCalSingleChamberStatus;
24 class AliTRDcalibDB : public TObject {
33 static AliTRDcalibDB *Instance();
34 static void Terminate();
36 void SetRun(Long64_t run);
37 Long64_t GetRun() const { return fRun; }
39 Float_t GetVdrift(Int_t det, Int_t col, Int_t row);
40 Float_t GetVdriftAverage(Int_t det);
41 AliTRDCalROC *GetVdriftROC(Int_t det);
42 const AliTRDCalDet *GetVdriftDet();
44 Float_t GetT0(Int_t det, Int_t col, Int_t row);
45 Float_t GetT0Average(Int_t det);
46 AliTRDCalROC *GetT0ROC(Int_t det);
47 const AliTRDCalDet *GetT0Det();
49 Float_t GetGainFactor(Int_t det, Int_t col, Int_t row);
50 Float_t GetGainFactorAverage(Int_t det);
51 AliTRDCalROC *GetGainFactorROC(Int_t det);
52 const AliTRDCalDet *GetGainFactorDet();
54 AliTRDCalROC *GetPRFROC(Int_t det);
55 Float_t GetPRFWidth(Int_t det, Int_t col, Int_t row);
57 Float_t* GetSampledPRF() { return fPRFsmp; };
58 Int_t GetPRFbin() { return fPRFbin; };
59 Float_t GetPRFlo() { return fPRFlo; };
60 Float_t GetPRFhi() { return fPRFhi; };
62 Int_t GetNumberOfTimeBins();
64 Char_t GetPadStatus(Int_t det, Int_t col, Int_t row);
65 AliTRDCalSingleChamberStatus *GetPadStatusROC(Int_t det);
67 Char_t GetChamberStatus(Int_t det);
69 Bool_t IsPadMasked(Int_t det, Int_t col, Int_t row);
70 Bool_t IsPadBridgedLeft(Int_t det, Int_t col, Int_t row);
71 Bool_t IsPadBridgedRight(Int_t det, Int_t col, Int_t row);
72 Bool_t IsPadNotConnected(Int_t det, Int_t col, Int_t row);
74 Bool_t IsChamberInstalled(Int_t det);
75 Bool_t IsChamberMasked(Int_t det);
77 const AliTRDCalMonitoring *GetMonitoringObject();
78 const AliTRDCalPID *GetPIDObject(const Int_t method);
80 // Related functions, these depend on calibration data
81 static Float_t GetOmegaTau(Float_t vdrift, Float_t bz);
82 Int_t PadResponse(Double_t signal, Double_t dist
83 , Int_t plane, Double_t *pad) const;
87 // For caching see also implentation of GetCachedCDBObject in the .cxx file
88 enum { kCDBCacheSize = 16 }; // Number of cached objects
89 enum { kIDVdriftPad = 0
94 , kIDGainFactorChamber
104 , kIDPadStatus }; // IDs of cached objects
106 const TObject *GetCachedCDBObject(Int_t id);
111 AliCDBEntry *GetCDBEntry(const Char_t *cdbPath);
112 const TObject *CacheCDBEntry(Int_t id, const Char_t *cdbPath);
114 static AliTRDcalibDB *fgInstance; // Instance of this class (singleton implementation)
115 static Bool_t fgTerminated; // Defines if this class has already been terminated
117 AliCDBEntry *fCDBEntries[kCDBCacheSize]; // Cache for CDB entries
118 TObject *fCDBCache[kCDBCacheSize]; // Cache for calibration objects.
120 Long64_t fRun; // Run Number
122 Float_t *fPRFsmp; //! Sampled pad response
123 Int_t fPRFbin; // Number of bins for the PRF
124 Float_t fPRFlo; // Lower boundary of the PRF
125 Float_t fPRFhi; // Higher boundary of the PRF
126 Float_t fPRFwid; // Bin width of the sampled PRF
127 Int_t fPRFpad; // Distance to next pad in PRF
131 AliTRDcalibDB(); // This is a singleton, constructor is private!
132 AliTRDcalibDB(const AliTRDcalibDB &c);
133 AliTRDcalibDB &operator=(const AliTRDcalibDB &c);
134 virtual ~AliTRDcalibDB();
136 ClassDef(AliTRDcalibDB,3) // Provides central access to the CDB