]>
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 | |
720a0a16 | 18 | class AliTRDCalPID; |
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); | |
afb9f880 | 40 | AliTRDCalROC *GetVdriftROC(Int_t det); |
41 | const AliTRDCalDet *GetVdriftDet(); | |
7754cd1f | 42 | |
56178ff4 | 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(); | |
7754cd1f | 47 | |
56178ff4 | 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(); | |
3551db50 | 52 | |
524fc8fa | 53 | AliTRDCalROC *GetPRFROC(Int_t det); |
56178ff4 | 54 | Float_t GetPRFWidth(Int_t det, Int_t col, Int_t row); |
7754cd1f | 55 | |
56178ff4 | 56 | Int_t GetNumberOfTimeBins(); |
7754cd1f | 57 | |
56178ff4 | 58 | Char_t GetPadStatus(Int_t det, Int_t col, Int_t row); |
59 | Char_t GetChamberStatus(Int_t det); | |
7754cd1f | 60 | |
56178ff4 | 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); | |
3551db50 | 64 | |
56178ff4 | 65 | Bool_t IsChamberInstalled(Int_t det); |
66 | Bool_t IsChamberMasked(Int_t det); | |
7754cd1f | 67 | |
2745a409 | 68 | const AliTRDCalMonitoring *GetMonitoringObject(); |
44dbae42 | 69 | const AliTRDCalPID *GetPIDObject(const Int_t method); |
7754cd1f | 70 | |
2745a409 | 71 | // Related functions, these depend on calibration data |
56178ff4 | 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; | |
3551db50 | 75 | |
2745a409 | 76 | protected: |
77 | ||
78 | // For caching see also implentation of GetCachedCDBObject in the .cxx file | |
44dbae42 | 79 | enum { kCDBCacheSize = 16 }; // Number of cached objects |
b43a3e17 | 80 | enum { kIDVdriftPad = 0 |
81 | , kIDVdriftChamber | |
82 | , kIDT0Pad | |
83 | , kIDT0Chamber | |
84 | , kIDGainFactorPad | |
85 | , kIDGainFactorChamber | |
86 | , kIDPRFWidth | |
aa617684 | 87 | , kIDFEE |
b43a3e17 | 88 | , kIDChamberPos |
89 | , kIDStackPos | |
90 | , kIDSuperModulePos | |
44dbae42 | 91 | , kIDPIDNN |
b43a3e17 | 92 | , kIDPIDLQ |
93 | , kIDMonitoringData | |
94 | , kIDChamberStatus | |
95 | , kIDPadStatus }; // IDs of cached objects | |
7754cd1f | 96 | |
56178ff4 | 97 | const TObject *GetCachedCDBObject(Int_t id); |
3551db50 | 98 | |
2745a409 | 99 | void Invalidate(); |
100 | void SamplePRF(); | |
6a739e92 | 101 | |
b43a3e17 | 102 | AliCDBEntry *GetCDBEntry(const Char_t *cdbPath); |
103 | const TObject *CacheCDBEntry(Int_t id, const Char_t *cdbPath); | |
7754cd1f | 104 | |
2745a409 | 105 | static AliTRDcalibDB *fgInstance; // Instance of this class (singleton implementation) |
106 | static Bool_t fgTerminated; // Defines if this class has already been terminated | |
6d50f529 | 107 | |
2745a409 | 108 | AliCDBEntry *fCDBEntries[kCDBCacheSize]; // Cache for CDB entries |
109 | TObject *fCDBCache[kCDBCacheSize]; // Cache for calibration objects. | |
6a739e92 | 110 | |
2745a409 | 111 | Long64_t fRun; // Run Number |
3551db50 | 112 | |
6d50f529 | 113 | Float_t *fPRFsmp; //! Sampled pad response |
114 | Int_t fPRFbin; // Number of bins for the PRF | |
115 | Float_t fPRFlo; // Lower boundary of the PRF | |
116 | Float_t fPRFhi; // Higher boundary of the PRF | |
117 | Float_t fPRFwid; // Bin width of the sampled PRF | |
118 | Int_t fPRFpad; // Distance to next pad in PRF | |
6a739e92 | 119 | |
2745a409 | 120 | private: |
121 | ||
122 | AliTRDcalibDB(); // This is a singleton, constructor is private! | |
123 | AliTRDcalibDB(const AliTRDcalibDB &c); | |
124 | AliTRDcalibDB &operator=(const AliTRDcalibDB &c); | |
3551db50 | 125 | virtual ~AliTRDcalibDB(); |
126 | ||
b43a3e17 | 127 | ClassDef(AliTRDcalibDB,3) // Provides central access to the CDB |
2745a409 | 128 | |
3551db50 | 129 | }; |
130 | ||
3551db50 | 131 | #endif |