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 */
6 ///////////////////////////////////////////////////////////////////////////////
8 // Class providing the calibration parameters by accessing the CDB //
10 ///////////////////////////////////////////////////////////////////////////////
18 #ifndef ALITRDRECONSTRUCTOR_H
19 #include "AliTRDReconstructor.h"
25 class AliTRDCalMonitoring;
28 class AliTRDCalSingleChamberStatus;
29 class AliTRDcalibDB : public TObject {
38 static AliTRDcalibDB *Instance();
39 static void Terminate();
41 void SetRun(Long64_t run);
42 Long64_t GetRun() const { return fRun; }
44 Float_t GetNoise(Int_t det, Int_t col, Int_t row);
45 AliTRDCalROC *GetNoiseROC(Int_t det);
46 const AliTRDCalDet *GetNoiseDet();
48 Float_t GetVdrift(Int_t det, Int_t col, Int_t row);
49 Float_t GetVdriftAverage(Int_t det);
50 AliTRDCalROC *GetVdriftROC(Int_t det);
51 const AliTRDCalDet *GetVdriftDet();
53 Float_t GetT0(Int_t det, Int_t col, Int_t row);
54 Float_t GetT0Average(Int_t det);
55 AliTRDCalROC *GetT0ROC(Int_t det);
56 const AliTRDCalDet *GetT0Det();
58 Float_t GetGainFactor(Int_t det, Int_t col, Int_t row);
59 Float_t GetGainFactorAverage(Int_t det);
60 AliTRDCalROC *GetGainFactorROC(Int_t det);
61 const AliTRDCalDet *GetGainFactorDet();
63 AliTRDCalROC *GetPRFROC(Int_t det);
64 Float_t GetPRFWidth(Int_t det, Int_t col, Int_t row);
66 Float_t* GetSampledPRF() { return fPRFsmp; };
67 Int_t GetPRFbin() { return fPRFbin; };
68 Float_t GetPRFlo() { return fPRFlo; };
69 Float_t GetPRFhi() { return fPRFhi; };
71 Int_t GetNumberOfTimeBins();
73 Char_t GetPadStatus(Int_t det, Int_t col, Int_t row);
74 AliTRDCalSingleChamberStatus *GetPadStatusROC(Int_t det);
75 AliTRDrecoParam* GetRecoParam(Int_t *eventtype);
77 Char_t GetChamberStatus(Int_t det);
79 Bool_t IsPadMasked(Int_t det, Int_t col, Int_t row);
80 Bool_t IsPadBridgedLeft(Int_t det, Int_t col, Int_t row);
81 Bool_t IsPadBridgedRight(Int_t det, Int_t col, Int_t row);
82 Bool_t IsPadNotConnected(Int_t det, Int_t col, Int_t row);
84 Bool_t IsChamberInstalled(Int_t det);
85 Bool_t IsChamberMasked(Int_t det);
87 const AliTRDCalMonitoring *GetMonitoringObject();
88 const AliTRDCalPID *GetPIDObject(AliTRDReconstructor::AliTRDpidMethod method);
90 // Related functions, these depend on calibration data
91 static Float_t GetOmegaTau(Float_t vdrift, Float_t bz);
92 Int_t PadResponse(Double_t signal, Double_t dist
93 , Int_t layer, Double_t *pad) const;
97 // For caching see also implentation of GetCachedCDBObject in the .cxx file
98 enum { kCDBCacheSize = 19 }; // Number of cached objects
99 enum { kIDVdriftPad = 0
104 , kIDGainFactorChamber
117 , kIDPadStatus }; // IDs of cached objects
119 const TObject *GetCachedCDBObject(Int_t id);
124 AliCDBEntry *GetCDBEntry(const Char_t *cdbPath);
125 const TObject *CacheCDBEntry(Int_t id, const Char_t *cdbPath);
127 static AliTRDcalibDB *fgInstance; // Instance of this class (singleton implementation)
128 static Bool_t fgTerminated; // Defines if this class has already been terminated
130 AliCDBEntry *fCDBEntries[kCDBCacheSize]; // Cache for CDB entries
131 TObject *fCDBCache[kCDBCacheSize]; // Cache for calibration objects.
133 Long64_t fRun; // Run Number
135 Float_t *fPRFsmp; //! Sampled pad response
136 Int_t fPRFbin; // Number of bins for the PRF
137 Float_t fPRFlo; // Lower boundary of the PRF
138 Float_t fPRFhi; // Higher boundary of the PRF
139 Float_t fPRFwid; // Bin width of the sampled PRF
140 Int_t fPRFpad; // Distance to next pad in PRF
144 AliTRDcalibDB(); // This is a singleton, constructor is private!
145 AliTRDcalibDB(const AliTRDcalibDB &c);
146 AliTRDcalibDB &operator=(const AliTRDcalibDB &c);
147 virtual ~AliTRDcalibDB();
149 ClassDef(AliTRDcalibDB, 4) // Provides central access to the CDB