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