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