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