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