]>
Commit | Line | Data |
---|---|---|
3551db50 | 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 */ | |
5 | ||
6 | /////////////////////////////////////////////////////////////////////////////// | |
7 | // // | |
8 | // Class providing the calibration parameters by accessing the CDB // | |
9 | // // | |
10 | /////////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | /* $Id$ */ | |
13 | ||
3551db50 | 14 | #include "TObject.h" |
15 | ||
2745a409 | 16 | class AliCDBEntry; |
3551db50 | 17 | |
cc7cef99 | 18 | class AliTRDCalPIDLQ; |
7754cd1f | 19 | class AliTRDCalMonitoring; |
56178ff4 | 20 | class AliTRDCalROC; |
21 | class AliTRDCalDet; | |
3551db50 | 22 | |
2745a409 | 23 | class AliTRDcalibDB : public TObject { |
24 | ||
25 | public: | |
26 | ||
b43a3e17 | 27 | enum { kNplan = 6 |
28 | , kNcham = 5 | |
29 | , kNsect = 18 | |
30 | , kNdet = 540 }; | |
6a739e92 | 31 | |
56178ff4 | 32 | static AliTRDcalibDB *Instance(); |
33 | static void Terminate(); | |
3551db50 | 34 | |
56178ff4 | 35 | void SetRun(Long64_t run); |
36 | Long64_t GetRun() { return fRun; } | |
7754cd1f | 37 | |
56178ff4 | 38 | Float_t GetVdrift(Int_t det, Int_t col, Int_t row); |
39 | Float_t GetVdriftAverage(Int_t det); | |
7754cd1f | 40 | |
56178ff4 | 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(); | |
7754cd1f | 45 | |
56178ff4 | 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(); | |
3551db50 | 50 | |
56178ff4 | 51 | Float_t GetPRFWidth(Int_t det, Int_t col, Int_t row); |
7754cd1f | 52 | |
56178ff4 | 53 | Int_t GetNumberOfTimeBins(); |
7754cd1f | 54 | |
56178ff4 | 55 | Char_t GetPadStatus(Int_t det, Int_t col, Int_t row); |
56 | Char_t GetChamberStatus(Int_t det); | |
7754cd1f | 57 | |
56178ff4 | 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); | |
3551db50 | 61 | |
56178ff4 | 62 | Bool_t IsChamberInstalled(Int_t det); |
63 | Bool_t IsChamberMasked(Int_t det); | |
7754cd1f | 64 | |
2745a409 | 65 | const AliTRDCalMonitoring *GetMonitoringObject(); |
66 | const AliTRDCalPIDLQ *GetPIDLQObject(); | |
7754cd1f | 67 | |
2745a409 | 68 | // Related functions, these depend on calibration data |
56178ff4 | 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; | |
3551db50 | 72 | |
2745a409 | 73 | protected: |
74 | ||
75 | // For caching see also implentation of GetCachedCDBObject in the .cxx file | |
11f5dd43 | 76 | enum { kCDBCacheSize = 15 }; // Number of cached objects |
b43a3e17 | 77 | enum { kIDVdriftPad = 0 |
78 | , kIDVdriftChamber | |
79 | , kIDT0Pad | |
80 | , kIDT0Chamber | |
81 | , kIDGainFactorPad | |
82 | , kIDGainFactorChamber | |
83 | , kIDPRFWidth | |
84 | , kIDGlobals | |
85 | , kIDChamberPos | |
86 | , kIDStackPos | |
87 | , kIDSuperModulePos | |
88 | , kIDPIDLQ | |
89 | , kIDMonitoringData | |
90 | , kIDChamberStatus | |
91 | , kIDPadStatus }; // IDs of cached objects | |
7754cd1f | 92 | |
56178ff4 | 93 | const TObject *GetCachedCDBObject(Int_t id); |
3551db50 | 94 | |
2745a409 | 95 | void Invalidate(); |
96 | void SamplePRF(); | |
6a739e92 | 97 | |
b43a3e17 | 98 | AliCDBEntry *GetCDBEntry(const Char_t *cdbPath); |
99 | const TObject *CacheCDBEntry(Int_t id, const Char_t *cdbPath); | |
7754cd1f | 100 | |
2745a409 | 101 | static AliTRDcalibDB *fgInstance; // Instance of this class (singleton implementation) |
102 | static Bool_t fgTerminated; // Defines if this class has already been terminated | |
6d50f529 | 103 | |
2745a409 | 104 | AliCDBEntry *fCDBEntries[kCDBCacheSize]; // Cache for CDB entries |
105 | TObject *fCDBCache[kCDBCacheSize]; // Cache for calibration objects. | |
6a739e92 | 106 | |
2745a409 | 107 | Long64_t fRun; // Run Number |
3551db50 | 108 | |
6d50f529 | 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 | |
6a739e92 | 115 | |
2745a409 | 116 | private: |
117 | ||
118 | AliTRDcalibDB(); // This is a singleton, constructor is private! | |
119 | AliTRDcalibDB(const AliTRDcalibDB &c); | |
120 | AliTRDcalibDB &operator=(const AliTRDcalibDB &c); | |
3551db50 | 121 | virtual ~AliTRDcalibDB(); |
122 | ||
b43a3e17 | 123 | ClassDef(AliTRDcalibDB,3) // Provides central access to the CDB |
2745a409 | 124 | |
3551db50 | 125 | }; |
126 | ||
3551db50 | 127 | #endif |