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 #include "AliTRDgeometry.h"
20 #include <AliCDBStorage.h>
21 #include <AliCDBEntry.h>
24 class AliTRDCalMonitoring;
26 class AliTRDcalibDB : public TObject
29 enum { kNplan = 6, kNcham = 5, kNsect = 18, kNdet = 540 };
31 static AliTRDcalibDB* Instance();
32 static void Terminate();
34 void SetRun(Long64_t run);
35 Long64_t GetRun() { return fRun; }
37 Float_t GetVdrift(Int_t det, Int_t col, Int_t row);
38 Float_t GetVdriftAverage(Int_t det);
40 Float_t GetT0(Int_t det, Int_t col, Int_t row);
41 Float_t GetT0Average(Int_t det);
43 Float_t GetGainFactor(Int_t det, Int_t col, Int_t row);
44 Float_t GetGainFactorAverage(Int_t det);
46 Float_t GetPRFWidth(Int_t det, Int_t col, Int_t row);
48 Float_t GetSamplingFrequency();
49 Int_t GetNumberOfTimeBins();
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);
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);
60 Bool_t IsMCMMasked(Int_t det, Int_t col, Int_t row);
62 Bool_t IsChamberInstalled(Int_t det);
63 Bool_t IsChamberMasked(Int_t det);
65 Bool_t IsSuperModuleInstalled(Int_t det);
66 Bool_t IsSuperModuleMasked(Int_t det);
68 const AliTRDCalMonitoring* GetMonitoringObject();
69 const AliTRDCalPIDLQ* GetPIDLQObject();
71 //Related functions, these depend on calibration data
72 static Float_t GetOmegaTau(Float_t vdrift);
73 Int_t PadResponse(Double_t signal, Double_t dist, Int_t plane, Double_t *pad) const;
76 // for caching see also implentation of GetCachedCDBObject in the .cxx file
77 enum { kCDBCacheSize = 17 }; // Number of cached objects
78 enum { kIDVdriftPad = 0, kIDVdriftChamber,
79 kIDT0Pad, kIDT0Chamber,
80 kIDGainFactorPad, kIDGainFactorChamber,
83 kIDChamberPos, kIDStackPos, kIDSuperModulePos,
84 kIDPIDLQ, kIDMonitoringData,
85 kIDSuperModuleStatus, kIDChamberStatus, kIDMCMStatus, kIDPadStatus }; // IDs of cached objects
87 const TObject* GetCachedCDBObject(Int_t id);
92 AliCDBEntry* GetCDBEntry(const char* cdbPath);
93 const TObject* CacheCDBEntry(Int_t id, const char* cdbPath);
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
98 AliCDBEntry* fCDBEntries[kCDBCacheSize]; // Cache for CDB entries
99 TObject* fCDBCache[kCDBCacheSize]; // Cache for calibration objects.
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
114 AliTRDcalibDB(); // this is a singleton, constructor is private!
115 virtual ~AliTRDcalibDB();
117 ClassDef(AliTRDcalibDB, 2)