]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDcalibDB.h
New online gain tables
[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
eda91732 63 const AliTRDCalDet *GetExBDet();
64
0e09df31 65 Float_t GetT0(Int_t det, Int_t col, Int_t row);
66 Float_t GetT0Average(Int_t det);
67 AliTRDCalROC *GetT0ROC(Int_t det);
68 const AliTRDCalDet *GetT0Det();
7754cd1f 69
0e09df31 70 Float_t GetGainFactor(Int_t det, Int_t col, Int_t row);
71 Float_t GetGainFactorAverage(Int_t det);
4ba1d6ae 72 AliTRDCalROC *GetGainFactorROC(Int_t det);
0e09df31 73 const AliTRDCalDet *GetGainFactorDet();
3551db50 74
ea3eaa08 75 Float_t GetOnlineGainFactor(Int_t det, Int_t col, Int_t row);
76 AliTRDCalOnlineGainTableROC *GetOnlineGainTableROC(Int_t det);
77
4ba1d6ae 78 AliTRDCalROC *GetPRFROC(Int_t det);
0e09df31 79 Float_t GetPRFWidth(Int_t det, Int_t col, Int_t row);
7754cd1f 80
be28462a 81 Float_t* GetSampledPRF() const { return fPRFsmp; };
82 Int_t GetPRFbin() const { return fPRFbin; };
83 Float_t GetPRFlo() const { return fPRFlo; };
84 Float_t GetPRFhi() const { return fPRFhi; };
fa7427d0 85
e232d349 86 Int_t GetNumberOfTimeBinsDCS();
87 void GetFilterType(TString &filterType);
af086c5e 88 void GetGlobalConfiguration(TString &config);
f8059b39 89 void GetGlobalConfigurationVersion(TString &version);
ea3eaa08 90
91 Int_t GetOnlineGainTableID();
92
af086c5e 93 Bool_t HasOnlineFilterPedestal();
94 Bool_t HasOnlineFilterGain();
95 Bool_t HasOnlineTailCancellation();
7754cd1f 96
0e09df31 97 Char_t GetPadStatus(Int_t det, Int_t col, Int_t row);
4ba1d6ae 98 AliTRDCalSingleChamberStatus *GetPadStatusROC(Int_t det);
a7ac01d2 99 AliTRDrecoParam* GetRecoParam(Int_t *eventtype);
9dcc64cc 100 AliTRDPIDResponse *GetPIDResponse(AliTRDPIDResponse::ETRDPIDMethod m);
7754cd1f 101
0e09df31 102 Char_t GetChamberStatus(Int_t det);
103
104 Bool_t IsPadMasked(Int_t det, Int_t col, Int_t row);
105 Bool_t IsPadBridgedLeft(Int_t det, Int_t col, Int_t row);
106 Bool_t IsPadBridgedRight(Int_t det, Int_t col, Int_t row);
fa7427d0 107 Bool_t IsPadNotConnected(Int_t det, Int_t col, Int_t row);
3551db50 108
eda91732 109 Bool_t IsChamberGood(Int_t det);
110 Bool_t IsChamberNoData(Int_t det);
111 Bool_t IsHalfChamberNoData(Int_t det, Int_t side);
112 Bool_t IsChamberBadCalibrated(Int_t det);
7754cd1f 113
0e09df31 114 const AliTRDCalMonitoring *GetMonitoringObject();
0d83b3a5 115 const AliTRDCalPID *GetPIDObject(AliTRDpidUtil::ETRDPIDMethod m);
9dcc64cc 116 const AliTRDCalTrkAttach *GetAttachObject();
7754cd1f 117
2745a409 118 // Related functions, these depend on calibration data
ea3eaa08 119 Int_t PadResponse(Double_t signal, Double_t dist
053767a4 120 , Int_t layer, Double_t *pad) const;
543691ea 121
2745a409 122 protected:
123
124 // For caching see also implentation of GetCachedCDBObject in the .cxx file
b43a3e17 125 enum { kIDVdriftPad = 0
126 , kIDVdriftChamber
eda91732 127 , kIDExBChamber
b43a3e17 128 , kIDT0Pad
129 , kIDT0Chamber
130 , kIDGainFactorPad
131 , kIDGainFactorChamber
ea3eaa08 132 , kIDOnlineGainFactor
df83a620 133 , kIDNoiseChamber
134 , kIDNoisePad
b43a3e17 135 , kIDPRFWidth
aa617684 136 , kIDFEE
b43a3e17 137 , kIDChamberPos
138 , kIDStackPos
139 , kIDSuperModulePos
44dbae42 140 , kIDPIDNN
b43a3e17 141 , kIDPIDLQ
9dcc64cc 142 , kIDPIDLQ1D
a7ac01d2 143 , kIDRecoParam
b43a3e17 144 , kIDMonitoringData
145 , kIDChamberStatus
913950a4 146 , kIDPadStatus
d6a1ec13 147 , kIDDCS
9dcc64cc 148 , kIDAttach
d6a1ec13 149 , kCDBCacheSize }; // IDs of cached objects
7754cd1f 150
56178ff4 151 const TObject *GetCachedCDBObject(Int_t id);
3551db50 152
2745a409 153 void Invalidate();
154 void SamplePRF();
6a739e92 155
b43a3e17 156 AliCDBEntry *GetCDBEntry(const Char_t *cdbPath);
157 const TObject *CacheCDBEntry(Int_t id, const Char_t *cdbPath);
7754cd1f 158
2745a409 159 static AliTRDcalibDB *fgInstance; // Instance of this class (singleton implementation)
160 static Bool_t fgTerminated; // Defines if this class has already been terminated
6d50f529 161
2745a409 162 AliCDBEntry *fCDBEntries[kCDBCacheSize]; // Cache for CDB entries
163 TObject *fCDBCache[kCDBCacheSize]; // Cache for calibration objects.
6a739e92 164
2745a409 165 Long64_t fRun; // Run Number
ea3eaa08 166
6d50f529 167 Float_t *fPRFsmp; //! Sampled pad response
168 Int_t fPRFbin; // Number of bins for the PRF
169 Float_t fPRFlo; // Lower boundary of the PRF
170 Float_t fPRFhi; // Higher boundary of the PRF
171 Float_t fPRFwid; // Bin width of the sampled PRF
172 Int_t fPRFpad; // Distance to next pad in PRF
ea3eaa08 173
9dcc64cc 174 AliTRDPIDResponse *fPIDResponse; // TRD PID Response function
ea3eaa08 175
176 Int_t fOnlineGainTableID; // ID for online gain table
6a739e92 177
2745a409 178 private:
179
180 AliTRDcalibDB(); // This is a singleton, constructor is private!
181 AliTRDcalibDB(const AliTRDcalibDB &c);
182 AliTRDcalibDB &operator=(const AliTRDcalibDB &c);
3551db50 183 virtual ~AliTRDcalibDB();
184
ea3eaa08 185 ClassDef(AliTRDcalibDB, 7) // Provides central access to the CDB
2745a409 186
3551db50 187};
188
3551db50 189#endif
7a6352a6 190