Add online gain tables (Annika)
[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
4ba1d6ae 14#ifndef ROOT_TObject
3551db50 15#include "TObject.h"
4ba1d6ae 16#endif
17
0d83b3a5 18#ifndef ALITRDPIDUTIL_H
19#include "AliTRDpidUtil.h"
4ba1d6ae 20#endif
3551db50 21
9dcc64cc 22#ifndef ALITRDPIDRESPONSE_H
23#include "AliTRDPIDResponse.h"
24#endif
25
ea3eaa08 26class TString;
27
2745a409 28class AliCDBEntry;
3551db50 29
0d83b3a5 30class AliTRDrecoParam;
9dcc64cc 31class AliTRDCalTrkAttach;
720a0a16 32class AliTRDCalPID;
7754cd1f 33class AliTRDCalMonitoring;
56178ff4 34class AliTRDCalROC;
35class AliTRDCalDet;
0e09df31 36class AliTRDCalSingleChamberStatus;
ea3eaa08 37class AliTRDCalOnlineGainTableROC;
38
2745a409 39class AliTRDcalibDB : public TObject {
40
41 public:
42
053767a4 43 enum { kNlayer = 6
44 , kNstack = 5
45 , kNsector = 18
46 , kNdet = 540 };
6a739e92 47
0e09df31 48 static AliTRDcalibDB *Instance();
49 static void Terminate();
3551db50 50
0e09df31 51 void SetRun(Long64_t run);
52 Long64_t GetRun() const { return fRun; }
7754cd1f 53
df83a620 54 Float_t GetNoise(Int_t det, Int_t col, Int_t row);
55 AliTRDCalROC *GetNoiseROC(Int_t det);
56 const AliTRDCalDet *GetNoiseDet();
57
0e09df31 58 Float_t GetVdrift(Int_t det, Int_t col, Int_t row);
59 Float_t GetVdriftAverage(Int_t det);
60 AliTRDCalROC *GetVdriftROC(Int_t det);
61 const AliTRDCalDet *GetVdriftDet();
7754cd1f 62
0e09df31 63 Float_t GetT0(Int_t det, Int_t col, Int_t row);
64 Float_t GetT0Average(Int_t det);
65 AliTRDCalROC *GetT0ROC(Int_t det);
66 const AliTRDCalDet *GetT0Det();
7754cd1f 67
0e09df31 68 Float_t GetGainFactor(Int_t det, Int_t col, Int_t row);
69 Float_t GetGainFactorAverage(Int_t det);
4ba1d6ae 70 AliTRDCalROC *GetGainFactorROC(Int_t det);
0e09df31 71 const AliTRDCalDet *GetGainFactorDet();
3551db50 72
ea3eaa08 73 Float_t GetOnlineGainFactor(Int_t det, Int_t col, Int_t row);
74 AliTRDCalOnlineGainTableROC *GetOnlineGainTableROC(Int_t det);
75
4ba1d6ae 76 AliTRDCalROC *GetPRFROC(Int_t det);
0e09df31 77 Float_t GetPRFWidth(Int_t det, Int_t col, Int_t row);
7754cd1f 78
be28462a 79 Float_t* GetSampledPRF() const { return fPRFsmp; };
80 Int_t GetPRFbin() const { return fPRFbin; };
81 Float_t GetPRFlo() const { return fPRFlo; };
82 Float_t GetPRFhi() const { return fPRFhi; };
fa7427d0 83
e232d349 84 Int_t GetNumberOfTimeBinsDCS();
85 void GetFilterType(TString &filterType);
af086c5e 86 void GetGlobalConfiguration(TString &config);
ea3eaa08 87
88 Int_t GetOnlineGainTableID();
89
af086c5e 90 Bool_t HasOnlineFilterPedestal();
91 Bool_t HasOnlineFilterGain();
92 Bool_t HasOnlineTailCancellation();
7754cd1f 93
0e09df31 94 Char_t GetPadStatus(Int_t det, Int_t col, Int_t row);
4ba1d6ae 95 AliTRDCalSingleChamberStatus *GetPadStatusROC(Int_t det);
a7ac01d2 96 AliTRDrecoParam* GetRecoParam(Int_t *eventtype);
9dcc64cc 97 AliTRDPIDResponse *GetPIDResponse(AliTRDPIDResponse::ETRDPIDMethod m);
7754cd1f 98
0e09df31 99 Char_t GetChamberStatus(Int_t det);
100
101 Bool_t IsPadMasked(Int_t det, Int_t col, Int_t row);
102 Bool_t IsPadBridgedLeft(Int_t det, Int_t col, Int_t row);
103 Bool_t IsPadBridgedRight(Int_t det, Int_t col, Int_t row);
fa7427d0 104 Bool_t IsPadNotConnected(Int_t det, Int_t col, Int_t row);
3551db50 105
0e09df31 106 Bool_t IsChamberInstalled(Int_t det);
107 Bool_t IsChamberMasked(Int_t det);
7a6352a6 108 Bool_t IsHalfChamberMasked(Int_t det, Int_t side);
7754cd1f 109
0e09df31 110 const AliTRDCalMonitoring *GetMonitoringObject();
0d83b3a5 111 const AliTRDCalPID *GetPIDObject(AliTRDpidUtil::ETRDPIDMethod m);
9dcc64cc 112 const AliTRDCalTrkAttach *GetAttachObject();
7754cd1f 113
2745a409 114 // Related functions, these depend on calibration data
ea3eaa08 115 Int_t PadResponse(Double_t signal, Double_t dist
053767a4 116 , Int_t layer, Double_t *pad) const;
543691ea 117
2745a409 118 protected:
119
120 // For caching see also implentation of GetCachedCDBObject in the .cxx file
b43a3e17 121 enum { kIDVdriftPad = 0
122 , kIDVdriftChamber
123 , kIDT0Pad
124 , kIDT0Chamber
125 , kIDGainFactorPad
126 , kIDGainFactorChamber
ea3eaa08 127 , kIDOnlineGainFactor
df83a620 128 , kIDNoiseChamber
129 , kIDNoisePad
b43a3e17 130 , kIDPRFWidth
aa617684 131 , kIDFEE
b43a3e17 132 , kIDChamberPos
133 , kIDStackPos
134 , kIDSuperModulePos
44dbae42 135 , kIDPIDNN
b43a3e17 136 , kIDPIDLQ
9dcc64cc 137 , kIDPIDLQ1D
a7ac01d2 138 , kIDRecoParam
b43a3e17 139 , kIDMonitoringData
140 , kIDChamberStatus
913950a4 141 , kIDPadStatus
d6a1ec13 142 , kIDDCS
9dcc64cc 143 , kIDAttach
d6a1ec13 144 , kCDBCacheSize }; // IDs of cached objects
7754cd1f 145
56178ff4 146 const TObject *GetCachedCDBObject(Int_t id);
3551db50 147
2745a409 148 void Invalidate();
149 void SamplePRF();
6a739e92 150
b43a3e17 151 AliCDBEntry *GetCDBEntry(const Char_t *cdbPath);
152 const TObject *CacheCDBEntry(Int_t id, const Char_t *cdbPath);
7754cd1f 153
2745a409 154 static AliTRDcalibDB *fgInstance; // Instance of this class (singleton implementation)
155 static Bool_t fgTerminated; // Defines if this class has already been terminated
6d50f529 156
2745a409 157 AliCDBEntry *fCDBEntries[kCDBCacheSize]; // Cache for CDB entries
158 TObject *fCDBCache[kCDBCacheSize]; // Cache for calibration objects.
6a739e92 159
2745a409 160 Long64_t fRun; // Run Number
ea3eaa08 161
6d50f529 162 Float_t *fPRFsmp; //! Sampled pad response
163 Int_t fPRFbin; // Number of bins for the PRF
164 Float_t fPRFlo; // Lower boundary of the PRF
165 Float_t fPRFhi; // Higher boundary of the PRF
166 Float_t fPRFwid; // Bin width of the sampled PRF
167 Int_t fPRFpad; // Distance to next pad in PRF
ea3eaa08 168
9dcc64cc 169 AliTRDPIDResponse *fPIDResponse; // TRD PID Response function
ea3eaa08 170
171 Int_t fOnlineGainTableID; // ID for online gain table
6a739e92 172
2745a409 173 private:
174
175 AliTRDcalibDB(); // This is a singleton, constructor is private!
176 AliTRDcalibDB(const AliTRDcalibDB &c);
177 AliTRDcalibDB &operator=(const AliTRDcalibDB &c);
3551db50 178 virtual ~AliTRDcalibDB();
179
ea3eaa08 180 ClassDef(AliTRDcalibDB, 7) // Provides central access to the CDB
2745a409 181
3551db50 182};
183
3551db50 184#endif
7a6352a6 185