]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDcalibDB.h
Conversion of survey data into alignable objects implemented
[u/mrichter/AliRoot.git] / TRD / AliTRDcalibDB.h
CommitLineData
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
3551db50 14#include "TObject.h"
15
2745a409 16class AliCDBEntry;
3551db50 17
cc7cef99 18class AliTRDCalPIDLQ;
7754cd1f 19class AliTRDCalMonitoring;
56178ff4 20class AliTRDCalROC;
21class AliTRDCalDet;
3551db50 22
2745a409 23class AliTRDcalibDB : public TObject {
24
25 public:
26
b43a3e17 27 enum { kNplan = 6
28 , kNcham = 5
29 , kNsect = 18
30 , kNdet = 540 };
6a739e92 31
56178ff4 32 static AliTRDcalibDB *Instance();
33 static void Terminate();
3551db50 34
56178ff4 35 void SetRun(Long64_t run);
36 Long64_t GetRun() { return fRun; }
7754cd1f 37
56178ff4 38 Float_t GetVdrift(Int_t det, Int_t col, Int_t row);
39 Float_t GetVdriftAverage(Int_t det);
afb9f880 40 AliTRDCalROC *GetVdriftROC(Int_t det);
41 const AliTRDCalDet *GetVdriftDet();
7754cd1f 42
56178ff4 43 Float_t GetT0(Int_t det, Int_t col, Int_t row);
44 Float_t GetT0Average(Int_t det);
45 AliTRDCalROC *GetT0ROC(Int_t det);
46 const AliTRDCalDet *GetT0Det();
7754cd1f 47
56178ff4 48 Float_t GetGainFactor(Int_t det, Int_t col, Int_t row);
49 Float_t GetGainFactorAverage(Int_t det);
50 AliTRDCalROC *GetGainFactorROC(Int_t det);
51 const AliTRDCalDet *GetGainFactorDet();
3551db50 52
56178ff4 53 Float_t GetPRFWidth(Int_t det, Int_t col, Int_t row);
7754cd1f 54
56178ff4 55 Int_t GetNumberOfTimeBins();
7754cd1f 56
56178ff4 57 Char_t GetPadStatus(Int_t det, Int_t col, Int_t row);
58 Char_t GetChamberStatus(Int_t det);
7754cd1f 59
56178ff4 60 Bool_t IsPadMasked(Int_t det, Int_t col, Int_t row);
61 Bool_t IsPadBridgedLeft(Int_t det, Int_t col, Int_t row);
62 Bool_t IsPadBridgedRight(Int_t det, Int_t col, Int_t row);
3551db50 63
56178ff4 64 Bool_t IsChamberInstalled(Int_t det);
65 Bool_t IsChamberMasked(Int_t det);
7754cd1f 66
2745a409 67 const AliTRDCalMonitoring *GetMonitoringObject();
68 const AliTRDCalPIDLQ *GetPIDLQObject();
7754cd1f 69
2745a409 70 // Related functions, these depend on calibration data
56178ff4 71 static Float_t GetOmegaTau(Float_t vdrift, Float_t bz);
72 Int_t PadResponse(Double_t signal, Double_t dist
73 , Int_t plane, Double_t *pad) const;
3551db50 74
2745a409 75 protected:
76
77 // For caching see also implentation of GetCachedCDBObject in the .cxx file
11f5dd43 78 enum { kCDBCacheSize = 15 }; // Number of cached objects
b43a3e17 79 enum { kIDVdriftPad = 0
80 , kIDVdriftChamber
81 , kIDT0Pad
82 , kIDT0Chamber
83 , kIDGainFactorPad
84 , kIDGainFactorChamber
85 , kIDPRFWidth
86 , kIDGlobals
87 , kIDChamberPos
88 , kIDStackPos
89 , kIDSuperModulePos
90 , kIDPIDLQ
91 , kIDMonitoringData
92 , kIDChamberStatus
93 , kIDPadStatus }; // IDs of cached objects
7754cd1f 94
56178ff4 95 const TObject *GetCachedCDBObject(Int_t id);
3551db50 96
2745a409 97 void Invalidate();
98 void SamplePRF();
6a739e92 99
b43a3e17 100 AliCDBEntry *GetCDBEntry(const Char_t *cdbPath);
101 const TObject *CacheCDBEntry(Int_t id, const Char_t *cdbPath);
7754cd1f 102
2745a409 103 static AliTRDcalibDB *fgInstance; // Instance of this class (singleton implementation)
104 static Bool_t fgTerminated; // Defines if this class has already been terminated
6d50f529 105
2745a409 106 AliCDBEntry *fCDBEntries[kCDBCacheSize]; // Cache for CDB entries
107 TObject *fCDBCache[kCDBCacheSize]; // Cache for calibration objects.
6a739e92 108
2745a409 109 Long64_t fRun; // Run Number
3551db50 110
6d50f529 111 Float_t *fPRFsmp; //! Sampled pad response
112 Int_t fPRFbin; // Number of bins for the PRF
113 Float_t fPRFlo; // Lower boundary of the PRF
114 Float_t fPRFhi; // Higher boundary of the PRF
115 Float_t fPRFwid; // Bin width of the sampled PRF
116 Int_t fPRFpad; // Distance to next pad in PRF
6a739e92 117
2745a409 118 private:
119
120 AliTRDcalibDB(); // This is a singleton, constructor is private!
121 AliTRDcalibDB(const AliTRDcalibDB &c);
122 AliTRDcalibDB &operator=(const AliTRDcalibDB &c);
3551db50 123 virtual ~AliTRDcalibDB();
124
b43a3e17 125 ClassDef(AliTRDcalibDB,3) // Provides central access to the CDB
2745a409 126
3551db50 127};
128
3551db50 129#endif