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>
25 class AliTRDcalibDB : public TObject
28 enum { kNplan = 6, kNcham = 5, kNsect = 18, kNdet = 540 };
30 static AliTRDcalibDB* Instance();
31 static void Terminate();
33 void SetRun(Long64_t run);
35 Bool_t GetChamberPos(Int_t det, Float_t* xyz);
36 Bool_t GetChamberPos(Int_t plane, Int_t chamber, Int_t sector, Float_t* xyz) { return GetChamberPos(AliTRDgeometry::GetDetector(plane, chamber, sector), xyz); }
38 Bool_t GetChamberRot(Int_t det, Float_t* xyz);
39 Bool_t GetChamberRot(Int_t plane, Int_t chamber, Int_t sector, Float_t* xyz) { return GetChamberRot(AliTRDgeometry::GetDetector(plane, chamber, sector), xyz); }
41 Bool_t GetStackPos(Int_t chamber, Int_t sector, Float_t* xyz);
42 Bool_t GetStackRot(Int_t chamber, Int_t sector, Float_t* xyz);
44 Float_t GetVdrift(Int_t det, Int_t col, Int_t row);
45 Float_t GetVdrift(Int_t plane, Int_t chamber, Int_t sector, Int_t col, Int_t row) { return GetVdrift(AliTRDgeometry::GetDetector(plane, chamber, sector), col, row); }
47 Float_t GetT0(Int_t det, Int_t col, Int_t row);
48 Float_t GetT0(Int_t plane, Int_t chamber, Int_t sector, Int_t col, Int_t row) { return GetT0(AliTRDgeometry::GetDetector(plane, chamber, sector), col, row); }
50 Float_t GetGainFactor(Int_t det, Int_t col, Int_t row);
51 Float_t GetGainFactor(Int_t plane, Int_t chamber, Int_t sector, Int_t col, Int_t row) { return GetGainFactor(AliTRDgeometry::GetDetector(plane, chamber, sector), col, row); }
53 Float_t GetPRFWidth(Int_t det, Int_t col, Int_t row);
54 Float_t GetPRFWidth(Int_t plane, Int_t chamber, Int_t sector, Int_t col, Int_t row) { return GetPRFWidth(AliTRDgeometry::GetDetector(plane, chamber, sector), col, row); }
56 Float_t GetSamplingFrequency();
57 Int_t GetNumberOfTimeBins();
59 const AliTRDCalPIDLQ* GetPIDLQObject();
61 //Related functions, these depend on calibration data
62 static Float_t GetOmegaTau(Float_t vdrift);
63 Int_t PadResponse(Double_t signal, Double_t dist, Int_t plane, Double_t *pad) const;
66 // for caching see also implentation of GetCachedCDBObject in the .cxx file
67 enum { kCDBCacheSize = 8 }; // Number of cached objects
68 enum { kIDVdrift = 0, kIDT0 = 1, kIDGainFactor = 2, kIDPRFWidth = 3, kIDGlobals = 4,
69 kIDChamber = 5, kIDStack = 6, kIDPIDLQ = 7 }; // IDs of cached objects
71 const TObject* GetCachedCDBObject(Int_t id);
76 AliCDBEntry* GetCDBEntry(const char* cdbPath);
77 const TObject* CacheCDBEntry(Int_t id, const char* cdbPath);
78 const TObject* CacheMergeCDBEntry(Int_t id, const char* cdbPadPath, const char* cdbChamberPath);
80 static AliTRDcalibDB* fgInstance; // Instance of this class (singleton implementation)
81 static Bool_t fgTerminated; // Defines if this class has already been terminated and therefore does not return instances in GetInstance anymore
83 AliCDBStorage* fLocator; // Storage locator retrieved from AliCDBManager
85 AliCDBEntry* fCDBEntries[kCDBCacheSize]; // Cache for CDB entries
86 TObject* fCDBCache[kCDBCacheSize]; // Cache for calibration objects.
92 Float_t *fPRFsmp; //! Sampled pad response
93 Int_t fPRFbin; // Number of bins for the PRF
94 Float_t fPRFlo; // Lower boundary of the PRF
95 Float_t fPRFhi; // Higher boundary of the PRF
96 Float_t fPRFwid; // Bin width of the sampled PRF
97 Int_t fPRFpad; // Distance to next pad in PRF
101 // this is a singleton, constructor is private!
103 virtual ~AliTRDcalibDB();
105 ClassDef(AliTRDcalibDB, 0)