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