]>
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; |
3551db50 | 20 | |
2745a409 | 21 | class AliTRDcalibDB : public TObject { |
22 | ||
23 | public: | |
24 | ||
6a739e92 | 25 | enum { kNplan = 6, kNcham = 5, kNsect = 18, kNdet = 540 }; |
26 | ||
2745a409 | 27 | static AliTRDcalibDB *Instance(); |
28 | static void Terminate(); | |
3551db50 | 29 | |
2745a409 | 30 | void SetRun(Long64_t run); |
7754cd1f | 31 | Long64_t GetRun() { return fRun; } |
32 | ||
2745a409 | 33 | Float_t GetVdrift(Int_t det, Int_t col, Int_t row); |
34 | Float_t GetVdriftAverage(Int_t det); | |
7754cd1f | 35 | |
2745a409 | 36 | Float_t GetT0(Int_t det, Int_t col, Int_t row); |
37 | Float_t GetT0Average(Int_t det); | |
7754cd1f | 38 | |
2745a409 | 39 | Float_t GetGainFactor(Int_t det, Int_t col, Int_t row); |
40 | Float_t GetGainFactorAverage(Int_t det); | |
3551db50 | 41 | |
2745a409 | 42 | Float_t GetPRFWidth(Int_t det, Int_t col, Int_t row); |
7754cd1f | 43 | |
2745a409 | 44 | Float_t GetSamplingFrequency(); |
45 | Int_t GetNumberOfTimeBins(); | |
7754cd1f | 46 | |
2745a409 | 47 | Char_t GetPadStatus(Int_t det, Int_t col, Int_t row); |
2745a409 | 48 | Char_t GetChamberStatus(Int_t det); |
7754cd1f | 49 | |
2745a409 | 50 | Bool_t IsPadMasked(Int_t det, Int_t col, Int_t row); |
51 | Bool_t IsPadBridgedLeft(Int_t det, Int_t col, Int_t row); | |
52 | Bool_t IsPadBridgedRight(Int_t det, Int_t col, Int_t row); | |
3551db50 | 53 | |
2745a409 | 54 | Bool_t IsChamberInstalled(Int_t det); |
55 | Bool_t IsChamberMasked(Int_t det); | |
7754cd1f | 56 | |
2745a409 | 57 | const AliTRDCalMonitoring *GetMonitoringObject(); |
58 | const AliTRDCalPIDLQ *GetPIDLQObject(); | |
7754cd1f | 59 | |
2745a409 | 60 | // Related functions, these depend on calibration data |
1b95a37b | 61 | static Float_t GetOmegaTau(Float_t vdrift, Float_t bz); |
4e009ce4 | 62 | |
2745a409 | 63 | Int_t PadResponse(Double_t signal, Double_t dist, Int_t plane, Double_t *pad) const; |
3551db50 | 64 | |
2745a409 | 65 | protected: |
66 | ||
67 | // For caching see also implentation of GetCachedCDBObject in the .cxx file | |
11f5dd43 | 68 | enum { kCDBCacheSize = 15 }; // Number of cached objects |
7754cd1f | 69 | enum { kIDVdriftPad = 0, kIDVdriftChamber, |
70 | kIDT0Pad, kIDT0Chamber, | |
71 | kIDGainFactorPad, kIDGainFactorChamber, | |
72 | kIDPRFWidth, | |
73 | kIDGlobals, | |
74 | kIDChamberPos, kIDStackPos, kIDSuperModulePos, | |
75 | kIDPIDLQ, kIDMonitoringData, | |
11f5dd43 | 76 | kIDChamberStatus, kIDPadStatus }; // IDs of cached objects |
7754cd1f | 77 | |
63a700c6 | 78 | const TObject* GetCachedCDBObject(Int_t id); |
3551db50 | 79 | |
2745a409 | 80 | void Invalidate(); |
81 | void SamplePRF(); | |
6a739e92 | 82 | |
2745a409 | 83 | AliCDBEntry *GetCDBEntry(const char* cdbPath); |
84 | const TObject *CacheCDBEntry(Int_t id, const char* cdbPath); | |
7754cd1f | 85 | |
2745a409 | 86 | static AliTRDcalibDB *fgInstance; // Instance of this class (singleton implementation) |
87 | static Bool_t fgTerminated; // Defines if this class has already been terminated | |
6d50f529 | 88 | |
2745a409 | 89 | AliCDBEntry *fCDBEntries[kCDBCacheSize]; // Cache for CDB entries |
90 | TObject *fCDBCache[kCDBCacheSize]; // Cache for calibration objects. | |
6a739e92 | 91 | |
2745a409 | 92 | Long64_t fRun; // Run Number |
3551db50 | 93 | |
6d50f529 | 94 | Float_t *fPRFsmp; //! Sampled pad response |
95 | Int_t fPRFbin; // Number of bins for the PRF | |
96 | Float_t fPRFlo; // Lower boundary of the PRF | |
97 | Float_t fPRFhi; // Higher boundary of the PRF | |
98 | Float_t fPRFwid; // Bin width of the sampled PRF | |
99 | Int_t fPRFpad; // Distance to next pad in PRF | |
6a739e92 | 100 | |
2745a409 | 101 | private: |
102 | ||
103 | AliTRDcalibDB(); // This is a singleton, constructor is private! | |
104 | AliTRDcalibDB(const AliTRDcalibDB &c); | |
105 | AliTRDcalibDB &operator=(const AliTRDcalibDB &c); | |
3551db50 | 106 | virtual ~AliTRDcalibDB(); |
107 | ||
6d50f529 | 108 | ClassDef(AliTRDcalibDB,3) // Provides central access to the CDB |
2745a409 | 109 | |
3551db50 | 110 | }; |
111 | ||
3551db50 | 112 | #endif |