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