]>
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 | ||
4ba1d6ae | 14 | #ifndef ROOT_TObject |
3551db50 | 15 | #include "TObject.h" |
4ba1d6ae | 16 | #endif |
17 | ||
18 | #ifndef ALITRDRECOPARAM_H | |
19 | #include "AliTRDrecoParam.h" | |
20 | #endif | |
3551db50 | 21 | |
2745a409 | 22 | class AliCDBEntry; |
3551db50 | 23 | |
720a0a16 | 24 | class AliTRDCalPID; |
7754cd1f | 25 | class AliTRDCalMonitoring; |
56178ff4 | 26 | class AliTRDCalROC; |
27 | class AliTRDCalDet; | |
0e09df31 | 28 | class AliTRDCalSingleChamberStatus; |
3551db50 | 29 | |
2745a409 | 30 | class AliTRDcalibDB : public TObject { |
31 | ||
32 | public: | |
33 | ||
053767a4 | 34 | enum { kNlayer = 6 |
35 | , kNstack = 5 | |
36 | , kNsector = 18 | |
37 | , kNdet = 540 }; | |
6a739e92 | 38 | |
0e09df31 | 39 | static AliTRDcalibDB *Instance(); |
40 | static void Terminate(); | |
3551db50 | 41 | |
0e09df31 | 42 | void SetRun(Long64_t run); |
43 | Long64_t GetRun() const { return fRun; } | |
7754cd1f | 44 | |
df83a620 | 45 | Float_t GetNoise(Int_t det, Int_t col, Int_t row); |
46 | AliTRDCalROC *GetNoiseROC(Int_t det); | |
47 | const AliTRDCalDet *GetNoiseDet(); | |
48 | ||
0e09df31 | 49 | Float_t GetVdrift(Int_t det, Int_t col, Int_t row); |
50 | Float_t GetVdriftAverage(Int_t det); | |
51 | AliTRDCalROC *GetVdriftROC(Int_t det); | |
52 | const AliTRDCalDet *GetVdriftDet(); | |
7754cd1f | 53 | |
0e09df31 | 54 | Float_t GetT0(Int_t det, Int_t col, Int_t row); |
55 | Float_t GetT0Average(Int_t det); | |
56 | AliTRDCalROC *GetT0ROC(Int_t det); | |
57 | const AliTRDCalDet *GetT0Det(); | |
7754cd1f | 58 | |
0e09df31 | 59 | Float_t GetGainFactor(Int_t det, Int_t col, Int_t row); |
60 | Float_t GetGainFactorAverage(Int_t det); | |
4ba1d6ae | 61 | AliTRDCalROC *GetGainFactorROC(Int_t det); |
0e09df31 | 62 | const AliTRDCalDet *GetGainFactorDet(); |
3551db50 | 63 | |
4ba1d6ae | 64 | AliTRDCalROC *GetPRFROC(Int_t det); |
0e09df31 | 65 | Float_t GetPRFWidth(Int_t det, Int_t col, Int_t row); |
7754cd1f | 66 | |
fa7427d0 | 67 | Float_t* GetSampledPRF() { return fPRFsmp; }; |
68 | Int_t GetPRFbin() { return fPRFbin; }; | |
69 | Float_t GetPRFlo() { return fPRFlo; }; | |
70 | Float_t GetPRFhi() { return fPRFhi; }; | |
71 | ||
0e09df31 | 72 | Int_t GetNumberOfTimeBins(); |
7754cd1f | 73 | |
0e09df31 | 74 | Char_t GetPadStatus(Int_t det, Int_t col, Int_t row); |
4ba1d6ae | 75 | AliTRDCalSingleChamberStatus *GetPadStatusROC(Int_t det); |
a7ac01d2 | 76 | AliTRDrecoParam* GetRecoParam(Int_t *eventtype); |
7754cd1f | 77 | |
0e09df31 | 78 | Char_t GetChamberStatus(Int_t det); |
79 | ||
80 | Bool_t IsPadMasked(Int_t det, Int_t col, Int_t row); | |
81 | Bool_t IsPadBridgedLeft(Int_t det, Int_t col, Int_t row); | |
82 | Bool_t IsPadBridgedRight(Int_t det, Int_t col, Int_t row); | |
fa7427d0 | 83 | Bool_t IsPadNotConnected(Int_t det, Int_t col, Int_t row); |
3551db50 | 84 | |
0e09df31 | 85 | Bool_t IsChamberInstalled(Int_t det); |
86 | Bool_t IsChamberMasked(Int_t det); | |
7754cd1f | 87 | |
0e09df31 | 88 | const AliTRDCalMonitoring *GetMonitoringObject(); |
4ba1d6ae | 89 | const AliTRDCalPID *GetPIDObject(AliTRDrecoParam::AliTRDpidMethod method); |
7754cd1f | 90 | |
2745a409 | 91 | // Related functions, these depend on calibration data |
0e09df31 | 92 | static Float_t GetOmegaTau(Float_t vdrift, Float_t bz); |
93 | Int_t PadResponse(Double_t signal, Double_t dist | |
053767a4 | 94 | , Int_t layer, Double_t *pad) const; |
3551db50 | 95 | |
2745a409 | 96 | protected: |
97 | ||
98 | // For caching see also implentation of GetCachedCDBObject in the .cxx file | |
a7ac01d2 | 99 | enum { kCDBCacheSize = 19 }; // Number of cached objects |
b43a3e17 | 100 | enum { kIDVdriftPad = 0 |
101 | , kIDVdriftChamber | |
102 | , kIDT0Pad | |
103 | , kIDT0Chamber | |
104 | , kIDGainFactorPad | |
105 | , kIDGainFactorChamber | |
df83a620 | 106 | , kIDNoiseChamber |
107 | , kIDNoisePad | |
b43a3e17 | 108 | , kIDPRFWidth |
aa617684 | 109 | , kIDFEE |
b43a3e17 | 110 | , kIDChamberPos |
111 | , kIDStackPos | |
112 | , kIDSuperModulePos | |
44dbae42 | 113 | , kIDPIDNN |
b43a3e17 | 114 | , kIDPIDLQ |
a7ac01d2 | 115 | , kIDRecoParam |
b43a3e17 | 116 | , kIDMonitoringData |
117 | , kIDChamberStatus | |
118 | , kIDPadStatus }; // IDs of cached objects | |
7754cd1f | 119 | |
56178ff4 | 120 | const TObject *GetCachedCDBObject(Int_t id); |
3551db50 | 121 | |
2745a409 | 122 | void Invalidate(); |
123 | void SamplePRF(); | |
6a739e92 | 124 | |
b43a3e17 | 125 | AliCDBEntry *GetCDBEntry(const Char_t *cdbPath); |
126 | const TObject *CacheCDBEntry(Int_t id, const Char_t *cdbPath); | |
7754cd1f | 127 | |
2745a409 | 128 | static AliTRDcalibDB *fgInstance; // Instance of this class (singleton implementation) |
129 | static Bool_t fgTerminated; // Defines if this class has already been terminated | |
6d50f529 | 130 | |
2745a409 | 131 | AliCDBEntry *fCDBEntries[kCDBCacheSize]; // Cache for CDB entries |
132 | TObject *fCDBCache[kCDBCacheSize]; // Cache for calibration objects. | |
6a739e92 | 133 | |
2745a409 | 134 | Long64_t fRun; // Run Number |
3551db50 | 135 | |
6d50f529 | 136 | Float_t *fPRFsmp; //! Sampled pad response |
137 | Int_t fPRFbin; // Number of bins for the PRF | |
138 | Float_t fPRFlo; // Lower boundary of the PRF | |
139 | Float_t fPRFhi; // Higher boundary of the PRF | |
140 | Float_t fPRFwid; // Bin width of the sampled PRF | |
141 | Int_t fPRFpad; // Distance to next pad in PRF | |
6a739e92 | 142 | |
2745a409 | 143 | private: |
144 | ||
145 | AliTRDcalibDB(); // This is a singleton, constructor is private! | |
146 | AliTRDcalibDB(const AliTRDcalibDB &c); | |
147 | AliTRDcalibDB &operator=(const AliTRDcalibDB &c); | |
3551db50 | 148 | virtual ~AliTRDcalibDB(); |
149 | ||
a7ac01d2 | 150 | ClassDef(AliTRDcalibDB, 4) // Provides central access to the CDB |
2745a409 | 151 | |
3551db50 | 152 | }; |
153 | ||
3551db50 | 154 | #endif |